class_docstr: Composes networks for probabilistic policies.
  
  :param action_spaces_dict: Dict of sub-step id to action space.
  :param observation_spaces_dict: Dict of sub-step id to observation space.
  :param distribution_mapper: The distribution mapper.
  :param networks: Policy networks as defined in the config (either list or dictionary of object params and type).
class_docstr_tok: ["Composes","networks","for","probabilistic","policies",".",":","param","action_spaces_dict",":","Dict","of","sub-step","id","to","action","space",".",":","param","observation_spaces_dict",":","Dict","of","sub-step","id","to","observation","space",".",":","param","distribution_mapper",":","The","distribution","mapper",".",":","param","networks",":","Policy","networks","as","defined","in","the","config","(","either","list","or","dictionary","of","object","params","and","type",")","."]
docstr: implementation of :class:`~maze.perception.models.policies.base_policy_composer.BasePolicyComposer`
          
docstr_tok: ["implementation","of",":","class",":","`","~maze.perception.models.policies.base_policy_composer.BasePolicyComposer","`"]
code: def policy(self) -> TorchPolicy:
      """implementation of :class:`~maze.perception.models.policies.base_policy_composer.BasePolicyComposer`"""
      return TorchPolicy(
          networks=self._policies,
          distribution_mapper=self._distribution_mapper,
          device="cpu",
          substeps_with_separate_agent_nets=self._substeps_with_separate_agent_nets,
      )
  
file_path: maze/maze/perception/models/policies/probabilistic_policy_composer.py
imports: from typing import Dict, List
  from gym import spaces
  from torch import nn
  from maze.core.agent.torch_policy import TorchPolicy
  from maze.core.env.structured_env import StepKeyType
  from maze.core.utils.config_utils import list_to_dict
  from maze.core.utils.factory import CollectionOfConfigType, Factory
  from maze.distributions.distribution_mapper import DistributionMapper
  from maze.perception.models.policies.base_policy_composer import BasePolicyComposer
label_desc: Use image node_id 2 for calling the ProbabilisticPolicyComposer obj's underlying member method code with example usage: obj.policy() and returns: TorchPolicy