code: def batched_feed_forward_to_actor_core(
      policy: FeedForwardPolicy,
  ) -> ActorCore[PRNGKey, Tuple[()]]:
      """A convenience adaptor from FeedForwardPolicy to ActorCore."""
  
      def select_action(
          params: networks_lib.Params,
          observation: networks_lib.Observation,
          state: PRNGKey,
      ):
          rng = state
          rng1, rng2 = jax.random.split(rng)
          observation = utils.add_batch_dim(observation)
          action = utils.squeeze_batch_dim(
              policy(params, rng1, observation)
          )
          return action, rng2
  
      def init(rng: PRNGKey) -> PRNGKey:
          return rng
  
      def get_extras(unused_rng: PRNGKey) -> Tuple[()]:
          return ()
  
      return ActorCore(
          init=init, select_action=select_action, get_extras=get_extras
      )
  
file_path: acme/acme/agents/jax/actor_core.py
imports: import dataclasses
  from typing import Callable, Generic, Mapping, Tuple, TypeVar, Union
  from acme import types
  from acme.jax import networks
  from acme.jax import utils
  from acme.jax.types import PRNGKey
  import chex
  import jax
  import jax.numpy
label_desc: Use image node_id 1 for calling a global function with example usage: batched_feed_forward_to_actor_core(policy) and returns: ActorCore, action,  rng2, rng, 