Hi folks!
While running an experiment, I keep getting this error in the backward pass.
The forward works properly. Could anyone help me understand what this is about?
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-83-0b1a3ff3f774> in <module>
      2     out = net(batch[0])
      3     loss = nn.MSELoss()(out, batch[1])
----> 4     loss.backward(retain_graph=False)

~/anaconda3/envs/Juniper/lib/python3.7/site-packages/torch/tensor.py in backward(self, gradient, retain_graph, create_graph)
    183                 products. Defaults to ``False``.
    184         """
--> 185         torch.autograd.backward(self, gradient, retain_graph, create_graph)
    186 
    187     def register_hook(self, hook):

~/anaconda3/envs/Juniper/lib/python3.7/site-packages/torch/autograd/__init__.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables)
    125     Variable._execution_engine.run_backward(
    126         tensors, grad_tensors, retain_graph, create_graph,
--> 127         allow_unreachable=True)  # allow_unreachable flag
    128 
    129 

RuntimeError: shape '[2, 1, 4]' is invalid for input of size 4