something like the following tensorflow equivalent.
tf.TensorArray.scatter(indices, value, name=None) Scatter the values of a Tensor in specific indices of a TensorArray. Args: indices: A 1-D Tensor taking values in [0, max_value). If the TensorArray is not dynamic, max_value=size(). value: (N+1)-D. Tensor of type dtype. The Tensor to unpack. name: A name for the operation (optional). Returns: A new TensorArray object with flow that ensures the scatter occurs. Use this object all for subsequent operations. Raises: ValueError: if the shape inference fails.