class_docstr: Engine for cross-graph optimization.
class_docstr_tok: ["Engine","for","cross-graph","optimization","."]
docstr: Copy the training service config from the parent experiment config.
docstr_tok: ["Copy","the","training","service","config","from","the","parent","experiment","config","."]
code: def _canonicalize(self, parents):
      """Copy the training service config from the parent experiment config."""
      assert len(parents) > 0
      parent_config = parents[0]
      assert isinstance(
          parent_config, ExperimentConfig
      ), "CgoEngineConfig must be a child of ExperimentConfig"
      if not isinstance(parent_config.training_service, RemoteConfig):
          raise TypeError(
              "CGO execution engine currently only supports remote training service"
          )
      self.training_service = parent_config.training_service
      return super()._canonicalize(parents)
  
file_path: nni/nni/nas/experiment/config/engine.py
imports: import logging
  from dataclasses import dataclass
  from typing import Optional
  from nni.experiment.config import ExperimentConfig
  from nni.experiment.config.training_services import RemoteConfig
  from nni.experiment.config.utils import parse_time
  from .utils import NamedSubclassConfigBase
label_desc: Use image node_id 1 for calling the CgoEngineConfig obj's underlying member method code with example usage: obj._canonicalize(parents) and returns: super