TensorRT 10.0.0
|
Generate a tensor according to a specified mode. More...
#include <NvInfer.h>
Public Member Functions | |
void | setDimensions (Dims const &dimensions) noexcept |
Set the output tensor's dimensions. More... | |
Dims | getDimensions () const noexcept |
Get the output tensor's dimensions. More... | |
void | setOperation (FillOperation op) noexcept |
Set the fill operation for the layer. More... | |
FillOperation | getOperation () const noexcept |
Get the fill operation for the layer. More... | |
void | setAlpha (double alpha) noexcept |
Set the alpha parameter. More... | |
double | getAlpha () const noexcept |
Get the value of alpha parameter. More... | |
void | setBeta (double beta) noexcept |
Set the beta parameter. More... | |
double | getBeta () const noexcept |
Get the value of beta parameter. More... | |
void | setAlphaInt64 (int64_t alpha) noexcept |
Set the alpha parameter with int64 datatype. More... | |
int64_t | getAlphaInt64 () const noexcept |
Get the value of alpha parameter with int64 datatype. More... | |
void | setBetaInt64 (int64_t beta) noexcept |
Set the beta parameter with int64 datatype. More... | |
int64_t | getBetaInt64 () const noexcept |
Get the value of beta parameter with int64 datatype. More... | |
bool | isAlphaBetaInt64 () const noexcept |
Return true if alpha/beta have type int64, false if they have type double. More... | |
void | setToType (DataType toType) noexcept |
Set the fill layer output type. More... | |
DataType | getToType () const noexcept |
Get the fill layer output type. More... | |
void | setInput (int32_t index, ITensor &tensor) noexcept |
Replace an input of this layer with a specific tensor. 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 | ~IFillLayer () 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::VFillLayer * | mImpl |
Protected Attributes inherited from nvinfer1::ILayer | |
apiv::VLayer * | mLayer |
Generate a tensor according to a specified mode.
The fill layer generates a tensor with values that are drawn from a random distribution or an affine function of their indices, as specified by the FillMode.
When an IFillLayer is initially added to a network, all of its parameters are static. Each parameter may be changed to dynamic by setting a corresponding input. A parameter is considered dynamic even if that input is the output of an IConstantLayer. The inputs for each parameter are:
The parameter Dimensions describes the shape of the output. If the Dimensions input is provided, it must be a 1D tensor of type Int32 or Int64 whose length is computable by constant folding.
The meanings of Alpha and Beta depend on the mode, as described in IFillLayer::setAlpha(), IFillLayer::setBeta(), and IFillLayer::setInput(). Parameters Alpha and Beta must both be static or both be dynamic.
An IFillLayer can produce a shape tensor if the following restrictions are met:
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
Get the value of alpha parameter.
If the second input is present and non-null, this function returns -1.0.
|
inlinenoexcept |
Get the value of alpha parameter with int64 datatype.
If the second input is present and non-null, this function returns -1.
|
inlinenoexcept |
Get the value of beta parameter.
If the third input is present and non-null, this function returns -1.0.
|
inlinenoexcept |
Get the value of beta parameter with int64 datatype.
If the third input is present and non-null, this function returns -1.0.
|
inlinenoexcept |
Get the output tensor's dimensions.
If the first input is present and non-null, this function returns a Dims with nbDims = -1.
|
inlinenoexcept |
Get the fill operation for the layer.
|
inlinenoexcept |
Get the fill layer output type.
|
inlinenoexcept |
Return true if alpha/beta have type int64, false if they have type double.
|
inlinenoexcept |
Set the alpha parameter.
alpha | has different meanings for each operator: |
Operation | Usage kLINSPACE | the start value, defaults to 0.0; kRANDOM_UNIFORM | the minimum value, defaults to 0.0; kRANDOM_NORMAL | the mean of the normal distribution, default is 0.0;
If input 1 exists, it is reset to null by this method.
|
inlinenoexcept |
Set the alpha parameter with int64 datatype.
alpha | has different meanings for each operator: |
Operation | Usage kLINSPACE | the start value, defaults to 0; kRANDOM_UNIFORM | the minimum value, defaults to 0; kRANDOM_NORMAL | the mean of the normal distribution, default is 0;
If a third input had been used to create this layer, that input is reset to null by this method.
|
inlinenoexcept |
Set the beta parameter.
beta | has different meanings for each operator: |
Operation | Usage kLINSPACE | the delta value, defaults to 1.0; kRANDOM_UNIFORM | the maximal value, defaults to 1.0; kRANDOM_NORMAL | the standard deviation of the normal distribution, default is 1.0;
If input 2 exists, it is reset to null by this method.
|
inlinenoexcept |
Set the beta parameter with int64 datatype.
beta | has different meanings for each operator: |
Operation | Usage kLINSPACE | the delta value, defaults to 1; kRANDOM_UNIFORM | the maximal value, defaults to 1; kRANDOM_NORMAL | the standard deviation of the normal distribution, default is 1;
If a third input had been used to create this layer, that input is reset to null by this method.
|
inlinenoexcept |
Set the output tensor's dimensions.
dimensions | The output tensor's dimensions. |
If the first input had been used to create this layer, that input is reset to null by this method.
|
inlinenoexcept |
Replace an input of this layer with a specific tensor.
index | the index of the input to set. |
tensor | the new input tensor |
The three inputs correspond to these setters of IFillLayer:
The following descriptions give more intuitive names for the inputs.
Indices for kLINSPACE are:
Indices for kRANDOM_UNIFORM are:
Indices for kRANDOM_NORMAL are:
Using the corresponding setter resets the input to null.
If either inputs 1 or 2 is non-null, then both must be non-null and have the same data type.
If this function is called for an index greater or equal to getNbInputs(), then afterwards getNbInputs() returns index + 1, and any missing intervening inputs are set to null.
|
inlinenoexcept |
Set the fill operation for the layer.
|
inlinenoexcept |
Set the fill layer output type.
toType | The DataType of the output tensor. |
Set the output type of the fill layer. Valid values are DataType::kFLOAT, DataType::kINT32, and DataType::kINT64. If the network is strongly typed, setToType must be used to set the output type, and use of setOutputType is an error. Otherwise, types passed to setOutputType and setToType must be the same.
|
protected |