Shortcuts

Struct FoldOptions

Page Contents

Struct Documentation

struct FoldOptions

Options for the Fold module.

Example:

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

Public Functions

inline FoldOptions(ExpandingArray<2> output_size, ExpandingArray<2> kernel_size)
inline 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.

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

the size of the sliding blocks

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

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

inline auto dilation(ExpandingArray<2> &&new_dilation) -> decltype(*this)
inline const ExpandingArray<2> &dilation() const noexcept
inline ExpandingArray<2> &dilation() noexcept
inline 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.

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

controls the stride for the sliding blocks.

inline auto stride(ExpandingArray<2> &&new_stride) -> decltype(*this)
inline const ExpandingArray<2> &stride() const noexcept
inline 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