code: def broadcast(src: torch.Tensor, other: torch.Tensor, dim: int):
      if dim < 0:
          dim = other.dim() + dim
      if src.dim() == 1:
          for _ in range(0, dim):
              src = src.unsqueeze(0)
      for _ in range(src.dim(), other.dim()):
          src = src.unsqueeze(-1)
      src = src.expand(other.size())
      return src
  
file_path: AutoGL/autogl/module/nas/scatter_utils.py
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: broadcast(src, other, dim) and returns: src