Skip to content
New issue

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

[Bug]: Indexing with 0-dimensional key #1019

Closed
neosunhan opened this issue Aug 29, 2022 · 4 comments
Closed

[Bug]: Indexing with 0-dimensional key #1019

neosunhan opened this issue Aug 29, 2022 · 4 comments
Assignees
Labels
bug Something isn't working dndarray GSoC stale

Comments

@neosunhan
Copy link
Collaborator

neosunhan commented Aug 29, 2022

What happened?

Indexing a DNDarray with a 0-dimensional DNDarray as a key throws an error.

Code snippet triggering the error

>>> import heat as ht
>>> import numpy as np
>>> np.array(False)[np.array(False)]
array([], dtype=bool)
>>> ht.array(False)[ht.array(False)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  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: too many indices for tensor of dimension 0

Version

main (development branch)

Python version

3.10

PyTorch version

1.11

@neosunhan neosunhan added bug Something isn't working GSoC dndarray labels Aug 29, 2022
@neosunhan neosunhan self-assigned this Aug 29, 2022
@neosunhan neosunhan linked a pull request Aug 29, 2022 that will close this issue
4 tasks
@ClaudiaComito
Copy link
Contributor

Thanks for this, ongoing work in #938

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2023

Branch bugs/1019-_Bug_Indexing_with_0-dimensional_key created!

Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label May 20, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 60 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dndarray GSoC stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants