Solved by ptrblck in post #2 
              
              
                You could broadcast the second tensor to the same shape as the first one and could then apply e.g. nn.MSELoss. The right approach depends on the actual use case and the desired loss function, i.e. since both tensors have a different shape, what should the loss represent?