class_docstr: An actor that also returns `log_prob`.
class_docstr_tok: ["An","actor","that","also","returns","`","log_prob","`","."]
code: def select_action(
      self, observation: types.NestedArray
  ) -> types.NestedArray:
      # Add a dummy batch dimension and as a side effect convert numpy to TF.
      batched_observation = tf2_utils.add_batch_dim(observation)
  
      # Compute the policy, conditioned on the observation.
      policy = self._policy_network(batched_observation)
      if self._deterministic_policy:
          action = policy.mean()
      else:
          action = policy.sample()
      self._log_prob = policy.log_prob(action)
      return tf2_utils.to_numpy_squeeze(action)
  
file_path: acme/acme/agents/tf/svg0_prior/acting.py
imports: from typing import Optional
  from acme import adders
  from acme import types
  from acme.agents.tf import actors
  from acme.tf import utils
  from acme.tf import variable_utils
  import dm_env
  import sonnet
label_desc: Use image node_id 2 for calling the SVG0Actor obj's underlying member method code with example usage: obj.select_action(observation) and returns: tf2_utils