class_docstr: Tests :class:`~texar.tf.modules.TransformerDecoder`
      
class_docstr_tok: ["Tests",":","class",":","`","~texar.tf.modules.TransformerDecoder","`"]
code: def setUp(self):
      tf.test.TestCase.setUp(self)
      self._vocab_size = 15
      self._batch_size = 2
      self._max_time = 10
      self._emb_dim = 512
      self._max_decode_len = 16
      self._inputs = tf.random_uniform(
          [self._batch_size, self._max_time, self._emb_dim],
          maxval=1,
          dtype=tf.float32,
      )
  
      self._memory = tf.random_uniform(
          [self._batch_size, self._max_time, self._emb_dim],
          maxval=1,
          dtype=tf.float32,
      )
      self._memory_sequence_length = tf.random_uniform(
          [self._batch_size], maxval=self._max_time, dtype=tf.int32
      )
  
      self._embedding = tf.random_uniform(
          [self._vocab_size, self._emb_dim], maxval=1, dtype=tf.float32
      )
      self._pos_embedding = tf.random_uniform(
          [self._max_decode_len, self._emb_dim],
          maxval=1,
          dtype=tf.float32,
      )
  
      def _embedding_fn(x, y):
          x_emb = tf.nn.embedding_lookup(self._embedding, x)
          y_emb = tf.nn.embedding_lookup(self._pos_embedding, y)
          return x_emb * self._emb_dim**0.5 + y_emb
  
      self._embedding_fn = _embedding_fn
  
      self._output_layer = tf.random_uniform(
          [self._emb_dim, self._vocab_size], maxval=1, dtype=tf.float32
      )
  
      self._start_tokens = tf.fill([self._batch_size], 1)
      self._end_token = 2
      self.max_decoding_length = self._max_time
  
      _context = [[3, 4, 5, 2, 0], [4, 3, 5, 7, 2]]
      _context_length = [4, 5]
      self._context = tf.Variable(_context)
      self._context_length = tf.Variable(_context_length)
  
file_path: texar/tests/modules/decoders/transformer_decoders_test.py
imports: import tensorflow
  from texar.tf.modules.decoders.transformer_decoders import TransformerDecoder
  from texar.tf.modules.decoders.transformer_decoders import TransformerDecoderOutput
  from texar.tf.modules.decoders import tf_helpers
label_desc: Use image node_id 1 for calling the TransformerDecoderTest obj's underlying member method code with example usage: obj.setUp() and returns: unknown