Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
torch::data::samplers::SequentialSampler Class Reference

A Sampler that returns indices sequentially. More...

#include <sequential.h>

Inheritance diagram for torch::data::samplers::SequentialSampler:
torch::data::samplers::Sampler<>

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 >
 

Detailed Description

A Sampler that returns indices sequentially.

Definition at line 22 of file sequential.h.

Constructor & Destructor Documentation

torch::data::samplers::SequentialSampler::SequentialSampler ( size_t  size)
explicit

Creates a SequentialSampler that will return indices in the range 0...size - 1.

Definition at line 12 of file sequential.cpp.


The documentation for this class was generated from the following files: