GroupNorm¶
General¶
The GroupNorm operation performs the following transformation of the input tensor:
The operation is applied per batch, per group of channels. The gamma and beta coefficients are the optional inputs to the model and need to be specified separately for each channel. The mean
and variance
are calculated for each group.
Operation attributes¶
Attribute Name |
Description |
Value Type |
Supported Values |
Required or Optional |
---|---|---|---|---|
Specifies the number of groups |
s64 |
between 1 and the number of channels |
Required |
|
Indicate whether to output mean and variance which can be later passed to backward op. |
bool |
|
Optional |
|
When set to True, this module has inputs |
bool |
|
Optional |
|
The constant to improve numerical stability. |
f32 |
Arbitrary positive f32 value, |
Optional |
|
Controls how to interpret the shape of |
string |
|
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 |
|
Required |
1 |
|
Optional |
2 |
|
Optional |
Note
gamma
is scaling for the normalized value. beta
is the bias added to the scaled normalized value. They are both 1D tensor with the same span as src’s channel axis and required if the attribute use_affine
is set to True.
Outputs¶
Index |
Argument Name |
Required or Optional |
---|---|---|
0 |
|
Required |
1 |
|
Optional |
2 |
|
Optional |
Note
Both mean
and variance
are required if the attribute keep_stats
is set to True
.
Supported data types¶
GroupNorm operation supports the following data type combinations.
Src / Dst |
Gamma / Beta / Mean / Variance |
---|---|
f32 |
f32 |
bf16 |
f32, bf16 |
f16 |
f32 |