code: def feed_forward_policy_prior_to_actor_core(
      policy: actor_core.RecurrentPolicy,
      initial_action_tm1: networks.Action,
  ) -> actor_core.ActorCore[PolicyPriorState, actor_core.NoneType]:
      """A convenience adaptor from a feed forward policy prior to ActorCore.
  
      Args:
        policy: A feed forward policy prior. In the planner and other components,
          the previous action is explicitly passed as an argument to the policy
          prior together with the observation to infer the next action. Therefore,
          we model feed forward policy priors as recurrent ActorCore policies with
          previous action being the recurrent state.
        initial_action_tm1: Initial previous action. This will usually be a zero
          tensor.
  
      Returns:
        an ActorCore representing the feed forward policy prior.
      """
  
      def select_action(
          params: networks.Params,
          observation: networks.Observation,
          state: FeedForwardPolicyState,
      ):
          rng, policy_rng = jax.random.split(state.rng)
          action = policy(
              params, policy_rng, observation, state.action_tm1
          )
          return action, PolicyPriorState(rng, action)
  
      def init(rng: networks.PRNGKey) -> FeedForwardPolicyState:
          return PolicyPriorState(rng, initial_action_tm1)
  
      def get_extras(
          unused_state: FeedForwardPolicyState,
      ) -> actor_core.NoneType:
          return None
  
      return actor_core.ActorCore(
          init=init, select_action=select_action, get_extras=get_extras
      )
  
file_path: acme/acme/agents/jax/mbop/models.py
imports: import functools
  from typing import Callable, Generic, Optional, Tuple
  from acme import specs
  from acme.agents.jax import actor_core
  from acme.agents.jax.mbop import ensemble
  from acme.agents.jax.mbop import networks
  from acme.jax import networks
  from acme.jax import utils
  import chex
  import jax
label_desc: Use image node_id 1 for calling a global function with example usage: feed_forward_policy_prior_to_actor_core(policy, initial_action_tm1) and returns: actor_core, action,  PolicyPriorState, PolicyPriorState, None