Class DistributedSequentialSampler¶
Defined in File distributed.h
Page Contents
Inheritance Relationships¶
Base Type¶
public torch::data::samplers::DistributedSampler<>
(Template Class DistributedSampler)
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 std::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 thearchive
.
-
virtual void load(serialize::InputArchive &archive) override¶
Deserializes the
DistributedSequentialSampler
from thearchive
.
-
size_t index() const noexcept¶
Returns the current index of the
DistributedSequentialSampler
.
-
DistributedSequentialSampler(size_t size, size_t num_replicas = 1, size_t rank = 0, bool allow_duplicates = true)¶