Skip to content

Commit

Permalink
Create a debug flag (#1546)
Browse files Browse the repository at this point in the history
Create a `DEBUG` flag for onnxscript. Users can enable it via
`onnxscript.DEBUG=True`. We will use this flag to enable additional
invariance checking in the IR.

1/2 of #1545
  • Loading branch information
justinchuby authored May 15, 2024
1 parent 2b6dc27 commit b77f393
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions onnxscript/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"opset_ai_onnx_ml2",
"opset_ai_onnx_ml3",
"opset_ai_onnx_ml4",
"DEBUG",
]

import importlib.metadata
Expand Down Expand Up @@ -122,6 +123,9 @@
from ._internal.utils import external_tensor
from .values import OnnxFunction, TracedOnnxFunction

# Set DEBUG to True to enable additional debug checks
DEBUG = False

try: # noqa: SIM105
__version__ = importlib.metadata.version("onnxscript")
except importlib.metadata.PackageNotFoundError:
Expand Down

0 comments on commit b77f393

Please sign in to comment.