class_docstr: Errors around TorchScript values and nodes.
class_docstr_tok: ["Errors","around","TorchScript","values","and","nodes","."]
code: def __init__(self, msg: str, value: _C.Value):
      message = (
          f"{msg}  [Caused by the value '{value}' (type '{value.type()}') in the "
          f"TorchScript graph. The containing node has kind '{value.node().kind()}'.] "
      )
  
      code_location = value.node().sourceRange()
      if code_location:
          message += f"\n    (node defined in {code_location})"
  
      try:
          # Add its input and output to the message.
          message += "\n\n"
          message += textwrap.indent(
              (
                  "Inputs:\n"
                  + (
                      "\n".join(
                          f"    #{i}: {input_}  (type '{input_.type()}')"
                          for i, input_ in enumerate(
                              value.node().inputs()
                          )
                      )
                      or "    Empty"
                  )
                  + "\n"
                  + "Outputs:\n"
                  + (
                      "\n".join(
                          f"    #{i}: {output}  (type '{output.type()}')"
                          for i, output in enumerate(
                              value.node().outputs()
                          )
                      )
                      or "    Empty"
                  )
              ),
              "    ",
          )
      except AttributeError:
          message += (
              " Failed to obtain its input and output for debugging. "
              "Please refer to the TorchScript graph for debugging information."
          )
  
      super().__init__(message)
  
file_path: pytorch/torch/onnx/errors.py
imports: from __future__ import annotations
  import textwrap
  from typing import Optional
  from torch import _C
  from torch.onnx import _constants
  from torch.onnx._internal import diagnostics
label_desc: Use image node_id 1 to create a new SymbolicValueError object from inherited base classes: OnnxExporterError with example: obj = SymbolicValueError(msg, value)