How does the “view” method work in PyTorch?
The view function is meant to reshape the tensor. Say you have a tensor a is a tensor that has 16 elements from 1 to 16(included). If you want to reshape this tensor to make it a 4 x 4 tensor then you can use Now a will be a 4 x 4 tensor. Note that after the reshape the total number of … Read more