Skip to content

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

Closed
@antonwolfy

Description

@antonwolfy

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions