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: Build encoder layers all at once.
docstr_tok: ["Build","encoder","layers","all","at","once","."]
code: def _build_all_encoder_layers(
      self, bi_encoder_outputs, num_uni_layers, dtype, hparams
  ):
      """Build encoder layers all at once."""
      uni_cell = model_helper.create_rnn_cell(
          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_outputs, encoder_state = tf.nn.dynamic_rnn(
          uni_cell,
          bi_encoder_outputs,
          dtype=dtype,
          sequence_length=self.iterator.source_sequence_length,
          time_major=self.time_major,
      )
  
      # Use the top layer for now
      self.encoder_state_list = [encoder_outputs]
  
      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 3 for calling the GNMTModel obj's underlying member method code with example usage: obj._build_all_encoder_layers(bi_encoder_outputs, num_uni_layers, dtype, hparams) and returns: encoder_state,  encoder_outputs