torch.empty will create a tensor with uninitialized memory, so it won’t really be “empty” in the sense that no memory is used.



 Ashish_Gupta1:

Is using a Variable good option?


No, Variables are deprecated since PyTorch 0.4.