Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions monai/data/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class DistributedWeightedRandomSampler(DistributedSampler):
by default, `world_size` is retrieved from the current distributed group.
rank: rank of the current process within `num_replicas`. by default,
`rank` is retrieved from the current distributed group.
shuffle: if `True`, sampler will shuffle the indices, default to True.
kwargs: additional arguments for `DistributedSampler` super class, can be `seed` and `drop_last`.

"""
Expand All @@ -95,15 +94,14 @@ def __init__(
even_divisible: bool = True,
num_replicas: int | None = None,
rank: int | None = None,
shuffle: bool = True,
**kwargs,
):
kwargs.setdefault("shuffle", True)
Comment thread
wyli marked this conversation as resolved.
super().__init__(
dataset=dataset,
even_divisible=even_divisible,
num_replicas=num_replicas,
rank=rank,
shuffle=shuffle,
**kwargs,
)
self.weights = weights
Expand Down