CPU tensors are compatible with numpy, you can use .numpy() to get a numpy array view on the storage.
You can inspect the memory layout using .stride(). C means highest stride first, F means lowest stride first.
For example
c = torch.randn(5,5)
print (c.stride())

returns (5,1) for me, so it would be in C order. Similarly, .continguous() makes C order.
A sightly convoluted way to get to F order would then be
cp = c.permute(list(numpy.argsort(c.stride()))).contiguous()
d = cp.permute(list(numpy.argsort(cp.stride())))

Now d.stride() will be (1,5) and (c==d).all().item() will be one.
Best regards
Thomas