code: def _scatter_nd(index, src, n_rows):
      assert index.shape == src.shape
      shp = index.shape
      ctx = context(src)
      ndim = index.ndim
      offsets = []
      stride = 1
      for i in reversed(range(1, ndim)):
          di = shp[i]
          offset_i = tf.range(di, dtype=index.dtype)
          offsets.append(
              tf.reshape(
                  (stride * offset_i),
                  (1,) * i + (di,) + (1,) * (ndim - 1 - i),
              )
          )
          stride *= di
      if ndim > 1:
          new_idx = index * stride + copy_to(sum(offsets), ctx)
      else:
          new_idx = index
      src = tf.reshape(src, (-1,))
      new_idx = tf.reshape(new_idx, (-1, 1))
      rst = tf.reshape(
          tf.scatter_nd(new_idx, src, (stride * n_rows,)),
          (n_rows, *shp[1:]),
      )
      return rst
  
imports: import numpy
  import tensorflow
  from ..._sparse_ops import _bwd_segment_cmp, _csrmask, _csrmm, _csrsum, _gsddmm, _gspmm, _scatter_add, _segment_reduce
  from ...base import ALL, is_all
  from ...heterograph_index import create_unitgraph_from_csr
  from .tensor import asnumpy, context, copy_to, tensor, 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