A Sampler
that returns indices sequentially.
More...
#include <sequential.h>
Public Member Functions | |
TORCH_API | SequentialSampler (size_t size) |
Creates a SequentialSampler that will return indices in the range 0...size - 1 . More... | |
TORCH_API void | reset (optional< size_t > new_size=nullopt) override |
Resets the SequentialSampler to zero. | |
TORCH_API optional< std::vector< size_t > > | next (size_t batch_size) override |
Returns the next batch of indices. | |
TORCH_API void | save (serialize::OutputArchive &archive) const override |
Serializes the SequentialSampler to the archive . | |
TORCH_API void | load (serialize::InputArchive &archive) override |
Deserializes the SequentialSampler from the archive . | |
TORCH_API size_t | index () const noexcept |
Returns the current index of the SequentialSampler . | |
Additional Inherited Members | |
Public Types inherited from torch::data::samplers::Sampler<> | |
using | BatchRequestType = std::vector< size_t > |
A Sampler
that returns indices sequentially.
Definition at line 22 of file sequential.h.
|
explicit |
Creates a SequentialSampler
that will return indices in the range 0...size - 1
.
Definition at line 12 of file sequential.cpp.