Skip to content

Bugfix/gh 728 astype - #757

Merged
oleksandr-pavlyk merged 2 commits into
masterfrom
bugfix/gh-728-astype
Feb 1, 2022
Merged

oleksandr-pavlyk merged 2 commits into
masterfrom
bugfix/gh-728-astype

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Feb 1, 2022

Copy link
Copy Markdown

@coveralls

coveralls commented Feb 1, 2022 •

Copy link
Copy Markdown
Collaborator

Coverage Status

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

Comment thread dpctl/tensor/_copy_utils.py Resolved
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

github-actions Bot commented Feb 1, 2022

Copy link
Copy Markdown

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