class_docstr: Tests :class:`~texar.tf.modules.Conv1DEncoder` class.
      
docstr: Tests use of pooling layer when the seq_length dimension of inputs
  is `None`.
docstr_tok: ["Tests","use","of","pooling","layer","when","the","seq_length","dimension","of","inputs","is","`","None","`","."]
code: def test_unknown_seq_length(self):
      """Tests use of pooling layer when the seq_length dimension of inputs
      is `None`.
      """
      encoder_1 = Conv1DEncoder()
      inputs_1 = tf.placeholder(tf.float32, [64, None, 300])
      outputs_1 = encoder_1(inputs_1)
      self.assertEqual(outputs_1.shape, [64, 128])
  
      hparams = {
          # Conv layers
          "num_conv_layers": 2,
          "filters": 128,
          "kernel_size": [[3, 4, 5], 4],
          # Pooling layers
          "pooling": "AveragePooling",
          "pool_size": [2, None],
          # Dense layers
          "num_dense_layers": 1,
          "dense_size": 10,
      }
      encoder = Conv1DEncoder(hparams)
      # nlayers = nconv-pool + nconv + npool + ndense + ndropout + flatten
      self.assertEqual(len(encoder.layers), 1 + 1 + 1 + 1 + 1 + 1)
      self.assertTrue(
          isinstance(
              encoder.layer_by_name("pool_2"),
              tx.core.AverageReducePooling1D,
          )
      )
  
      inputs = tf.placeholder(tf.float32, [64, None, 300])
      outputs = encoder(inputs)
      self.assertEqual(outputs.shape, [64, 10])
  
      hparams_2 = {
          # Conv layers
          "num_conv_layers": 1,
          "filters": 128,
          "kernel_size": 4,
          "other_conv_kwargs": {"data_format": "channels_first"},
          # Pooling layers
          "pooling": "MaxPooling",
          "other_pool_kwargs": {"data_format": "channels_first"},
          # Dense layers
          "num_dense_layers": 1,
          "dense_size": 10,
      }
      encoder_2 = Conv1DEncoder(hparams_2)
      inputs_2 = tf.placeholder(tf.float32, [64, 300, None])
      outputs_2 = encoder_2(inputs_2)
      self.assertEqual(outputs_2.shape, [64, 10])
  
imports: import tensorflow
  import texar.tf
  from texar.tf.modules.encoders.conv_encoders import Conv1DEncoder
label_desc: Use image node_id 2 for calling the Conv1DEncoderTest obj's underlying member method code with example usage: obj.test_unknown_seq_length() without return types