Hi. I think you can use the PyTorch Profiler here: https://pytorch.org/tutorials/recipes/recipes/profiler.html 7   for getting the amount of memory required per layer, execution time per layer in the model as well as show the amount of memory (used by the model’s tensors) that was allocated (or released) during the execution of the model’s operators.
Hope this helps