code: def add_state(self, state_name, initial_state, batch_size=None):
      
      state_shape = initial_state.get_shape().as_list()
      full_shape = [batch_size] + state_shape
      if not batch_size:
        # TODO(): -1 is now reserved for unknown, so this should be
        # updated, but that requires coordination with the binary and is
        # checkpoint incompatible.
        # TODO(eiderman): When we make the above breaking change, we should make
        # the C++ client use the initial state instead of passing in zeros.
        shape_proto = self._as_shape_proto([0] + state_shape)
        batch_size = 1
      else:
        shape_proto = self._as_shape_proto([batch_size] + state_shape)
  
      # Add a constant tensor of zeros. At training time, this will initialize
      # the state with the initial_state - at inference time,
      # this node is replaced by a feed.
      tiles = [batch_size] + ([1] * len(initial_state.get_shape()))
      feed_op = tf.placeholder_with_default(
          tf.tile(
              tf.expand_dims(initial_state, [0]), tiles),
          shape=full_shape,
          name='%s_feed' % state_name)
      s = {'feed_op': feed_op,
           'feed_type': initial_state.dtype,
           'feed_shape': shape_proto}
      self._states[state_name] = s
docs: Adds a state to the state saver.
  
      Args:
        state_name: The name of this state.
        initial_state: The initial state vector. Only zeros are supported.
        batch_size: The batch_size or None for unknown.