class_docstr: Sequence-to-sequence dynamic model with GNMT attention architecture
  with sparsity policy support.
class_docstr_tok: ["Sequence-to-sequence","dynamic","model","with","GNMT","attention","architecture","with","sparsity","policy","support","."]
docstr: Run each of the encoder layer separately, not used in general seq2seq.
docstr_tok: ["Run","each","of","the","encoder","layer","separately",",","not","used","in","general","seq2seq","."]
code: def _build_individual_encoder_layers(
      self, bi_encoder_outputs, num_uni_layers, dtype, hparams
  ):
      """Run each of the encoder layer separately, not used in general seq2seq."""
      uni_cell_lists = model_helper._cell_list(
          unit_type=hparams.unit_type,
          num_units=hparams.num_units,
          num_layers=num_uni_layers,
          num_residual_layers=self.num_encoder_residual_layers,
          forget_bias=hparams.forget_bias,
          dropout=hparams.dropout,
          num_gpus=self.num_gpus,
          base_gpu=1,
          mode=self.mode,
          single_cell_fn=self.single_cell_fn,
      )
  
      encoder_inp = bi_encoder_outputs
      encoder_states = []
      self.encoder_state_list = [
          bi_encoder_outputs[:, :, : hparams.num_units],
          bi_encoder_outputs[:, :, hparams.num_units :],
      ]
      with tf.variable_scope("rnn/multi_rnn_cell"):
          for i, cell in enumerate(uni_cell_lists):
              with tf.variable_scope("cell_%d" % i) as scope:
                  encoder_inp, encoder_state = tf.nn.dynamic_rnn(
                      cell,
                      encoder_inp,
                      dtype=dtype,
                      sequence_length=self.iterator.source_sequence_length,
                      time_major=self.time_major,
                      scope=scope,
                  )
                  encoder_states.append(encoder_state)
                  self.encoder_state_list.append(encoder_inp)
  
      encoder_state = tuple(encoder_states)
      encoder_outputs = self.encoder_state_list[-1]
      return encoder_state, encoder_outputs
  
file_path: nlp-architect/examples/sparse_gnmt/gnmt_model.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from .gnmt import attention_model
  from .gnmt import model_helper
  from .gnmt.utils import misc_utils
label_desc: Use image node_id 4 for calling the GNMTModel obj's underlying member method code with example usage: obj._build_individual_encoder_layers(bi_encoder_outputs, num_uni_layers, dtype, hparams) and returns: encoder_state,  encoder_outputs