code: def _scatter_nd(index, src, n_rows):
      """Similar to PyTorch's scatter nd on first dimension."""
      assert index.shape == src.shape
      dgl_warning(
          "MXNet do not support scatter_add, fallback to numpy."
      )
      ctx = context(src)
      index = asnumpy(index)
      src = asnumpy(src)
      shp = index.shape
      ndim = src.ndim
      offsets = []
      stride = 1
      for i in reversed(range(1, ndim)):
          di = shp[i]
          offset_i = np.arange(di, dtype=index.dtype)
          offsets.append(
              (stride * offset_i).reshape(
                  (1,) * i + (di,) + (1,) * (ndim - 1 - i)
              )
          )
          stride *= di
      if ndim > 1:
          new_idx = index * stride + sum(offsets)
      else:
          new_idx = index
      src = src.reshape(-1)
      new_idx = new_idx.reshape(-1)
      rst = np.zeros((stride * n_rows,), dtype=src.dtype)
      np.add.at(rst, new_idx, src)
      rst = rst.reshape(n_rows, *shp[1:])
      rst = copy_to(zerocopy_from_numpy(rst), ctx)
      return rst
  
imports: import mxnet
  import numpy
  from mxnet import nd
  from ..._sparse_ops import _bwd_segment_cmp, _csrmask, _csrmm, _csrsum, _gsddmm, _gspmm, _scatter_add, _segment_reduce
  from ...base import ALL, dgl_warning, is_all
  from ...heterograph_index import create_unitgraph_from_csr
  from .tensor import asnumpy, context, copy_to, to_backend_ctx, zerocopy_from_numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _scatter_nd(index, src, n_rows) and returns: rst