class_docstr: A recurrent actor.
  
  An actor based on a recurrent policy which takes non-batched observations and
  outputs non-batched actions, and keeps track of the recurrent state inside. It
  also allows adding experiences to replay and updating the weights from the
  policy on the learner.
class_docstr_tok: ["A","recurrent","actor",".","An","actor","based","on","a","recurrent","policy","which","takes","non-batched","observations","and","outputs","non-batched","actions",",","and","keeps","track","of","the","recurrent","state","inside",".","It","also","allows","adding","experiences","to","replay","and","updating","the","weights","from","the","policy","on","the","learner","."]
code: def select_action(
      self, observation: types.NestedArray
  ) -> types.NestedArray:
      # Initialize the RNN state if necessary.
      if self._state is None:
          self._state = self._network.initial_state(1)
  
      # Step the recurrent policy forward given the current observation and state.
      policy_output, new_state = self._policy(observation, self._state)
  
      # Bookkeeping of recurrent states for the observe method.
      self._prev_state = self._state
      self._state = new_state
  
      # Return a numpy array with squeezed out batch dimension.
      return tf2_utils.to_numpy_squeeze(policy_output)
  
imports: from typing import Optional, Tuple
  from acme import adders
  from acme import core
  from acme import types
  from acme.tf import utils
  from acme.tf import variable_utils
  import dm_env
  import sonnet
  import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 3 for calling the RecurrentActor obj's underlying member method code with example usage: obj.select_action(observation) and returns: tf2_utils