Convolution and Deconvolution¶
The convolution and deconvolution primitives compute forward, backward, or weight update for a batched convolution or deconvolution operations on 1D, 2D, or 3D spatial data with bias.
The operations are defined by the following formulas. We show formulas only for 2D spatial data which are straightforward to generalize to cases of higher and lower dimensions. Variable names follow the standard Conventions.
Forward¶
Let \(\src\), \(\weights\) and \(\dst\) be \(N \times IC \times IH \times IW\), \(OC \times IC \times KH \times KW\), and \(N \times OC \times OH \times OW\) tensors respectively. Let \(\bias\) be a 1D tensor with \(OC\) elements.
Furthermore, let the remaining convolution parameters be:
Parameter |
Depth |
Height |
Width |
Comment |
---|---|---|---|---|
Padding: Front, top, and left |
\(PD_L\) |
\(PH_L\) |
\(PW_L\) |
In the API |
Padding: Back, bottom, and right |
\(PD_R\) |
\(PH_R\) |
\(PW_R\) |
In the API |
Stride |
\(SD\) |
\(SH\) |
\(SW\) |
Convolution without strides is defined by setting the stride parameters to 1 |
Dilation |
\(DD\) |
\(DH\) |
\(DW\) |
Non-dilated convolution is defined by setting the dilation parameters to 0 |
The following formulas show how oneDNN computes convolutions. They are broken down into several types to simplify the exposition, but in reality the convolution types can be combined.
To further simplify the formulas, we assume that \(\src(n, ic, ih, iw) = 0\) if \(ih < 0\), or \(ih \geq IH\), or \(iw < 0\), or \(iw \geq IW\).
Regular Convolution¶
Here:
\(oh' = oh \cdot SH + kh - PH_L\),
\(ow' = ow \cdot SW + kw - PW_L\),
\(OH = \left\lfloor{\frac{IH - KH + PH_L + PH_R}{SH}} \right\rfloor + 1\),
\(OW = \left\lfloor{\frac{IW - KW + PW_L + PW_R}{SW}} \right\rfloor + 1\).
Convolution with Groups¶
oneDNN adds a separate groups dimension to memory objects representing \(\weights\) tensors and represents weights as \(G \times OC_G \times IC_G \times KH \times KW\) 5D tensors for 2D convolutions with groups.
where
\(IC_G = \frac{IC}{G}\),
\(OC_G = \frac{OC}{G}\), and
\(oc_g \in [0, OC_G)\).
The case when \(OC_G = IC_G = 1\) is also known as a depthwise convolution.
Convolution with Dilation¶
Here:
\(oh'' = oh \cdot SH + kh \cdot (DH + 1) - PH_L\),
\(ow'' = ow \cdot SW + kw \cdot (DW + 1) - PW_L\),
\(OH = \left\lfloor{\frac{IH - DKH + PH_L + PH_R}{SH}} \right\rfloor + 1,\) where \(DKH = 1 + (KH - 1) \cdot (DH + 1)\), and
\(OW = \left\lfloor{\frac{IW - DKW + PW_L + PW_R}{SW}} \right\rfloor + 1,\) where \(DKW = 1 + (KW - 1) \cdot (DW + 1)\).
Deconvolution (Transposed Convolution)¶
Deconvolutions (also called fractionally-strided convolutions or transposed convolutions) can be defined by swapping the forward and backward passes of a convolution. One way to put it is to note that the weights define a convolution, but whether it is a direct convolution or a transposed convolution is determined by how the forward and backward passes are computed.
Difference Between Forward Training and Forward Inference¶
There is no difference between the forward_training
and forward_inference
propagation kinds.
Backward¶
The backward propagation computes \(\diffsrc\) based on \(\diffdst\) and \(\weights\).
The weights update computes \(\diffweights\) and \(\diffbias\) based on \(\diffdst\) and \(\src\).
Note
The optimized memory formats \(\src\) and \(\weights\) might be different on forward propagation, backward propagation, and weights update.
Execution Arguments¶
When executed, the inputs and outputs should be mapped to an execution argument index as specified by the following table.
Primitive input/output |
Execution argument index |
---|---|
\(\src\) |
|
\(\weights\) |
|
\(\bias\) |
|
\(\dst\) |
|
\(\diffsrc\) |
|
\(\diffweights\) |
|
\(\diffbias\) |
|
\(\diffdst\) |
Operation Details¶
N/A
Data Types Support¶
Convolution primitive supports the following combination of data types for source, destination, and weights memory objects.
Note
Here we abbreviate data types names for readability. For example, dnnl::memory::data_type::f32
is
abbreviated to f32
.
Propagation |
Source |
Weights |
Destination |
Bias |
---|---|---|---|---|
forward / backward |
||||
forward |
||||
forward |
||||
forward |
||||
backward |
||||
weights update |
Data Representation¶
Like other CNN primitives, the convolution primitive expects the following tensors:
Spatial |
Source / Destination |
Weights |
---|---|---|
1D |
\(N \times C \times W\) |
\([G \times ] OC \times IC \times KW\) |
2D |
\(N \times C \times H \times W\) |
\([G \times ] OC \times IC \times KH \times KW\) |
3D |
\(N \times C \times D \times H \times W\) |
\([G \times ] OC \times IC \times KD \times KH \times KW\) |
Memory format of data and weights memory objects is critical for convolution
primitive performance. In the oneDNN programming model, convolution is one of
the few primitives that support the placeholder memory format tag any
and
can define data and weight memory objects format based on the primitive
parameters. When using any
it is necessary to first create a convolution
primitive descriptor and then query it for the actual data and weight memory
objects formats.
While convolution primitives can be created with memory formats specified explicitly, the performance is likely to be suboptimal.
The table below shows the combinations for which plain memory formats the convolution primitive is optimized for.
Spatial
|
Convolution Type
|
Data /
Weights logical tensor
|
Implementation optimized
for memory formats
|
1D, 2D, 3D |
optimized |
||
1D |
f32, bf16 |
NCW / OIW, GOIW |
|
1D |
f32, bf16 |
NCW / OIW, GOIW |
|
1D |
int8 |
NCW / OIW |
|
2D |
f32, bf16 |
NCHW / OIHW, GOIHW |
|
2D |
f32, bf16 |
NCHW / OIHW, GOIHW |
|
2D |
int8 |
NCHW / OIHW, GOIHW |
|
3D |
f32, bf16 |
NCDHW / OIDHW, GOIDHW |
|
3D |
f32, bf16 |
NCDHW / OIDHW, GOIDHW |
|
3D |
int8 |
NCDHW / OIDHW |
Post-ops and Attributes¶
Post-ops and attributes enable you to modify the behavior of the convolution primitive by applying the output scale to the result of the primitive and by chaining certain operations after the primitive. The following attributes and post-ops are supported:
Propagation |
Type |
Operation |
Description |
Restrictions |
---|---|---|---|---|
forward |
attribute |
Scales the result of convolution by given scale factor(s) |
int8 convolutions only |
|
forward |
post-op |
Applies an elementwise operation to the result |
||
forward |
post-op |
Adds the operation result to the destination tensor instead of overwriting it |
The primitive supports dynamic quantization via run-time output scales. That
means a user could configure attributes with output scales set to the
DNNL_RUNTIME_F32_VAL
wildcard value instead of the actual scales,
if the scales are not known at the primitive descriptor creation stage. In
this case, the user must provide the scales as an additional input memory
object with argument DNNL_ARG_ATTR_OUTPUT_SCALES
during the
execution stage.
Note
The library does not prevent using post-ops in training, but note that not
all post-ops are feasible for training usage. For instance, using ReLU with
non-zero negative slope parameter as a post-op would not produce an
additional output workspace
that is required to compute backward
propagation correctly. Hence, in this particular case one should use
separate convolution and eltwise primitives for training.
The following post-ops chaining should be supported by the library:
Type of convolutions |
Post-ops sequence supported |
---|---|
f32 and bf16 convolution |
eltwise, sum, sum -> eltwise |
int8 convolution |
eltwise, sum, sum -> eltwise, eltwise -> sum |
The attributes and post-ops take effect in the following sequence:
Output scale attribute,
Post-ops, in order they were attached.
The operations during attributes and post-ops applying are done in single precision floating point data type. The conversion to the actual destination data type happens just before the actual storing.
Example 1¶
Consider the following pseudo code:
attribute attr;
attr.set_output_scale(alpha);
attr.set_post_ops({
{ sum={scale=beta} },
{ eltwise={scale=gamma, type=tanh, alpha=ignore, beta=ignored }
});
convolution_forward(src, weights, dst, attr)
The would lead to the following:
Example 2¶
The following pseudo code:
attribute attr;
attr.set_output_scale(alpha);
attr.set_post_ops({
{ eltwise={scale=gamma, type=relu, alpha=eta, beta=ignored }
{ sum={scale=beta} },
});
convolution_forward(src, weights, dst, attr)
That would lead to the following:
Algorithms¶
oneDNN implementations may implement convolution primitives using several different algorithms which can be chosen by the user.
Direct (
dnnl::algorithm::convolution_direct
). The convolution operation is computed directly using SIMD instructions. This also includes implicit GEMM formulations which notably may require workspace.Winograd (
dnnl::algorithm::convolution_winograd
). This algorithm reduces computational complexity of convolution at the expense of accuracy loss and additional memory operations. The implementation is based on the Fast Algorithms for Convolutional Neural Networks by A. Lavin and S. Gray. The Winograd algorithm often results in the best performance, but it is applicable only to particular shapes. Moreover, Winograd only supports int8 and f32 data types.Auto (
dnnl::algorithm::convolution_auto
). In this case the library should automatically select the best algorithm based on the heuristics that take into account tensor shapes and the number of logical processors available.
API¶
-
struct dnnl::convolution_forward : public dnnl::primitive¶
Convolution forward propagation primitive.
Public Functions
-
convolution_forward()¶
Default constructor. Produces an empty object.
-
convolution_forward(const primitive_desc &pd)¶
Constructs a convolution forward propagation primitive.
- Parameters
pd – Primitive descriptor for a convolution forward propagation primitive.
-
struct desc¶
Descriptor for a convolution forward propagation primitive.
Public Functions
-
desc(prop_kind aprop_kind, algorithm aalgorithm, 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 convolution forward propagation primitive with bias.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 – 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(prop_kind aprop_kind, algorithm aalgorithm, 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 convolution forward propagation primitive without bias.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
src_desc – Source memory descriptor.
weights_desc – Weights memory descriptor.
dst_desc – 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(prop_kind aprop_kind, algorithm aalgorithm, 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 convolution forward propagation primitive with bias.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 – 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(prop_kind aprop_kind, algorithm aalgorithm, 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 convolution forward propagation primitive without bias.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
src_desc – Source memory descriptor.
weights_desc – Weights memory descriptor.
dst_desc – 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(prop_kind aprop_kind, algorithm aalgorithm, 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)¶
-
struct primitive_desc : public dnnl::primitive_desc¶
Primitive descriptor for a convolution forward propagation primitive.
Public Functions
-
primitive_desc()¶
Default constructor. Produces an empty object.
-
primitive_desc(const desc &adesc, const engine &aengine, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution forward propagation primitive.
- Parameters
adesc – Descriptor for a convolution forward propagation primitive.
aengine – 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 &adesc, const primitive_attr &attr, const engine &aengine, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution forward propagation primitive.
- Parameters
adesc – Descriptor for a convolution forward propagation primitive.
aengine – 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.
- Returns
Source memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a source parameter.
-
memory::desc weights_desc() const¶
Returns a weights memory descriptor.
- Returns
Weights memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a weights parameter.
-
primitive_desc()¶
-
convolution_forward()¶
-
struct dnnl::convolution_backward_data : public dnnl::primitive¶
Convolution backward propagation primitive.
Public Functions
-
convolution_backward_data()¶
Default constructor. Produces an empty object.
-
convolution_backward_data(const primitive_desc &pd)¶
Constructs a convolution backward propagation primitive.
- Parameters
pd – Primitive descriptor for a convolution backward propagation primitive.
-
struct desc¶
Descriptor for a convolution backward propagation primitive.
Public Functions
-
desc(algorithm aalgorithm, 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 convolution backward propagation primitive.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 aalgorithm, 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 dilated convolution backward propagation primitive.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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)
.
-
desc(algorithm aalgorithm, 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)¶
-
struct primitive_desc : public dnnl::primitive_desc¶
Primitive descriptor for a convolution backward propagation primitive.
Public Functions
-
primitive_desc()¶
Default constructor. Produces an empty object.
-
primitive_desc(const desc &adesc, const engine &aengine, const convolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution backward propagation primitive.
- Parameters
adesc – Descriptor for a convolution backward propagation primitive.
aengine – Engine to perform the operation on.
hint_fwd_pd – Primitive descriptor for a convolution 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 &adesc, const primitive_attr &attr, const engine &aengine, const convolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution backward propagation primitive.
- Parameters
adesc – Descriptor for a convolution backward propagation primitive.
aengine – Engine to perform the operation on.
attr – Primitive attributes to use.
hint_fwd_pd – Primitive descriptor for a convolution 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.
- Returns
Diff source memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a diff source memory with.
-
primitive_desc()¶
-
convolution_backward_data()¶
-
struct dnnl::convolution_backward_weights : public dnnl::primitive¶
Convolution weights gradient primitive.
Public Functions
-
convolution_backward_weights()¶
Default constructor. Produces an empty object.
-
convolution_backward_weights(const primitive_desc &pd)¶
Constructs a convolution weights gradient primitive.
- Parameters
pd – Primitive descriptor for a convolution weights gradient primitive.
-
struct desc¶
Descriptor for a convolution weights gradient primitive.
Public Functions
-
desc(algorithm aalgorithm, 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 convolution weights gradient primitive with bias.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 aalgorithm, 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 convolution weights gradient primitive without bias.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 aalgorithm, 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 convolution weights gradient primitive with bias.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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 aalgorithm, 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 convolution weights gradient primitive without bias.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – Convolution algorithm. Possible values are dnnl::algorithm::convolution_direct, dnnl::algorithm::convolution_winograd, and dnnl::algorithm::convolution_auto.
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)
.
-
desc(algorithm aalgorithm, 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)¶
-
struct primitive_desc : public dnnl::primitive_desc¶
Primitive descriptor for a convolution weights gradient primitive.
Public Functions
-
primitive_desc()¶
Default constructor. Produces an empty object.
-
primitive_desc(const desc &adesc, const engine &aengine, const convolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution weights gradient primitive.
- Parameters
adesc – Descriptor for a convolution weights gradient primitive.
aengine – Engine to use.
hint_fwd_pd – Primitive descriptor for a convolution 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 &adesc, const primitive_attr &attr, const engine &aengine, const convolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a convolution weights gradient primitive.
- Parameters
adesc – Descriptor for a convolution weights gradient primitive.
attr – Primitive attributes to use.
aengine – Engine to use.
hint_fwd_pd – Primitive descriptor for a convolution 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.
- Returns
Source memory descriptor.
- Returns
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.
- Returns
Diff weights memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a diff weights parameter.
-
primitive_desc()¶
-
convolution_backward_weights()¶
-
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 aprop_kind, algorithm aalgorithm, 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.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – 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.
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 aprop_kind, algorithm aalgorithm, 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.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – 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.
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 aprop_kind, algorithm aalgorithm, 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.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – 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 aprop_kind, algorithm aalgorithm, 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.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aprop_kind – Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.
aalgorithm – 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)
.
-
desc(prop_kind aprop_kind, algorithm aalgorithm, 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)¶
-
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 &adesc, const engine &aengine, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution forward propagation primitive.
- Parameters
adesc – Descriptor for a deconvolution forward propagation primitive.
aengine – 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 &adesc, const primitive_attr &attr, const engine &aengine, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution forward propagation primitive.
- Parameters
adesc – Descriptor for a deconvolution forward propagation primitive.
aengine – 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.
- Returns
Source memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a source parameter.
-
memory::desc weights_desc() const¶
Returns a weights memory descriptor.
- Returns
Weights memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a weights parameter.
-
primitive_desc()¶
-
deconvolution_forward()¶
-
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 aalgorithm, 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.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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 aalgorithm, 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.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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)
.
-
desc(algorithm aalgorithm, 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)¶
-
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 &adesc, const engine &aengine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution backward propagation primitive.
- Parameters
adesc – Descriptor for a deconvolution backward propagation primitive.
aengine – 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 &adesc, const primitive_attr &attr, const engine &aengine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution backward propagation primitive.
- Parameters
adesc – Descriptor for a deconvolution backward propagation primitive.
attr – Primitive attributes to use.
aengine – 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.
- Returns
Diff source memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a diff source memory with.
-
primitive_desc()¶
-
deconvolution_backward_data()¶
-
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 aalgorithm, 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.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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 aalgorithm, 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.
Arrays
strides
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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 aalgorithm, 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.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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 aalgorithm, 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.
Arrays
strides
,dilates
,padding_l
, andpadding_r
contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.Note
All the memory descriptors may be initialized with the dnnl::memory::format_tag::any value of
format_tag
.- Parameters
aalgorithm – 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)
.
-
desc(algorithm aalgorithm, 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)¶
-
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 &adesc, const engine &aengine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution weights update primitive.
- Parameters
adesc – Descriptor for a deconvolution weights gradient primitive.
aengine – 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 &adesc, const primitive_attr &attr, const engine &aengine, const deconvolution_forward::primitive_desc &hint_fwd_pd, bool allow_empty = false)¶
Constructs a primitive descriptor for a deconvolution weights update primitive.
- Parameters
adesc – Descriptor for a deconvolution weights gradient primitive.
attr – Primitive attributes to use.
aengine – 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.
- Returns
Source memory descriptor.
- Returns
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.
- Returns
Diff weights memory descriptor.
- Returns
A zero memory descriptor if the primitive does not have a diff weights parameter.
-
primitive_desc()¶
-
deconvolution_backward_weights()¶