(tensor, dim, keepdim)
return torch.sum(tensor, dim, keepdim)
Computes the sum of elements in input tensor.

    :param tensor: PyTorch tensor.
    :type tensor: `torch.nn.Module`
    :param dim: Reduction dimension.
    :type dim: `int`
    :param keepdim: Whether the output has `dim` retained.
    :type keepdim: `bool`
    :return: Sum of input tensor.
Computes the sum of elements in input tensor.
Computes the sum of elements in input tensor .
def sum(tensor, dim, keepdim):
    """
    Computes the sum of elements in input tensor.

    :param tensor: PyTorch tensor.
    :type tensor: `torch.nn.Module`
    :param dim: Reduction dimension.
    :type dim: `int`
    :param keepdim: Whether the output has `dim` retained.
    :type keepdim: `bool`
    :return: Sum of input tensor.
    """
    return torch.sum(tensor, dim, keepdim)
def sum ( tensor , dim , keepdim ) : return torch . sum ( tensor , dim , keepdim )