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

Bugfix/gh 728 astype #757

Merged
merged 2 commits into from
Feb 1, 2022
Merged

Bugfix/gh 728 astype #757

merged 2 commits into from
Feb 1, 2022

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Fixes #728

In [1]: import dpctl.tensor as dpt

In [2]: X = dpt.asarray([])

In [3]: dpt.astype(X, float)
Out[3]: <dpctl.tensor._usmarray.usm_ndarray at 0x7fdb48137740>

In [4]: (dpt.asnumpy(_), _.dtype, _.shape, _.strides)
Out[4]: (array([], dtype=float64), dtype('float64'), (0,), (1,))

@github-actions
Copy link

github-actions bot commented Feb 1, 2022

@coveralls
Copy link
Collaborator

coveralls commented Feb 1, 2022

Coverage Status

Coverage decreased (-0.4%) to 81.308% when pulling 3ce1b68 on bugfix/gh-728-astype into 9c90442 on master.

Special-cased copying of 0-element arrays.
```python
In [1]: import dpctl.tensor as dpt

In [2]: X = dpt.asarray([])

In [3]: dpt.astype(X, float)
Out[3]: <dpctl.tensor._usmarray.usm_ndarray at 0x7fdb48137740>

In [4]: (dpt.asnumpy(_), _.dtype, _.shape, _.strides)
Out[4]: (array([], dtype=float64), dtype('float64'), (0,), (1,))
```
@oleksandr-pavlyk oleksandr-pavlyk merged commit f9d7498 into master Feb 1, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the bugfix/gh-728-astype branch February 1, 2022 18:03
@github-actions
Copy link

github-actions bot commented Feb 1, 2022

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

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 this pull request may close these issues.

dpctl.tensor.astype raises ValueError with empty list as input
3 participants