docstr: Convert curr_state into input tensors tensorflow is expecting. i.e. if we have several inputs states, stack all
  observations together, measurements together, etc.
  
  :param states: A list of environment states, where each one is a dict mapping from an observation name to its
                 corresponding observation
  :param network_name: The agent network name to prepare the batch for. this is needed in order to extract only
                       the observation relevant for the network from the states.
  :return: A dictionary containing a list of values from all the given states for each of the observations
docstr_tok: ["Convert","curr_state","into","input","tensors","tensorflow","is","expecting",".","i.e",".","if","we","have","several","inputs","states",",","stack","all","observations","together",",","measurements","together",",","etc",".",":","param","states",":","A","list","of","environment","states",",","where","each","one","is","a","dict","mapping","from","an","observation","name","to","its","corresponding","observation",":","param","network_name",":","The","agent","network","name","to","prepare","the","batch","for",".","this","is","needed","in","order","to","extract","only","the","observation","relevant","for","the","network","from","the","states",".",":","return",":","A","dictionary","containing","a","list","of","values","from","all","the","given","states","for","each","of","the","observations"]
code: def prepare_batch_for_inference(
      self,
      states: Union[Dict[str, np.ndarray], List[Dict[str, np.ndarray]]],
      network_name: str,
  ) -> Dict[str, np.array]:
      """
      Convert curr_state into input tensors tensorflow is expecting. i.e. if we have several inputs states, stack all
      observations together, measurements together, etc.
  
      :param states: A list of environment states, where each one is a dict mapping from an observation name to its
                     corresponding observation
      :param network_name: The agent network name to prepare the batch for. this is needed in order to extract only
                           the observation relevant for the network from the states.
      :return: A dictionary containing a list of values from all the given states for each of the observations
      """
      # convert to batch so we can run it through the network
      states = force_list(states)
      batches_dict = {}
      for key in self.ap.network_wrappers[
          network_name
      ].input_embedders_parameters.keys():
          # there are cases (e.g. ddpg) where the state does not contain all the information needed for running
          # through the network and this has to be added externally (e.g. ddpg where the action needs to be given in
          # addition to the current_state, so that all the inputs of the network will be filled)
          if key in states[0].keys():
              batches_dict[key] = np.array(
                  [np.array(state[key]) for state in states]
              )
  
      return batches_dict
  
imports: import copy
  import random
  from collections import OrderedDict
  from typing import Dict, List, Union, Tuple
  import numpy
  from six.moves import range
  from rl_coach.agents.agent_interface import AgentInterface
  from rl_coach.architectures.network_wrapper import NetworkWrapper
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, DistributedTaskParameters, Frameworks
  from rl_coach.core_types import RunPhase, PredictionType, EnvironmentEpisodes, ActionType, Batch, Episode, StateType
  from rl_coach.core_types import Transition, ActionInfo, TrainingSteps, EnvironmentSteps, EnvResponse
  from rl_coach.logger import screen, Logger, EpisodeLogger
  from rl_coach.memories.episodic.episodic_experience_replay import EpisodicExperienceReplay
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition, VectorObservationSpace, GoalsSpace, AttentionActionSpace
  from rl_coach.utils import Signal, force_list
  from rl_coach.utils import dynamic_import_and_instantiate_module_from_params
  from rl_coach.memories.backend.memory_impl import get_memory_backend
  from rl_coach.core_types import TimeTypes
  from rl_coach.off_policy_evaluators.ope_manager import OpeManager
  from rl_coach.core_types import PickledReplayBuffer, CsvDataset
label_desc: Use image node_id 27 for calling the Agent obj's underlying member method code with example usage: obj.prepare_batch_for_inference(states, network_name) and returns: batches_dict