Skip to content

Commit 0da6430

Browse files
authored
Fix MultiSampler test partition bug (#170)
* multisampler test partition bug * remove print statement * remove assertion made for testing * typo fix
1 parent a6dba32 commit 0da6430

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

selene_sdk/samplers/multi_sampler.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def __init__(self,
118118
test_sampler if isinstance(test_sampler, Sampler) else None
119119
self._dataloaders["test"] = \
120120
test_sampler if isinstance(test_sampler, DataLoader) else None
121+
self._iterators["test"] = iter(self._dataloaders["test"]) \
122+
if self._dataloaders["test"] else None
121123

122124
self.mode = mode
123125

@@ -232,11 +234,11 @@ def get_data_and_targets(self, batch_size, n_samples=None, mode=None):
232234
The size of the batches to divide the data into.
233235
n_samples : int or None, optional
234236
Default is None. The total number of samples to retrieve.
235-
If `n_samples` is None, if a FileSampler is specified for the
236-
mode, the number of samplers returned is defined by the FileSample,
237-
or if a Dataloader is specified, will set `n_samples` to 32000
238-
if the mode is `validate`, or 640000 if the mode is `test`.
239-
If the mode is `train` you must have specified a value for
237+
If `n_samples` is None, if a FileSampler is specified for the
238+
mode, the number of samplers returned is defined by the FileSampler,
239+
or if a Dataloader is specified, will set `n_samples` to 32000
240+
if the mode is `validate`, or 640000 if the mode is `test`.
241+
If the mode is `train` you must have specified a value for
240242
`n_samples`.
241243
mode : str, optional
242244
Default is None. The operating mode that the object should run in.

0 commit comments

Comments
 (0)