class_docstr: One critic is shared across all sub-steps or actors (default to use for standard gym-style environments).
  
  Instantiates a
  :class:`~maze.core.agent.torch_state_action_critic.TorchSharedStateActionCritic`.
  
  :param observation_spaces_dict: Dict of sub-step id to observation space.
  :param action_spaces_dict: Dict of sub-step id to action space.
  :param networks: Critics networks as defined in the config (either list or dictionary of object params and type).
class_docstr_tok: ["One","critic","is","shared","across","all","sub-steps","or","actors","(","default","to","use","for","standard","gym-style","environments",")",".","Instantiates","a",":","class",":","`","~maze.core.agent.torch_state_action_critic.TorchSharedStateActionCritic","`",".",":","param","observation_spaces_dict",":","Dict","of","sub-step","id","to","observation","space",".",":","param","action_spaces_dict",":","Dict","of","sub-step","id","to","action","space",".",":","param","networks",":","Critics","networks","as","defined","in","the","config","(","either","list","or","dictionary","of","object","params","and","type",")","."]
docstr: implementation of
  :class:`~maze.perception.models.critics.base_state_action_critic_composer.BaseStateActionCriticComposer`
docstr_tok: ["implementation","of",":","class",":","`","~maze.perception.models.critics.base_state_action_critic_composer.BaseStateActionCriticComposer","`"]
code: def critic(self) -> TorchSharedStateActionCritic:
      """implementation of
      :class:`~maze.perception.models.critics.base_state_action_critic_composer.BaseStateActionCriticComposer`
      """
      return TorchSharedStateActionCritic(
          self._critics,
          num_policies=len(self._obs_shapes),
          device="cpu",
          only_discrete_spaces={
              0: all(self._only_discrete_spaces.values())
          },
          action_spaces_dict={
              0: flat_structured_space(self._action_spaces_dict)
          },
      )
  
file_path: maze/maze/perception/models/critics/shared_state_action_critics_composer.py
imports: from typing import Dict, Union
  from gym import spaces
  from torch import nn
  from maze.core.agent.torch_state_action_critic import TorchSharedStateActionCritic
  from maze.core.annotations import override
  from maze.core.utils.factory import Factory, CollectionOfConfigType
  from maze.core.utils.structured_env_utils import flat_structured_shapes, flat_structured_space
  from maze.perception.models.critics.base_state_action_critic_composer import BaseStateActionCriticComposer
label_desc: Use image node_id 2 for calling the SharedStateActionCriticComposer obj's underlying member method code with example usage: obj.critic() and returns: TorchSharedStateActionCritic