As far as I understand it, the memory format of pytorch tensors is basically the same as that of numpy ndarrays, so I shall give some basic pointers and let the experts fill in any gaps.
I assume you know how strides work in numpy, if not here are some links.
Basic docs https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.strides.html 5
A more wordy explanation https://www.datacamp.com/community/tutorials/python-numpy-tutorial 1
A lengthy explanation of numpy C code https://docs.scipy.org/doc/numpy-1.13.0/reference/internals.code-explanations.html 2
Do you have a more specific question?