We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On arrays where one of the dimensions is of size 0, adding an extra dimension via slicing with None results in an error.
None
Taking reference from numpy, this should instead add the extra dimension normally.
>>> import heat as ht >>> import numpy as np >>> np_array = np.array([]) >>> ht_array = ht.array([]) >>> np_array.shape (0,) >>> ht_array.shape (0,) >>> np_array[None] array([], shape=(1, 0), dtype=float64) >>> ht_array[None] Traceback (most recent call last): File "<stdin>", line 1, in <module> File ".../heat/core/dndarray.py", line 757, in __getitem__ return self.expand_dims(i)[tuple(key)] File ".../heat/core/dndarray.py", line 755, in __getitem__ if self.__key_adds_dimension(key, i, self_proxy): File ".../heat/core/dndarray.py", line 968, in __key_adds_dimension return self_proxy[(*zeros[:axis], key[axis], *zeros[axis:])].ndim == 2 IndexError: index 0 is out of bounds for dimension 1 with size 0
main (development branch)
3.10
1.11
The text was updated successfully, but these errors were encountered:
ongoing work in #938
Sorry, something went wrong.
Branch bugs/1012-_Bug_Slice_error_when_array_contains_an_axis_of_length_0 created!
This issue is stale because it has been open for 60 days with no activity.
This issue was closed because it has been inactive for 60 days since being marked as stale.
ClaudiaComito
Successfully merging a pull request may close this issue.
What happened?
On arrays where one of the dimensions is of size 0, adding an extra dimension via slicing with
None
results in an error.Taking reference from numpy, this should instead add the extra dimension normally.
Code snippet triggering the error
Version
main (development branch)
Python version
3.10
PyTorch version
1.11
The text was updated successfully, but these errors were encountered: