class_docstr: Tests for discrete_policy_gradient op.
class_docstr_tok: ["Tests","for","discrete_policy_gradient","op","."]
code: def testDynamicBatchSize(self):
      policy_logits = tf.placeholder(tf.float32, shape=[None, 3])
      action_values = tf.placeholder(tf.float32, shape=[None])
      actions = tf.placeholder(tf.int32, shape=[None])
      loss = pg_ops.discrete_policy_gradient(
          policy_logits, actions, action_values
      )
      self.assertEqual(loss.get_shape().as_list(), [None])
      gradients = tf.gradients(tf.reduce_sum(loss), [policy_logits])
      self.assertAllEqual(gradients[0].get_shape().as_list(), [None, 3])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from six.moves import xrange
  import tensorflow.compat.v1
  import tree
  from trfl import discrete_policy_gradient_ops
label_desc: Use image node_id 3 for calling the DiscretePolicyGradientTest obj's underlying member method code with example usage: obj.testDynamicBatchSize() without return types