class_docstr: Tests various connectors.
      
docstr: Tests the logic of
  :class:`~texar.tf.modules.connectors.ConstantConnector`.
docstr_tok: ["Tests","the","logic","of",":","class",":","`","~texar.tf.modules.connectors.ConstantConnector","`","."]
code: def test_constant_connector(self):
      """Tests the logic of
      :class:`~texar.tf.modules.connectors.ConstantConnector`.
      """
      connector = ConstantConnector(self._decoder_cell.state_size)
  
      decoder_initial_state_0 = connector(self._batch_size)
      decoder_initial_state_1 = connector(self._batch_size, value=1.0)
      nest.assert_same_structure(
          decoder_initial_state_0, self._decoder_cell.state_size
      )
      nest.assert_same_structure(
          decoder_initial_state_1, self._decoder_cell.state_size
      )
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          s_0, s_1 = sess.run(
              [decoder_initial_state_0, decoder_initial_state_1]
          )
          self.assertEqual(nest.flatten(s_0)[0][0, 0], 0.0)
          self.assertEqual(nest.flatten(s_1)[0][0, 0], 1.0)
  
file_path: texar/tests/modules/connectors/connectors_test.py
imports: import tensorflow
  from tensorflow_probability import distributions
  from tensorflow.python.util import nest
  from texar.tf.core import layers
  from texar.tf.modules import ConstantConnector
  from texar.tf.modules import MLPTransformConnector
  from texar.tf.modules import ReparameterizedStochasticConnector, StochasticConnector
  from texar.tf.modules.connectors.connectors import _assert_same_size
label_desc: Use image node_id 2 for calling the TestConnectors obj's underlying member method code with example usage: obj.test_constant_connector() without return types