Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions python/torch_mlir/tools/import_onnx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def main(args: argparse.Namespace):
# some copies.
if args.output_file and args.output_file != "-":
with open(args.output_file, "wt") as f:
print(m.get_asm(assume_verified=not args.no_verify), file=f)
print(m.get_asm(assume_verified=not args.no_verify, enable_debug_info=args.enable_debug_info), file=f)
else:
print(m.get_asm(assume_verified=not args.no_verify))
print(m.get_asm(assume_verified=not args.no_verify, enable_debug_info=args.enable_debug_info))


def load_onnx_model(args: argparse.Namespace) -> onnx.ModelProto:
Expand Down Expand Up @@ -215,6 +215,13 @@ def parse_arguments(argv=None) -> argparse.Namespace:
help="Disable the allowlist for ONNX function expansion,"
" allowing non-allowlisted functions to be expanded.",
)
parser.add_argument(
"--enable-debug-info",
action="store_true",
default=False,
help="Whether to print debug/location information."
" Defaults to False.",
)
args = parser.parse_args(argv)
return args

Expand Down