Closed antonwolfy closed 1 month ago
The input dpt.usm_ndarray((2, 3), numpy.float32, strides=(5, 1))
result in allocation of larger memory blob than np.float32.itemsize * 2 * 3 = 24
bytes. dpctl.tensor
would allocate dpt.float32.itemsize * ( 5 * (2-1) + 1 * (3-1) ) = 28
bytes, although not all bytes are going to be addressed by the array indices.
The dpt.usm_ndarray
is not intended for use of end-user. The user is advised to use Python Array API constructor functions.
This behavior is not going to change. Feel free to close this ticket.
@oleksandr-pavlyk, I see, thank you for the detailed explanation.
In case when strides passed in
usm_ndarray
constructor is incompatible with shape keyword, there is no validation exception raised by dpctl. Please check below example for more details: