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

ValueError when trying to access an array with zero value in one of shape values #870

Closed
npolina4 opened this issue Jul 28, 2022 · 1 comment · Fixed by #871
Closed

ValueError when trying to access an array with zero value in one of shape values #870

npolina4 opened this issue Jul 28, 2022 · 1 comment · Fixed by #871

Comments

@npolina4
Copy link
Collaborator

Reproducer:

In [1]: import dpctl, dpctl.tensor as dpt
In [2]: X = dpt.empty((0,4))
In [3]: X[:, 1:3]

Output:

ValueError: Buffer can not accomodate the requested array
@oleksandr-pavlyk
Copy link
Collaborator

Also similar error for X[:, 1].

@oleksandr-pavlyk oleksandr-pavlyk changed the title ValueError when trying to access an array with zero value one of shape values ValueError when trying to access an array with zero value in one of shape values Jul 28, 2022
oleksandr-pavlyk added a commit that referenced this issue Jul 28, 2022
Offset should not be incremented if the array is found empty.

```
import dpctl.tensor as dpt
X = dpt.empty((0,4), dtype='u1')
X[:, 1]  # no longer raises ValueError
X[:, 1:3] # no longer raises ValueError
```
oleksandr-pavlyk added a commit that referenced this issue Jul 28, 2022
@oleksandr-pavlyk oleksandr-pavlyk mentioned this issue Jul 28, 2022
2 tasks
ndgrigorian pushed a commit to ndgrigorian/dpctl that referenced this issue Sep 8, 2022
Offset should not be incremented if the array is found empty.

```
import dpctl.tensor as dpt
X = dpt.empty((0,4), dtype='u1')
X[:, 1]  # no longer raises ValueError
X[:, 1:3] # no longer raises ValueError
```
ndgrigorian pushed a commit to ndgrigorian/dpctl that referenced this issue Sep 8, 2022
ndgrigorian pushed a commit to ndgrigorian/dpctl that referenced this issue Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants