Shortcuts

Struct FoldOptions

Page Contents

Struct Documentation

struct torch::nn::FoldOptions

Options for the Fold module.

Example:

Fold model(FoldOptions({8, 8}, {3, 3}).dilation(2).padding({2, 1}).stride(2));

Public Functions

FoldOptions(ExpandingArray<2> output_size, ExpandingArray<2> kernel_size)
auto output_size(const ExpandingArray<2> &new_output_size) -> decltype(*this)

describes the spatial shape of the large containing tensor of the sliding local blocks.

It is useful to resolve the ambiguity when multiple input shapes map to same number of sliding blocks, e.g., with stride > 0.

auto output_size(ExpandingArray<2> &&new_output_size) -> decltype(*this)
const ExpandingArray<2> &output_size() const noexcept
ExpandingArray<2> &output_size() noexcept
auto kernel_size(const ExpandingArray<2> &new_kernel_size) -> decltype(*this)

the size of the sliding blocks

auto kernel_size(ExpandingArray<2> &&new_kernel_size) -> decltype(*this)
const ExpandingArray<2> &kernel_size() const noexcept
ExpandingArray<2> &kernel_size() noexcept
auto dilation(const ExpandingArray<2> &new_dilation) -> decltype(*this)

controls the spacing between the kernel points; also known as the à trous algorithm.

auto dilation(ExpandingArray<2> &&new_dilation) -> decltype(*this)
const ExpandingArray<2> &dilation() const noexcept
ExpandingArray<2> &dilation() noexcept
auto padding(const ExpandingArray<2> &new_padding) -> decltype(*this)

controls the amount of implicit zero-paddings on both sides for padding number of points for each dimension before reshaping.

auto padding(ExpandingArray<2> &&new_padding) -> decltype(*this)
const ExpandingArray<2> &padding() const noexcept
ExpandingArray<2> &padding() noexcept
auto stride(const ExpandingArray<2> &new_stride) -> decltype(*this)

controls the stride for the sliding blocks.

auto stride(ExpandingArray<2> &&new_stride) -> decltype(*this)
const ExpandingArray<2> &stride() const noexcept
ExpandingArray<2> &stride() noexcept

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