@@ -140,7 +140,7 @@ def __init__(self, process_function: Callable[["Engine", Any], Any]):
140
140
self ._process_function = process_function
141
141
self .last_event_name : Optional [Events ] = None
142
142
self .should_terminate = False
143
- self .skip_completed_after_termination = False
143
+ self ._skip_completed_after_termination = False
144
144
self .should_terminate_single_epoch = False
145
145
self ._skip_epoch_completed_after_termination = False
146
146
self .should_interrupt = False
@@ -627,7 +627,7 @@ def terminate():
627
627
"""
628
628
self .logger .info ("Terminate signaled. Engine will stop after current iteration is finished." )
629
629
self .should_terminate = True
630
- self .skip_completed_after_termination = skip_completed
630
+ self ._skip_completed_after_termination = skip_completed
631
631
632
632
def terminate_epoch (self , skip_epoch_completed : bool = False ) -> None :
633
633
"""Sends terminate signal to the engine, so that it terminates the current epoch. The run
@@ -1015,7 +1015,7 @@ def _internal_run_as_gen(self) -> Generator[Any, None, State]:
1015
1015
self .state .times [Events .COMPLETED .name ] = time_taken
1016
1016
1017
1017
# do not fire Events.COMPLETED if we terminated the run with flag `skip_completed=True`
1018
- if not (self .should_terminate and self .skip_completed_after_termination ):
1018
+ if not (self .should_terminate and self ._skip_completed_after_termination ):
1019
1019
handlers_start_time = time .time ()
1020
1020
self ._fire_event (Events .COMPLETED )
1021
1021
time_taken += time .time () - handlers_start_time
@@ -1204,7 +1204,7 @@ def _internal_run_legacy(self) -> State:
1204
1204
self .state .times [Events .COMPLETED .name ] = time_taken
1205
1205
1206
1206
# do not fire Events.COMPLETED if we terminated the run with flag `skip_completed=True`
1207
- if not (self .should_terminate and self .skip_completed_after_termination ):
1207
+ if not (self .should_terminate and self ._skip_completed_after_termination ):
1208
1208
handlers_start_time = time .time ()
1209
1209
self ._fire_event (Events .COMPLETED )
1210
1210
time_taken += time .time () - handlers_start_time
0 commit comments