code: def _setup_pgops(
      multi_actions=False,
      normalise_entropy=False,
      sequence_length=4,
      batch_size=2,
      num_mvn_actions=3,
      num_discrete_actions=5,
  ):
      """Setup polices, actions, policy_vars and (optionally) entropy_scale_op."""
      t = sequence_length
      b = batch_size
      a = num_mvn_actions
      c = num_discrete_actions
  
      # MVN actions
      mu = tf.placeholder(tf.float32, shape=(t, b, a))
      sigma = tf.placeholder(tf.float32, shape=(t, b, a))
      mvn_policies = tfp.distributions.MultivariateNormalDiag(
          loc=mu, scale_diag=sigma
      )
      mvn_actions = tf.placeholder(tf.float32, shape=(t, b, a))
      mvn_params = [mu, sigma]
  
      if multi_actions:
          # Create a list of n_cat Categorical distributions
          n_cat = 2
          cat_logits = [
              tf.placeholder(tf.float32, shape=(t, b, c))
              for _ in xrange(n_cat)
          ]
          cat_policies = [
              tfp.distributions.Categorical(logits=logits)
              for logits in cat_logits
          ]
          cat_actions = [
              tf.placeholder(tf.int32, shape=(t, b))
              for _ in xrange(n_cat)
          ]
          cat_params = [[logits] for logits in cat_logits]
  
          # Create an exponential distribution
          exp_rate = tf.placeholder(tf.float32, shape=(t, b))
          exp_policies = tfp.distributions.Exponential(rate=exp_rate)
          exp_actions = tf.placeholder(tf.float32, shape=(t, b))
          exp_params = [exp_rate]
  
          # Nest all policies and nest corresponding actions and parameters
          policies = [mvn_policies, cat_policies, exp_policies]
          actions = [mvn_actions, cat_actions, exp_actions]
          policy_vars = [mvn_params, cat_params, exp_params]
      else:
          # No nested policy structure
          policies = mvn_policies
          actions = mvn_actions
          policy_vars = mvn_params
  
      entropy_scale_op = None
      if normalise_entropy:
          # Scale op that divides by total action dims
          def scale_op(policies):
              policies = nest.flatten(policies)
              num_dims = [
                  tf.to_float(
                      tf.reduce_prod(policy.event_shape_tensor())
                  )
                  for policy in policies
              ]
              return 1.0 / tf.reduce_sum(tf.stack(num_dims))
  
          entropy_scale_op = scale_op
  
      return policies, actions, policy_vars, entropy_scale_op
  
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 2 for calling a global function with example usage: _setup_pgops(multi_actions, normalise_entropy, sequence_length, batch_size, num_mvn_actions, num_discrete_actions) and returns: policies,  actions,  policy_vars,  entropy_scale_op, unknown