Well, maybe it is the problem of my IDE (Pycharm)?
I know that torch.sum is written in C++,and the __init__.py only record the form function.
I use the Go to declaration tools in the IDE, and it goes to an __init__.py  file, and the illustrate of torch.sum is like this:

def sum(input): # real signature unknown; restored from __doc__
    """
    .. function:: sum(input) -> float
    
    Returns the sum of all elements in the :attr:`input` Tensor.
    
    Args:
        input (Tensor): the input `Tensor`
    
    Example::
    
        >>> a = torch.randn(1, 3)
        >>> a
    
         0.6170  0.3546  0.0253
        [torch.FloatTensor of size 1x3]
    
        >>> torch.sum(a)
        0.9969287421554327
    
    
    .. function:: sum(input, dim, keepdim=False, out=None) -> Tensor
    
    Returns the sum of each row of the :attr:`input` Tensor in the given
    dimension :attr:`dim`.
    
    If :attr:`keepdim` is ``True``, the output Tensor is of the same size
    as :attr:`input` except in the dimension :attr:`dim` where it is of size 1.
    Otherwise, :attr:`dim` is squeezed (see :func:`torch.squeeze`), resulting in
    the output Tensor having 1 fewer dimension than :attr:`input`.
    
    Args:
        input (Tensor): the input `Tensor`
        dim (int): the dimension to reduce
        keepdim (bool): whether the output Tensor has :attr:`dim` retained or not
        out (Tensor, optional): the result Tensor
    
    Example::
    
        >>> a = torch.randn(4, 4)
        >>> a
    
        -0.4640  0.0609  0.1122  0.4784
        -1.3063  1.6443  0.4714 -0.7396
        -1.3561 -0.1959  1.0609 -1.9855
         2.6833  0.5746 -0.5709 -0.4430
        [torch.FloatTensor of size 4x4]
    
        >>> torch.sum(a, 1)
    
         0.1874
         0.0698
        -2.4767
         2.2440
        [torch.FloatTensor of size 4]
    """
    return 0.0


What I want to say is the input part, I only see an arument input,  and my IDE’s argument prompt message will only give the hint of input, and will drop an warning if I add the dim argument.
Do I illustrate the little problem clearly this time? Thanks a lot!