You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a slight mismatch in the notation used to denote the extracted dimensions from the shape of the input tensor. here
batch_size, _, x_dim, y_dim = input_tensor.size()
You extract x_dim from dimension number 2 and y_dim from dimension number 3. As per the image based 4d tensors of Pytorch, it is the height that comes before width. Please refer to the documentation of Pytorch's Conv2d layer. Notice the input and output tensor shapes.
The code would run fine since the extracted dimensions end up in right place when constructing the output tensor, but for a code reader like me (implementation checking), it seems like a mistake at first glance. Perhaps, the notation can be changed as per Pytorch.
Thanks
There is a slight mismatch in the notation used to denote the extracted dimensions from the shape of the input tensor. here
batch_size, _, x_dim, y_dim = input_tensor.size()
You extract x_dim from dimension number 2 and y_dim from dimension number 3. As per the image based 4d tensors of Pytorch, it is the height that comes before width. Please refer to the documentation of Pytorch's Conv2d layer. Notice the input and output tensor shapes.
The code would run fine since the extracted dimensions end up in right place when constructing the output tensor, but for a code reader like me (implementation checking), it seems like a mistake at first glance. Perhaps, the notation can be changed as per Pytorch.
Thanks
Hi @mkocabas,
There is a slight mismatch in the notation used to denote the extracted dimensions from the shape of the input tensor. here
You extract
x_dim
from dimension number2
andy_dim
from dimension number3
. As per the image based4d
tensors of Pytorch, it is the height that comes before width. Please refer to the documentation of Pytorch's Conv2d layer. Notice the input and output tensor shapes.The code would run fine since the extracted dimensions end up in right place when constructing the output tensor, but for a code reader like me (implementation checking), it seems like a mistake at first glance. Perhaps, the notation can be changed as per Pytorch.
Thanks
Cheers!
@akanimax
The text was updated successfully, but these errors were encountered: