Public Member Functions | |
| TestIndexSampler (size_t size) | |
| void | reset (torch::optional< size_t > new_size=torch::nullopt) override |
Resets the Sampler's internal state. More... | |
| torch::optional< TestIndex > | next (size_t batch_size) override |
| Returns the next index if possible, or an empty optional if the sampler is exhausted for this epoch. More... | |
| void | save (torch::serialize::OutputArchive &archive) const override |
Serializes the Sampler to the archive. | |
| void | load (torch::serialize::InputArchive &archive) override |
Deserializes the Sampler from the archive. | |
Data Fields | |
| size_t | index_ = 0 |
| size_t | size_ |
Additional Inherited Members | |
Public Types inherited from torch::data::samplers::Sampler< TestIndex > | |
| using | BatchRequestType = TestIndex |
Definition at line 802 of file dataloader.cpp.
|
inlineoverridevirtual |
Returns the next index if possible, or an empty optional if the sampler is exhausted for this epoch.
Implements torch::data::samplers::Sampler< TestIndex >.
Definition at line 805 of file dataloader.cpp.
|
inlineoverridevirtual |
Resets the Sampler's internal state.
Typically called before a new epoch. Optionally, accepts a new size when reseting the sampler.
Implements torch::data::samplers::Sampler< TestIndex >.
Definition at line 804 of file dataloader.cpp.
1.8.11