class_docstr: A SAC Agent.
class_docstr_tok: ["A","SAC","Agent","."]
code: def _get_default_target_entropy(self, action_spec):
      # If target_entropy was not passed, set it to -dim(A)/2.0
      # Note that the original default entropy target is -dim(A) in the SAC paper.
      # However this formulation has also been used in practice by the original
      # authors and has in our experience been more stable for gym/mujoco.
      flat_action_spec = tf.nest.flatten(action_spec)
      target_entropy = (
          -np.sum(
              [
                  np.prod(single_spec.shape.as_list())
                  for single_spec in flat_action_spec
              ]
          )
          / 2.0
      )
      return target_entropy
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Callable, Optional, Text
  import gin
  import numpy
  from six.moves import zip
  import tensorflow
  import tensorflow_probability
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.networks import network
  from tf_agents.policies import actor_policy
  from tf_agents.policies import tf_policy
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import eager_utils
  from tf_agents.utils import nest_utils
  from tf_agents.utils import object_identity
label_desc: Use image node_id 4 for calling the SacAgent obj's underlying member method code with example usage: obj._get_default_target_entropy(action_spec) and returns: target_entropy