TensorRT
|
A tensor in a network definition. More...
#include <NvInfer.h>
Public Member Functions | |
virtual void | setName (const char *name)=0 |
Set the tensor name. More... | |
virtual const char * | getName () const =0 |
Get the tensor name. More... | |
virtual void | setDimensions (Dims dimensions)=0 |
Set the dimensions of a tensor. More... | |
virtual Dims | getDimensions () const =0 |
Get the dimensions of a tensor. More... | |
virtual void | setType (DataType type)=0 |
Set the data type of a tensor. More... | |
virtual DataType | getType () const =0 |
Get the data type of a tensor. More... | |
virtual bool | isNetworkInput () const =0 |
Whether the tensor is a network input. | |
virtual bool | isNetworkOutput () const =0 |
Whether the tensor is a network output. | |
virtual void | setBroadcastAcrossBatch (bool broadcastAcrossBatch)=0 |
Set whether to enable broadcast of tensor across the batch. More... | |
virtual bool | getBroadcastAcrossBatch () const =0 |
Check if tensor is broadcast across the batch. More... | |
virtual TensorLocation | getLocation () const =0 |
Get the storage location of a tensor. More... | |
virtual void | setLocation (TensorLocation location)=0 |
Set the storage location of a tensor. More... | |
A tensor in a network definition.
|
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.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get the tensor name.
|
pure virtual |
|
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.
broadcastAcrossBatch | Whether to enable broadcast of tensor across the batch. |
|
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.
dimensions | The dimensions of the tensor. |
|
pure virtual |
Set the storage location of a tensor.
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.
|
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.
name | The name. |
|
pure virtual |
Set the data type of a tensor.
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.