It seems you are not flattening the activations in your model before feeding them to the linear layers, so I would recommend to uncomment the view operation and change it to out = out.view(out.size(0), -1).
Also, you are not using activation functions between the linear layers.
nn.BCELoss expects a probability input, so you should either apply sigmoid on the output or use nn.BCEWithLogitsLoss.
However, based on the target shape it seems you are dealing with a multi-class classification with output classes.
If that’s the case, you should use nn.CrossEntropyLoss instead.
The model output should have the shape [batch_size, nb_classes] and the target [batch_size] containing the class indices in the range [0, nb_classes-1].