If you are looking for how large are the new tensors created by running this segment of code, can’t you just look at the difference of memory_allocated ?

You’re correct, @SimonW. It works just fine. For some reason I thought caching would affect the numbers, but it doesn’t. I verified it with some more tests.
So I am all set, just need to wait for pytorch-1.0.1 to be out.
Thank you, again.