Skip to content

Fix a few bugs in engine interrupt/resume feature #2689

@sadra-barikbin

Description

@sadra-barikbin

🐛 Bug description

  • A typo in docstrings. 0.4.10 or 0.5.0?
  • _run_once_on_dataset_as_gen is restarted (because it is called) whenever we get into _internal_run_as_gen
  • Some statements before _run_once_on_dataset_as_gen should be skipped on resume and some other after that should be skipped on interrupt
  • Once running after a terminated state, _run_once_on_dataset_as_gen should be set to None before entering _internal_run.
  • If engine was interrupted in the middle of the last epoch, is_done incorrectly returns True on resume thus preventing it.
  • _run_once_on_dataset_as_gen yields the state on interrupt, not the time, so this shoud be changed.
  • Since _run_once_on_dataset_as_gen has both return value and yield value with different types, its annotation could be updated to reflect this e.g. become Generator[State, None, float]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions