-
-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Right now, this is not the case:
import numpy as np
import blosc2
import torch
# Create an empty array
dset_out = blosc2.empty(shape=(10,), dtype=np.int64)
a = torch.from_numpy(np.arange(10))
dset_out[:] = np.asarray(a) # this works
dset_out[:] = a # this does notoutput:
Traceback (most recent call last):
File "/Users/faltet/blosc/python-blosc2/blosc2-torch-ingest.py", line 10, in <module>
dset_out[:] = a # this does not
~~~~~~~~^^^
File "/Users/faltet/blosc/python-blosc2/src/blosc2/ndarray.py", line 4241, in __setitem__
return super().set_slice((start, stop), value)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "blosc2/blosc2_ext.pyx", line 2544, in blosc2.blosc2_ext.NDArray.set_slice
TypeError: a bytes-like object is required, not 'Tensor'
Process finished with exit code 1
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request