Looking at the implementation of MSE loss: https://pytorch.org/docs/stable/_modules/torch/nn/functional.html#mse_loss 45
I’m pretty confused about this bit here:
    if target.requires_grad:
        ret = (input - target) ** 2
        if reduction != 'none':
            ret = torch.mean(ret) if reduction == 'mean' else torch.sum(ret)
    else:
        expanded_input, expanded_target = torch.broadcast_tensors(input, target)
       ret = torch._C._nn.mse_loss(expanded_input, expanded_target, _Reduction.get_enum(reduction))

Why exactly is the  torch._C mse_loss being used if the tensor doesn’t need a gradient (so, presumably, if .backwards doesn’t need to be called on the loss) ?
If so, is it faster, or rather, fast enough to justify the complexity ? Even given that the broadcast operation is needed