Deconvolution

A deconvolution primitive performs 1D, 2D, or 3D deconvolution. Supported variants are forward propagation, backward propagation, and weights gradient with or without bias.

API

struct dnnl::deconvolution_forward : public dnnl::primitive

Deconvolution forward propagation primitive.

Public Functions

deconvolution_forward()

Default constructor. Produces an empty object.

deconvolution_forward(const primitive_desc &pd)

Constructs a deconvolution forward propagation primitive.

Parameters
  • pd: Primitive descriptor for a deconvolution forward propagation primitive.

struct desc

Descriptor for a deconvolution forward propagation primitive.

Public Functions

desc(prop_kind prop_kind, algorithm algorithm, const memory::desc &src_desc, const memory::desc &weights_desc, const memory::desc &bias_desc, const memory::desc &dst_desc, const memory::dims &strides, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a deconvolution forward propagation primitive with bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters

desc(prop_kind prop_kind, algorithm algorithm, const memory::desc &src_desc, const memory::desc &weights_desc, const memory::desc &dst_desc, const memory::dims &strides, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a deconvolution forward propagation primitive without bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters

desc(prop_kind prop_kind, algorithm algorithm, const memory::desc &src_desc, const memory::desc &weights_desc, const memory::desc &bias_desc, const memory::desc &dst_desc, const memory::dims &strides, const memory::dims &dilates, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a dilated deconvolution forward propagation primitive with bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • prop_kind: Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.

  • algorithm: Deconvolution algorithm: dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • weights_desc: Weights memory descriptor.

  • bias_desc: Bias memory descriptor. Passing zero memory descriptor disables the bias term.

  • dst_desc: Destination memory descriptor.

  • strides: Vector of strides for spatial dimension.

  • dilates: Dilations for each spatial dimension. A zero value means no dilation in the corresponding dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

desc(prop_kind prop_kind, algorithm algorithm, const memory::desc &src_desc, const memory::desc &weights_desc, const memory::desc &dst_desc, const memory::dims &strides, const memory::dims &dilates, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a dilated deconvolution forward propagation primitive without bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • prop_kind: Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.

  • algorithm: Deconvolution algorithm: dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • weights_desc: Weights memory descriptor.

  • dst_desc: Destination memory descriptor.

  • strides: Vector of strides for spatial dimension.

  • dilates: Dilations for each spatial dimension. A zero value means no dilation in the corresponding dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

struct primitive_desc : public dnnl::primitive_desc

Primitive descriptor for a deconvolution forward propagation primitive.

Public Functions

primitive_desc()

Default constructor. Produces an empty object.

primitive_desc(const desc &desc, const engine &engine, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution forward propagation primitive.

Parameters
  • desc: Descriptor for a deconvolution forward propagation primitive.

  • engine: Engine to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

primitive_desc(const desc &desc, const primitive_attr &attr, const engine &engine, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution forward propagation primitive.

Parameters
  • desc: Descriptor for a deconvolution forward propagation primitive.

  • engine: Engine to use.

  • attr: Primitive attributes to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

memory::desc src_desc() const

Returns a source memory descriptor.

Return

Source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a source parameter.

memory::desc weights_desc() const

Returns a weights memory descriptor.

Return

Weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a weights parameter.

memory::desc dst_desc() const

Returns a destination memory descriptor.

Return

Destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a destination parameter.

memory::desc bias_desc() const

Returns the bias memory descriptor.

Return

The bias memory descriptor.

Return

A zero memory descriptor of the primitive does not have a bias parameter.

struct dnnl::deconvolution_backward_data : public dnnl::primitive

Deconvolution backward propagation primitive.

Public Functions

deconvolution_backward_data()

Default constructor. Produces an empty object.

deconvolution_backward_data(const primitive_desc &pd)

Constructs a deconvolution backward propagation primitive.

Parameters
  • pd: Primitive descriptor for a deconvolution backward propagation primitive.

struct desc

Descriptor for a deconvolution backward propagation primitive.

Public Functions

desc(algorithm algorithm, const memory::desc &diff_src_desc, const memory::desc &weights_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a deconvolution backward propagation primitive.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm (dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd).

  • diff_src_desc: Diff source memory descriptor.

  • weights_desc: Weights memory descriptor.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

desc(algorithm algorithm, const memory::desc &diff_src_desc, const memory::desc &weights_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &dilates, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a dilated deconvolution backward propagation primitive.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm (dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd).

  • diff_src_desc: Diff source memory descriptor.

  • weights_desc: Weights memory descriptor.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • dilates: Dilations for each spatial dimension. A zero value means no dilation in the corresponding dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

struct primitive_desc : public dnnl::primitive_desc

Primitive descriptor for a deconvolution backward propagation primitive.

Public Functions

primitive_desc()

Default constructor. Produces an empty object.

primitive_desc(const desc &desc, const engine &engine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution backward propagation primitive.

Parameters
  • desc: Descriptor for a deconvolution backward propagation primitive.

  • engine: Engine to use.

  • hint_fwd_pd: Primitive descriptor for a deconvolution forward propagation primitive. It is used as a hint for deciding which memory format to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

primitive_desc(const desc &desc, const primitive_attr &attr, const engine &engine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution backward propagation primitive.

Parameters
  • desc: Descriptor for a deconvolution backward propagation primitive.

  • attr: Primitive attributes to use.

  • engine: Engine to use.

  • hint_fwd_pd: Primitive descriptor for a deconvolution forward propagation primitive. It is used as a hint for deciding which memory format to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

memory::desc diff_src_desc() const

Returns a diff source memory descriptor.

Return

Diff source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff source memory with.

memory::desc weights_desc() const

Returns a weights memory descriptor.

Return

Weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a weights parameter.

memory::desc diff_dst_desc() const

Returns a diff destination memory descriptor.

Return

Diff destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff destination parameter.

struct dnnl::deconvolution_backward_weights : public dnnl::primitive

Deconvolution weights gradient primitive.

Public Functions

deconvolution_backward_weights()

Default constructor. Produces an empty object.

deconvolution_backward_weights(const primitive_desc &pd)

Constructs a deconvolution weights gradient primitive.

Parameters
  • pd: Primitive descriptor for a deconvolution weights gradient primitive.

struct desc

Descriptor for a deconvolution weights gradient primitive.

Public Functions

desc(algorithm algorithm, const memory::desc &src_desc, const memory::desc &diff_weights_desc, const memory::desc &diff_bias_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a deconvolution weights gradient primitive with bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm. Possible values are dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • diff_weights_desc: Diff weights memory descriptor.

  • diff_bias_desc: Diff bias memory descriptor. Passing zero memory descriptor disables the bias term.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

desc(algorithm algorithm, const memory::desc &src_desc, const memory::desc &diff_weights_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a deconvolution weights gradient primitive without bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm. Possible values are dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • diff_weights_desc: Diff weights memory descriptor.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

desc(algorithm algorithm, const memory::desc &src_desc, const memory::desc &diff_weights_desc, const memory::desc &diff_bias_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &dilates, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a dilated deconvolution weights gradient primitive with bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm. Possible values are dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • diff_weights_desc: Diff weights memory descriptor.

  • diff_bias_desc: Diff bias memory descriptor. Passing zero memory descriptor disables the bias term.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • dilates: Dilations for each spatial dimension. A zero value means no dilation in the corresponding dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

desc(algorithm algorithm, const memory::desc &src_desc, const memory::desc &diff_weights_desc, const memory::desc &diff_dst_desc, const memory::dims &strides, const memory::dims &dilates, const memory::dims &padding_l, const memory::dims &padding_r)

Constructs a descriptor for a dilated deconvolution weights gradient primitive without bias.

Inputs:

Outputs:

Note

All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of format_tag.

Parameters
  • algorithm: Deconvolution algorithm. Possible values are dnnl::algorithm::deconvolution_direct, and dnnl::algorithm::deconvolution_winograd.

  • src_desc: Source memory descriptor.

  • diff_weights_desc: Diff weights memory descriptor.

  • diff_dst_desc: Diff destination memory descriptor.

  • strides: Strides for each spatial dimension.

  • dilates: Dilations for each spatial dimension. A zero value means no dilation in the corresponding dimension.

  • padding_l: Vector of padding values for low indices for each spatial dimension (front, top, left).

  • padding_r: Vector of padding values for high indices for each spatial dimension (back, bottom, right).

struct primitive_desc : public dnnl::primitive_desc

Primitive descriptor for a deconvolution weights gradient primitive.

Public Functions

primitive_desc()

Default constructor. Produces an empty object.

primitive_desc(const desc &desc, const engine &engine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution weights update primitive.

Parameters
  • desc: Descriptor for a deconvolution weights gradient primitive.

  • engine: Engine to use.

  • hint_fwd_pd: Primitive descriptor for a deconvolution forward propagation primitive. It is used as a hint for deciding which memory format to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

primitive_desc(const desc &desc, const primitive_attr &attr, const engine &engine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)

Constructs a primitive descriptor for a deconvolution weights update primitive.

Parameters
  • desc: Descriptor for a deconvolution weights gradient primitive.

  • attr: Primitive attributes to use.

  • engine: Engine to use.

  • hint_fwd_pd: Primitive descriptor for a deconvolution forward propagation primitive. It is used as a hint for deciding which memory format to use.

  • allow_empty: A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

memory::desc src_desc() const

Returns a source memory descriptor.

Return

Source memory descriptor.

Return

A zero memory descriptor if the primitive does not have a source parameter.

memory::desc diff_weights_desc() const

Returns a diff weights memory descriptor.

Return

Diff weights memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff weights parameter.

memory::desc diff_dst_desc() const

Returns a diff destination memory descriptor.

Return

Diff destination memory descriptor.

Return

A zero memory descriptor if the primitive does not have a diff destination parameter.

memory::desc diff_bias_desc() const

Returns the diff bias memory descriptor.

Return

The diff bias memory descriptor.

Return

A zero memory descriptor of the primitive does not have a diff bias parameter.