class_docstr: Structured policy used for rollouts of trained models.
  
  Will build the models based on the model composer and spaces config and set the state of individual
  policies according to the state dict dump.
  
  Policies are set to eval mode by default.
  
  :param model: Model composer configuration
  :param state_dict_file: Path to dumped state dictionaries of the trained policies
  :param spaces_dict_file: Path to dumped spaces configuration (action and observation spaces of
                                the env the policy was trained on, used for model initialization)
  :param deterministic: If True actions are computed deterministically; else sample from the probability distribution.
class_docstr_tok: ["Structured","policy","used","for","rollouts","of","trained","models",".","Will","build","the","models","based","on","the","model","composer","and","spaces","config","and","set","the","state","of","individual","policies","according","to","the","state","dict","dump",".","Policies","are","set","to","eval","mode","by","default",".",":","param","model",":","Model","composer","configuration",":","param","state_dict_file",":","Path","to","dumped","state","dictionaries","of","the","trained","policies",":","param","spaces_dict_file",":","Path","to","dumped","spaces","configuration","(","action","and","observation","spaces","of","the","env","the","policy","was","trained","on",",","used","for","model","initialization",")",":","param","deterministic",":","If","True","actions","are","computed","deterministically",";","else","sample","from","the","probability","distribution","."]
code: def compute_action(
      self,
      observation: ObservationType,
      maze_state: Optional[MazeStateType] = None,
      env: Optional[BaseEnv] = None,
      actor_id: ActorID = None,
      deterministic: bool = False,
  ) -> ActionType:
      return super().compute_action(
          observation=observation,
          maze_state=maze_state,
          env=env,
          actor_id=actor_id,
          deterministic=self.deterministic,
      )
  
file_path: maze/maze/core/agent/serialized_torch_policy.py
imports: from typing import Union, Dict, Optional
  import torch
  from omegaconf import DictConfig
  from maze.core.agent.torch_policy import TorchPolicy
  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
  from maze.core.utils.factory import Factory
  from maze.perception.models.model_composer import BaseModelComposer
  from maze.perception.models.space_config import SpacesConfig
label_desc: Use image node_id 2 for calling the SerializedTorchPolicy obj's underlying member method code with example usage: obj.compute_action(observation, maze_state, env, actor_id, deterministic) and returns: super