Docs: Warning on target size difference
bockets opened this issue · comments
Aaron B. commented
torch.rb/tutorials/blitz/neural_networks.md
Line 143 in b0fa9a1
I think this line is supposed to be target = Torch.randn(1, 10)
rather than target = Torch.randn(10)
to fit in with the sample code that precedes this line.
Otherwise I get the warning:
Using a target size ([10]) that is different to the input size ([1, 10]). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
Andrew Kane commented
Hi @bockets, thanks for another report, but I'm not able to reproduce the warning. That line and the next one will give target
a shape of [1, 10]
.
target = Torch.randn(10) # a dummy target, for example
target = target.view(1, -1) # make it the same shape as output