Skip to content

lowercase order value in dpctl.tensor.copy() #1372

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

Closed
antonwolfy opened this issue Aug 27, 2023 · 0 comments · Fixed by #1376
Closed

lowercase order value in dpctl.tensor.copy() #1372

antonwolfy opened this issue Aug 27, 2023 · 0 comments · Fixed by #1376

Comments

@antonwolfy
Copy link
Collaborator

It looks dpctl doesn't properly handle lowercase order value in dpctl.tensor.copy():

import dpctl, dpctl.tensor as dpt

a = dpt.ones(10)

# works with dpt.asarray
dpt.asarray(a, order='c')
# Out: usm_ndarray([1., 1., 1., 1., 1., 1., 1., 1., 1., 1.], dtype=float32)

# but caused an exception with dpt.copy
dpt.copy(a, order='c')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 dpt.copy(a, order='c')

File ~/miniconda3/envs/dpnp_dev/lib/python3.9/site-packages/dpctl/tensor/_copy_utils.py:536, in copy(usm_ary, order)
    534         copy_order = "F"
    535 else:
--> 536     raise ValueError(
    537         "Unrecognized value of the order keyword. "
    538         "Recognized values are 'A', 'C', 'F', or 'K'"
    539     )
    540 if order == "K":
    541     R = _empty_like_orderK(usm_ary, usm_ary.dtype)

ValueError: Unrecognized value of the order keyword. Recognized values are 'A', 'C', 'F', or 'K'
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.

1 participant