class_docstr: Tests the ConvEncoder class.
docstr: Tests the encoder with a given parameter configuration
code: def _test_with_params(self, params):
      """Tests the encoder with a given parameter configuration"""
      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 = ConvEncoder(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)
  
      att_value_units = encode_fn.params["attention_cnn.units"]
      output_units = encode_fn.params["output_cnn.units"]
  
      np.testing.assert_array_equal(
          encoder_output_.outputs.shape,
          [self.batch_size, self.sequence_length, att_value_units],
      )
      np.testing.assert_array_equal(
          encoder_output_.attention_values.shape,
          [self.batch_size, self.sequence_length, output_units],
      )
      np.testing.assert_array_equal(
          encoder_output_.final_state.shape,
          [self.batch_size, output_units],
      )
  
file_path: seq2seq/seq2seq/test/conv_encoder_test.py
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 ConvEncoder
label_desc: Use image node_id 2 for calling the ConvEncoderTest obj's underlying member method code with example usage: obj._test_with_params(params) without return types