:github_url: https://github.com/pytorch/pytorch .. _program_listing_file_torch_csrc_api_include_torch_nn_modules_fold.h: Program Listing for File fold.h =============================== |exhale_lsh| :ref:`Return to documentation for file ` (``torch/csrc/api/include/torch/nn/modules/fold.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include #include namespace torch::nn { class TORCH_API FoldImpl : public torch::nn::Cloneable { public: FoldImpl(ExpandingArray<2> output_size, ExpandingArray<2> kernel_size) : FoldImpl(FoldOptions(output_size, kernel_size)) {} explicit FoldImpl(const FoldOptions& options_); void reset() override; void pretty_print(std::ostream& stream) const override; Tensor forward(const Tensor& input); FoldOptions options; }; TORCH_MODULE(Fold); // ============================================================================ class TORCH_API UnfoldImpl : public Cloneable { public: UnfoldImpl(ExpandingArray<2> kernel_size) : UnfoldImpl(UnfoldOptions(kernel_size)) {} explicit UnfoldImpl(const UnfoldOptions& options_); void reset() override; void pretty_print(std::ostream& stream) const override; Tensor forward(const Tensor& input); UnfoldOptions options; }; TORCH_MODULE(Unfold); } // namespace torch::nn