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: Convert any model space to a specific type of executable model space.
  
  Parameters
  ----------
  model_space
      Model space written in deep learning framework in most cases.
  evaluator
      A model usually requires an evaluator to be *executable*.
      But evaluator can sometimes be optional for debug purposes or to support fancy algorithms.
  configs
      Additional configurations for the executable model space.
  
  Returns
  -------
  The converted model space.
docstr_tok: ["Convert","any","model","space","to","a","specific","type","of","executable","model","space",".","Parameters","--","--","--","--","--","model_space","Model","space","written","in","deep","learning","framework","in","most","cases",".","evaluator","A","model","usually","requires","an","evaluator","to","be","*","executable","*",".","But","evaluator","can","sometimes","be","optional","for","debug","purposes","or","to","support","fancy","algorithms",".","configs","Additional","configurations","for","the","executable","model","space",".","Returns","--","--","--","-","The","converted","model","space","."]
code: def from_model(
      cls,
      model_space: BaseModelSpace,
      evaluator: Evaluator | None = None,
      **configs: Any,
  ) -> ExecutableModelSpace:
      """Convert any model space to a specific type of executable model space.
  
      Parameters
      ----------
      model_space
          Model space written in deep learning framework in most cases.
      evaluator
          A model usually requires an evaluator to be *executable*.
          But evaluator can sometimes be optional for debug purposes or to support fancy algorithms.
      configs
          Additional configurations for the executable model space.
  
      Returns
      -------
      The converted model space.
      """
      raise NotImplementedError(
          "`from_model` is not implemented for {}".format(cls.__name__)
      )
  
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 3 for calling the ExecutableModelSpace obj's underlying member method code with example usage: obj.from_model(cls, model_space, evaluator) without return types