Closed
Description
Documentation of dpctl.tensor.from_dlpack
clearly states to return usm_ndarray
array, but it will result into numpy.ndarray
for an input object passed as numpy array:
import numpy, dpctl, dpctl.tensor as dpt
dpctl.__version__
# Out: '0.19.0dev0+280.g4a94ef9c25'
numpy.__version__
# Out: '2.1.3'
x = numpy.arange(10)
b = dpt.from_dlpack(x)
type(b)
# Out: numpy.ndarray
# setting `device` to a value will change the behavior:
b = dpt.from_dlpack(x, device='cpu')
type(b)
# Out: dpctl.tensor._usmarray.usm_ndarray
b = dpt.from_dlpack(x, device='gpu')
type(b)
# Out: dpctl.tensor._usmarray.usm_ndarray
Metadata
Metadata
Assignees
Labels
No labels