class_docstr: :class:`~nni.nas.space.GraphModelSpace` specialized for PyTorch.
  It converts a PyTorch model into a graph, and provides a method to convert the graph back.
  
  Warning
  -------
  As of now, :class:`PytorchGraphModelSpace` is known to be problematic, and NOT recommended to use unless necessary.
  
  Firstly, the graph converter will put users' models through :meth:`torch.jit.script`,
  which will cause some ad-hoc models to fail.
  The traced model will be converted into our graph representation,
  which has quite limited supported for control flows, loops, etc.
  
  Other than unsupported types of models,
  the graph converter will also induce some unexpected behaviors due to the implementation changes.
  For example candidate names of :class:`~nni.nas.nn.pytorch.LayerChoice` will be prefixed,
  so that ``freeze()`` might not work as expected.
docstr: Convert the model to Python code.
docstr_tok: ["Convert","the","model","to","Python","code","."]
code: def to_code(self) -> str:
      """Convert the model to Python code."""
      return model_to_pytorch_script(self)
  
file_path: nni/nni/nas/space/pytorch/graph.py
imports: from __future__ import annotations
  import logging
  from typing import Any, TYPE_CHECKING
  import torch
  from nni.nas.evaluator import Evaluator
  from nni.nas.space import GraphModelSpace, Mutator
  from nni.nas.nn.pytorch.repeat import repeat_jit_forward_patch
  from .codegen import model_to_pytorch_script
  from .converter import GraphConverter, GraphConverterWithShape
  from .mutator import process_inline_mutation
label_desc: Use image node_id 3 for calling the PytorchGraphModelSpace obj's underlying member method code with example usage: obj.to_code() and returns: model_to_pytorch_script