Hi,
so my Neural Network’s forward() returns a tensor of shape: z.size() torch.Size([64, 1]) whereas
z=
tensor([[0.000],
[0.264],
…
[0.000]], grad_fn=)
Now my original y is of shape y.size()= torch.Size([64]) looking like
y = tensor([0., 0., 0. … 0. ])
Now my y_pred = model(X) has shape torch.Size([64, 1]).
Now I want to do loss = loss_fn(y_pred, y) but I need the same dimensions. I know I could use z.view(-1) to get the correct reshaping but then I loose grad_fn= no? Isn’t that problematic for the backpropagation?
Sorry for the missing formatting but I don’t get that forum here. Does it support markdown? Latex?