class_docstr: Base class for NAS strategies.
  
  To explore a space with a strategy, use::
  
      strategy = MyStrategy()
      strategy(model_space, engine)
  
  The strategy has a :meth:`run` method, that defines the process of exploring a NAS space.
  
  Strategy is stateful. It might store information of the current :meth:`initialize` and :meth:`run` as member attributes.
  We do not allow :meth:`run` a strategy twice with same, or different model spaces.
  
  Subclass should override :meth:`_initialize` and :meth:`_run`,
  as well as :meth:`state_dict` and :meth:`load_state_dict` for checkpointing.
class_docstr_tok: ["Base","class","for","NAS","strategies",".","To","explore","a","space","with","a","strategy",",","use",":",":","strategy","=","MyStrategy","(",")","strategy","(","model_space",",","engine",")","The","strategy","has","a",":","meth",":","`","run","`","method",",","that","defines","the","process","of","exploring","a","NAS","space",".","Strategy","is","stateful",".","It","might","store","information","of","the","current",":","meth",":","`","initialize","`","and",":","meth",":","`","run","`","as","member","attributes",".","We","do","not","allow",":","meth",":","`","run","`","a","strategy","twice","with","same",",","or","different","model","spaces",".","Subclass","should","override",":","meth",":","`","_initialize","`","and",":","meth",":","`","_run","`",",","as","well","as",":","meth",":","`","state_dict","`","and",":","meth",":","`","load_state_dict","`","for","checkpointing","."]
docstr: Load the state of the strategy. This is used for loading checkpoints.
  
  The *state* of strategy is some variables that are related to the current exploration process.
  The loading is often done after :meth:`initialize` and before :meth:`run`.
docstr_tok: ["Load","the","state","of","the","strategy",".","This","is","used","for","loading","checkpoints",".","The","*","state","*","of","strategy","is","some","variables","that","are","related","to","the","current","exploration","process",".","The","loading","is","often","done","after",":","meth",":","`","initialize","`","and","before",":","meth",":","`","run","`","."]
code: def load_state_dict(self, state_dict: dict) -> None:
      """Load the state of the strategy. This is used for loading checkpoints.
  
      The *state* of strategy is some variables that are related to the current exploration process.
      The loading is often done after :meth:`initialize` and before :meth:`run`.
      """
      raise NotImplementedError(
          f"{self.__class__.__name__} does not implement `load_state_dict()`."
      )
  
imports: from __future__ import annotations
  import logging
  import time
  from enum import Enum
  from typing import Iterator, cast
  from nni.nas.execution import ExecutionEngine
  from nni.nas.space import ExecutableModelSpace, ModelStatus
  from nni.typehint import TrialMetric
label_desc: Use image node_id 15 for calling the Strategy obj's underlying member method code with example usage: obj.load_state_dict(state_dict) without return types