Visible to Intel only — GUID: GUID-8CDE21DE-F324-4D82-94E9-EB54154F9D9E
Visible to Intel only — GUID: GUID-8CDE21DE-F324-4D82-94E9-EB54154F9D9E
Convolution
General
Convolution operation performs the convolution between src tensor and weight tensor, which is defined as by the following formulas. Variable names follow the standard Naming Conventions.
Let , and tensors have shape , , and respectively.
Furthermore, let the remaining convolution parameters be:
Parameter |
Depth |
Height |
Width |
Comment |
---|---|---|---|---|
Paddings: Front, top, and left |
In the attributes we use pads_begin to indicate the corresponding vector of paddings |
|||
Padding: Back, bottom, and right |
In the attributes we use pads_end to indicate the corresponding vector of paddings |
|||
Stride |
In the attributes we use strides to indicate the corresponding vector of strides |
|||
Dilation |
In the attributes we use dilations to indicate the corresponding vector of dilations |
To further simplify the formulas, we assume that the attribute data_format and weights_format are set to NCX and OIX respectively. NCX means the fist axis represents batch dimension, the second axis represents channel dimension and the rest represents spatial dimensions. OIX means the first axis represents output channel dimension, the second axis represents input channel dimension and the rest represents weights spatial dimensions.
Regular Convolution
This is the same as the formula in Convolution primitive.
Here:
Convolution with Groups
The attribute groups is set to .
where
,
, and
Convolution with Dilation
The attribute dilation contains the element which is .
Here:
where , and
where .
Operation attributes
Attribute Name |
Description |
Value Type |
Supported Values |
Required or Optional |
---|---|---|---|---|
Controls the strides the weights tensor is moved when computing convolution |
s64 |
A s64 list containing positive values |
Required |
|
Controls number of zeros to be add to the front/top/left of spatial dimensions |
s64 |
A s64 list containing non-negative values |
Required |
|
Controls number of zeros to be add to the back/bottom/right of spatial dimensions |
s64 |
A s64 list containing non-negative values |
Required |
|
Controls the amount of stretching the kernel before convolution ( visualization link ) |
s64 |
A s64 list containing positive values (>1 means dilated convolution) |
Required |
|
Controls how the padding is calculated |
string |
none (default), same_upper , same_lower , valid |
Optional |
|
Controls how input channels and output channels are divided into |
s64 |
A positive s64 value, 1 by default |
Optional |
|
Controls how to interpret the shape of src and dst . |
string |
NCX , NXC (default) |
Optional |
|
Controls how to interpret the shape of weights |
string |
OIX , XIO (default) |
Optional |
Execution arguments
The inputs and outputs must be provided according to below index order when constructing an operation.
Inputs
Index |
Argument Name |
Required or Optional |
---|---|---|
0 |
src |
Required |
1 |
weights |
Required |
2 |
bias |
Optional |
Outputs
Index |
Argument Name |
Required or Optional |
---|---|---|
0 |
dst |
Required |
Supported data types
Convolution operation supports the following data type combinations.
Src |
Weights |
Bias |
Dst |
---|---|---|---|
f32 |
f32 |
f32 |
f32 |
bf16 |
bf16 |
bf16 |
bf16 |
f16 |
f16 |
f16 |
f16 |