:github_url: https://github.com/pytorch/pytorch .. _program_listing_file_torch_csrc_api_include_torch_data_samplers_base.h: Program Listing for File base.h =============================== |exhale_lsh| :ref:`Return to documentation for file ` (``torch/csrc/api/include/torch/data/samplers/base.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include namespace torch::serialize { class OutputArchive; class InputArchive; } // namespace torch::serialize namespace torch::data::samplers { template > class Sampler { public: using BatchRequestType = BatchRequest; virtual ~Sampler() = default; virtual void reset(std::optional new_size) = 0; virtual std::optional next(size_t batch_size) = 0; virtual void save(serialize::OutputArchive& archive) const = 0; virtual void load(serialize::InputArchive& archive) = 0; }; } // namespace torch::data::samplers