class_docstr: Encapsulates multiple torch policies along with a distribution mapper for training and rollouts
  in structured environments.
  
  :param networks: Mapping of policy networks to encapsulate
  :param distribution_mapper: Distribution mapper associated with the policy mapping.
  :param device: Device the policy should be located on (cpu or cuda)
class_docstr_tok: ["Encapsulates","multiple","torch","policies","along","with","a","distribution","mapper","for","training","and","rollouts","in","structured","environments",".",":","param","networks",":","Mapping","of","policy","networks","to","encapsulate",":","param","distribution_mapper",":","Distribution","mapper","associated","with","the","policy","mapping",".",":","param","device",":","Device","the","policy","should","be","located","on","(","cpu","or","cuda",")"]
docstr: Compute the full Policy output for all policy networks over a full (flat) environment step.
  
  :param record: The StructuredSpacesRecord holding the observation and actor ids.
  :param temperature: Optional, the temperature to use for initializing the probability distribution.
  :return: The full Policy output for the record given.
docstr_tok: ["Compute","the","full","Policy","output","for","all","policy","networks","over","a","full","(","flat",")","environment","step",".",":","param","record",":","The","StructuredSpacesRecord","holding","the","observation","and","actor","ids",".",":","param","temperature",":","Optional",",","the","temperature","to","use","for","initializing","the","probability","distribution",".",":","return",":","The","full","Policy","output","for","the","record","given","."]
code: def compute_policy_output(
      self, record: StructuredSpacesRecord, temperature: float = 1.0
  ) -> PolicyOutput:
      """Compute the full Policy output for all policy networks over a full (flat) environment step.
  
      :param record: The StructuredSpacesRecord holding the observation and actor ids.
      :param temperature: Optional, the temperature to use for initializing the probability distribution.
      :return: The full Policy output for the record given.
      """
  
      structured_policy_output = PolicyOutput()
      for substep_record in record.substep_records:
          structured_policy_output.append(
              self.compute_substep_policy_output(
                  substep_record.observation,
                  actor_id=substep_record.actor_id,
                  temperature=temperature,
              )
          )
      return structured_policy_output
  
imports: from typing import Mapping, Union, List, Dict, Tuple, Sequence, Optional
  import torch
  from torch import nn
  from maze.core.agent.policy import Policy
  from maze.core.agent.torch_model import TorchModel
  from maze.core.agent.torch_policy_output import PolicySubStepOutput, PolicyOutput
  from maze.core.annotations import override
  from maze.core.env.action_conversion import ActionType
  from maze.core.env.base_env import BaseEnv
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.observation_conversion import ObservationType
  from maze.core.env.structured_env import ActorID, StepKeyType
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.distributions.categorical import CategoricalProbabilityDistribution
  from maze.distributions.distribution_mapper import DistributionMapper
  from maze.perception.perception_utils import convert_to_torch, convert_to_numpy
label_desc: Use image node_id 14 for calling the TorchPolicy obj's underlying member method code with example usage: obj.compute_policy_output(record, temperature) and returns: structured_policy_output