class_docstr: Class to build Actor Policies.
code: def _distribution(self, time_step, policy_state):
      observation_and_action_constraint_splitter = (
          self.observation_and_action_constraint_splitter
      )
      network_observation = time_step.observation
      mask = None
  
      if observation_and_action_constraint_splitter is not None:
          (
              network_observation,
              mask,
          ) = observation_and_action_constraint_splitter(
              network_observation
          )
  
      # Actor network outputs nested structure of distributions or actions.
      (
          actions_or_distributions,
          policy_state,
      ) = self._apply_actor_network(
          network_observation,
          step_type=time_step.step_type,
          policy_state=policy_state,
          mask=mask,
      )
  
      def _to_distribution(action_or_distribution):
          if isinstance(action_or_distribution, tf.Tensor):
              # This is an action tensor, so wrap it in a deterministic distribution.
              return tfp.distributions.Deterministic(
                  loc=action_or_distribution
              )
          return action_or_distribution
  
      distributions = tf.nest.map_structure(
          _to_distribution, actions_or_distributions
      )
      return policy_step.PolicyStep(distributions, policy_state)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Text
  import gin
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.networks import network
  from tf_agents.policies import tf_policy
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import tensor_normalizer
label_desc: Use image node_id 5 for calling the ActorPolicy obj's underlying member method code with example usage: obj._distribution(time_step, policy_state) and returns: policy_step, action_or_distribution, tfp