In torch, we can declare an empty torch.Tensor() in a module’s init function, then in the forward function, just resize this torch tensor. I think in this way we can save some time on mallocing new memories.
In pytorch, do we even need to do this? If yes, then should it be a tensor or an autograd.Variable?
Thanks!