class_docstr: Model space with an extra execute method that defines how the models should be evaluated.
  It should be ``ModelSpaceWithExecution`` but that's too long.
  
  Both model space, as well as single models mutated from the space,
  will be instances of :class:`ExecutableModelSpace`.
  They only differ in the status flag (see :class:`ModelStatus`).
  
  Since the single models that are directly evaluated are also of this type,
  this class has an :meth:`execute` method which defines how the training pipeline works,
  i.e., how to assemble the evaluator and the model, and how to execute the training and evaluation.
  
  By convention, only frozen models (status is :attr:`ModelStatus.Frozen`) and instances of :class:`ExecutableModelSpace`
  can be sent to execution engine for training.
  
  In most cases, :class:`ExecutableModelSpace` only contains the necessary information
  that is required for NAS mutations and reconstruction of the original model.
  This makes the model space light-weighted, and easy to be serialized for sending to clusters.
  It also reforms the space to be more friendly to NAS algorithms (e.g., in the format of graphs).
class_docstr_tok: ["Model","space","with","an","extra","execute","method","that","defines","how","the","models","should","be","evaluated",".","It","should","be","``","ModelSpaceWithExecution","``","but","that","'s","too","long",".","Both","model","space",",","as","well","as","single","models","mutated","from","the","space",",","will","be","instances","of",":","class",":","`","ExecutableModelSpace","`",".","They","only","differ","in","the","status","flag","(","see",":","class",":","`","ModelStatus","`",")",".","Since","the","single","models","that","are","directly","evaluated","are","also","of","this","type",",","this","class","has","an",":","meth",":","`","execute","`","method","which","defines","how","the","training","pipeline","works",",","i.e.",",","how","to","assemble","the","evaluator","and","the","model",",","and","how","to","execute","the","training","and","evaluation",".","By","convention",",","only","frozen","models","(","status","is",":","attr",":","`","ModelStatus.Frozen","`",")","and","instances","of",":","class",":","`","ExecutableModelSpace","`","can","be","sent","to","execution","engine","for","training",".","In","most","cases",",",":","class",":","`","ExecutableModelSpace","`","only","contains","the","necessary","information","that","is","required","for","NAS","mutations","and","reconstruction","of","the","original","model",".","This","makes","the","model","space","light-weighted",",","and","easy","to","be","serialized","for","sending","to","clusters",".","It","also","reforms","the","space","to","be","more","friendly","to","NAS","algorithms","(","e.g.",",","in","the","format","of","graphs",")","."]
docstr: Execute the training (and/or evaluation).
docstr_tok: ["Execute","the","training","(","and\/or","evaluation",")","."]
code: def execute(self) -> Any:
      """Execute the training (and/or evaluation)."""
      if self.evaluator is None:
          raise ValueError(
              "Evaluator is not set, but default execute requires an evaluator."
          )
      return self.evaluator._execute(self)
  
imports: from __future__ import annotations
  import weakref
  from copy import deepcopy
  from enum import Enum
  from typing import NoReturn, Any, Callable, Iterable
  from nni.common.serializer import is_traceable, SerializableObject
  from nni.nas.evaluator import Evaluator
  from nni.mutable import Mutable, Sample, MutableDict, LabeledMutable, SampleValidationError, frozen_factory
  from nni.typehint import TrialMetric
  from .frozen import model_context
  from .metrics import Metrics
label_desc: Use image node_id 2 for calling the ExecutableModelSpace obj's underlying member method code with example usage: obj.execute() and returns: self