# ConvolutionBackwardWeights¶

## General¶

ConvolutionBackwardWeights operation accepts $$\src$$, $$\diffdst$$ and optional weights shape as inputs, and compute the $$\diffweights$$.

## Operation attributes¶

Attribute Name

De

strides

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, the attribute will be ignored when auto_pad attribute is specified to same_upper , same_lower or valid .

s64

A s64 list containing non-negative values

Required

Controls number of zeros to be add to the back/bottom/right of spatial dimensions, the attribute will be ignored when auto_pad attribute is specified to same_upper , same_lower or valid .

s64

A s64 list containing non-negative values

Required

dilations

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

groups

Controls how input channels and output channels are divided into.

s64

A positive s64 value, 1 by default

Optional

data_format

Controls how to interpret the shape of src and dst .

string

NCX , NXC (default)

Optional

weights_format

Controls how to interpret the shape of weights .

string

OIX , XIO (default)

Optional

weights_shape

Denotes the shape of the weights tensor.

s64

A s64 list containing positive values

Optional

## Execution arguments¶

The inputs and outputs must be provided according to below index order when constructing an operation.

### Inputs¶

Index

Argu

0

src

Required

1

diff_dst

Required

2

weights_shape

Optional

Note

The shape of $$\weights$$ is $$(out\_channels, in\_channels / groups, spatial\_shape)$$ for OIX format or $$(spatial\_shape, in\_channels / groups, out\_channels)$$ for XIO format. Both $$in\_channels$$ and $$out\_channels$$ must be divisible by groups attribute.

Note Either weights_shape input or weights_shape attribute should be provided. If both provided, weights_shape input will precede over weights_shape attribute.

### Outputs¶

Index

Argu

0

diff_weights

Required

## Supported data types¶

ConvolutionBackwardWeights operation supports the following data type combinations.

Src

Diff_ds

f32

f32

f32

s32

bf16

bf16

bf16

s32

f16

f16

f16

s32