This is a shorcut for this method. It works up to 4 dimensions. szi is the size of the =i=-th dimension of the tensor. sti is the stride in the =i=-th dimension.