question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

numpy 1.17 update: empty_like et. al now accept a shape argument

See original GitHub issue

We 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aslvrstncommented, Dec 18, 2019

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?

0reactions
rsoklcommented, Feb 16, 2021

NumPy 1.17 is now the minimum version supported by MyGrad 2.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found