Skip to content

Commit

Permalink
InitVar
Browse files Browse the repository at this point in the history
  • Loading branch information
norabelrose committed Mar 22, 2023
1 parent a80369e commit d304ab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions elk/extraction/balanced_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class BalancedSampler(TorchIterableDataset):

dataset: IterableDataset
label_counts: np.ndarray = field(default_factory=lambda: np.zeros(2))
seed: int = 42
seed: InitVar[int] = 42

def __post_init__(self):
self.rng = np.random.default_rng(self.seed)
def __post_init__(self, seed: int):
self.rng = np.random.default_rng(seed)

def __iter__(self):
for sample in self.dataset:
Expand Down

0 comments on commit d304ab3

Please sign in to comment.