numpy 1.17 update: empty_like et. al now accept a shape argument
See original GitHub issueWe should update mygrad.empty_like
, mygrad.ones_like
, mygrad.zero_like
, and mygrad.full_like
to accept a shape
argument.
This does, however raise a question. How do we handle the numpy versioning issue. E.g. If someone passes the shape
parameter, but has numpy 1.16.X installed, do we raise an error? Do we hack our implementation so that it will work rain or shine?
@Zac-HD do you have any insight into how you have handled this sort of thing?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
NumPy 1.17.0 Release Notes
empty_like , full_like , ones_like and zeros_like now accept a shape keyword argument, which can be used to create a new array as...
Read more >Return a new array with the same shape and type as given ...
To return a new array with the same shape and type as a given array, use the numpy.empty_like() method in Python Numpy. It...
Read more >NumPy: empty_like() function - w3resource
The empty_like() function is used to create a new array with the same shape and type as a given array. Syntax: numpy.empty_like(prototype ...
Read more >How to Use Numpy Empty - Sharp Sight
An example of a 2-dimensional NumPy array with the numbers 0 to 7. NumPy arrays have a shape. One important thing that you...
Read more >Create an empty ndarray with np.empty() and np.empty_like()
This article describes how to create an uninitialized empty NumPy array ndarray.numpy.empty()Specify shape (number of rows, columns, etc.)
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Given that this would only break people who update MyGrad, what do you think about just simultaneously bumping the min version of numpy to 1.17 in the PR that would make this change?
Or are you worried that there are people who can bump MyGrad but not numpy?
NumPy 1.17 is now the minimum version supported by MyGrad 2.0