class_docstr: The entry for a NAS experiment.
  Users can use this class to start/stop or inspect an experiment, like exporting the results.
  
  Experiment is a sub-class of :class:`nni.experiment.Experiment`, there are many similarities such as
  configurable training service to distributed running the experiment on remote server.
  But unlike :class:`nni.experiment.Experiment`, :class:`NasExperiment` doesn't support configure:
  
  - ``trial_code_directory``, which can only be current working directory.
  - ``search_space``, which is auto-generated in NAS.
  - ``trial_command``, which is auto-set to launch the modulized trial code.
  
  :class:`NasExperiment` also doesn't have tuner/assessor/advisor, because such functionality is already implemented in strategy.
  
  Also, unlike :class:`nni.experiment.Experiment` which is bounded to a node server,
  :class:`NasExperiment` optionally starts a node server to schedule the trials, depending on the configuration of execution engine.
  When the strategy is one-shot, the step of launching node server is omitted, and the experiment is run locally by default.
  
  Configurations of experiments, such as execution engine, number of GPUs allocated,
  should be put into a :class:`NasExperimentConfig` and passed to the initialization of an experiment.
  The config can be also altered after the experiment is initialized.
  
  Parameters
  ----------
  model_space
      The model space to search.
  evaluator
      Evaluator for the experiment.
  strategy
      Exploration strategy. Can be multi-trial or one-shot.
  config
      Configurations of the experiment. See :class:`~nni.nas.experiment.NasExperimentConfig` for details.
      When not provided, a default config will be created based on current model space, evaluator and strategy.
      Detailed rules can be found in :meth:`nni.nas.experiment.NasExperimentConfig.default`.
  
  Warnings
  --------
  ``wait_completion`` doesn't work for NAS experiment because NAS experiment **always wait for completion**.
  
  Examples
  --------
  >>> base_model = MobileNetV3Space()
  >>> search_strategy = strategy.Random()
  >>> model_evaluator = Classification()
  >>> exp = NasExperiment(base_model, model_evaluator, search_strategy)
  >>> exp_config.max_trial_number = 20
  >>> exp_config.training_service.use_active_gpu = False
  >>> exp.run(exp_config, 8081)
  
  Export top models and re-initialize the top model:
  
  >>> for model_dict in exp.export_top_models(formatter='dict'):
  ...     print(model_dict)
  >>> with model_context(model_dict):
  ...     final_model = Net()
docstr: Summarize the state of current experiment for serialization purposes.
  
  Please deepcopy the states (or save them to disk) in case you want to restore them later.
  
  NOTE: This should only be called after the engine is created (i.e., after calling :meth:`start`).
code: def state_dict(self) -> dict:
      """Summarize the state of current experiment for serialization purposes.
  
      Please deepcopy the states (or save them to disk) in case you want to restore them later.
  
      NOTE: This should only be called after the engine is created (i.e., after calling :meth:`start`).
      """
      result = {
          "version": self._state_dict_version,
          "strategy": self.strategy.state_dict(),
      }
      if self._engine is not None:
          result["engine"] = self._engine.state_dict()
      return result
  
imports: from __future__ import annotations
  import atexit
  import logging
  import warnings
  from pathlib import Path
  from typing import Any, ClassVar, cast
  from typing_extensions import Literal
  import nni
  from nni.experiment import Experiment, RunMode
  from nni.nas.evaluator import Evaluator
  from nni.nas.execution import ExecutionEngine, TrainingServiceExecutionEngine, SequentialExecutionEngine
  from nni.nas.space import ExecutableModelSpace, BaseModelSpace, GraphModelSpace
  from nni.nas.strategy import Strategy
  from nni.nas.utils.serializer import get_default_serializer
  from nni.tools.nnictl.config_utils import Experiments
  from .config import NasExperimentConfig, ExecutionEngineConfig, TrainingServiceEngineConfig, CgoEngineConfig, SequentialEngineConfig, ModelFormatConfig, GraphModelFormatConfig, SimplifiedModelFormatConfig, RawModelFormatConfig
label_desc: Use image node_id 18 for calling the NasExperiment obj's underlying member method code with example usage: obj.state_dict() and returns: result