From 641ec1a2ead37327034a98dbe79b2ce8b47ecec4 Mon Sep 17 00:00:00 2001 From: Fabio Bonassi Date: Mon, 9 Dec 2024 10:02:00 +0100 Subject: [PATCH] Union[bool, str] instead of the pipe operator for compatibility with older Python versions --- ignite/engine/engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ignite/engine/engine.py b/ignite/engine/engine.py index ffeddb2b3df..7eaf328773d 100644 --- a/ignite/engine/engine.py +++ b/ignite/engine/engine.py @@ -141,10 +141,10 @@ def __init__(self, process_function: Callable[["Engine", Any], Any]): self.last_event_name: Optional[Events] = None # should_terminate flag: False - don't terminate, True - terminate, # "skip_completed" - terminate and skip the event "COMPLETED" - self.should_terminate: bool | str = False + self.should_terminate: Union[bool, str] = False # should_terminate_single_epoch flag: False - don't terminate, True - terminate, # "skip_epoch_completed" - terminate and skip the event "EPOCH_COMPLETED" - self.should_terminate_single_epoch: bool | str = False + self.should_terminate_single_epoch: Union[bool, str] = False self.should_interrupt = False self.state = State() self._state_dict_user_keys: List[str] = []