class_docstr: Tests :class:`texar.tf.agents.SeqPGAgent`
      
docstr: Tests logits.
          
docstr_tok: ["Tests","logits","."]
code: def test_seq_pg_agent(self):
      """Tests logits."""
      decoder = BasicRNNDecoder(vocab_size=self._vocab_size)
      outputs, _, sequence_length = decoder(
          decoding_strategy="infer_greedy",
          max_decoding_length=10,
          embedding=self._embedding,
          start_tokens=[1] * self._batch_size,
          end_token=2,
      )
  
      agent = SeqPGAgent(
          outputs.sample_id,
          outputs.logits,
          sequence_length,
          decoder.trainable_variables,
      )
  
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
  
          agent.sess = sess
  
          feed_dict = {
              context.global_mode(): tf.estimator.ModeKeys.TRAIN
          }
          for _ in range(2):
              vals = agent.get_samples(feed_dict=feed_dict)
              self.assertEqual(
                  vals["samples"].shape[0], self._batch_size
              )
  
              loss_1 = agent.observe([1.0] * self._batch_size)
              loss_2 = agent.observe(
                  [1.0] * self._batch_size, train_policy=False
              )
              self.assertEqual(loss_1.shape, ())
              self.assertEqual(loss_2.shape, ())
  
imports: import tensorflow
  from texar.tf.modules.decoders.rnn_decoders import BasicRNNDecoder
  from texar.tf.agents import SeqPGAgent
  from texar.tf import context
label_desc: Use image node_id 2 for calling the SeqPGAgentTest obj's underlying member method code with example usage: obj.test_seq_pg_agent() without return types