code: def test_continue_training():
      # Tests issue : https://github.com/pytorch/ignite/issues/993
      max_epochs = 2
      data = range(10)
      engine = Engine(lambda e, b: 1)
      state = engine.run(data, max_epochs=max_epochs)
      assert state.max_epochs == max_epochs
      assert state.iteration == len(data) * max_epochs
      assert state.epoch == max_epochs
  
      @engine.on(Events.STARTED)
      def assert_continue_training():
          assert engine.state.epoch == max_epochs
  
      state = engine.run(data, max_epochs=max_epochs * 2)
      assert state.max_epochs == max_epochs * 2
      assert state.iteration == len(data) * max_epochs * 2
      assert state.epoch == max_epochs * 2
  
file_path: ignite/tests/ignite/engine/test_engine_state_dict.py
imports: from collections.abc import Mapping
  import pytest
  import torch
  from ignite.engine import Engine, Events, State
  from tests.ignite.engine import BatchChecker, EpochCounter, IterationCounter
label_desc: Use image node_id 10 for calling a global function with example usage: test_continue_training() without return types