|
| void | setEpsilon (float eps) noexcept |
| | Set the epsilon value used for the normalization calculation. More...
|
| |
| float | getEpsilon () const noexcept |
| | Get the epsilon value used for the normalization calculation. More...
|
| |
| void | setAxes (uint32_t axesMask) noexcept |
| | Set the reduction axes for the normalization calculation. More...
|
| |
| uint32_t | getAxes () const noexcept |
| | Get the axes value used for the normalization calculation. More...
|
| |
| void | setNbGroups (int64_t nbGroups) noexcept |
| | Set the number of groups used to split the channels in the normalization calculation. More...
|
| |
| int64_t | getNbGroups () const noexcept |
| | Get the number of groups used to split the channels for the normalization calculation. More...
|
| |
| TRT_NODISCARD bool | isV2 () const noexcept |
| | Returns true if this layer was created through addNormalizationV2(). More...
|
| |
| LayerType | getType () const noexcept |
| | Return the type of a layer. More...
|
| |
| void | setName (char const *name) noexcept |
| | Set the name of a layer. More...
|
| |
| char const * | getName () const noexcept |
| | Return the name of a layer. More...
|
| |
| int32_t | getNbInputs () const noexcept |
| | Get the number of inputs of a layer. More...
|
| |
| ITensor * | getInput (int32_t index) const noexcept |
| | Get the layer input corresponding to the given index. More...
|
| |
| int32_t | getNbOutputs () const noexcept |
| | Get the number of outputs of a layer. More...
|
| |
| ITensor * | getOutput (int32_t index) const noexcept |
| | Get the layer output corresponding to the given index. More...
|
| |
| void | setInput (int32_t index, ITensor &tensor) noexcept |
| | Replace an input of this layer with a specific tensor. More...
|
| |
| DataType | getOutputType (int32_t index) const noexcept |
| | get the output type of this layer More...
|
| |
| void | setMetadata (char const *metadata) noexcept |
| | Set the metadata for this layer. More...
|
| |
| char const * | getMetadata () const noexcept |
| | Get the metadata of the layer. More...
|
| |
| bool | setNbRanks (int32_t nbRanks) noexcept |
| | Set the number of ranks for multi-device execution. More...
|
| |
| int32_t | getNbRanks () const noexcept |
| | Get the number of ranks for multi-device execution. More...
|
| |
A normalization layer in a network definition.
The normalization layer performs the following operation:
X - input Tensor Y - output Tensor S - scale Tensor B - bias Tensor
Y = (X - Mean(X, axes)) / Sqrt(Variance(X) + epsilon) * S + B
Where Mean(X, axes) is a reduction over a set of axes, and Variance(X) = Mean((X - Mean(X, axes)) ^ 2, axes).
- Warning
- Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
| void nvinfer1::INormalizationLayer::setNbGroups |
( |
int64_t |
nbGroups | ) |
|
|
inlinenoexcept |
Set the number of groups used to split the channels in the normalization calculation.
The input tensor channels are divided into nbGroups groups, and normalization is performed per group. The channel dimension is considered to be the second dimension in a [N, C, H, W, ...] formatted tensor.
The default nbGroups is 1.
- Warning
- It is an error to set
nbGroups to a value that does not evenly divide into the number of channels of the input tensor.
-
When
nbGroups is != 1, it is expected that the provided axesMask will have all bits corresponding to dimensions after the channel dimension set to 1, with all other bits set to 0.
- Parameters
-
| nbGroups | The number of groups to split the channels into for the normalization calculation. |