class_docstr: Tests :class:`~texar.tf.modules.Conv1DClassifier` class.
      
class_docstr_tok: ["Tests",":","class",":","`","~texar.tf.modules.Conv1DClassifier","`","class","."]
docstr: Tests classification.
          
docstr_tok: ["Tests","classification","."]
code: def test_classifier(self):
      """Tests classification."""
      # case 1: default hparams
      classifier = Conv1DClassifier()
      self.assertEqual(len(classifier.layers), 5)
      self.assertTrue(
          isinstance(classifier.layers[-1], tf.layers.Dense)
      )
      inputs = tf.ones([64, 16, 300], tf.float32)
      logits, pred = classifier(inputs)
      self.assertEqual(logits.shape, [64, 2])
      self.assertEqual(pred.shape, [64])
  
      inputs = tf.placeholder(tf.float32, [64, None, 300])
      logits, pred = classifier(inputs)
      self.assertEqual(logits.shape, [64, 2])
      self.assertEqual(pred.shape, [64])
  
      # case 1
      hparams = {
          "num_classes": 10,
          "logit_layer_kwargs": {"use_bias": False},
      }
      classifier = Conv1DClassifier(hparams=hparams)
      inputs = tf.ones([64, 16, 300], tf.float32)
      logits, pred = classifier(inputs)
      self.assertEqual(logits.shape, [64, 10])
      self.assertEqual(pred.shape, [64])
  
imports: import tensorflow
  import texar.tf
  from texar.tf.modules.classifiers.conv_classifiers import Conv1DClassifier
label_desc: Use image node_id 1 for calling the Conv1DClassifierTest obj's underlying member method code with example usage: obj.test_classifier() without return types