class_docstr: Stand-in for tf.TensorArray.
docstr: Writes `value` at position `index`.
docstr_tok: ["Writes","`","value","`","at","position","`","index","`","."]
code: def write(
      self, index, value, name=None
  ):  # pylint: disable=unused-argument
      """Writes `value` at position `index`."""
      index = np.array(index, dtype=np.int32)
      value = np.array(value, dtype=self.dtype)
      if isinstance(self._data, list):
          if JAX_MODE:
              warnings.warn(
                  "Writing to nptf.TensorArray with unknown size in JAX. This will "
                  "not work well with while loops. {}".format(
                      repr(self)
                  )
              )
          new_data = list(self._data)
          if self.dynamic_size:
              new_data.extend([None] * (int(index) - len(new_data) + 1))
          new_data[index] = value
      elif JAX_MODE:
          import jax  # pylint: disable=g-import-not-at-top
  
          try:
              new_data = self._data.at[index].set(value)
          except:
              raise ValueError("Error writing to {}".format(repr(self)))
      else:
          raise ValueError(
              "Unexpected type: {}".format(type(self._data))
          )
      return TensorArray(
          self.dtype,
          data=new_data,
          dynamic_size=self.dynamic_size,
          element_shape=self.element_shape,
          infer_shape=self._infer_shape,
      )
  
imports: import warnings
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import numpy_array
label_desc: Use image node_id 10 for calling the TensorArray obj's underlying member method code with example usage: obj.write(index, value, name) and returns: TensorArray