Shortcuts

Class DistributedSequentialSampler

Inheritance Relationships

Base Type

Class Documentation

class DistributedSequentialSampler : public torch::data::samplers::DistributedSampler<>

Select samples sequentially.

Public Functions

DistributedSequentialSampler(size_t size, size_t num_replicas = 1, size_t rank = 0, bool allow_duplicates = true)
virtual void reset(optional<size_t> new_size = nullopt) override

Resets the DistributedSequentialSampler to a new set of indices.

virtual optional<std::vector<size_t>> next(size_t batch_size) override

Returns the next batch of indices.

virtual void save(serialize::OutputArchive &archive) const override

Serializes the DistributedSequentialSampler to the archive.

virtual void load(serialize::InputArchive &archive) override

Deserializes the DistributedSequentialSampler from the archive.

size_t index() const noexcept

Returns the current index of the DistributedSequentialSampler.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources