From b82e7c539e6272af1167dcee96ab2406f76a34d6 Mon Sep 17 00:00:00 2001 From: iefgnoix Date: Mon, 5 Feb 2024 23:23:01 +0000 Subject: [PATCH] make sure we flush printing the exception --- torch_xla/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch_xla/__init__.py b/torch_xla/__init__.py index 1112b299aeca..be700ae917f4 100644 --- a/torch_xla/__init__.py +++ b/torch_xla/__init__.py @@ -154,7 +154,7 @@ def _prepare_to_exit(): if int(os.environ.get('PT_XLA_DEBUG', '0')): _summarize_fn_tracker() except Exception as e: - print('Caught an exception in the atexit callback: ', e) + print('Caught an exception in the atexit callback: ', e, flush=True) os._exit(1)