Skip to content

Commit

Permalink
Fixed mypy failure with DistributedSampler
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 authored Jun 21, 2023
1 parent c54117e commit 4f3b5f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ignite/contrib/engines/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _setup_common_distrib_training_handlers(

@trainer.on(Events.EPOCH_STARTED)
def distrib_set_epoch(engine: Engine) -> None:
cast(DistributedSampler, train_sampler).set_epoch(engine.state.epoch - 1)
train_sampler.set_epoch(engine.state.epoch - 1)


def empty_cuda_cache(_: Engine) -> None:
Expand Down

0 comments on commit 4f3b5f2

Please sign in to comment.