TensorRT 10.4.0
|
A normalization layer in a network definition. More...
#include <NvInfer.h>
Public Member Functions | |
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... | |
void | setComputePrecision (DataType type) noexcept |
Set the compute precision of this layer. More... | |
DataType | getComputePrecision () const noexcept |
Get the compute precision of this layer. More... | |
Public Member Functions inherited from nvinfer1::ILayer | |
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... | |
void | setPrecision (DataType dataType) noexcept |
Set the preferred or required computational precision of this layer in a weakly-typed network. More... | |
DataType | getPrecision () const noexcept |
get the computational precision of this layer More... | |
bool | precisionIsSet () const noexcept |
whether the computational precision has been set for this layer More... | |
void | resetPrecision () noexcept |
reset the computational precision for this layer More... | |
void | setOutputType (int32_t index, DataType dataType) noexcept |
Set the output type of this layer in a weakly-typed network. More... | |
DataType | getOutputType (int32_t index) const noexcept |
get the output type of this layer More... | |
bool | outputTypeIsSet (int32_t index) const noexcept |
whether the output type has been set for this layer More... | |
void | resetOutputType (int32_t index) noexcept |
reset the output type for 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... | |
Protected Member Functions | |
virtual | ~INormalizationLayer () noexcept=default |
Protected Member Functions inherited from nvinfer1::ILayer | |
virtual | ~ILayer () noexcept=default |
Protected Member Functions inherited from nvinfer1::INoCopy | |
INoCopy ()=default | |
virtual | ~INoCopy ()=default |
INoCopy (INoCopy const &other)=delete | |
INoCopy & | operator= (INoCopy const &other)=delete |
INoCopy (INoCopy &&other)=delete | |
INoCopy & | operator= (INoCopy &&other)=delete |
Protected Attributes | |
apiv::VNormalizationLayer * | mImpl |
Protected Attributes inherited from nvinfer1::ILayer | |
apiv::VLayer * | mLayer |
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).
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
Get the axes value used for the normalization calculation.
|
inlinenoexcept |
Get the compute precision of this layer.
|
inlinenoexcept |
Get the epsilon value used for the normalization calculation.
|
inlinenoexcept |
Get the number of groups used to split the channels for the normalization calculation.
|
inlinenoexcept |
Set the reduction axes for the normalization calculation.
axesMask | The axes used for the normalization calculation. |
|
inlinenoexcept |
Set the compute precision of this layer.
type | The datatype used for the compute precision of this layer. |
The method is used to avoid overflow errors by controlling the normalization computation in mixed precision mode. The compute precision defaults to DataType::kFLOAT32. To override this default, use this method to set the desired compute precision.
For a weakly typed network:
Strongly typed network rejects calls to this method since the compute precision is typically controlled by casting the input tensors to the desired type.
Only DataType::kFLOAT32 and DataType::kHALF are valid types for type
.
|
inlinenoexcept |
Set the epsilon value used for the normalization calculation.
The default value of eps
is 1e-5F.
eps | The epsilon value used for the normalization calculation. |
|
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.
nbGroups
to a value that does not evenly divide into the number of channels of the input tensor.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.nbGroups | The number of groups to split the channels into for the normalization calculation. |
|
protected |
Copyright © 2024 NVIDIA Corporation
Privacy Policy |
Manage My Privacy |
Do Not Sell or Share My Data |
Terms of Service |
Accessibility |
Corporate Policies |
Product Security |
Contact