class_docstr: Encapsulates multiple torch state action critics for training in structured environments.
  
  :param networks: Mapping of value functions (critic) to encapsulate.
  :param num_policies: The number of corresponding policies.
  :param device: Device the policy should be located on (cpu or cuda)
  :param only_discrete_spaces: A dict specifying if the action spaces w.r.t. the step only hold discrete action
                               spaces.
class_docstr_tok: ["Encapsulates","multiple","torch","state","action","critics","for","training","in","structured","environments",".",":","param","networks",":","Mapping","of","value","functions","(","critic",")","to","encapsulate",".",":","param","num_policies",":","The","number","of","corresponding","policies",".",":","param","device",":","Device","the","policy","should","be","located","on","(","cpu","or","cuda",")",":","param","only_discrete_spaces",":","A","dict","specifying","if","the","action","spaces","w.r.t",".","the","step","only","hold","discrete","action","spaces","."]
docstr: Predict the value with specified step_key, step_observation and action for discrete actions only.
  
  :param observation: The observation for the current step.
  :param critic_id: The current step key of the multi-step env.
  
  :return: A list of dicts holding the predicted q value for each action w.r.t. to the critic.
docstr_tok: ["Predict","the","value","with","specified","step_key",",","step_observation","and","action","for","discrete","actions","only",".",":","param","observation",":","The","observation","for","the","current","step",".",":","param","critic_id",":","The","current","step","key","of","the","multi-step","env",".",":","return",":","A","list","of","dicts","holding","the","predicted","q","value","for","each","action","w.r.t",".","to","the","critic","."]
code: def compute_state_action_values_step(
      self,
      observation: Dict[str, torch.Tensor],
      critic_id: Union[str, int, tuple],
  ) -> List[Dict[str, torch.Tensor]]:
      """Predict the value with specified step_key, step_observation and action for discrete actions only.
  
      :param observation: The observation for the current step.
      :param critic_id: The current step key of the multi-step env.
  
      :return: A list of dicts holding the predicted q value for each action w.r.t. to the critic.
      """
  
      sub_critic_keys = self.critic_key_mapping[critic_id]
      q_values = []
      for idx, sub_critic_key in enumerate(sub_critic_keys):
          net_out = self.networks[sub_critic_key](observation)
          for value in net_out.values():
              value.unsqueeze(-1)
          q_values.append(net_out)
  
      return q_values
  
imports: import copy
  import itertools
  from abc import abstractmethod
  from typing import Mapping, Union, List, Dict
  import torch
  from gym import spaces
  from torch import nn
  from torch.distributions.utils import logits_to_probs
  from maze.core.agent.state_action_critic import StateActionCritic
  from maze.core.agent.torch_model import TorchModel
  from maze.core.annotations import override
  from maze.core.wrappers.observation_preprocessing.preprocessors.one_hot import OneHotPreProcessor
  from maze.perception.blocks.inference import InferenceBlock
  from maze.perception.perception_utils import flatten_spaces, convert_to_numpy, convert_to_torch
  from maze.perception.weight_init import make_module_init_normc
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 3 for calling the TorchStateActionCritic obj's underlying member method code with example usage: obj.compute_state_action_values_step(observation, critic_id) and returns: q_values