class_docstr: Base class for actor critic trainers. Suitable for multi-step and multi-agent training.
  
  :param algorithm_config: Algorithm parameters.
  :param rollout_generator: The rollout generator to use. This object encapsulates the env.
  :param evaluator: The evaluator to use.
  :param model: Structured torch actor critic model.
  :param model_selection: Optional model selection class, receives model evaluation results.
docstr: implementation of :class:`~maze.train.trainers.common.trainer.Trainer`
          
docstr_tok: ["implementation","of",":","class",":","`","~maze.train.trainers.common.trainer.Trainer","`"]
code: def load_state(self, file_path: Union[str, BinaryIO]) -> None:
      """implementation of :class:`~maze.train.trainers.common.trainer.Trainer`"""
      state_dict = torch.load(
          file_path,
          map_location=torch.device(self.algorithm_config.device),
      )
      self.load_state_dict(state_dict)
  
imports: import sys
  import time
  from abc import ABC, abstractmethod
  from typing import List, Union, Dict, Optional
  import numpy
  import torch
  import torch.nn
  from maze.core.agent.torch_actor_critic import TorchActorCritic
  from maze.core.annotations import override
  from maze.core.env.base_env_events import BaseEnvEvents
  from maze.core.env.structured_env import ActorID
  from maze.core.log_stats.log_stats import increment_log_step, LogStatsLevel
  from maze.core.rollout.rollout_generator import RolloutGenerator
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.train.parallelization.distributed_actors.distributed_actors import DistributedActors
  from maze.train.trainers.a2c.a2c_algorithm_config import A2CAlgorithmConfig
  from maze.train.trainers.common.actor_critic.actor_critic_events import ActorCriticEvents
  from maze.train.trainers.common.evaluators.rollout_evaluator import RolloutEvaluator
  from maze.train.trainers.common.model_selection.best_model_selection import BestModelSelection
  from maze.train.trainers.common.trainer import Trainer
  from maze.train.trainers.impala.impala_algorithm_config import ImpalaAlgorithmConfig
  from maze.train.trainers.ppo.ppo_algorithm_config import PPOAlgorithmConfig
  from maze.train.utils.train_utils import compute_gradient_norm
  from maze.utils.bcolors import BColors
  from tqdm import tqdm
  from typing.io import BinaryIO
label_desc: Use image node_id 6 for calling the ActorCritic obj's underlying member method code with example usage: obj.load_state(file_path) without return types