class_docstr: A SAC Agent.
class_docstr_tok: ["A","SAC","Agent","."]
docstr: Get actions and corresponding log probabilities from policy.
docstr_tok: ["Get","actions","and","corresponding","log","probabilities","from","policy","."]
code: def _actions_and_log_probs(self, time_steps, training=False):
      """Get actions and corresponding log probabilities from policy."""
      # Get raw action distribution from policy, and initialize bijectors list.
      batch_size = nest_utils.get_outer_shape(
          time_steps, self._time_step_spec
      )[0]
      policy_state = self._train_policy.get_initial_state(batch_size)
      if training:
          action_distribution = self._train_policy.distribution(
              time_steps, policy_state=policy_state
          ).action
      else:
          action_distribution = self._policy.distribution(
              time_steps, policy_state=policy_state
          ).action
  
      # Sample actions and log_pis from transformed distribution.
      actions = tf.nest.map_structure(
          lambda d: d.sample(), action_distribution
      )
      log_pi = common.log_probability(
          action_distribution, actions, self.action_spec
      )
  
      return actions, log_pi
  
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 10 for calling the SacAgent obj's underlying member method code with example usage: obj._actions_and_log_probs(time_steps, training) and returns: actions,  log_pi