class_docstr: A SAC Agent.
class_docstr_tok: ["A","SAC","Agent","."]
docstr: Computes the alpha_loss for EC-SAC training.
  
  Args:
    time_steps: A batch of timesteps.
    weights: Optional scalar or elementwise (per-batch-entry) importance
      weights.
    training: Whether this loss is being used during training.
  
  Returns:
    alpha_loss: A scalar alpha loss.
docstr_tok: ["Computes","the","alpha_loss","for","EC-SAC","training",".","Args",":","time_steps",":","A","batch","of","timesteps",".","weights",":","Optional","scalar","or","elementwise","(","per-batch-entry",")","importance","weights",".","training",":","Whether","this","loss","is","being","used","during","training",".","Returns",":","alpha_loss",":","A","scalar","alpha","loss","."]
code: def alpha_loss(
      self,
      time_steps: ts.TimeStep,
      weights: Optional[types.Tensor] = None,
      training: bool = False,
  ) -> types.Tensor:
      """Computes the alpha_loss for EC-SAC training.
  
      Args:
        time_steps: A batch of timesteps.
        weights: Optional scalar or elementwise (per-batch-entry) importance
          weights.
        training: Whether this loss is being used during training.
  
      Returns:
        alpha_loss: A scalar alpha loss.
      """
      with tf.name_scope("alpha_loss"):
          nest_utils.assert_same_structure(
              time_steps, self.time_step_spec
          )
  
          # We do not update actor during alpha loss.
          unused_actions, log_pi = self._actions_and_log_probs(
              time_steps, training=False
          )
          entropy_diff = tf.stop_gradient(
              -log_pi - self._target_entropy
          )
          if self._use_log_alpha_in_alpha_loss:
              alpha_loss = self._log_alpha * entropy_diff
          else:
              alpha_loss = tf.exp(self._log_alpha) * entropy_diff
  
          if alpha_loss.shape.rank > 1:
              # Sum over the time dimension.
              alpha_loss = tf.reduce_sum(
                  alpha_loss, axis=range(1, alpha_loss.shape.rank)
              )
  
          agg_loss = common.aggregate_losses(
              per_example_loss=alpha_loss, sample_weight=weights
          )
          alpha_loss = agg_loss.total_loss
  
          self._alpha_loss_debug_summaries(alpha_loss, entropy_diff)
  
          return alpha_loss
  
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 13 for calling the SacAgent obj's underlying member method code with example usage: obj.alpha_loss(time_steps, weights, training) and returns: alpha_loss