TensorRT 10.7.0
|
A Scale layer in a network definition. More...
#include <NvInfer.h>
Public Member Functions | |
void | setMode (ScaleMode mode) noexcept |
Set the scale mode. More... | |
ScaleMode | getMode () const noexcept |
Get the scale mode. More... | |
void | setShift (Weights shift) noexcept |
Set the shift value. More... | |
Weights | getShift () const noexcept |
Get the shift value. More... | |
void | setScale (Weights scale) noexcept |
Set the scale value. More... | |
Weights | getScale () const noexcept |
Get the scale value. More... | |
void | setPower (Weights power) noexcept |
Set the power value. More... | |
Weights | getPower () const noexcept |
Get the power value. More... | |
int32_t | getChannelAxis () const noexcept |
Get the channel axis. More... | |
void | setChannelAxis (int32_t channelAxis) noexcept |
Set the channel axis. 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 | ~IScaleLayer () 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::VScaleLayer * | mImpl |
Protected Attributes inherited from nvinfer1::ILayer | |
apiv::VLayer * | mLayer |
A Scale layer in a network definition.
This layer applies a per-element computation to its input:
output
= (input*
scale
+ shift
)^ power
The coefficients can be applied on a per-tensor, per-channel, or per-element basis.
The output size is the same as the input size.
A scale layer may be used as an INT8 quantization node in a graph, if the output is constrained to INT8 and the input to FP32. Quantization rounds ties to even, and clamps to [-128, 127].
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
Get the channel axis.
The value is the index of the channel axis in the input tensor's dimensions. Scaling happens along the channel axis when ScaleMode::kCHANNEL is enabled.
|
inlinenoexcept |
Get the scale mode.
|
inlinenoexcept |
Get the power value.
|
inlinenoexcept |
Get the scale value.
|
inlinenoexcept |
Get the shift value.
|
inlinenoexcept |
Set the channel axis.
The value is the index of the channel axis in the input tensor's dimensions.
For ScaleMode::kCHANNEL, there can be distinct scale, shift, and power weights for each channel coordinate. For ScaleMode::kELEMENTWISE, there can be distinct scale, shift, and power weights for each combination of coordinates from the channel axis and axes after it.
For example, suppose the input tensor has dimensions [10,20,30,40] and the channel axis is 1. Let [n,c,h,w] denote an input coordinate. For ScaleMode::kCHANNEL, the scale, shift, and power weights are indexed by c. For ScaleMode::kELEMENTWISE, the scale, shift, and power weights are indexed by [c,h,w].
|
inlinenoexcept |
Set the scale mode.
|
inlinenoexcept |
Set the power value.
|
inlinenoexcept |
Set the scale value.
|
inlinenoexcept |
Set the shift value.
|
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