-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
Description
Following the discussion in dask/dask#4462, in some cases it's necessary to create a new array of the same NumPy-like type (e.g., sparse or CuPy) as the input array. This can be achieved by using {empty,full,ones,zeros}_like() functions. However, this prevents a new array of arbitrary shape to be created.
@shoyer suggested the following change in dask/dask#4462:
What about adding a
shapekeyword argument to NumPy'szeros_like,ones_likeandfull_like? There's some precedence for overwriting attributes of the original array with thedtypeargument already.
I think this is a good solution and I would like to see this implemented. I will be opening a PR for this soon.
Reactions are currently unavailable