class_docstr: A lightweight buffer for maintaining lists.
  
  The TensorBuffer accumulates tensors of the given shape into a tensor (whose
  rank is one more than that of the given shape) via calls to `append`. The
  current value of the accumulated tensor can be extracted via the property
  `values`.
docstr: Appends a new tensor to the end of the buffer.
  
  Args:
    value: The tensor to append. Must match the shape specified in the
      initializer.
  
  Returns:
    An op appending the new tensor to the end of the buffer.
docstr_tok: ["Appends","a","new","tensor","to","the","end","of","the","buffer",".","Args",":","value",":","The","tensor","to","append",".","Must","match","the","shape","specified","in","the","initializer",".","Returns",":","An","op","appending","the","new","tensor","to","the","end","of","the","buffer","."]
code: def append(self, value):
      """Appends a new tensor to the end of the buffer.
  
      Args:
        value: The tensor to append. Must match the shape specified in the
          initializer.
  
      Returns:
        An op appending the new tensor to the end of the buffer.
      """
  
      def _double_capacity():
          """Doubles the capacity of the current tensor buffer."""
          padding = tf.zeros_like(self._buffer, self._buffer.dtype)
          new_buffer = tf.concat([self._buffer, padding], axis=0)
          if tf.executing_eagerly():
              with tf.compat.v1.variable_scope(self._name, reuse=True):
                  self._buffer = tf.get_variable(
                      name="buffer",
                      dtype=self._dtype,
                      initializer=new_buffer,
                      trainable=False,
                  )
                  return self._buffer, tf.compat.v1.assign(
                      self._capacity, tf.multiply(self._capacity, 2)
                  )
          else:
              return tf.compat.v1.assign(
                  self._buffer, new_buffer, validate_shape=False
              ), tf.compat.v1.assign(
                  self._capacity, tf.multiply(self._capacity, 2)
              )
  
      update_buffer, update_capacity = tf.cond(
          pred=tf.equal(self._current_size, self._capacity),
          true_fn=_double_capacity,
          false_fn=lambda: (self._buffer, self._capacity),
      )
  
      with tf.control_dependencies([update_buffer, update_capacity]):
          with tf.control_dependencies(
              [
                  tf.assert_less(
                      self._current_size,
                      self._capacity,
                      message="Appending past end of TensorBuffer.",
                  ),
                  tf.assert_equal(
                      tf.shape(input=value),
                      tf.shape(input=self._buffer)[1:],
                      message="Appending value of inconsistent shape.",
                  ),
              ]
          ):
              with tf.control_dependencies(
                  [
                      tf.compat.v1.assign(
                          self._buffer[self._current_size, :], value
                      )
                  ]
              ):
                  return tf.compat.v1.assign_add(self._current_size, 1)
  
imports: import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the TensorBuffer obj's underlying member method code with example usage: obj.append(value) and returns: tf,  tf, self,  tf, tf