Shortcuts

Template Struct ConvNdOptions

Page Contents

Struct Documentation

template<size_t D>
struct torch::nn::detail::ConvNdOptions

Options for a D-dimensional convolution or convolution transpose module.

Public Types

using padding_t = conv_padding_t<D>

Public Functions

ConvNdOptions(int64_t in_channels, int64_t out_channels, ExpandingArray<D> kernel_size)
auto in_channels(const int64_t &new_in_channels) -> decltype(*this)

The number of channels the input volumes will have.

Changing this parameter after construction has no effect.

auto in_channels(int64_t &&new_in_channels) -> decltype(*this)
const int64_t &in_channels() const noexcept
int64_t &in_channels() noexcept
auto out_channels(const int64_t &new_out_channels) -> decltype(*this)

The number of output channels the convolution should produce.

Changing this parameter after construction has no effect.

auto out_channels(int64_t &&new_out_channels) -> decltype(*this)
const int64_t &out_channels() const noexcept
int64_t &out_channels() noexcept
auto kernel_size(const ExpandingArray<D> &new_kernel_size) -> decltype(*this)

The kernel size to use.

For a D-dim convolution, must be a single number or a list of D numbers. This parameter can be changed after construction.

auto kernel_size(ExpandingArray<D> &&new_kernel_size) -> decltype(*this)
const ExpandingArray<D> &kernel_size() const noexcept
ExpandingArray<D> &kernel_size() noexcept
auto stride(const ExpandingArray<D> &new_stride) -> decltype(*this)

The stride of the convolution.

For a D-dim convolution, must be a single number or a list of D numbers. This parameter can be changed after construction.

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

The padding to add to the input volumes.

For a D-dim convolution, must be a single number or a list of D numbers. This parameter can be changed after construction.

auto padding(padding_t &&new_padding) -> decltype(*this)
const padding_t &padding() const noexcept
padding_t &padding() noexcept
decltype(auto) padding(std::initializer_list<int64_t> il)
auto dilation(const ExpandingArray<D> &new_dilation) -> decltype(*this)

The kernel dilation.

For a D-dim convolution, must be a single number or a list of D numbers. This parameter can be changed after construction.

auto dilation(ExpandingArray<D> &&new_dilation) -> decltype(*this)
const ExpandingArray<D> &dilation() const noexcept
ExpandingArray<D> &dilation() noexcept
auto transposed(const bool &new_transposed) -> decltype(*this)

If true, convolutions will be transpose convolutions (a.k.a.

deconvolutions). Changing this parameter after construction has no effect.

auto transposed(bool &&new_transposed) -> decltype(*this)
const bool &transposed() const noexcept
bool &transposed() noexcept
auto output_padding(const ExpandingArray<D> &new_output_padding) -> decltype(*this)

For transpose convolutions, the padding to add to output volumes.

For a D-dim convolution, must be a single number or a list of D numbers. This parameter can be changed after construction.

auto output_padding(ExpandingArray<D> &&new_output_padding) -> decltype(*this)
const ExpandingArray<D> &output_padding() const noexcept
ExpandingArray<D> &output_padding() noexcept
auto groups(const int64_t &new_groups) -> decltype(*this)

The number of convolution groups.

This parameter can be changed after construction.

auto groups(int64_t &&new_groups) -> decltype(*this)
const int64_t &groups() const noexcept
int64_t &groups() noexcept
auto bias(const bool &new_bias) -> decltype(*this)

Whether to add a bias after individual applications of the kernel.

Changing this parameter after construction has no effect.

auto bias(bool &&new_bias) -> decltype(*this)
const bool &bias() const noexcept
bool &bias() noexcept
auto padding_mode(const conv_padding_mode_t &new_padding_mode) -> decltype(*this)

Accepted values torch::kZeros, torch::kReflect, torch::kReplicate or torch::kCircular. Default: torch::kZeros

auto padding_mode(conv_padding_mode_t &&new_padding_mode) -> decltype(*this)
const conv_padding_mode_t &padding_mode() const noexcept
conv_padding_mode_t &padding_mode() 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