-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
It would be nice if __setitem__ worked with Numpy arrays as right-hand side. Currently one gets the error
Traceback (most recent call last):
File "cupy/core/core.pyx", line 1575, in cupy.core.core.ndarray.__setitem__
File "cupy/core/core.pyx", line 3043, in cupy.core.core._scatter_op
File "cupy/core/core.pyx", line 442, in cupy.core.core.ndarray.fill
ValueError: non-scalar numpy.ndarray cannot be used for fill
A straightforward implementation could first cast to a cupy array and then do the usual setitem. An optimization for same dtype and size (assuming contiguous memory) would be to just use cudaMemcpycupy_array.data.copy_from_host, but that may not be very relevant.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels