code: def index_add(self, dim, index, tensor):
      """Performs out-of-place index_add: Accumulate the elements of tensor into the
      self tensor by adding to the indices in the order given in index.
      """
      result = self.clone()
      assert index.dim() == 1, "index needs to be a vector"
      tensor = getattr(tensor, "_tensor", tensor)
      result._tensor.index_add_(dim, index, tensor)
      return result
  
imports: import torch
  from ..tensor_types import is_tensor
  from ..util import torch_cat, torch_stack
label_desc: Use image node_id 3 for calling a global function with example usage: index_add(dim, index, tensor) and returns: result