code: def scatter_sum(
      src: torch.Tensor,
      index: torch.Tensor,
      dim: int = -1,
      out: Optional[torch.Tensor] = None,
      dim_size: Optional[int] = None,
  ) -> torch.Tensor:
      index = broadcast(index, src, dim)
      if out is None:
          size = list(src.size())
          if dim_size is not None:
              size[dim] = dim_size
          elif index.numel() == 0:
              size[dim] = 0
          else:
              size[dim] = int(index.max()) + 1
          out = torch.zeros(size, dtype=src.dtype, device=src.device)
          return out.scatter_add_(dim, index, src)
      else:
          return out.scatter_add_(dim, index, src)
  
file_path: AutoGL/autogl/module/feature/_generators/_pyg_impl.py
imports: import torch
  import typing
  from typing import Optional, Tuple
label_desc: Use image node_id 3 for calling a global function with example usage: scatter_sum(src, index, dim, out, dim_size) and returns: out, out