Yes, it does. Thanks again for your help. I would have never thought that this was the problem, it’s not so easy to spot. If there isn’t any counterside, I would recommend to not allow this behaviour with MSE loss or maybe print a warning message about the possible issue with dimension mismatch.