Where can I see the source code for pytorch's MSELoss?
I use the U-NET network to train my data.
But I need to modify its loss function to reduce the loss of pixels below 1 to reduce the impact of negative cases on network weights. But I opened the source code in pycharm MSELOSS, see this:

class MSELoss(_Loss):
    r"""Creates a criterion that measures the mean squared error between
    `n` elements in the input `x` and target `y`:

    :math:`{loss}(x, y)  = 1/n \sum |x_i - y_i|^2`

    `x` and `y` arbitrary shapes with a total of `n` elements each.

    The sum operation still operates over all the elements, and divides by `n`.

    The division by `n` can be avoided if one sets the internal variable
    `size_average` to `False`.

    """
    pass


I can't get anything useful.

There you go: https://github.com/pytorch/pytorch/blob/master/torch/nn/functional.py#L1423 However, it calls the C api

def mse_loss(input, target, size_average=True, reduce=True):
    """
    mse_loss(input, target, size_average=True, reduce=True) -&gt; Variable
    Measures the element-wise mean squared error.
    See :class:`~torch.nn.MSELoss` for details.
    """
    return _pointwise_loss(lambda a, b: (a - b) ** 2, torch._C._nn.mse_loss,
input, target, size_average, reduce)

def own_mse_loss(input, target, size_average=True):
    L = (input - target) ** 2
    return torch.mean(L) if size_average else torch.sum(L)

