Skip to content

dpt.usm_ndarray does not support order "K" #1764

@antonwolfy

Description

@antonwolfy

The example below points on different range supported values for order keyword passed into asarray function and usm_ndarray constructor:

import numpy, dpctl, dpctl.tensor as dpt

dpctl.__version__
# Out: '0.18.0dev0+158.g7450558d25'

a = dpt.ones((2, 5), order='F')

# order="K" works for asarray:
b = dpt.asarray(a, order="K")

# but fails with usm_ndarray constructor
c = dpt.usm_ndarray(a.shape, buffer=a, order="K")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[13], line 1
----> 1 c = dpt.usm_ndarray(a.shape, buffer=a, order="K")

File dpctl/tensor/_usmarray.pyx:264, in dpctl.tensor._usmarray.usm_ndarray.__cinit__()

ValueError: Unsupported order='K' given. Supported values are 'C' or 'F'.

# for numpy both use cases are supporting
a = numpy.ones((2, 5), order="F")
b = numpy.asarray(a, order="K")
c = numpy.ndarray(a.shape, buffer=a, order="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