Go to the documentation of this file.
134 :
Dims2(height, width)
144 int&
h() {
return d[0]; }
151 int h()
const {
return d[0]; }
158 int&
w() {
return d[1]; }
165 int w()
const {
return d[1]; }
181 d[0] =
d[1] =
d[2] = 0;
227 :
Dims3(channels, height, width)
238 int&
c() {
return d[0]; }
245 int c()
const {
return d[0]; }
252 int&
h() {
return d[1]; }
259 int h()
const {
return d[1]; }
266 int&
w() {
return d[2]; }
273 int w()
const {
return d[2]; }
289 d[0] =
d[1] =
d[2] =
d[3] = 0;
300 Dims4(
int d0,
int d1,
int d2,
int d3)
338 DimsNCHW(
int batchSize,
int channels,
int height,
int width)
339 :
Dims4(batchSize, channels, height, width)
351 int&
n() {
return d[0]; }
358 int n()
const {
return d[0]; }
365 int&
c() {
return d[1]; }
372 int c()
const {
return d[1]; }
379 int&
h() {
return d[2]; }
386 int h()
const {
return d[2]; }
393 int&
w() {
return d[3]; }
400 int w()
const {
return d[3]; }
482 virtual void setName(
const char* name) TRTNOEXCEPT = 0;
491 virtual const char*
getName()
const TRTNOEXCEPT = 0;
748 virtual void setName(
const char* name) TRTNOEXCEPT = 0;
756 virtual const char*
getName()
const TRTNOEXCEPT = 0;
1255 virtual void setNbGroups(
int nbGroups) TRTNOEXCEPT = 0;
1631 virtual void setAlpha(
float alpha) TRTNOEXCEPT = 0;
1642 virtual void setBeta(
float beta) TRTNOEXCEPT = 0;
1648 virtual float getAlpha()
const TRTNOEXCEPT = 0;
1654 virtual float getBeta()
const TRTNOEXCEPT = 0;
1666 kMAX_AVERAGE_BLEND = 2
1972 virtual void setAlpha(
float alpha) TRTNOEXCEPT = 0;
1979 virtual float getAlpha()
const TRTNOEXCEPT = 0;
1987 virtual void setBeta(
float beta) TRTNOEXCEPT = 0;
1994 virtual float getBeta()
const TRTNOEXCEPT = 0;
2002 virtual void setK(
float k) TRTNOEXCEPT = 0;
2009 virtual float getK()
const TRTNOEXCEPT = 0;
2178 virtual void setAxes(uint32_t axes) TRTNOEXCEPT = 0;
2185 virtual uint32_t
getAxes()
const TRTNOEXCEPT = 0;
2215 virtual void setAxis(
int axis) TRTNOEXCEPT = 0;
2222 virtual int getAxis()
const TRTNOEXCEPT = 0;
2340 virtual void setNbGroups(
int nbGroups) TRTNOEXCEPT = 0;
2817 virtual unsigned getLayerCount()
const TRTNOEXCEPT = 0;
2827 virtual std::size_t getHiddenSize()
const TRTNOEXCEPT = 0;
2837 virtual int getSeqLength()
const TRTNOEXCEPT = 0;
2844 virtual void setOperation(
RNNOperation op) TRTNOEXCEPT = 0;
2851 virtual RNNOperation getOperation()
const TRTNOEXCEPT = 0;
2858 virtual void setInputMode(
RNNInputMode op) TRTNOEXCEPT = 0;
2865 virtual RNNInputMode getInputMode()
const TRTNOEXCEPT = 0;
2878 virtual void setDirection(
RNNDirection op) TRTNOEXCEPT = 0;
2885 virtual RNNDirection getDirection()
const TRTNOEXCEPT = 0;
3001 virtual void setWeights(
Weights weights) TRTNOEXCEPT = 0;
3008 virtual Weights getWeights()
const TRTNOEXCEPT = 0;
3061 virtual void setBias(
Weights bias) TRTNOEXCEPT = 0;
3068 virtual Weights getBias()
const TRTNOEXCEPT = 0;
3076 virtual int getDataLength()
const TRTNOEXCEPT = 0;
3095 virtual void setHiddenState(
ITensor& hidden) TRTNOEXCEPT = 0;
3102 virtual ITensor* getHiddenState()
const TRTNOEXCEPT = 0;
3123 virtual void setCellState(
ITensor& cell) TRTNOEXCEPT = 0;
3130 virtual ITensor* getCellState()
const TRTNOEXCEPT = 0;
3172 virtual int32_t getLayerCount()
const TRTNOEXCEPT = 0;
3173 virtual int32_t getHiddenSize()
const TRTNOEXCEPT = 0;
3174 virtual int32_t getMaxSeqLength()
const TRTNOEXCEPT = 0;
3175 virtual int32_t getDataLength()
const TRTNOEXCEPT = 0;
3381 virtual IPlugin& getPlugin() TRTNOEXCEPT = 0;
3538 virtual void setReduceAxes(uint32_t reduceAxes) TRTNOEXCEPT = 0;
4036 virtual void setK(
int k) TRTNOEXCEPT = 0;
4043 virtual int getK()
const TRTNOEXCEPT = 0;
4050 virtual void setReduceAxes(uint32_t reduceAxes) TRTNOEXCEPT = 0;
4148 TRT_DEPRECATED
virtual void setTranspose(
int index,
bool val) TRTNOEXCEPT = 0;
4157 TRT_DEPRECATED
virtual bool getTranspose(
int index)
const TRTNOEXCEPT = 0;
4342 virtual void setScales(
const float* scales,
int nbScales) TRTNOEXCEPT = 0;
4358 virtual int getScales(
int size,
float* scales)
const TRTNOEXCEPT = 0;
4508 virtual LoopOutput getLoopOutput()
const noexcept = 0;
4522 virtual void setAxis(
int axis) noexcept = 0;
4525 virtual int getAxis()
const noexcept = 0;
4553 virtual TripLimit getTripLimit()
const noexcept = 0;
4560 virtual void setAxis(
int axis) noexcept = 0;
4563 virtual int getAxis()
const noexcept = 0;
4570 virtual void setReverse(
bool reverse) noexcept = 0;
4573 virtual bool getReverse()
const noexcept = 0;
4636 virtual void setName(
const char* name) noexcept = 0;
4643 virtual const char*
getName()
const noexcept = 0;
4748 virtual void setAlpha(
double alpha) noexcept = 0;
4760 virtual double getAlpha()
const noexcept = 0;
4775 virtual void setBeta(
double beta) noexcept = 0;
4787 virtual double getBeta()
const noexcept = 0;
5123 TRT_DEPRECATED
virtual IRNNLayer*
addRNN(
ITensor& inputs,
int layerCount, std::size_t hiddenSize,
int maxSeqLen,
5143 ITensor*
const* inputs,
int nbInputs,
IPlugin& plugin) TRTNOEXCEPT = 0;
5337 virtual void destroy() TRTNOEXCEPT = 0;
5460 ITensor& input0,
bool transpose0,
ITensor& input1,
bool transpose1) TRTNOEXCEPT = 0;
5546 ITensor& input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen,
RNNOperation op) TRTNOEXCEPT = 0;
5650 virtual void setName(
const char* name) TRTNOEXCEPT = 0;
5661 virtual const char*
getName()
const TRTNOEXCEPT = 0;
5896 kLEGACY_CALIBRATION = 0,
5897 kENTROPY_CALIBRATION = 1,
5898 kENTROPY_CALIBRATION_2 = 2,
5899 kMINMAX_CALIBRATION = 3,
5942 virtual bool getBatch(
void* bindings[],
const char* names[],
int nbBindings) TRTNOEXCEPT = 0;
6043 virtual double getQuantile() const TRTNOEXCEPT = 0;
6134 virtual int64_t
getTactic()
const TRTNOEXCEPT = 0;
6155 virtual const char*
getName()
const TRTNOEXCEPT = 0;
6168 virtual int32_t
getNbInputs()
const TRTNOEXCEPT = 0;
6243 int32_t nbChoices, int32_t* selection) TRTNOEXCEPT = 0;
6255 int32_t nbAlgorithms) TRTNOEXCEPT = 0;
6594 virtual void setDLACore(
int dlaCore) TRTNOEXCEPT = 0;
6602 virtual int getDLACore()
const TRTNOEXCEPT = 0;
6623 virtual void reset() TRTNOEXCEPT = 0;
6630 virtual void destroy() TRTNOEXCEPT = 0;
6772 constexpr
inline int EnumMax<NetworkDefinitionCreationFlag>()
6830 TRT_DEPRECATED
virtual void setMaxWorkspaceSize(std::size_t workspaceSize) TRTNOEXCEPT = 0;
6855 TRT_DEPRECATED
virtual void setHalf2Mode(
bool mode) TRTNOEXCEPT = 0;
6864 TRT_DEPRECATED
virtual bool getHalf2Mode()
const TRTNOEXCEPT = 0;
6874 TRT_DEPRECATED
virtual void setDebugSync(
bool sync) TRTNOEXCEPT = 0;
6883 TRT_DEPRECATED
virtual bool getDebugSync()
const TRTNOEXCEPT = 0;
6950 virtual void destroy() TRTNOEXCEPT = 0;
6963 TRT_DEPRECATED
virtual void setInt8Mode(
bool mode) TRTNOEXCEPT = 0;
6972 TRT_DEPRECATED
virtual bool getInt8Mode()
const TRTNOEXCEPT = 0;
7027 TRT_DEPRECATED
virtual bool canRunOnDLA(
const ILayer* layer)
const TRTNOEXCEPT = 0;
7063 TRT_DEPRECATED
virtual void allowGPUFallback(
bool setFallBackMode) TRTNOEXCEPT = 0;
7080 TRT_DEPRECATED
virtual void setDLACore(
int dlaCore) TRTNOEXCEPT = 0;
7088 TRT_DEPRECATED
virtual int getDLACore()
const TRTNOEXCEPT = 0;
7127 TRT_DEPRECATED
virtual void setFp16Mode(
bool mode) TRTNOEXCEPT = 0;
7136 TRT_DEPRECATED
virtual bool getFp16Mode()
const TRTNOEXCEPT = 0;
7172 TRT_DEPRECATED
virtual void setRefittable(
bool canRefit) TRTNOEXCEPT = 0;
7181 TRT_DEPRECATED
virtual bool getRefittable()
const TRTNOEXCEPT = 0;
7270 virtual void reset() TRTNOEXCEPT = 0;
7284 extern "C" TENSORRTAPI
void* createInferBuilder_INTERNAL(
void* logger,
int version);
7299 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
virtual void reportAlgorithms(const IAlgorithmContext *const *algoContexts, const IAlgorithm *const *algoChoices, int32_t nbAlgorithms)=0
Called by TensorRT to report choices it made.
virtual float getBeta() const =0
Get the beta parameter.
virtual int getNbGroups() const =0
Get the number of groups for a deconvolution.
int w() const
Get the width.
Definition: NvInfer.h:165
virtual TRT_DEPRECATED int getAverageFindIterations() const =0
Query the number of averaging iterations.
virtual TRT_DEPRECATED void setHalf2Mode(bool mode)=0
Set whether half2 mode is used.
virtual const IAlgorithmIOInfo & getAlgorithmIOInfo(int32_t index) const =0
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Dims3()
Construct an empty Dims3 object.
Definition: NvInfer.h:178
virtual TensorLocation getLocation() const =0
Get the storage location of a tensor.
virtual float getDynamicRangeMax() const =0
Get maximum of dynamic range.
Use explicit padding, rounding output size up.
virtual TRT_DEPRECATED void setKernelSize(DimsHW kernelSize)=0
Set the HW kernel size of the convolution.
virtual TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator)=0
Set Int8 Calibration interface.
int & h()
Get the height.
Definition: NvInfer.h:379
virtual void setProfileStream(const cudaStream_t stream)=0
Set the cudaStream that is used to profile this network.
virtual TRT_DEPRECATED void setDilation(DimsHW dilation)=0
Set the dilation for a convolution.
virtual ILoop * addLoop() noexcept=0
Add a loop to the network.
virtual IPluginV2 & getPlugin()=0
Get the plugin for the layer.
Output value is concatenation of values of tensor for each iteration, in reverse order.
virtual Dims getSize() const =0
Get dimensions of the output slice.
virtual TRT_DEPRECATED bool canRunOnDLA(const ILayer *layer) const =0
Checks if a layer can run on DLA.
virtual void setMaxBatchSize(int batchSize)=0
Set the maximum batch size.
virtual TRT_DEPRECATED void setDeviceType(ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
ActivationType
Forward declare IGpuAllocator for use in other interfaces.
Definition: NvInferRuntimeCommon.h:133
virtual void setErrorRecorder(IErrorRecorder *recorder)=0
Set the ErrorRecorder for this interface.
virtual int getMaxDLABatchSize() const =0
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combi...
virtual void setInputMode(RNNInputMode op)=0
Set the input mode of the RNN layer.
virtual RNNDirection getDirection() const =0
Get the direction of the RNN layer.
virtual IIteratorLayer * addIterator(ITensor &tensor, int axis=0, bool reverse=false) noexcept=0
Return layer that subscripts tensor by loop iteration.
virtual void setName(const char *name)=0
Sets the name of the network.
Generate a tensor with random values drawn from a uniform distribution.
A fully connected layer in a network definition. This layer expects an input tensor of three or more ...
Definition: NvInfer.h:1515
Definition: NvInfer.h:3663
virtual TRT_DEPRECATED void setDefaultDeviceType(DeviceType deviceType)=0
Sets the default DeviceType to be used by the builder. It ensures that all the layers that can run on...
virtual void setLocation(TensorLocation location)=0
Set the storage location of a tensor.
virtual TRT_DEPRECATED void setEngineCapability(EngineCapability capability)=0
Configure the builder to target specified EngineCapability flow.
Layer that represents a constant value.
Definition: NvInfer.h:4204
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
Dims4()
Construct an empty Dims2 object.
Definition: NvInfer.h:286
virtual float getAlpha() const =0
Get the alpha parameter.
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4254
virtual void clearQuantizationFlag(QuantizationFlag flag)=0
clear a quantization flag.
No operation is performed on the first recurrent layer.
virtual Weights getKernelWeights() const =0
Get the kernel weights for the deconvolution.
virtual int64_t getImplementation() const =0
Return implementation of the algorithm.
virtual IResizeLayer * addResize(ITensor &input)=0
Add a resize layer to the network.
virtual void setDirection(RNNDirection op)=0
Set the direction of the RNN layer.
virtual TRT_DEPRECATED void resetDeviceType(ILayer *layer)=0
reset the DeviceType for this layer
A network definition for input to the builder.
Definition: NvInfer.h:4838
Layer type for plugins.
Definition: NvInfer.h:3373
virtual void setFirstTranspose(Permutation permutation)=0
Set the permutation applied by the first transpose operation.
virtual void setReduceAxes(uint32_t reduceAxes)=0
Set the axes over which to reduce.
constexpr int EnumMax< PaddingMode >()
Maximum number of elements in PaddingMode enum.
Definition: NvInfer.h:1138
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:107
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:6123
Output value is concatenation of values of tensor for each iteration, in forward order.
virtual TRT_DEPRECATED void setConvolutionOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the convolution output dimensions formula.
virtual bool unmarkOutputForShapes(ITensor &tensor)=0
Undo markOutputForShapes.
virtual ILRNLayer * addLRN(ITensor &input, int window, float alpha, float beta, float k)=0
Add a LRN layer to the network.
virtual TRT_DEPRECATED void setPrePadding(DimsHW padding)=0
Set the padding that is applied at the start of the tensor.
Layer that represents a padding operation.
Definition: NvInfer.h:3575
virtual void setMode(SliceMode mode)=0
Set the slice mode.
virtual ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput)=0
Add a select layer to the network.
virtual int getK() const =0
Get the k value for the layer.
Descriptor for data with one channel dimension and two spatial dimensions.
Definition: NvInfer.h:206
A convolution layer in a network definition.
Definition: NvInfer.h:1155
virtual void setOperation(UnaryOperation op)=0
Set the unary operation for the layer.
virtual int getChannelAxis() const =0
Get the channel axis.
virtual void setDLACore(int dlaCore)=0
Sets the DLA core used by the network.
constexpr int EnumMax< LoopOutput >()
Maximum number of elements in LoopOutput enum.
Definition: NvInfer.h:4434
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:3417
virtual bool platformHasFastFp16() const =0
Determine whether the platform has fast native fp16.
Logical AND of two elements.
constexpr int EnumMax< RNNOperation >()
Maximum number of elements in RNNOperation enum.
Definition: NvInfer.h:2745
A layer that represents the identity function.
Definition: NvInfer.h:4191
virtual const IAlgorithmVariant & getAlgorithmVariant() const =0
Returns the algorithm variant.
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3143
virtual bool getReverse() const noexcept=0
True if and only if reversing input.
virtual void setGatherAxis(int axis)=0
Set the axis to gather on. The axis must be less than the number of dimensions in the data input.
virtual void setNbOutputChannels(int nbOutputs)=0
Set the number of output channels K from the fully connected layer.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights for the deconvolution.
virtual void writeCalibrationCache(const void *ptr, std::size_t length)=0
Save a calibration cache.
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations.
Definition: NvInfer.h:6334
virtual float getDynamicRangeMin() const =0
Get minimum of dynamic range.
Register layer names in NVTX message field and register layer detail in NVTX JSON payload field.
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding of the convolution.
virtual TRT_DEPRECATED nvinfer1::INetworkDefinition * createNetwork()=0
Create a network definition object where all tensors have an implicit batch dimension.
virtual TRT_DEPRECATED IRNNLayer * addRNN(ITensor &inputs, int layerCount, std::size_t hiddenSize, int maxSeqLen, RNNOperation op, RNNInputMode mode, RNNDirection dir, Weights weights, Weights bias)=0
Add an layerCount deep RNN layer to the network with a sequence length of maxSeqLen and hiddenSize in...
Interface implemented by application for selecting and reporting algorithms of a layer provided by th...
Definition: NvInfer.h:6226
virtual int getAvgTimingIterations() const =0
Query the number of averaging iterations.
Logical OR of two elements.
Mark the network to be an explicit precision network.
virtual void setKernelSizeNd(Dims kernelSize)=0
Set the multi-dimension kernel size of the convolution.
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the deconvolution.
constexpr int EnumMax< UnaryOperation >()
Maximum number of elements in UnaryOperation enum.
Definition: NvInfer.h:3443
uint32_t NetworkDefinitionCreationFlags
This bitset is capable of representing one or more NetworkDefinitionCreationFlag flags constructed wi...
Definition: NvInfer.h:6738
virtual float getTimingMSec() const =0
The time in milliseconds to execute the algorithm.
virtual void setCellState(ITensor &cell)=0
Set the initial cell state of the LSTM with the provided cell ITensor.
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding of the deconvolution.
virtual bool markOutputForShapes(ITensor &tensor)=0
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
virtual TRT_DEPRECATED void setStrictTypeConstraints(bool mode)=0
Set whether or not type constraints are strict.
virtual void setDimensions(Dims dimensions)=0
Set the dimensions of a tensor.
virtual Dims getDilationNd() const =0
Get the multi-dimension dilation of the convolution.
virtual TRT_DEPRECATED int getDLACore() const =0
Get the DLA core that the engine executes on.
RNNOperation
Enumerates the RNN operations that may be performed by an RNN layer.
Definition: NvInfer.h:2736
virtual TRT_DEPRECATED void setInt8Mode(bool mode)=0
Set whether or not quantized 8-bit kernels are permitted.
Definition: NvInfer.h:4550
Output value is value of tensor for last iteration.
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:371
virtual void setNbGroups(int nbGroups)=0
Set the number of groups for a convolution.
virtual bool platformHasFastInt8() const =0
Determine whether the platform has fast native int8.
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:6090
virtual void setType(DataType type)=0
Set the data type of a tensor.
virtual IScaleLayer * addScaleNd(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power, int channelAxis)=0
Add a multi-dimension scale layer to the network.
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:4069
virtual void reset()=0
Resets the builder state to default values.
Like kNONE, but transpose the matrix dimensions.
virtual uint32_t getReduceAxes() const =0
Get the axes to reduce for the layer.
Definition: NvInfer.h:6014
virtual const char * getName() const noexcept=0
Return the name of the loop.
virtual bool hasExplicitPrecision() const =0
True if network is an explicit precision network.
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:960
virtual MatrixOperation getOperation(int index) const =0
Get the operation for an input tensor.
Coordinates wrap around periodically.
virtual Dims getPostPadding() const =0
Get the padding.
virtual void setBroadcastAcrossBatch(bool broadcastAcrossBatch)=0
Set whether to enable broadcast of tensor across the batch.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInferRuntimeCommon.h:234
virtual IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation)=0
Add a unary layer to the network.
Dims4(int d0, int d1, int d2, int d3)
Construct a Dims4 from 4 elements.
Definition: NvInfer.h:300
Inverse hyperbolic cosine.
Substract the second element from the first.
virtual Dims getDimensions() const noexcept=0
Get the output tensor's dimensions.
virtual TRT_DEPRECATED void setPostPadding(DimsHW padding)=0
Set the padding that is applied at the end of the tensor.
virtual void setEngineCapability(EngineCapability capability)=0
Configure the builder to target specified EngineCapability flow.
virtual double getBeta() const noexcept=0
Get the value of beta parameter.
virtual void resetOutputType(int index)=0
reset the output type for this layer
virtual int getNbOutputMaps() const =0
Get the number of output maps for the convolution.
virtual TRT_DEPRECATED float getDynamicRange() const =0
Get dynamic range for the tensor.
virtual cudaStream_t getProfileStream() const =0
Get the cudaStream that is used to profile this network.
virtual void markOutput(ITensor &tensor)=0
Mark a tensor as a network output.
Enable layers marked to execute on GPU if layer cannot execute on DLA.
Four-gate LSTM network w/o peephole connections.
DimsNCHW()
Construct an empty DimsNCHW object.
Definition: NvInfer.h:322
virtual IFullyConnectedLayer * addFullyConnected(ITensor &input, int nbOutputs, Weights kernelWeights, Weights biasWeights)=0
Add a fully connected layer to the network.
virtual ElementWiseOperation getOperation() const =0
Get the binary operation for the layer.
virtual void setZeroIsPlaceholder(bool zeroIsPlaceholder)=0
Set meaning of 0 in reshape dimensions.
virtual SliceMode getMode() const =0
Get the slice mode.
constexpr int32_t EnumMax< ProfilingVerbosity >()
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInfer.h:6342
Enable building a refittable engine.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
constexpr int EnumMax< ScaleMode >()
Maximum number of elements in ScaleMode enum.
Definition: NvInfer.h:2028
virtual void setStride(Dims stride)=0
Set the stride for computing the output slice data.
virtual Dims getPostPadding() const =0
Get the post-padding.
virtual IPaddingLayer * addPaddingNd(ITensor &input, Dims prePadding, Dims postPadding)=0
Add a padding layer to the network. Only 2D padding is currently supported.
int nbDims
The number of dimensions.
Definition: NvInferRuntimeCommon.h:223
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the convolution.
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3993
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4421
An RNN layer in a network definition, version 2.
Definition: NvInfer.h:3169
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:979
virtual void setSize(Dims size)=0
Set the dimensions of the output slice.
virtual TensorFormats getAllowedFormats() const =0
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
virtual TRT_DEPRECATED DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
constexpr int EnumMax< ResizeMode >()
Maximum number of elements in ResizeMode enum.
Definition: NvInfer.h:4272
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
virtual FillOperation getOperation() const noexcept=0
Get the fill operation for the layer.
virtual void resetDeviceType(const ILayer *layer)=0
reset the DeviceType for this layer
virtual int getBatchSize() const =0
Get the batch size used for calibration batches.
virtual void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the convolution.
A RNN layer in a network definition.
Definition: NvInfer.h:2809
virtual TRT_DEPRECATED bool getRefittable() const =0
Query whether or not engines will be refittable.
virtual void setBiasWeights(Weights weights)=0
Set the bias weights for the convolution.
virtual TRT_DEPRECATED IPluginLayer * addPluginExt(ITensor *const *inputs, int nbInputs, IPluginExt &plugin)=0
Add a plugin layer to the network using an IPluginExt interface.
virtual IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept=0
Create a recurrence layer for this loop with initialValue as its first input.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride for pooling.
virtual IConstantLayer * addConstant(Dims dimensions, Weights weights)=0
Add a constant layer to the network.
Descriptor for two-dimensional spatial data.
Definition: NvInfer.h:115
virtual double getQuantile() const =0
The quantile (between 0 and 1) that will be used to select the region maximum when the quantile metho...
virtual TRT_DEPRECATED int getMinFindIterations() const =0
Query the number of minimization iterations.
virtual int getMinTimingIterations() const =0
Query the number of minimization iterations.
Divide the first element by the second.
virtual bool isDeviceTypeSet(const ILayer *layer) const =0
whether the DeviceType has been explicitly set for this layer
virtual TRT_DEPRECATED void setWindowSize(DimsHW windowSize)=0
Set the window size for pooling.
virtual void resetDynamicRange()=0
Undo effect of setDynamicRange.
Definition: NvInfer.h:4505
virtual Dims getStride() const =0
Get the stride for the output slice.
Floor division of the first element by the second.
virtual uint32_t getReduceAxes() const =0
Get the axes over which to reduce for the layer.
virtual TRT_DEPRECATED void setDLACore(int dlaCore)=0
Set the DLA core that the engine must execute on.
int c() const
Get the channel count.
Definition: NvInfer.h:245
virtual TopKOperation getOperation() const =0
Get the operation for the layer.
virtual int getNbOutputs() const =0
Get the number of outputs of a layer.
virtual void setOperation(FillOperation op) noexcept=0
Set the fill operation for the layer.
virtual ITensor * addInput(const char *name, DataType type, Dims dimensions)=0
Add an input tensor to the network.
virtual IFillLayer * addFill(Dims dimensions, FillOperation op) noexcept=0
Add a fill layer to the network.
virtual void clearFlag(BuilderFlag builderFlag)=0
clear a single build mode flag.
virtual ITensor * getOutput(int index) const =0
Get the layer output corresponding to the given index.
virtual void setK(float k)=0
Set the LRN K value.
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:219
virtual IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims windowSize)=0
Add a multi-dimension pooling layer to the network.
Network iterations from first input to last input.
virtual bool getQuantizationFlag(QuantizationFlag flag) const =0
Returns true if the quantization flag is set.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the deconvolution.
Use CAFFE padding, rounding output size up, uses prePadding value.
virtual int getWindowSize() const =0
Get the LRN window size.
virtual Dims getPrePadding() const =0
Get the pre-padding.
constexpr int EnumMax< RNNGateType >()
Maximum number of elements in RNNGateType enum.
Definition: NvInfer.h:3155
int w() const
Get the width.
Definition: NvInfer.h:273
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1020
virtual TRT_DEPRECATED bool getFp16Mode() const =0
Query whether 16-bit kernels are permitted.
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:6148
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
virtual Weights getScale() const =0
Get the scale value.
virtual void setActivationType(ActivationType type)=0
Set the type of activation to be performed.
constexpr int EnumMax< LayerType >()
Maximum number of elements in LayerType enum.
Definition: NvInfer.h:449
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
virtual void setWindowSizeNd(Dims windowSize)=0
Set the multi-dimension window size for pooling.
virtual TRT_DEPRECATED void setMaxWorkspaceSize(std::size_t workspaceSize)=0
Set the maximum workspace size.
Network iterates from first to last and vice versa and outputs concatenated.
virtual DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:2020
int & w()
Get the width.
Definition: NvInfer.h:393
Use SAME padding, with prePadding <= postPadding.
virtual bool isShapeTensor() const =0
Whether the tensor is a shape tensor.
virtual TRT_DEPRECATED bool getInt8Mode() const =0
Query whether Int8 mode is used.
virtual IPluginV2Layer * addPluginV2(ITensor *const *inputs, int nbInputs, IPluginV2 &plugin)=0
Add a plugin layer to the network using the IPluginV2 interface.
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1136
uint32_t QuantizationFlags
Represents a collection of one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:6266
Enable FP16 layer selection, with FP32 fallback.
virtual void setBiasWeights(Weights weights)=0
Set the bias weights.
virtual TRT_DEPRECATED nvinfer1::ICudaEngine * buildCudaEngine(nvinfer1::INetworkDefinition &network)=0
Build a CUDA engine from a network definition.
virtual bool precisionIsSet() const =0
whether the computational precision has been set for this layer
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:4177
virtual ISliceLayer * addSlice(ITensor &input, Dims start, Dims size, Dims stride)=0
Add a slice layer to the network.
virtual ProfilingVerbosity getProfilingVerbosity() const =0
Get verbosity level of layer information exposed in NVTX annotations.
virtual TRT_DEPRECATED IOutputDimensionsFormula & getPoolingOutputDimensionsFormula() const =0
Get the pooling output dimensions formula.
virtual Dims getPostPaddingNd() const =0
Get the padding that is applied at the end of the tensor.
virtual ITensor * getOutput(int index) const =0
Get the output tensor specified by the given index.
virtual void writeHistogramCache(const void *ptr, std::size_t length)=0
Save a histogram cache.
virtual nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config)=0
Builds an engine for the given INetworkDefinition and given IBuilderConfig.
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding of the deconvolution.
virtual void setInt8Calibrator(IInt8Calibrator *calibrator)=0
Set Int8 Calibration interface.
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
virtual void setAlpha(float alpha)=0
Set the LRN alpha value.
virtual void setAvgTimingIterations(int avgTiming)=0
Set the number of averaging iterations used when timing layers.
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:688
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
virtual int getNbOutputChannels() const =0
Get the number of output channels K from the fully connected layer.
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3859
virtual TRT_DEPRECATED IPaddingLayer * addPadding(ITensor &input, DimsHW prePadding, DimsHW postPadding)=0
Add a padding layer to the network.
int h() const
Get the height.
Definition: NvInfer.h:386
virtual bool getKeepDimensions() const =0
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual int getNbOutputMaps() const =0
Get the number of output feature maps for the deconvolution.
virtual int32_t selectAlgorithms(const IAlgorithmContext &context, const IAlgorithm *const *choices, int32_t nbChoices, int32_t *selection)=0
Select Algorithms for a layer from the given list of algorithm choices.
virtual void setAxis(int axis)=0
Set the axis along which concatenation occurs.
virtual bool dynamicRangeIsSet() const =0
Query whether dynamic range is set.
virtual void setPrecision(DataType dataType)=0
Set the computational precision of this layer.
virtual TRT_DEPRECATED EngineCapability getEngineCapability() const =0
Query EngineCapability flow configured for the builder.
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
virtual void setQuantizationFlag(QuantizationFlag flag)=0
Set a single quantization flag.
virtual Dims getDimensions() const =0
Get the dimensions for the layer.
TRT_DEPRECATED DimensionType type[MAX_DIMS]
The type of each dimension.
Definition: NvInferRuntimeCommon.h:225
Definition: NvInfer.h:4556
virtual Dims getPrePadding() const =0
Get the pre-padding.
IBuilder * createInferBuilder(ILogger &logger)
Create an instance of an IBuilder class.
Definition: NvInfer.h:7297
virtual bool getAlignCorners() const =0
True if align corners has been set.
virtual bool getFlag(BuilderFlag builderFlag) const =0
Returns true if the build mode flag is set.
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:6304
Perform the normal matrix multiplication in the first recurrent layer.
virtual TRT_DEPRECATED void setPoolingOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the pooling output dimensions formula.
virtual void setAlignCorners(bool alignCorners)=0
Set whether to align corners while resizing.
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Set the stride for pooling.
virtual void setBeta(float beta)=0
Set the LRN beta value.
virtual void setPower(Weights power)=0
Set the power value.
virtual Dims getDimensions(int32_t index, OptProfileSelector select) const =0
Get the minimum / optimum / maximum dimensions for input or output tensor.
virtual void setScale(Weights scale)=0
Set the scale value.
virtual TRT_DEPRECATED void setTranspose(int index, bool val)=0
Set the transpose flag for an input tensor.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6020
virtual Weights getWeights() const =0
Get the weights for the layer.
virtual void setName(const char *name)=0
Set the tensor name.
Product of the two elements.
virtual Weights getPower() const =0
Get the power value.
virtual int getAxis() const =0
Get the axis along which concatenation occurs.
Per-channel coefficients.
virtual int getNbInputs() const =0
Get the number of inputs of a layer.
The TensorRT API version 1 namespace.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:249
Base class for all layer classes in a network definition.
Definition: NvInfer.h:731
virtual bool hasImplicitBatchDimension() const =0
Query whether the network was created with an implicit batch dimension.
int h() const
Get the height.
Definition: NvInfer.h:151
virtual void setFlag(BuilderFlag builderFlag)=0
Set a single build mode flag.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
constexpr int EnumMax< SliceMode >()
Maximum number of elements in SliceMode enum.
Definition: NvInfer.h:3826
virtual Dims getWindowSizeNd() const =0
Get the multi-dimension window size for pooling.
virtual IShuffleLayer * addShuffle(ITensor &input)=0
Add a shuffle layer to the network.
int c() const
Get the channel count.
Definition: NvInfer.h:372
constexpr int EnumMax< ReduceOperation >()
Maximum number of elements in ReduceOperation enum.
Definition: NvInfer.h:3504
virtual QuantizationFlags getQuantizationFlags() const =0
Get the quantization flags.
virtual void removeTensor(ITensor &tensor)=0
remove a tensor from the network definition.
virtual DataType getPrecision() const =0
get the computational precision of this layer
virtual int getNbDLACores() const =0
Return the number of DLA engines available to this builder.
constexpr int EnumMax< CalibrationAlgoType >()
Maximum number of elements in CalibrationAlgoType enum.
Definition: NvInfer.h:5903
virtual void setSecondTranspose(Permutation permutation)=0
Set the permutation applied by the second transpose operation.
virtual ITensor * getInput(int index) const =0
Get the input tensor specified by the given index.
virtual ITensor * getHiddenState() const =0
Get the initial hidden state of the RNN.
virtual void setMaxWorkspaceSize(std::size_t workspaceSize)=0
Set the maximum workspace size.
Definition: NvInfer.h:4579
Layer type for pluginV2.
Definition: NvInfer.h:3396
virtual IActivationLayer * addActivation(ITensor &input, ActivationType type)=0
Add an activation layer to the network.
Enables strict type constraints.
virtual int getNbOutputs() const =0
Get the number of outputs in the network.
virtual IErrorRecorder * getErrorRecorder() const =0
get the ErrorRecorder assigned to this interface.
virtual void setPoolingType(PoolingType type)=0
Set the type of activation to be performed.
virtual Permutation getSecondTranspose() const =0
Get the permutation applied by the second transpose operation.
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights, given as a KxC matrix in row-major order.
A elementwise layer in a network definition.
Definition: NvInfer.h:2590
virtual ScaleMode getMode() const =0
Get the scale mode.
virtual float getBeta() const =0
Get the LRN beta value.
virtual TRT_DEPRECATED IPluginLayer * addPlugin(ITensor *const *inputs, int nbInputs, IPlugin &plugin)=0
Add a plugin layer to the network.
virtual void setNbElementWiseDims(int k)=0
Set the number of leading dimensions of indices tensor to be handled elementwise. k must be 0 if ther...
LayerType
The type values of layer classes.
Definition: NvInfer.h:410
int & h()
Get the height.
Definition: NvInfer.h:144
virtual Weights getBiasWeights() const =0
Get the bias weights.
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding for pooling.
virtual TRT_DEPRECATED DimsHW getKernelSize() const =0
Get the HW kernel size of the deconvolution.
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:112
virtual ISoftMaxLayer * addSoftMax(ITensor &input)=0
Add a SoftMax layer to the network.
virtual bool setDynamicRange(float min, float max)=0
Set dynamic range for the tensor.
virtual void setOperation(RNNOperation op)=0
Set the operation of the RNN layer.
virtual void setName(const char *name)=0
Set the name of a layer.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual TRT_DEPRECATED void setMinFindIterations(int minFind)=0
Set the number of minimization iterations used when timing layers.
virtual Weights getBiasWeights() const =0
Get the bias weights for the deconvolution.
int & c()
Get the channel count.
Definition: NvInfer.h:238
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual LayerType getType() const =0
Return the type of a layer.
virtual ITensor * getCellState() const =0
Get the initial cell state of the RNN.
virtual Dims getDimensions() const =0
Get the dimensions of a tensor.
Disable reuse of timing information across identical layers.
virtual bool setCalibrationProfile(const IOptimizationProfile *profile) noexcept=0
Add a calibration profile.
constexpr int EnumMax< TopKOperation >()
Maximum number of elements in TopKOperation enum.
Definition: NvInfer.h:4000
virtual void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the deconvolution.
int & c()
Get the channel count.
Definition: NvInfer.h:365
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3982
virtual void setOutputDimensions(Dims dimensions)=0
Set the output dimensions.
virtual void setWeightsForGate(int layerIndex, RNNGateType gate, bool isW, Weights weights)=0
Set the weight parameters for an individual gate in the RNN.
virtual IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept=0
Add a parametric ReLU layer to the network.
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights for the convolution.
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride of the convolution.
virtual IInt8Calibrator * getInt8Calibrator() const =0
Get Int8 Calibration interface.
#define _TENSORRT_OVERRIDE
Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:62
virtual int getAxis() const noexcept=0
Get axis being concatenated over.
virtual TRT_DEPRECATED void setKernelSize(DimsHW kernelSize)=0
Set the HW kernel size of the convolution.
virtual void setDefaultDeviceType(DeviceType deviceType)=0
Sets the default DeviceType to be used by the builder. It ensures that all the layers that can run on...
virtual void setDimensions(Dims dimensions) noexcept=0
Set the output tensor's dimensions.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:5990
virtual TRT_DEPRECATED DimsHW getPrePadding() const =0
Get the padding that is applied at the start of the tensor.
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2552
virtual const char * getName() const =0
Get the tensor name.
int & n()
Get the index count.
Definition: NvInfer.h:351
Fail with error when the coordinates are out of bounds. This is the default.
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:163
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6035
virtual Permutation getFirstTranspose() const =0
Get the permutation applied by the first transpose operation.
virtual int getGatherAxis() const =0
Get the axis to gather on.
virtual TRT_DEPRECATED void setRefittable(bool canRefit)=0
virtual IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1)=0
Add a MatrixMultiply layer to the network.
virtual void destroy()=0
De-allocates any internally allocated memory.
virtual IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions)=0
Add a reduce layer to the network.
virtual int getMaxBatchSize() const =0
Get the maximum batch size.
virtual void setReshapeDimensions(Dims dimensions)=0
Set the reshaped dimensions.
Single gate RNN w/ ReLU activation function.
virtual TRT_DEPRECATED IConvolutionLayer * addConvolution(ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a convolution layer to the network.
virtual void setBeta(float beta)=0
Set the beta parameter (must be finite).
virtual TRT_DEPRECATED std::size_t getMaxWorkspaceSize() const =0
Get the maximum workspace size.
virtual void setDimensions(Dims dimensions)=0
Set the dimensions for the layer.
virtual void setKeepDimensions(bool keepDimensions)=0
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
Mark the network to be an explicit batch network.
virtual Dims getDilationNd() const =0
Get the multi-dimension dilation of the deconvolution.
virtual int getAxis() const noexcept=0
Get axis being iterated over.
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:247
int w() const
Get the width.
Definition: NvInfer.h:400
virtual TRT_DEPRECATED bool getHalf2Mode() const =0
Query whether half2 mode is used.
virtual Dims getPrePadding() const =0
Get the pre-padding.
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1014
virtual TRT_DEPRECATED IOutputDimensionsFormula & getConvolutionOutputDimensionsFormula() const =0
Get the convolution output dimensions formula.
ResizeMode
Enumerates various modes of resize in the resize layer. Resize mode set using setResizeMode().
Definition: NvInfer.h:4265
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding for pooling.
virtual RNNOperation getOperation() const =0
Get the operation of the RNN layer.
virtual Weights getKernelWeights() const =0
Get the kernel weights.
virtual int getDLACore() const =0
Get the DLA core that the engine executes on.
virtual nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept=0
Create a new optimization profile.
Check if two elements are equal.
virtual TRT_DEPRECATED bool getDebugSync() const =0
Query whether the builder will use debug synchronization.
constexpr int EnumMax< BuilderFlag >()
Maximum number of builder flags in BuilderFlag enum.
Definition: NvInfer.h:6321
Logical XOR of two elements.
constexpr int EnumMax< MatrixOperation >()
Maximum number of elements in MatrixOperation enum.
Definition: NvInfer.h:4092
virtual Weights getShift() const =0
Get the shift value.
Descriptor for data with one index dimension, one channel dimension and two spatial dimensions.
Definition: NvInfer.h:316
DimsNCHW(int batchSize, int channels, int height, int width)
Construct a DimsNCHW given batch size, channel count, height and width.
Definition: NvInfer.h:338
virtual std::size_t getMaxWorkspaceSize() const =0
Get the maximum workspace size.
A concatenation layer in a network definition.
Definition: NvInfer.h:2199
Layer type for shuffling data.
Definition: NvInfer.h:3686
virtual Dims getStart() const =0
Get the start offset for the slice layer.
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride for pooling.
virtual void destroy()=0
Destroy this object.
A tensor in a network definition.
Definition: NvInfer.h:467
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
virtual nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags)=0
Create a network definition object.
Definition: NvInfer.h:4464
virtual void setOutputType(int index, DataType dataType)=0
Set the output type of this layer.
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:2757
virtual void setNbOutputMaps(int nbOutputMaps)=0
Set the number of output feature maps for the deconvolution.
virtual TRT_DEPRECATED bool isDeviceTypeSet(const ILayer *layer) const =0
whether the DeviceType has been explicitly set for this layer
virtual void setBlendFactor(float blendFactor)=0
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
virtual void setName(const char *name) noexcept=0
Set the name of the loop.
virtual void reset()=0
Resets the builder configuration to defaults.
virtual Dims getKernelSizeNd() const =0
Get the multi-dimension kernel size of the convolution.
virtual TensorFormat getTensorFormat() const =0
Return TensorFormat of the input/output of algorithm.
virtual void setReverse(bool reverse) noexcept=0
virtual IConcatenationLayer * addConcatenation(ITensor *const *inputs, int nbInputs)=0
Add a concatenation layer to the network.
virtual void setBiasWeights(Weights weights)=0
Set the bias weights for the deconvolution.
virtual ILoop * getLoop() const noexcept=0
Return pointer to ILoop associated with this boundary layer.
virtual void setOperation(TopKOperation op)=0
Set the operation for the layer.
A LRN layer in a network definition.
Definition: NvInfer.h:1945
virtual DataType getType() const =0
Get the data type of a tensor.
virtual bool getZeroIsPlaceholder() const =0
Get meaning of 0 in reshape dimensions.
Layer that represents a reduction operator across Shape, Int32, Float, and Half tensors.
Definition: NvInfer.h:3516
virtual ITopKLayer * addTopK(ITensor &input, TopKOperation op, int k, uint32_t reduceAxes)=0
Add a TopK layer to the network.
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:4122
virtual void setDeviceType(const ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
Single gate RNN w/ TANH activation function.
virtual const char * getName() const =0
Returns the name associated with the network.
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:1127
int d[MAX_DIMS]
The extent of each dimension.
Definition: NvInferRuntimeCommon.h:224
Check if element in first tensor is greater than corresponding element in second tensor.
virtual nvinfer1::IBuilderConfig * createBuilderConfig()=0
Create a builder configuration object.
virtual IIdentityLayer * addIdentity(ITensor &input)=0
Add an identity layer.
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1662
virtual IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds)=0
Add a RaggedSoftMax layer to the network.
virtual int getNbInputs() const =0
Get the number of inputs in the network.
Definition: NvInfer.h:5999
virtual void setKernelSizeNd(Dims kernelSize)=0
Set the multi-dimension kernel size of the deconvolution.
Generate an output tensor with specified mode.
Definition: NvInfer.h:4695
virtual ITensor * getSequenceLengths() const =0
Get the sequence lengths specified for the RNN.
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
Use SAME padding, with prePadding >= postPadding.
Descriptor for three-dimensional data.
Definition: NvInfer.h:172
virtual const void * readCalibrationCache(std::size_t &length)=0
Load a calibration cache.
QuantizationFlag
List of valid flags for quantizing the network to int8.
Definition: NvInfer.h:6275
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
virtual bool getBroadcastAcrossBatch() const =0
Check if tensor is broadcast across the batch.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6005
Application-implemented interface for calibration.
Definition: NvInfer.h:5919
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1175
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Get the stride of the convolution.
virtual void setAlpha(float alpha)=0
Set the alpha parameter (must be finite).
Layer that represents a TopK reduction.
Definition: NvInfer.h:4012
virtual void setAllowedFormats(TensorFormats formats)=0
Set allowed formats for this tensor. By default all formats are allowed. Shape tensors (for which isS...
virtual IConvolutionLayer * addConvolutionNd(ITensor &input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension convolution layer to the network.
virtual DeviceType getDefaultDeviceType() const =0
Get the default DeviceType which was set by setDefaultDeviceType.
virtual TRT_DEPRECATED DeviceType getDefaultDeviceType() const =0
Get the default DeviceType which was set by setDefaultDeviceType.
virtual void setQuantizationFlags(QuantizationFlags flags)=0
Set the quantization flags.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the convolution.
Minimum of the two elements.
Use CAFFE padding, rounding output size down, uses prePadding value.
virtual void setMinTimingIterations(int minTiming)=0
Set the number of minimization iterations used when timing layers.
virtual void setInput(int index, ITensor &tensor)=0
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:4652
virtual void setWeights(Weights weights)=0
Set the weights for the layer.
virtual int addOptimizationProfile(const IOptimizationProfile *profile) noexcept=0
Add an optimization profile.
virtual CalibrationAlgoType getAlgorithm()=0
Get the algorithm used by this calibrator.
constexpr int EnumMax< PoolingType >()
Maximum number of elements in PoolingType enum.
Definition: NvInfer.h:1670
SliceMode
Controls how ISliceLayer handles out of bounds coordinates.
Definition: NvInfer.h:3819
virtual void destroy()=0
Destroy this INetworkDefinition object.
Definition: NvInfer.h:5984
virtual float getK() const =0
Get the LRN K value.
virtual void setAxis(int axis) noexcept=0
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
virtual void setReduceAxes(uint32_t reduceAxes)=0
Set which axes to reduce for the layer.
virtual void setOperation(ElementWiseOperation op)=0
Set the binary operation for the layer.
Definition: NvInfer.h:2620
DimsHW(int height, int width)
Construct a DimsHW given height and width.
Definition: NvInfer.h:133
virtual PoolingType getPoolingType() const =0
Get the type of activation to be performed.
RNNInputMode
Enumerates the RNN input modes that may occur with an RNN layer.
Definition: NvInfer.h:2784
virtual ActivationType getActivationType() const =0
Get the type of activation to be performed.
Descriptor for two-dimensional data.
Definition: NvInfer.h:85
virtual double getRegressionCutoff() const =0
The fraction (between 0 and 1) of the maximum used to define the regression cutoff when using regress...
virtual void setMode(ScaleMode mode)=0
Set the scale mode.
virtual TRT_DEPRECATED DimsHW getKernelSize() const =0
Get the HW kernel size of the convolution.
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4665
virtual int32_t getNbOutputs() const =0
Return number of outputs of the algorithm.
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3494
virtual void setAxis(int axis) noexcept=0
Set axis to iterate over.
virtual TRT_DEPRECATED IPoolingLayer * addPooling(ITensor &input, PoolingType type, DimsHW windowSize)=0
Add a pooling layer to the network.
virtual Dims getKernelSizeNd() const =0
Get the multi-dimension kernel size of the deconvolution.
virtual bool canRunOnDLA(const ILayer *layer) const =0
Checks if a layer can run on DLA.
virtual TRT_DEPRECATED bool getTranspose(int index) const =0
Get the transpose flag for an input tensor.
virtual Dims getStrides() const =0
Return strides of the input/output tensor of algorithm.
Inverse hyperbolic tangent.
uint32_t BuilderFlags
Represents a collection of one or more QuantizationFlag values using binary OR operations,...
Definition: NvInfer.h:6295
virtual Dims getOutputDimensions() const =0
Get the output dimensions.
virtual void setPostPaddingNd(Dims padding)=0
Set the padding that is applied at the end of the tensor.
virtual ReduceOperation getOperation() const =0
Get the reduce operation for the layer.
virtual const IOptimizationProfile * getCalibrationProfile() noexcept=0
Get the current calibration profile.
static const int MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:222
Definition: NvInfer.h:4457
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:6188
virtual int64_t getTactic() const =0
Return tactic of the algorithm.
DimsCHW(int channels, int height, int width)
Construct a DimsCHW given channel count, height and width.
Definition: NvInfer.h:226
virtual float getBlendFactor() const =0
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
constexpr int EnumMax< RNNDirection >()
Maximum number of elements in RNNDirection enum.
Definition: NvInfer.h:2764
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding of the convolution.
virtual void setPrePaddingNd(Dims padding)=0
Set the padding that is applied at the start of the tensor.
int h() const
Get the height.
Definition: NvInfer.h:259
virtual IDeconvolutionLayer * addDeconvolutionNd(ITensor &input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension deconvolution layer to the network.
virtual Weights getBiasForGate(int layerIndex, RNNGateType gate, bool isW) const =0
Get the bias parameters for an individual gate in the RNN.
Generate evenly spaced numbers over a specified interval.
virtual void setHiddenState(ITensor &hidden)=0
Set the initial hidden state of the RNN with the provided hidden ITensor.
virtual const char * getName() const =0
Return name of the algorithm node. This is a unique identifier for the IAlgorithmContext.
virtual TRT_DEPRECATED IOutputDimensionsFormula & getDeconvolutionOutputDimensionsFormula() const =0
Get the deconvolution output dimensions formula.
virtual Weights getKernelWeights() const =0
Get the kernel weights of the convolution.
virtual DataType getDataType() const =0
Return DataType of the input/output of algorithm.
virtual void setResizeMode(ResizeMode resizeMode)=0
Set resize mode for an input tensor.
Definition: NvInfer.h:6029
The first element to the power of the second element.
virtual void setAxes(uint32_t axes)=0
Set the axis along which softmax is computed. Currently, only one axis can be set.
virtual float getAlpha() const =0
Get the LRN alpha value.
virtual Dims getStrideNd() const =0
Get the multi-dimension stride of the deconvolution.
constexpr int EnumMax< TripLimit >()
Maximum number of elements in TripLimit enum.
Definition: NvInfer.h:4450
A Scale layer in a network definition.
Definition: NvInfer.h:2055
virtual TRT_DEPRECATED void allowGPUFallback(bool setFallBackMode)=0
Sets the builder to use GPU if a layer that was supposed to run on DLA can not run on DLA.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
replace an input of this layer with a specific tensor.
virtual uint32_t getAxes() const =0
Get the axis along which softmax occurs.
virtual DataType getOutputType(int index) const =0
get the output type of this layer
int & w()
Get the width.
Definition: NvInfer.h:266
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4440
Elements correspond to different batch index.
virtual ITensor * getInput(int index) const =0
Get the layer input corresponding to the given index.
A Softmax layer in a network definition.
Definition: NvInfer.h:2144
virtual void setFlags(BuilderFlags builderFlags)=0
Set the build mode flags to turn on builder options for this network.
virtual bool getBatch(void *bindings[], const char *names[], int nbBindings)=0
Get a batch of input for calibration.
virtual void setSequenceLengths(ITensor &seqLengths)=0
Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths.
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding of the deconvolution.
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:6749
virtual void unmarkOutput(ITensor &tensor)=0
unmark a tensor as a network output.
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:6352
virtual void resetPrecision()=0
reset the computational precision for this layer
virtual int getNbOptimizationProfiles() const noexcept=0
Get number of optimization profiles.
virtual TRT_DEPRECATED void setAverageFindIterations(int avgFind)=0
Set the number of averaging iterations used when timing layers.
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride of the deconvolution.
virtual IAlgorithmSelector * getAlgorithmSelector() const =0
Get Algorithm Selector.
virtual TRT_DEPRECATED void setDebugSync(bool sync)=0
Set whether the builder should use debug synchronization.
virtual double getAlpha() const noexcept=0
Get the value of alpha parameter.
int & w()
Get the width.
Definition: NvInfer.h:158
Dims3(int d0, int d1, int d2)
Construct a Dims3 from 3 elements.
Definition: NvInfer.h:191
virtual void setNbGroups(int nbGroups)=0
Set the number of groups for a deconvolution.
virtual void setShift(Weights shift)=0
Set the shift value.
virtual int32_t getNbInputs() const =0
Return number of inputs of the algorithm.
virtual void setBiasForGate(int layerIndex, RNNGateType gate, bool isW, Weights bias)=0
Set the bias parameters for an individual gate in the RNN.
virtual TRT_DEPRECATED IDeconvolutionLayer * addDeconvolution(ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a deconvolution layer to the network.
A resize layer in a network definition.
Definition: NvInfer.h:4297
virtual void setNbOutputMaps(int nbOutputMaps)=0
Set the number of output maps for the convolution.
DimsHW()
Construct an empty DimsHW object.
Definition: NvInfer.h:121
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:143
virtual void setStart(Dims start)=0
Set the start offset that the slice layer uses to create the output slice.
virtual TRT_DEPRECATED void setDeconvolutionOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the deconvolution output dimensions formula.
virtual UnaryOperation getOperation() const =0
Get the unary operation for the layer.
Dims2(int d0, int d1)
Construct a Dims2 from 2 elements.
Definition: NvInfer.h:103
virtual BuilderFlags getFlags() const =0
Get the build mode flags for this builder config. Defaults to 0.
Enable debugging of layers via synchronizing after every layer.
virtual IRNNv2Layer * addRNNv2(ITensor &input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen, RNNOperation op)=0
Add an layerCount deep RNN layer to the network with hiddenSize internal states that can take a batch...
virtual Dims getStrideNd() const =0
Get the multi-dimension stride for pooling.
virtual void setOperation(int index, MatrixOperation op)=0
Set the operation for an input tensor.
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding for pooling.
Descriptor for four-dimensional data.
Definition: NvInfer.h:280
A Pooling layer in a network definition.
Definition: NvInfer.h:1686
virtual void setAlgorithmSelector(IAlgorithmSelector *selector)=0
Set Algorithm Selector.
virtual Dims getReshapeDimensions() const =0
Get the reshaped dimensions.
virtual void setWindowSize(int windowSize)=0
Set the LRN window size.
virtual std::size_t getWorkspaceSize() const =0
The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:977
Layer that represents an unary operation.
Definition: NvInfer.h:3455
virtual void setAlpha(double alpha) noexcept=0
Set the alpha parameter.
virtual ResizeMode getResizeMode() const =0
Get resize mode for an input tensor.
virtual TRT_DEPRECATED void setFp16Mode(bool mode)=0
Set whether or not 16-bit kernels are permitted.
virtual ILayer * getLayer(int index) const =0
Get the layer specified by the given index.
Builds an engine from a network definition.
Definition: NvInfer.h:6785
virtual bool isExecutionTensor() const =0
Whether the tensor is an execution tensor.
DimsCHW()
Construct an empty DimsCHW object.
Definition: NvInfer.h:212
virtual RNNInputMode getInputMode() const =0
Get the input mode of the RNN layer.
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding for pooling.
Dims2()
Construct an empty Dims2 object.
Definition: NvInfer.h:91
virtual IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op)=0
Add an elementwise layer to the network.
virtual void setProfilingVerbosity(ProfilingVerbosity verbosity)=0
Set verbosity level of layer information exposed in NVTX annotations.
virtual bool getAverageCountExcludesPadding() const =0
Get whether exclusive pooling uses as a denominator the overlap area betwen the window and the unpadd...
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:5894
virtual IGatherLayer * addGather(ITensor &data, ITensor &indices, int axis)=0
Add a gather layer to the network.
virtual const char * getName() const =0
Return the name of a layer.
virtual TRT_DEPRECATED DimsHW getWindowSize() const =0
Get the window size for pooling.
Three-gate network consisting of Gated Recurrent Units.
virtual Dims getStrideNd() const =0
Get the multi-dimension stride of the convolution.
virtual Weights getBiasWeights() const =0
Get the bias weights for the convolution.
EngineCapability
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:82
virtual bool isNetworkInput() const =0
Whether the tensor is a network input.
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual int getNbElementWiseDims() const =0
Get the number of leading dimensions of indices tensor to be handled elementwise.
virtual Dims getPrePaddingNd() const =0
Get the padding that is applied at the start of the tensor.
virtual void setOperation(ReduceOperation op)=0
Set the reduce operation for the layer.
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
virtual bool platformHasTf32() const =0
Determine whether the platform has TF32 support.
virtual void setGpuAllocator(IGpuAllocator *allocator)=0
Set the GPU allocator.
int n() const
Get the index count.
Definition: NvInfer.h:358
virtual bool isNetworkOutput() const =0
Whether the tensor is a network output.
constexpr int EnumMax< FillOperation >()
Maximum number of elements in FillOperation enum.
Definition: NvInfer.h:4672
virtual ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept=0
Add a trip-count limiter, based on the given tensor.
constexpr int EnumMax< ElementWiseOperation >()
Maximum number of elements in ElementWiseOperation enum.
Definition: NvInfer.h:2571
virtual bool outputTypeIsSet(int index) const =0
whether the output type has been set for this layer
virtual int getNbGroups() const =0
Get the number of groups of the convolution.
virtual int getNbLayers() const =0
Get the number of layers in the network.
virtual void setAverageCountExcludesPadding(bool exclusive)=0
Set whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Use explicit padding, rounding output size down.
virtual TRT_DEPRECATED DimsHW getDilation() const =0
Get the dilation for a convolution.
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding of the convolution. If the padding is asymmetric, the pre-padding is returned.
virtual int getScales(int size, float *scales) const =0
Copies resize scales to scales[0, ..., nbScales-1], where nbScales is the number of scales that were ...
virtual ILoopOutputLayer * addLoopOutput(ITensor &tensor, LoopOutput outputKind, int axis=0) noexcept=0
Make an output for this loop, based on the given tensor.
virtual EngineCapability getEngineCapability() const =0
Query EngineCapability flow configured for the builder.
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
constexpr int EnumMax< RNNInputMode >()
Maximum number of elements in RNNInputMode enum.
Definition: NvInfer.h:2791
virtual IShapeLayer * addShape(ITensor &input)=0
Add a shape layer to the network.
Check if element in first tensor is less than corresponding element in second tensor.
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Get the stride of the deconvolution.
virtual const void * readHistogramCache(std::size_t &length)=0
Load a histogram.
Elements correspond to different spatial data.
virtual Dims getPostPadding() const =0
Get the padding.
virtual void setScales(const float *scales, int nbScales)=0
Set the resize scales.
An Activation layer in a network definition.
Definition: NvInfer.h:1599
virtual IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power)=0
Add a Scale layer to the network.
virtual void setBeta(double beta) noexcept=0
Set the beta parameter.
Identical coefficients across all elements of the tensor.
int & h()
Get the height.
Definition: NvInfer.h:252
virtual void setK(int k)=0
Set the k value for the layer.
int order[Dims::MAX_DIMS]
Definition: NvInfer.h:3671
constexpr int EnumMax< QuantizationFlag >()
Maximum number of quantization flags in QuantizationFlag enum.
Definition: NvInfer.h:6284
virtual TRT_DEPRECATED DimsHW getPostPadding() const =0
Get the padding that is applied at the end of the tensor.
virtual Weights getWeightsForGate(int layerIndex, RNNGateType gate, bool isW) const =0
Get the weight parameters for an individual gate in the RNN.
virtual TRT_DEPRECATED bool getStrictTypeConstraints() const =0
Query whether or not type constraints are strict.
A deconvolution layer in a network definition.
Definition: NvInfer.h:2234