Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Data Fields
TestIndexSampler Struct Reference
Inheritance diagram for TestIndexSampler:
torch::data::samplers::Sampler< TestIndex >

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< TestIndexnext (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
 

Detailed Description

Definition at line 802 of file dataloader.cpp.

Member Function Documentation

torch::optional<TestIndex> TestIndexSampler::next ( size_t  batch_size)
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.

void TestIndexSampler::reset ( torch::optional< size_t >  new_size = torch::nullopt)
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.


The documentation for this struct was generated from the following file: