code: def _replace_at_index(x, index, replacement):
      """Replaces an element at supplied index."""
      return tf.tensor_scatter_nd_update(x, [[index]], [replacement])
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 8 for calling a global function with example usage: _replace_at_index(x, index, replacement) and returns: tf