Difference between Initialized and uninitialized matrix?

Hi, I am pretty new to this field, in general, so forgive me if this seems like a very stupid question but I just don’t get the difference between x = torch.Tensor(5, 3) and x = torch.rand(5, 3).



The first allocates a new tensor in memory and returns it to you. Meaning that the tensor contains whatever the memory was containing before your tensor was allocated.
The second one allocates new memory as well then fills it with randomly generated numbers between 0 and 1.