class_docstr: The old BaseStrategy (avalanche 0.1.0)
  just a bit of refactoring to remove useless components for testing.
class_docstr_tok: ["The","old","BaseStrategy","(","avalanche","0.1.0",")","just","a","bit","of","refactoring","to","remove","useless","components","for","testing","."]
code: def _load_train_state(self, _prev_model_training_modes, _prev_state):
      # restore train-state variables and training mode.
      self.experience, self.adapted_dataset = _prev_state[:2]
      self.dataloader = _prev_state[2]
      self.is_training = _prev_state[3]
      # restore each layer's training mode to original
      for name, layer in self.model.named_modules():
          try:
              prev_mode = _prev_model_training_modes[name]
              layer.train(mode=prev_mode)
          except KeyError:
              # Unknown parameter, probably added during the eval
              # model's adaptation. We set it to train mode.
              layer.train()
  
imports: import copy
  import logging
  import unittest
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from typing import Optional, Sequence, Union
  from torch.nn import Module, CrossEntropyLoss
  from torch.optim import SGD
  from avalanche.benchmarks.scenarios import ClassificationExperience
  from avalanche.benchmarks.utils.data_loader import TaskBalancedDataLoader
  from avalanche.models import DynamicModule, SimpleMLP, MTSimpleMLP
  from avalanche.models.dynamic_optimizers import reset_optimizer
  from avalanche.models.utils import avalanche_forward
  from avalanche.training import Cumulative
  from avalanche.training.plugins.clock import Clock
  from avalanche.training.plugins import EvaluationPlugin
  from avalanche.training.templates import SupervisedTemplate
  from avalanche.training.utils import trigger_plugins
  from tests.unit_tests_utils import get_fast_benchmark
label_desc: Use image node_id 9 for calling the OldBaseStrategy obj's underlying member method code with example usage: obj._load_train_state(_prev_model_training_modes, _prev_state) without return types