class_docstr: Tests the StackBidirectionalRNNEncoder class.
class_docstr_tok: ["Tests","the","StackBidirectionalRNNEncoder","class","."]
docstr: Tests the StackBidirectionalRNNEncoder with a specific cell
docstr_tok: ["Tests","the","StackBidirectionalRNNEncoder","with","a","specific","cell"]
code: def _test_encode_with_params(self, params):
      """Tests the StackBidirectionalRNNEncoder with a specific cell"""
      inputs = tf.random_normal(
          [self.batch_size, self.sequence_length, self.input_depth]
      )
      example_length = (
          tf.ones(self.batch_size, dtype=tf.int32)
          * self.sequence_length
      )
  
      encode_fn = rnn_encoder.StackBidirectionalRNNEncoder(
          params, self.mode
      )
      encoder_output = encode_fn(inputs, example_length)
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          encoder_output_ = sess.run(encoder_output)
  
      output_size = encode_fn.params["rnn_cell"]["cell_params"][
          "num_units"
      ]
  
      np.testing.assert_array_equal(
          encoder_output_.outputs.shape,
          [self.batch_size, self.sequence_length, output_size * 2],
      )
  
      return encoder_output_
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import tensorflow
  import numpy
  from seq2seq.encoders import rnn_encoder
label_desc: Use image node_id 2 for calling the StackBidirectionalRNNEncoderTest obj's underlying member method code with example usage: obj._test_encode_with_params(params) and returns: encoder_output_