Layer type for pluginV2.
More...
Layer type for pluginV2.
- See also
- IPluginV2
- Warning
- Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
◆ ~IPluginV2Layer()
virtual nvinfer1::IPluginV2Layer::~IPluginV2Layer |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ getPlugin()
virtual IPluginV2& nvinfer1::IPluginV2Layer::getPlugin |
( |
| ) |
|
|
pure virtual |
Get the plugin for the layer.
- See also
- IPluginV2
◆ getType()
virtual LayerType nvinfer1::ILayer::getType |
( |
| ) |
const |
|
pure virtualinherited |
Return the type of a layer.
- See also
- LayerType
◆ setName()
virtual void nvinfer1::ILayer::setName |
( |
const char * |
name | ) |
|
|
pure virtualinherited |
Set the name of a layer.
This method copies the name string.
- See also
- getName()
◆ getName()
virtual const char* nvinfer1::ILayer::getName |
( |
| ) |
const |
|
pure virtualinherited |
Return the name of a layer.
- See also
- setName()
◆ getNbInputs()
virtual int32_t nvinfer1::ILayer::getNbInputs |
( |
| ) |
const |
|
pure virtualinherited |
Get the number of inputs of a layer.
◆ getInput()
virtual ITensor* nvinfer1::ILayer::getInput |
( |
int32_t |
index | ) |
const |
|
pure virtualinherited |
Get the layer input corresponding to the given index.
- Parameters
-
index | The index of the input tensor. |
- Returns
- The input tensor, or nullptr if the index is out of range or the tensor is optional (ISliceLayer, IRNNLayer and IRNNv2Layer).
◆ getNbOutputs()
virtual int32_t nvinfer1::ILayer::getNbOutputs |
( |
| ) |
const |
|
pure virtualinherited |
Get the number of outputs of a layer.
◆ getOutput()
virtual ITensor* nvinfer1::ILayer::getOutput |
( |
int32_t |
index | ) |
const |
|
pure virtualinherited |
Get the layer output corresponding to the given index.
- Returns
- The indexed output tensor, or nullptr if the index is out of range or the tensor is optional (IRNNLayer and IRNNv2Layer).
◆ setInput()
virtual void nvinfer1::ILayer::setInput |
( |
int32_t |
index, |
|
|
ITensor & |
tensor |
|
) |
| |
|
pure virtualinherited |
◆ setPrecision()
virtual void nvinfer1::ILayer::setPrecision |
( |
DataType |
dataType | ) |
|
|
pure virtualinherited |
Set the computational precision of this layer.
Setting the precision allows TensorRT to choose implementation which run at this computational precision. Layer input type would also get inferred from layer computational precision. TensorRT could still choose a non-conforming fastest implementation ignoring set layer precision. Use BuilderFlag::kSTRICT_TYPES to force choose implementations with requested precision. In case no implementation is found with requested precision, TensorRT would choose available fastest implementation. If precision is not set, TensorRT will select the layer computational precision and layer input type based on performance considerations and the flags specified to the builder.
- Parameters
-
precision | the computational precision. |
- See also
- getPrecision() precisionIsSet() resetPrecision()
◆ getPrecision()
virtual DataType nvinfer1::ILayer::getPrecision |
( |
| ) |
const |
|
pure virtualinherited |
◆ precisionIsSet()
virtual bool nvinfer1::ILayer::precisionIsSet |
( |
| ) |
const |
|
pure virtualinherited |
◆ resetPrecision()
virtual void nvinfer1::ILayer::resetPrecision |
( |
| ) |
|
|
pure virtualinherited |
◆ setOutputType()
virtual void nvinfer1::ILayer::setOutputType |
( |
int32_t |
index, |
|
|
DataType |
dataType |
|
) |
| |
|
pure virtualinherited |
Set the output type of this layer.
Setting the output type constrains TensorRT to choose implementations which generate output data with the given type. If it is not set, TensorRT will select output type based on layer computational precision. TensorRT could still choose non-conforming output type based on fastest implementation. Use BuilderFlag::kSTRICT_TYPES to force choose requested output type. In case layer precision is not specified, output type would depend on chosen implementation based on performance considerations and the flags specified to the builder.
This method cannot be used to set the data type of the second output tensor of the TopK layer. The data type of the second output tensor of the topK layer is always Int32. Also the output type of all layers that are shape operations must be DataType::kINT32, and all attempts to set the output type to some other data type will be ignored except for issuing an error message.
Note that the layer output type is generally not identical to the data type of the output tensor, as TensorRT may insert implicit reformatting operations to convert the former to the latter. Calling layer->setOutputType(i, type) has no effect on the data type of the i-th output tensor of layer, and users need to call layer->getOutput(i)->setType(type) to change the tensor data type. This is particularly relevant if the tensor is marked as a network output, since only setType() [but not setOutputType()] will affect the data representation in the corresponding output binding.
- Parameters
-
index | the index of the output to set |
dataType | the type of the output |
- See also
- getOutputType() outputTypeIsSet() resetOutputType()
◆ getOutputType()
virtual DataType nvinfer1::ILayer::getOutputType |
( |
int32_t |
index | ) |
const |
|
pure virtualinherited |
◆ outputTypeIsSet()
virtual bool nvinfer1::ILayer::outputTypeIsSet |
( |
int32_t |
index | ) |
const |
|
pure virtualinherited |
◆ resetOutputType()
virtual void nvinfer1::ILayer::resetOutputType |
( |
int32_t |
index | ) |
|
|
pure virtualinherited |
The documentation for this class was generated from the following file: