I have noticed that other models will have layers like torch.max() and torch.sum() right after the nn.Linear() layer. Which makes the 3D output from the previous layer become 2D again, then I am able to use it with the labels to calculate the loss.
So now my question has become, why would someone pick torch.max() or torch.sum() or other layers ? Is that part of the hyperparameter tuning procedure ?