Target size (torch.Size([10])) must be the same as input size (torch.Size([2]))

Both approaches would work but @KFrank has a great detailed explanation here.

1 Like