code: def scatter_mean(
      src: torch.Tensor,
      index: torch.Tensor,
      dim: int = -1,
      out: Optional[torch.Tensor] = None,
      dim_size: Optional[int] = None,
  ) -> torch.Tensor:
      out = scatter_sum(src, index, dim, out, dim_size)
      dim_size = out.size(dim)
  
      index_dim = dim
      if index_dim < 0:
          index_dim = index_dim + src.dim()
      if index.dim() <= index_dim:
          index_dim = index.dim() - 1
  
      ones = torch.ones(
          index.size(), dtype=src.dtype, device=src.device
      )
      count = scatter_sum(ones, index, index_dim, None, dim_size)
      count[count < 1] = 1
      count = broadcast(count, out, dim)
      if out.is_floating_point():
          out.true_divide_(count)
      else:
          out.floor_divide_(count)
      return out
  
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 6 for calling a global function with example usage: scatter_mean(src, index, dim, out, dim_size) and returns: out