When working with Loss Functions, documentation states the size should be (N, *) where N is the batch size.
The question is, when working with nets which have output of size 1 (Regression Net) the output of the net has the size (N, 1) (Namely a matrix with one column).
Yet the ground truth data is usually a vector of length N.
Now, if one just subtract one from the other he will get a broadcasting and a result of (N, N) matrix:
vA = torch.rand((3, 1))
vB = torch.rand((3))
vA - vB

Do loss functions avoid this because of the use of lambda function?
Should one make sure the net output is a pure vector and not single column matrix?
Is it best practice to output return x.view(-1) at the end of a single output net?