Skip to content

Commit dfcc77c

Browse files
committed
Modify Workflow to Allow IterableDataset Inputs
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent fb20109 commit dfcc77c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

monai/engines/workflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def __init__(
128128

129129
# set the epoch value for DistributedSampler objects when an epoch starts
130130
if isinstance(sampler, DistributedSampler):
131+
131132
@self.on(Events.EPOCH_STARTED)
132133
def set_sampler_epoch(engine: Engine) -> None:
133134
sampler.set_epoch(engine.state.epoch)

tests/test_iterable_dataset.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818

1919
import nibabel as nib
2020
import numpy as np
21+
import torch.nn as nn
2122

2223
from monai.data import DataLoader, Dataset, IterableDataset
23-
from monai.transforms import Compose, LoadImaged, SimulateDelayd
2424
from monai.engines import SupervisedEvaluator
25-
26-
import torch.nn as nn
25+
from monai.transforms import Compose, LoadImaged, SimulateDelayd
2726

2827

2928
class _Stream:

0 commit comments

Comments
 (0)