class_docstr: Tests for policy_entropy op.
class_docstr_tok: ["Tests","for","policy_entropy","op","."]
code: def testGradient(self, multi_actions, normalise):
      sequence_length = 4
      batch_size = 2
      self._setUp_entropy(
          multi_actions, normalise, sequence_length, batch_size
      )
      loss = self._policy_entropy_loss.loss
      # MVN mu has None gradient
      self.assertIsNone(
          tf.gradients(loss, nest.flatten(self._policy_vars)[0])[0]
      )
      for policy_var in nest.flatten(self._policy_vars)[1:]:
          gradient = tf.gradients(loss, policy_var)[0]
          self.assertEqual(gradient.get_shape(), policy_var.get_shape())
  
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 tensorflow_probability
  import tree
  from trfl import policy_gradient_ops
label_desc: Use image node_id 4 for calling the EntropyCostTest obj's underlying member method code with example usage: obj.testGradient(multi_actions, normalise) without return types