class_docstr: Sequence-to-sequence base class.
class_docstr_tok: ["Sequence-to-sequence","base","class","."]
docstr: Stack encoder states and return tensor [batch, length, layer, size].
docstr_tok: ["Stack","encoder","states","and","return","tensor","[","batch",",","length",",","layer",",","size","]","."]
code: def build_encoder_states(self, include_embeddings=False):
      """Stack encoder states and return tensor [batch, length, layer, size]."""
      assert self.mode == tf.contrib.learn.ModeKeys.INFER
      if include_embeddings:
          stack_state_list = tf.stack(
              [self.encoder_emb_inp] + self.encoder_state_list, 2
          )
      else:
          stack_state_list = tf.stack(self.encoder_state_list, 2)
  
      # transform from [length, batch, ...] -> [batch, length, ...]
      if self.time_major:
          stack_state_list = tf.transpose(
              stack_state_list, [1, 0, 2, 3]
          )
  
      return stack_state_list
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import collections
  import tensorflow
  from tensorflow.contrib.model_pruning import get_masks, get_thresholds
  from tensorflow.contrib.model_pruning.python import pruning
  from tensorflow.contrib.model_pruning.python.layers import core_layers
  from .None import model_helper
  from .utils import misc_utils, iterator_utils
label_desc: Use image node_id 23 for calling the BaseModel obj's underlying member method code with example usage: obj.build_encoder_states(include_embeddings) and returns: stack_state_list