Why use unsqueeze() here? #1153
Unanswered
mklingamsetty
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It is because most of the time you will work with data with 2 or more dimensions. In that case, it won't make sense if you have your data in one 1D i.e [x1, x2, x3, x4 ...]. But with unsqueeze, the same data is represented as Hope this helps :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In this image, I dont understand why we have to use the unsqueeze method to make the set from a 1D tensor to a 2D tensor. When I ran my code without the unsqueeze method it still worked, the only difference being the output was a 1D tensor.
Beta Was this translation helpful? Give feedback.
All reactions