I would like to get info about a tensor just like I can do that for np array.
import numpy as np
n = np.array([[1, 2, 3], [4, 5, 6]])
np.info(n)
Is this possible?
Also can you comment why there is difference in stride:
t = torch.tensor(np.array([[1, 2, 3], [4, 5, 6]]))
print(t.stride())
np.info(t.data.numpy())
###
(3, 1)
class: ndarray
shape: (2, 3)
strides: (12, 4)
itemsize: 4
aligned: True
contiguous: True
fortran: False
data pointer: 0x20ad4068950
byteorder: little
byteswap: False
type: int32
Is it because PyTorch tensors are packed differently.