From 37facf1f7072105e3ae80ac09e3de09e075987a1 Mon Sep 17 00:00:00 2001 From: Siyuan Liu Date: Fri, 10 May 2024 23:05:15 +0000 Subject: [PATCH] fix flag --- torch_xla/stablehlo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/torch_xla/stablehlo.py b/torch_xla/stablehlo.py index 5ac0a3ae080..4bf7120ef3c 100644 --- a/torch_xla/stablehlo.py +++ b/torch_xla/stablehlo.py @@ -347,13 +347,13 @@ def _exported_program_to_stablehlo_bundle(exported_model, if options.inline_all_constant: # Inline all constants. torch_xla._XLAC._set_xla_all_numbers_special_scalars(True) + if "XLA_HLO_DEBUG" in os.environ: + xla_hlo_debug_env = os.environ["XLA_HLO_DEBUG"] + else: + xla_hlo_debug_env = "0" if options.export_node_metadata: gm_serializer = GraphModuleSerializer(exported_model.graph_signature, exported_model.module_call_graph) - if "XLA_HLO_DEBUG" in os.environ: - xla_hlo_debug_env = os.environ["XLA_HLO_DEBUG"] - else: - xla_hlo_debug_env = "0" os.environ["XLA_HLO_DEBUG"] = "1" else: gm_serializer = None