A tensor in a network definition.
More...
#include <NvInfer.h>
A tensor in a network definition.
to remove a tensor from a network definition, use INetworkDefinition::removeTensor()
- Warning
- Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
virtual bool nvinfer1::ITensor::dynamicRangeIsSet |
( |
| ) |
const |
|
pure virtual |
Query whether dynamic range is set.
- Returns
- True if dynamic range is set, false otherwise.
virtual bool nvinfer1::ITensor::getBroadcastAcrossBatch |
( |
| ) |
const |
|
pure virtual |
Check if tensor is broadcast across the batch.
When a tensor is broadcast across a batch, it has the same value for every member in the batch. Memory is only allocated once for the single member.
- Returns
- True if tensor is broadcast across the batch, false otherwise.
- See Also
- setBroadcastAcrossBatch()
virtual Dims nvinfer1::ITensor::getDimensions |
( |
| ) |
const |
|
pure virtual |
Get the dimensions of a tensor.
- Returns
- The dimensions of the tensor.
- See Also
- setDimensions()
virtual float nvinfer1::ITensor::getDynamicRange |
( |
| ) |
const |
|
pure virtual |
Get dynamic range for the tensor.
- Returns
- maximal absolute value of the dynamic range, -1.0f if no dynamic range is set.
- Deprecated:
- This interface is superceded by getDynamicRangeMin and getDynamicRangeMax.
virtual float nvinfer1::ITensor::getDynamicRangeMax |
( |
| ) |
const |
|
pure virtual |
Get maximum of dynamic range.
- Returns
- Maximum of dynamic range, or quiet NaN if range was not set.
virtual float nvinfer1::ITensor::getDynamicRangeMin |
( |
| ) |
const |
|
pure virtual |
Get minimum of dynamic range.
- Returns
- Minimum of dynamic range, or quiet NaN if range was not set.
Get the storage location of a tensor.
- Returns
- The location of tensor data.
- See Also
- setLocation()
virtual const char* nvinfer1::ITensor::getName |
( |
| ) |
const |
|
pure virtual |
Get the tensor name.
- Returns
- The name, as a pointer to a NULL-terminated character sequence.
- See Also
- setName()
virtual DataType nvinfer1::ITensor::getType |
( |
| ) |
const |
|
pure virtual |
Get the data type of a tensor.
- Returns
- The data type of the tensor.
- See Also
- setType()
virtual void nvinfer1::ITensor::setBroadcastAcrossBatch |
( |
bool |
broadcastAcrossBatch | ) |
|
|
pure virtual |
Set whether to enable broadcast of tensor across the batch.
When a tensor is broadcast across a batch, it has the same value for every member in the batch. Memory is only allocated once for the single member.
This method is only valid for network input tensors, since the flags of layer output tensors are inferred based on layer inputs and parameters. If this state is modified for a tensor in the network, the states of all dependent tensors will be recomputed.
- Parameters
-
broadcastAcrossBatch | Whether to enable broadcast of tensor across the batch. |
- See Also
- getBroadcastAcrossBatch()
virtual void nvinfer1::ITensor::setDimensions |
( |
Dims |
dimensions | ) |
|
|
pure virtual |
Set the dimensions of a tensor.
For a network input the name is assigned by the application. For a network output it is computed based on the layer parameters and the inputs to the layer. If a tensor size or a parameter is modified in the network, the dimensions of all dependent tensors will be recomputed.
This call is only legal for network input tensors, since the dimensions of layer output tensors are inferred based on layer inputs and parameters.
- Parameters
-
dimensions | The dimensions of the tensor. |
- See Also
- getDimensions()
virtual bool nvinfer1::ITensor::setDynamicRange |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
|
pure virtual |
Set dynamic range for the tensor.
Currently, only symmetric ranges are supported. Therefore, the larger of the absolute values of the provided bounds is used.
- Returns
- Whether the dynamic range was set successfully.
Requires that min and max be finite, and min <= max.
virtual void nvinfer1::ITensor::setLocation |
( |
TensorLocation |
location | ) |
|
|
pure virtual |
Set the storage location of a tensor.
- Parameters
-
location | the location of tensor data |
Only input tensors for storing sequence lengths for RNNv2 are supported. Using host storage for layers that do not support it will generate errors at build time.
- See Also
- getLocation()
virtual void nvinfer1::ITensor::setName |
( |
const char * |
name | ) |
|
|
pure virtual |
Set the tensor name.
For a network input, the name is assigned by the application. For tensors which are layer outputs, a default name is assigned consisting of the layer name followed by the index of the output in brackets.
This method copies the name string.
- Parameters
-
- See Also
- getName()
virtual void nvinfer1::ITensor::setType |
( |
DataType |
type | ) |
|
|
pure virtual |
Set the data type of a tensor.
- Parameters
-
type | The data type of the tensor. |
The type is unchanged if the type is invalid for the given tensor.
If the tensor is a network input or output, then the tensor type cannot be DataType::kINT8.
- See Also
- getType()
The documentation for this class was generated from the following file: