Closed
Description
The code below works differently in dpctl and numpy:
import numpy, dpctl, dpctl.tensor as dpt
a = dpt.ones((2, 3))
dpt.reshape(a, (1, 6, 1)).flags
# Out:
# C_CONTIGUOUS : False
# F_CONTIGUOUS : False
# WRITABLE : True
x = numpy.ones((2, 3))
numpy.reshape(x, (1, 6, 1)).flags
# Out:
# C_CONTIGUOUS : True
# F_CONTIGUOUS : True
# OWNDATA : False
# WRITEABLE : True
# ALIGNED : True
# WRITEBACKIFCOPY : False
and similar use case:
a = dpt.ones((2, 3), order='F')
dpt.reshape(a, (1, 6, 1), order='F').flags
# Out:
# C_CONTIGUOUS : False
# F_CONTIGUOUS : False
# WRITABLE : True
x = numpy.ones((2, 3), order='F')
numpy.reshape(x, (1, 6, 1), order='F').flags
# Out:
# C_CONTIGUOUS : True
# F_CONTIGUOUS : True
# OWNDATA : False
# WRITEABLE : True
# ALIGNED : True
# WRITEBACKIFCOPY : False
one more example with sum:
a = dpt.ones((2, 3, 4))
dpt.sum(a, axis=(1, 2), keepdims=True).flags
# Out:
# C_CONTIGUOUS : False
# F_CONTIGUOUS : False
# WRITABLE : True
x = numpy.ones((2, 3, 4))
numpy.sum(a, axis=(1, 2), keepdims=True).flags
# Out:
# C_CONTIGUOUS : True
# F_CONTIGUOUS : True
# OWNDATA : True
# WRITEABLE : True
# ALIGNED : True
# WRITEBACKIFCOPY : False
Metadata
Metadata
Assignees
Labels
No labels