Returns memory displacement in array elements, upon unit change of respective index.

For example, for strides (s1, s2, s3) and multi-index (i1, i2, i3) position of the respective element relative to zero multi-index element is s1*s1 + s2*i2 + s3*i3.

from dpctl import tensor

x = tensor.zeros((20, 30))
xv = x[10:, :15]

multi_id = (3, 5)
byte_displacement = xv[multi_id]._pointer - xv[0, 0]._pointer
element_displacement = sum(
    i * s for i, s in zip(multi_id, xv.strides)
assert byte_displacement == element_displacement * xv.itemsize