class_docstr: Trainer for cross-graph optimization.
  
  Parameters
  ----------
  use_cgo
      Whether cross-graph optimization (CGO) is used.
      If it is True, CGO will manage device placement.
      Any device placement from pytorch lightning will be bypassed.
      default: False
  trainer_kwargs
      Optional keyword arguments passed to trainer. See
      `Lightning documentation <https://pytorch-lightning.readthedocs.io/en/stable/common/trainer.html>`__ for details.
class_docstr_tok: ["Trainer","for","cross-graph","optimization",".","Parameters","--","--","--","--","--","use_cgo","Whether","cross-graph","optimization","(","CGO",")","is","used",".","If","it","is","True",",","CGO","will","manage","device","placement",".","Any","device","placement","from","pytorch","lightning","will","be","bypassed",".","default",":","False","trainer_kwargs","Optional","keyword","arguments","passed","to","trainer",".","See","`","Lightning","documentation","<","https",":","\/\/pytorch-lightning.readthedocs.io\/en\/stable\/common\/trainer.html",">","`","__","for","details","."]
code: def __init__(self, use_cgo: bool = True, **trainer_kwargs):
      if use_cgo:
          # Accelerator and strategy can be both set at lightning 2.0.
          # if "accelerator" in trainer_kwargs:
          #     raise ValueError("accelerator should not be set when cross-graph optimization is enabled.")
  
          if "strategy" in trainer_kwargs:
              raise ValueError(
                  "MultiModelTrainer does not support specifying strategy"
              )
  
          trainer_kwargs["strategy"] = _BypassStrategy()
  
      super().__init__(**trainer_kwargs)
  
imports: from __future__ import annotations
  import pytorch_lightning
  import torch
  from pytorch_lightning.strategies import SingleDeviceStrategy
  from torch import nn
  from torchmetrics import Metric
  import nni
  from nni.nas.evaluator.pytorch.lightning import LightningModule
label_desc: Use image node_id 1 to create a new MultiModelTrainer object from inherited base classes: pytorch_lightning with example: obj = MultiModelTrainer(use_cgo)