code: def scatter_nd_impl(data, indices, updates, reduction="none"):  # type: ignore
      # Check tensor shapes
      assert indices.shape[-1] <= len(data.shape)
      assert (
          updates.shape
          == indices.shape[:-1] + data.shape[indices.shape[-1] :]
      )
  
      # Compute output
      output = np.copy(data)
      for i in np.ndindex(indices.shape[:-1]):
          # NOTE: The order of iteration in this loop is not specified.
          if reduction == "add":
              output[tuple(indices[i])] += updates[i]
          elif reduction == "mul":
              output[tuple(indices[i])] *= updates[i]
          elif reduction == "max":
              output[tuple(indices[i])] = np.maximum(
                  output[indices[i]], updates[i]
              )
          elif reduction == "min":
              output[tuple(indices[i])] = np.minimum(
                  output[indices[i]], updates[i]
              )
          else:
              output[tuple(indices[i])] = updates[i]
      return output
  
file_path: onnx/onnx/backend/test/case/node/scatternd.py
imports: import numpy
  import onnx
  from onnx.backend.test.case.base import Base
  from onnx.backend.test.case.node import expect
label_desc: Use image node_id 1 for calling a global function with example usage: scatter_nd_impl(data, indices, updates, reduction) and returns: output