class_docstr: Base class for all export diagnostics.
  
  This class is used to represent all export diagnostics. It is a subclass of
  infra.Diagnostic, and adds additional methods to add more information to the
  diagnostic.
class_docstr_tok: ["Base","class","for","all","export","diagnostics",".","This","class","is","used","to","represent","all","export","diagnostics",".","It","is","a","subclass","of","infra.Diagnostic",",","and","adds","additional","methods","to","add","more","information","to","the","diagnostic","."]
code: def __init__(
      self,
      *args,
      frames_to_skip: int = 1,
      cpp_stack: bool = False,
      **kwargs,
  ) -> None:
      super().__init__(*args, **kwargs)
      self.python_call_stack = self.record_python_call_stack(
          frames_to_skip=frames_to_skip
      )
      if cpp_stack:
          self.cpp_call_stack = self.record_cpp_call_stack(
              frames_to_skip=frames_to_skip
          )
  
imports: from __future__ import annotations
  import contextlib
  import gzip
  from collections.abc import Generator
  from typing import List, Optional
  import torch
  from torch.onnx._internal.diagnostics import infra
  from torch.onnx._internal.diagnostics.infra import formatter, sarif
  from torch.onnx._internal.diagnostics.infra.sarif import version
  from torch.utils import cpp_backtrace
label_desc: Use image node_id 1 to create a new TorchScriptOnnxExportDiagnostic object from inherited base classes: infra with example: obj = TorchScriptOnnxExportDiagnostic()