class_docstr: Tests for discrete_policy_entropy op.
class_docstr_tok: ["Tests","for","discrete_policy_entropy","op","."]
code: def testNormalisation(self, num_actions):
      with self.test_session() as sess:
          if isinstance(num_actions, list):
              policy_logits = [
                  tf.constant([[1.0] * n], dtype=tf.float32)
                  for n in num_actions
              ]
          else:
              policy_logits = tf.constant(
                  [[1.0] * num_actions], dtype=tf.float32
              )
          entropy_op = pg_ops.discrete_policy_entropy_loss(
              policy_logits, normalise=True
          )
          self.assertAllClose(sess.run(entropy_op.loss), [-1.0])
  
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 EntropyCostTest obj's underlying member method code with example usage: obj.testNormalisation(num_actions) without return types