code: def scatter_add(input, dim, index, src):
      """Add values from src into input at the indices specified in index.
  
      Parameters
      ----------
      input : array-like
          Tensor to scatter values into.
      dim : int
          The axis along which to index.
      index : array-like
          The indices of elements to scatter.
      src : array-like
          The source element(s) to scatter.
  
      Returns
      -------
      input : array-like
          Modified input array.
      """
      if dim == 0:
          for i, val in zip(index, src):
              input[i] += val
          return input
      if dim == 1:
          for j in range(len(input)):
              for i, val in zip(index[j], src[j]):
                  if (
                      not isinstance(val, _np.float64)
                      and BACKEND_NAME == "autograd"
                  ):
                      val = float(val._value)
                  input[j, i] += float(val)
          return input
      raise NotImplementedError
  
imports: from ._dispatch import BACKEND_NAME, _common
  from ._dispatch import numpy
label_desc: Use image node_id 29 for calling a global function with example usage: scatter_add(input, dim, index, src) and returns: input, input