code: def scatter_add(x0, indices, x1, axis):
      output = np.copy(x0)
      if x0.ndim == 2:
          for i in range(indices.shape[0]):
              for j in range(indices.shape[1]):
                  if axis == 0 or axis == -2:
                      output[indices[i][j]][j] += x1[i][j]
                  elif axis == 1 or axis == -1:
                      output[i][indices[i][j]] += x1[i][j]
      elif x0.ndim == 3:
          for i in range(indices.shape[0]):
              for j in range(indices.shape[1]):
                  for k in range(indices.shape[2]):
                      if axis == 0 or axis == -3:
                          output[indices[i][j][k]][j][k] += x1[i][j][k]
                      elif axis == 1 or axis == -2:
                          output[i][indices[i][j][k]][k] += x1[i][j][k]
                      elif axis == 2 or axis == -1:
                          output[i][j][indices[i][j][k]] += x1[i][j][k]
      return output
  
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context, function_tester
label_desc: Use image node_id 1 for calling a global function with example usage: scatter_add(x0, indices, x1, axis) and returns: output