Solved by ptrblck in post #2 
              
              
                If you call contiguous() on a non-contiguous tensor, a copy will be performed. 
Otherwise it will be a no-op. 
You could add some print statements to the linked example code and will see an increased memory usage after the y.contiguous() call.