Go to the documentation of this file.
134 :
Dims2(height, width)
193 d[0] =
d[1] =
d[2] = 0;
203 Dims3(int32_t d0, int32_t d1, int32_t d2)
238 DimsCHW(int32_t channels, int32_t height, int32_t width)
239 :
Dims3(channels, height, width)
319 d[0] =
d[1] =
d[2] =
d[3] = 0;
330 Dims4(int32_t d0, int32_t d1, int32_t d2, int32_t d3)
368 DimsNCHW(int32_t batchSize, int32_t channels, int32_t height, int32_t width)
369 :
Dims4(batchSize, channels, height, width)
1729 kMAX_AVERAGE_BLEND = 2
2894 virtual uint32_t getLayerCount()
const TRTNOEXCEPT = 0;
2904 virtual std::size_t getHiddenSize()
const TRTNOEXCEPT = 0;
2914 virtual int32_t getSeqLength()
const TRTNOEXCEPT = 0;
3153 virtual int32_t getDataLength()
const TRTNOEXCEPT = 0;
3250 virtual int32_t getLayerCount()
const TRTNOEXCEPT = 0;
3251 virtual int32_t getHiddenSize()
const TRTNOEXCEPT = 0;
3252 virtual int32_t getMaxSeqLength()
const TRTNOEXCEPT = 0;
3253 virtual int32_t getDataLength()
const TRTNOEXCEPT = 0;
4593 virtual LoopOutput getLoopOutput()
const noexcept = 0;
4607 virtual void setAxis(int32_t axis) noexcept = 0;
4610 virtual int32_t
getAxis()
const noexcept = 0;
4638 virtual TripLimit getTripLimit()
const noexcept = 0;
4645 virtual void setAxis(int32_t axis) noexcept = 0;
4648 virtual int32_t
getAxis()
const noexcept = 0;
4655 virtual void setReverse(
bool reverse) noexcept = 0;
4658 virtual bool getReverse()
const noexcept = 0;
4721 virtual void setName(
const char* name) noexcept = 0;
4728 virtual const char*
getName()
const noexcept = 0;
4834 virtual void setAlpha(
double alpha) noexcept = 0;
4846 virtual double getAlpha()
const noexcept = 0;
4861 virtual void setBeta(
double beta) noexcept = 0;
4873 virtual double getBeta()
const noexcept = 0;
5986 kLEGACY_CALIBRATION = 0,
5987 kENTROPY_CALIBRATION = 1,
5988 kENTROPY_CALIBRATION_2 = 2,
5989 kMINMAX_CALIBRATION = 3,
6033 virtual bool getBatch(
void* bindings[],
const char* names[], int32_t nbBindings)
TRTNOEXCEPT = 0;
6334 int32_t nbChoices, int32_t* selection)
TRTNOEXCEPT = 0;
7439 extern "C" TENSORRTAPI
void* createInferBuilder_INTERNAL(
void* logger, int32_t version);
7454 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.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4504
virtual float getBeta() const =0
Get the beta parameter.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
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:190
virtual TensorLocation getLocation() const =0
Get the storage location of a tensor.
constexpr int32_t EnumMax< ElementWiseOperation >()
Maximum number of elements in ElementWiseOperation enum.
Definition: NvInfer.h:2644
virtual float getDynamicRangeMax() const =0
Get maximum of dynamic range.
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.
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.
Use explicit padding, rounding output size up.
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 TRT_DEPRECATED void setDeviceType(ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
SliceMode
Controls how ISliceLayer handles out of bounds coordinates.
Definition: NvInfer.h:3898
Use SAME padding, with prePadding >= postPadding.
virtual void setErrorRecorder(IErrorRecorder *recorder)=0
Set the ErrorRecorder for this interface.
virtual int32_t getAxis() const =0
Get the axis along which concatenation occurs.
virtual void setInputMode(RNNInputMode op)=0
Set the input mode of the RNN layer.
virtual TRT_DEPRECATED bool getTranspose(int32_t index) const =0
Get the transpose flag for an input tensor.
int32_t n() const
Get the index count.
Definition: NvInfer.h:391
virtual RNNDirection getDirection() const =0
Get the direction of the RNN layer.
virtual void setName(const char *name)=0
Sets the name of the network.
A fully connected layer in a network definition. This layer expects an input tensor of three or more ...
Definition: NvInfer.h:1579
Definition: NvInfer.h:3743
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...
No operation is performed on the first recurrent layer.
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.
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntimeCommon.h:231
Layer that represents a constant value.
Definition: NvInfer.h:4287
Use CAFFE padding, rounding output size down, uses prePadding value.
Dims4()
Construct an empty Dims2 object.
Definition: NvInfer.h:316
virtual float getAlpha() const =0
Get the alpha parameter.
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4337
virtual void clearQuantizationFlag(QuantizationFlag flag)=0
clear a quantization flag.
virtual IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept=0
Return layer that subscripts tensor by loop iteration.
virtual Weights getKernelWeights() const =0
Get the kernel weights for the deconvolution.
virtual int32_t getAxis() const noexcept=0
Get axis being iterated over.
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.
Minimum of the two elements.
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:4926
Layer type for plugins.
Definition: NvInfer.h:3451
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.
Per-channel coefficients.
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:110
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:6214
virtual TRT_DEPRECATED void setConvolutionOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the convolution output dimensions formula.
virtual bool unmarkOutputForShapes(ITensor &tensor)=0
Undo markOutputForShapes.
virtual TRT_DEPRECATED int32_t getMinFindIterations() const =0
Query the number of minimization iterations.
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:3655
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.
Descriptor for data with one channel dimension and two spatial dimensions.
Definition: NvInfer.h:218
A convolution layer in a network definition.
Definition: NvInfer.h:1218
virtual void setOperation(UnaryOperation op)=0
Set the unary operation for the layer.
virtual bool platformHasFastFp16() const =0
Determine whether the platform has fast native fp16.
virtual IDeconvolutionLayer * addDeconvolutionNd(ITensor &input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension deconvolution layer to the network.
A layer that represents the identity function.
Definition: NvInfer.h:4274
virtual ITensor * getOutput(int32_t index) const =0
Get the layer output corresponding to the given index.
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:722
virtual const IAlgorithmVariant & getAlgorithmVariant() const =0
Returns the algorithm variant.
Network iterates from first to last and vice versa and outputs concatenated.
virtual bool getReverse() const noexcept=0
True if and only if reversing input.
virtual int32_t getMinTimingIterations() const =0
Query the number of minimization iterations.
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:6427
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.
Interface implemented by application for selecting and reporting algorithms of a layer provided by th...
Definition: NvInfer.h:6317
virtual void setNbOutputChannels(int32_t nbOutputs)=0
Set the number of output channels K from the fully connected layer.
virtual void setKernelSizeNd(Dims kernelSize)=0
Set the multi-dimension kernel size of the convolution.
RNNInputMode
Enumerates the RNN input modes that may occur with an RNN layer.
Definition: NvInfer.h:2860
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the deconvolution.
constexpr int32_t EnumMax< PaddingMode >()
Maximum number of elements in PaddingMode enum.
Definition: NvInfer.h:1201
uint32_t NetworkDefinitionCreationFlags
This bitset is capable of representing one or more NetworkDefinitionCreationFlag flags constructed wi...
Definition: NvInfer.h:6892
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 void setInt8Mode(bool mode)=0
Set whether or not quantized 8-bit kernels are permitted.
Definition: NvInfer.h:4635
virtual Weights getBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW) const =0
Get the bias parameters for an individual gate in the RNN.
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:398
virtual bool platformHasFastInt8() const =0
Determine whether the platform has fast native int8.
virtual void setNbGroups(int32_t nbGroups)=0
Set the number of groups for a deconvolution.
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:6181
virtual void setType(DataType type)=0
Set the data type of a tensor.
virtual void reset()=0
Resets the builder state to default values.
TacticSource
List of tactic sources for TensorRT.
Definition: NvInfer.h:6449
virtual uint32_t getReduceAxes() const =0
Get the axes to reduce for the layer.
Definition: NvInfer.h:6105
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.
virtual Dims getPostPadding() const =0
Get the padding.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual void setBroadcastAcrossBatch(bool broadcastAcrossBatch)=0
Set whether to enable broadcast of tensor across the batch.
virtual ILoopOutputLayer * addLoopOutput(ITensor &tensor, LoopOutput outputKind, int32_t axis=0) noexcept=0
Make an output for this loop, based on the given tensor.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInferRuntimeCommon.h:242
virtual IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation)=0
Add a unary layer to the network.
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 int32_t getBatchSize() const =0
Get the batch size used for calibration batches.
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 TRT_DEPRECATED float getDynamicRange() const =0
Get dynamic range for the tensor.
virtual TRT_DEPRECATED IDeconvolutionLayer * addDeconvolution(ITensor &input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a deconvolution layer to the network.
int32_t h() const
Get the height.
Definition: NvInfer.h:280
virtual void setAxis(int32_t axis)=0
Set the axis along which concatenation occurs.
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.
Fail with error when the coordinates are out of bounds. This is the default.
DimsNCHW()
Construct an empty DimsNCHW object.
Definition: NvInfer.h:352
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.
Like kNONE, but transpose the matrix dimensions.
constexpr int32_t EnumMax< ProfilingVerbosity >()
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInfer.h:6436
virtual void setOperation(int32_t index, MatrixOperation op)=0
Set the operation for an input tensor.
Enable building a refittable engine.
virtual void setStride(Dims stride)=0
Set the stride for computing the output slice data.
int32_t & n()
Get the index count.
Definition: NvInfer.h:381
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.
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the convolution.
An RNN layer in a network definition, version 2.
Definition: NvInfer.h:3247
virtual TacticSources getTacticSources() const =0
Get tactic sources.
virtual TRT_DEPRECATED void setMinFindIterations(int32_t minFind)=0
Set the number of minimization iterations used when timing layers.
virtual void setAvgTimingIterations(int32_t avgTiming)=0
Set the number of averaging iterations used when timing layers.
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,...
Logical AND of two elements.
virtual TRT_DEPRECATED DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
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 void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the convolution.
virtual int32_t getAxis() const noexcept=0
Get axis being concatenated over.
A RNN layer in a network definition.
Definition: NvInfer.h:2886
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 IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept=0
Create a recurrence layer for this loop with initialValue as its first input.
virtual int32_t getNbInputs() const =0
Get the number of inputs in the network.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride for pooling.
constexpr int32_t EnumMax< QuantizationFlag >()
Maximum number of quantization flags in QuantizationFlag enum.
Definition: NvInfer.h:6376
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...
constexpr int32_t EnumMax< CalibrationAlgoType >()
Maximum number of elements in CalibrationAlgoType enum.
Definition: NvInfer.h:5994
virtual IScaleLayer * addScaleNd(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis)=0
Add a multi-dimension scale layer to the network.
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.
ResizeMode
Enumerates various modes of resize in the resize layer. Resize mode set using setResizeMode().
Definition: NvInfer.h:4348
virtual void resetDynamicRange()=0
Undo effect of setDynamicRange.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:257
Definition: NvInfer.h:4590
virtual Dims getStride() const =0
Get the stride for the output slice.
virtual uint32_t getReduceAxes() const =0
Get the axes over which to reduce for the layer.
virtual TopKOperation getOperation() const =0
Get the operation for the layer.
virtual void setOperation(FillOperation op) noexcept=0
Set the fill operation for the layer.
virtual int32_t getScales(int32_t size, float *scales) const =0
Copies resize scales to scales[0, ..., nbScales-1], where nbScales is the number of scales that were ...
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 void setK(float k)=0
Set the LRN K value.
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:227
virtual IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims windowSize)=0
Add a multi-dimension pooling layer to the network.
virtual bool getQuantizationFlag(QuantizationFlag flag) const =0
Returns true if the quantization flag is set.
virtual int32_t getNbOutputMaps() const =0
Get the number of output feature maps for the deconvolution.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the deconvolution.
virtual void setScales(const float *scales, int32_t nbScales)=0
Set the resize scales.
int32_t & h()
Get the height.
Definition: NvInfer.h:270
int32_t order[Dims::MAX_DIMS]
Definition: NvInfer.h:3751
Output value is concatenation of values of tensor for each iteration, in reverse order.
virtual Dims getPrePadding() const =0
Get the pre-padding.
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1066
virtual TRT_DEPRECATED bool getFp16Mode() const =0
Query whether 16-bit kernels are permitted.
virtual void setGatherAxis(int32_t axis)=0
Set the axis to gather on. The axis must be less than the number of dimensions in the data input.
constexpr int32_t EnumMax< ScaleMode >()
Maximum number of elements in ScaleMode enum.
Definition: NvInfer.h:2096
int32_t & c()
Get the channel count.
Definition: NvInfer.h:250
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:6239
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.
int32_t & c()
Get the channel count.
Definition: NvInfer.h:401
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.
virtual DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
virtual bool isShapeTensor() const =0
Whether the tensor is a shape tensor.
virtual ITensor * getOutput(int32_t index) const =0
Get the output tensor specified by the given index.
virtual TRT_DEPRECATED bool getInt8Mode() const =0
Query whether Int8 mode is used.
constexpr int32_t EnumMax< FillOperation >()
Maximum number of elements in FillOperation enum.
Definition: NvInfer.h:4758
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1173
uint32_t QuantizationFlags
Represents a collection of one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:6357
Enable FP16 layer selection, with FP32 fallback.
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInferRuntimeCommon.h:141
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:4258
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 void writeHistogramCache(const void *ptr, std::size_t length)=0
Save a histogram cache.
Use SAME padding, with prePadding <= postPadding.
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 multi-dimension pre-padding of the deconvolution.
virtual void setAlpha(float alpha)=0
Set the LRN alpha value.
#define TRTNOEXCEPT
Definition: NvInferRuntimeCommon.h:103
DimsHW(int32_t height, int32_t width)
Construct a DimsHW given height and width.
Definition: NvInfer.h:133
int32_t d[MAX_DIMS]
The extent of each dimension.
Definition: NvInferRuntimeCommon.h:232
virtual int32_t getChannelAxis() const =0
Get the channel axis.
virtual void setPrePadding(Dims padding)=0
Set the multi-dimension pre-padding of the convolution.
virtual int32_t getNbInputs() const =0
Get the number of inputs of a layer.
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2624
virtual int32_t getNbOptimizationProfiles() const noexcept=0
Get number of optimization profiles.
Generate a tensor with random values drawn from a uniform distribution.
virtual bool setTacticSources(TacticSources tacticSources)=0
Set tactic sources.
Divide the first element by the second.
virtual bool getBatch(void *bindings[], const char *names[], int32_t nbBindings)=0
Get a batch of input for calibration.
Single gate RNN w/ ReLU activation function.
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3939
virtual TRT_DEPRECATED IPaddingLayer * addPadding(ITensor &input, DimsHW prePadding, DimsHW postPadding)=0
Add a padding layer to the network.
virtual bool getKeepDimensions() const =0
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
constexpr int32_t EnumMax< RNNOperation >()
Maximum number of elements in RNNOperation enum.
Definition: NvInfer.h:2820
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:2087
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.
Use explicit padding, rounding output size down.
virtual bool dynamicRangeIsSet() const =0
Query whether dynamic range is set.
Logical OR of two elements.
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 int32_t getAvgTimingIterations() const =0
Query the number of averaging iterations.
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:233
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3573
Definition: NvInfer.h:4641
virtual Dims getPrePadding() const =0
Get the pre-padding.
IBuilder * createInferBuilder(ILogger &logger)
Create an instance of an IBuilder class.
Definition: NvInfer.h:7452
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:6396
virtual int32_t getNbElementWiseDims() const =0
Get the number of leading dimensions of indices tensor to be handled elementwise.
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 setAxis(int32_t axis) noexcept=0
Set axis to iterate over.
virtual void setBeta(float beta)=0
Set the LRN beta value.
The first element to the power of the second element.
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.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6111
virtual Weights getWeights() const =0
Get the weights for the layer.
virtual void setName(const char *name)=0
Set the tensor name.
virtual Weights getPower() const =0
Get the power value.
virtual TRT_DEPRECATED int32_t getAverageFindIterations() const =0
Query the number of averaging iterations.
The TensorRT API version 1 namespace.
Base class for all layer classes in a network definition.
Definition: NvInfer.h:792
int32_t & h()
Get the height.
Definition: NvInfer.h:421
virtual bool hasImplicitBatchDimension() const =0
Query whether the network was created with an implicit batch dimension.
constexpr int32_t EnumMax< MatrixOperation >()
Maximum number of elements in MatrixOperation enum.
Definition: NvInfer.h:4173
virtual void setFlag(BuilderFlag builderFlag)=0
Set a single build mode flag.
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.
virtual ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes)=0
Add a TopK layer to the network.
virtual QuantizationFlags getQuantizationFlags() const =0
Get the quantization flags.
virtual void removeTensor(ITensor &tensor)=0
remove a tensor from the network definition.
virtual TRT_DEPRECATED IPluginLayer * addPlugin(ITensor *const *inputs, int32_t nbInputs, IPlugin &plugin)=0
Add a plugin layer to the network.
virtual void setMinTimingIterations(int32_t minTiming)=0
Set the number of minimization iterations used when timing layers.
Inverse hyperbolic tangent.
virtual DataType getPrecision() const =0
get the computational precision of this layer
virtual void setSecondTranspose(Permutation permutation)=0
Set the permutation applied by the second transpose operation.
virtual ILayer * getLayer(int32_t index) const =0
Get the layer 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:4664
Layer type for pluginV2.
Definition: NvInfer.h:3474
int32_t h() const
Get the height.
Definition: NvInfer.h:154
virtual IActivationLayer * addActivation(ITensor &input, ActivationType type)=0
Add an activation layer to the network.
Enables strict type constraints.
virtual IErrorRecorder * getErrorRecorder() const =0
get the ErrorRecorder assigned to this interface.
Dims3(int32_t d0, int32_t d1, int32_t d2)
Construct a Dims3 from 3 elements.
Definition: NvInfer.h:203
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:2663
Network iterations from first input to last input.
virtual ScaleMode getMode() const =0
Get the scale mode.
int32_t & w()
Get the width.
Definition: NvInfer.h:441
virtual float getBeta() const =0
Get the LRN beta value.
virtual TRT_DEPRECATED IRNNLayer * addRNN(ITensor &inputs, int32_t layerCount, std::size_t hiddenSize, int32_t 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...
Inverse hyperbolic cosine.
virtual void setK(int32_t k)=0
Set the k value for the layer.
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3220
virtual void setWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights weights)=0
Set the weight parameters for an individual gate in the RNN.
virtual TRT_DEPRECATED void setDLACore(int32_t dlaCore)=0
Set the DLA core that the engine must execute on.
Check if two elements are equal.
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:115
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.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual void setOperation(RNNOperation op)=0
Set the operation of the RNN layer.
Mark the network to be an explicit precision network.
virtual void setName(const char *name)=0
Set the name of a layer.
virtual Weights getBiasWeights() const =0
Get the bias weights for the deconvolution.
virtual int32_t getNbDLACores() const =0
Return the number of DLA engines available to this builder.
virtual LayerType getType() const =0
Return the type of a layer.
virtual DataType getOutputType(int32_t index) const =0
get the output type of this layer
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:3495
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.
Output value is value of tensor for last iteration.
virtual void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the deconvolution.
virtual void setInput(int32_t index, ITensor &tensor)=0
Replace an input of this layer with a specific tensor.
constexpr int32_t EnumMax< LayerType >()
Maximum number of elements in LayerType enum.
Definition: NvInfer.h:504
virtual void setPostPadding(Dims padding)=0
Set the multi-dimension post-padding for pooling.
Layer type for getting shape of a tensor.
Definition: NvInfer.h:4061
virtual void setOutputDimensions(Dims dimensions)=0
Set the output dimensions.
Coordinates wrap around periodically.
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 void setOutputType(int32_t index, DataType dataType)=0
Set the output type of this layer.
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
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:6903
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:6081
virtual TRT_DEPRECATED DimsHW getPrePadding() const =0
Get the padding that is applied at the start of the tensor.
virtual const char * getName() const =0
Get the tensor name.
Generate evenly spaced numbers over a specified interval.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6126
Dims4(int32_t d0, int32_t d1, int32_t d2, int32_t d3)
Construct a Dims4 from 4 elements.
Definition: NvInfer.h:330
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:1189
virtual Permutation getFirstTranspose() const =0
Get the permutation applied by the first transpose operation.
virtual bool outputTypeIsSet(int32_t index) const =0
whether the output type has been set for this layer
virtual TRT_DEPRECATED void setRefittable(bool canRefit)=0
constexpr int32_t EnumMax< TopKOperation >()
Maximum number of elements in TopKOperation enum.
Definition: NvInfer.h:4080
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 void setNbGroups(int32_t nbGroups)=0
Set the number of groups for a convolution.
virtual void setReshapeDimensions(Dims dimensions)=0
Set the reshaped dimensions.
Perform the normal matrix multiplication in the first recurrent layer.
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.
int32_t c() const
Get the channel count.
Definition: NvInfer.h:260
virtual Dims getDilationNd() const =0
Get the multi-dimension dilation of the deconvolution.
virtual IPluginV2Layer * addPluginV2(ITensor *const *inputs, int32_t nbInputs, IPluginV2 &plugin)=0
Add a plugin layer to the network using the IPluginV2 interface.
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:256
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:4149
virtual TRT_DEPRECATED bool getHalf2Mode() const =0
Query whether half2 mode is used.
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >()
Maximum number of elements in NetworkDefinitionCreationFlag enum.
Definition: NvInfer.h:6928
virtual void setBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights bias)=0
Set the bias parameters for an individual gate in the RNN.
virtual Dims getPrePadding() const =0
Get the pre-padding.
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1050
virtual TRT_DEPRECATED IOutputDimensionsFormula & getConvolutionOutputDimensionsFormula() const =0
Get the convolution output dimensions formula.
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1725
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding for pooling.
virtual int32_t getNbOutputChannels() const =0
Get the number of output channels K from the fully connected layer.
virtual RNNOperation getOperation() const =0
Get the operation of the RNN layer.
virtual Weights getKernelWeights() const =0
Get the kernel weights.
virtual int32_t getNbOutputs() const =0
Get the number of outputs of a layer.
virtual nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept=0
Create a new optimization profile.
Output value is concatenation of values of tensor for each iteration, in forward order.
virtual TRT_DEPRECATED bool getDebugSync() const =0
Query whether the builder will use debug synchronization.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInfer.h:6469
int32_t w() const
Get the width.
Definition: NvInfer.h:451
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:169
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:346
virtual std::size_t getMaxWorkspaceSize() const =0
Get the maximum workspace size.
A concatenation layer in a network definition.
Definition: NvInfer.h:2267
Layer type for shuffling data.
Definition: NvInfer.h:3766
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.
Dims2(int32_t d0, int32_t d1)
Construct a Dims2 from 2 elements.
Definition: NvInfer.h:103
RNNOperation
Enumerates the RNN operations that may be performed by an RNN layer.
Definition: NvInfer.h:2810
A tensor in a network definition.
Definition: NvInfer.h:522
virtual TRT_DEPRECATED void setAverageFindIterations(int32_t avgFind)=0
Set the number of averaging iterations used when timing layers.
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
replace an input of this layer with a specific tensor.
virtual nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags)=0
Create a network definition object.
Definition: NvInfer.h:4549
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.
Floor division of the first element by the second.
virtual Dims getKernelSizeNd() const =0
Get the multi-dimension kernel size of the convolution.
LayerType
The type values of layer classes.
Definition: NvInfer.h:464
virtual TensorFormat getTensorFormat() const =0
Return TensorFormat of the input/output of algorithm.
virtual void setReverse(bool reverse) noexcept=0
constexpr int32_t EnumMax< RNNGateType >()
Maximum number of elements in RNNGateType enum.
Definition: NvInfer.h:3233
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.
static const int32_t MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:230
Identical coefficients across all elements of the tensor.
A LRN layer in a network definition.
Definition: NvInfer.h:2012
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:2832
int32_t & h()
Get the height.
Definition: NvInfer.h:144
virtual DataType getType() const =0
Get the data type of a tensor.
Four-gate LSTM network w/o peephole connections.
Check if element in first tensor is greater than corresponding element in second tensor.
virtual bool getZeroIsPlaceholder() const =0
Get meaning of 0 in reshape dimensions.
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4524
Layer that represents a reduction operator across Shape, Int32, Float, and Half tensors.
Definition: NvInfer.h:3596
DimsNCHW(int32_t batchSize, int32_t channels, int32_t height, int32_t width)
Construct a DimsNCHW given batch size, channel count, height and width.
Definition: NvInfer.h:368
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:4203
virtual void setDeviceType(const ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
virtual int32_t getDLACore() const =0
Get the DLA core that the engine executes on.
virtual const char * getName() const =0
Returns the name associated with the network.
Logical XOR of two elements.
Substract the second element from the first.
constexpr int32_t EnumMax< BuilderFlag >()
Maximum number of builder flags in BuilderFlag enum.
Definition: NvInfer.h:6414
int32_t & w()
Get the width.
Definition: NvInfer.h:164
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4750
virtual void setDLACore(int32_t dlaCore)=0
Sets the DLA core used by the network.
virtual nvinfer1::IBuilderConfig * createBuilderConfig()=0
Create a builder configuration object.
virtual IIdentityLayer * addIdentity(ITensor &input)=0
Add an identity layer.
virtual IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds)=0
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:6090
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:4781
virtual ITensor * getSequenceLengths() const =0
Get the sequence lengths specified for the RNN.
virtual void setPostPadding(Dims padding)=0
Set the multi-dimension post-padding of the convolution.
constexpr int32_t EnumMax< ResizeMode >()
Maximum number of elements in ResizeMode enum.
Definition: NvInfer.h:4356
virtual ILRNLayer * addLRN(ITensor &input, int32_t window, float alpha, float beta, float k)=0
Add a LRN layer to the network.
Descriptor for three-dimensional data.
Definition: NvInfer.h:184
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:6366
virtual void setPostPadding(Dims padding)=0
Set the multi-dimension post-padding of the deconvolution.
virtual bool getBroadcastAcrossBatch() const =0
Check if tensor is broadcast across the batch.
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6096
Application-implemented interface for calibration.
Definition: NvInfer.h:6010
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1223
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).
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual int32_t getNbLayers() const =0
Get the number of layers in the network.
Layer that represents a TopK reduction.
Definition: NvInfer.h:4092
virtual void setAllowedFormats(TensorFormats formats)=0
Set allowed formats for this tensor. By default all formats are allowed. Shape tensors (for which isS...
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.
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1014
virtual IFullyConnectedLayer * addFullyConnected(ITensor &input, int32_t nbOutputs, Weights kernelWeights, Weights biasWeights)=0
Add a fully connected layer to the network.
virtual void setQuantizationFlags(QuantizationFlags flags)=0
Set the quantization flags.
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the convolution.
Use CAFFE padding, rounding output size up, uses prePadding value.
Definition: NvInfer.h:4737
constexpr int32_t EnumMax< RNNDirection >()
Maximum number of elements in RNNDirection enum.
Definition: NvInfer.h:2840
virtual void setWeights(Weights weights)=0
Set the weights for the layer.
virtual CalibrationAlgoType getAlgorithm()=0
Get the algorithm used by this calibrator.
virtual TRT_DEPRECATED void setTranspose(int32_t index, bool val)=0
Set the transpose flag for an input tensor.
virtual void destroy()=0
Destroy this INetworkDefinition object.
Definition: NvInfer.h:6075
virtual float getK() const =0
Get the LRN K 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:2693
virtual int32_t getNbGroups() const =0
Get the number of groups of the convolution.
virtual PoolingType getPoolingType() const =0
Get the type of activation to be performed.
constexpr int32_t EnumMax< TripLimit >()
Maximum number of elements in TripLimit enum.
Definition: NvInfer.h:4535
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 TRT_DEPRECATED int32_t getDLACore() const =0
Get the DLA core that the engine executes on.
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.
virtual int32_t getNbOutputs() const =0
Return number of outputs of the algorithm.
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 Dims getStrides() const =0
Return strides of the input/output tensor of algorithm.
virtual void setNbElementWiseDims(int32_t k)=0
Set the number of leading dimensions of indices tensor to be handled elementwise. k must be 0 if ther...
uint32_t BuilderFlags
Represents a collection of one or more QuantizationFlag values using binary OR operations,...
Definition: NvInfer.h:6387
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.
Product of the two elements.
virtual ReduceOperation getOperation() const =0
Get the reduce operation for the layer.
constexpr int32_t EnumMax< LoopOutput >()
Maximum number of elements in LoopOutput enum.
Definition: NvInfer.h:4518
virtual const IOptimizationProfile * getCalibrationProfile() noexcept=0
Get the current calibration profile.
virtual ITensor * getInput(int32_t index) const =0
Get the input tensor specified by the given index.
Definition: NvInfer.h:4542
EngineCapability
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:82
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:6279
virtual int64_t getTactic() const =0
Return tactic of the algorithm.
virtual float getBlendFactor() const =0
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding of the convolution.
constexpr int32_t EnumMax< UnaryOperation >()
Maximum number of elements in UnaryOperation enum.
Definition: NvInfer.h:3522
virtual void setPrePaddingNd(Dims padding)=0
Set the padding that is applied at the start of the tensor.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
virtual void setHiddenState(ITensor &hidden)=0
Set the initial hidden state of the RNN with the provided hidden ITensor.
constexpr int32_t EnumMax< RNNInputMode >()
Maximum number of elements in RNNInputMode enum.
Definition: NvInfer.h:2868
virtual const char * getName() const =0
Return name of the algorithm node. This is a unique identifier for the IAlgorithmContext.
virtual int32_t getGatherAxis() const =0
Get the axis to gather on.
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 void setNbOutputMaps(int32_t nbOutputMaps)=0
Set the number of output feature maps for the deconvolution.
virtual int32_t getMaxDLABatchSize() const =0
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combi...
virtual int32_t getNbOutputs() const =0
Get the number of outputs in the network.
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:6120
constexpr int32_t EnumMax< TacticSource >()
Maximum number of tactic sources in TacticSource enum.
Definition: NvInfer.h:6458
Check if element in first tensor is less than corresponding element in second tensor.
virtual void setAxes(uint32_t axes)=0
Set the axis along which softmax is computed. Currently, only one axis can be set.
int32_t & w()
Get the width.
Definition: NvInfer.h:290
virtual IGatherLayer * addGather(ITensor &data, ITensor &indices, int32_t axis)=0
Add a gather layer to the network.
DimsCHW(int32_t channels, int32_t height, int32_t width)
Construct a DimsCHW given channel count, height and width.
Definition: NvInfer.h:238
virtual float getAlpha() const =0
Get the LRN alpha value.
virtual Dims getStrideNd() const =0
Get the multi-dimension stride of the deconvolution.
A Scale layer in a network definition.
Definition: NvInfer.h:2123
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.
virtual uint32_t getAxes() const =0
Get the axis along which softmax occurs.
Three-gate network consisting of Gated Recurrent Units.
A Softmax layer in a network definition.
Definition: NvInfer.h:2212
virtual void setFlags(BuilderFlags builderFlags)=0
Set the build mode flags to turn on builder options for this network.
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.
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:6476
virtual void resetPrecision()=0
reset the computational precision for this layer
constexpr int32_t EnumMax< SliceMode >()
Maximum number of elements in SliceMode enum.
Definition: NvInfer.h:3906
virtual int32_t getNbOutputMaps() const =0
Get the number of output maps for the convolution.
virtual void setMaxBatchSize(int32_t batchSize)=0
Set the maximum batch size.
virtual MatrixOperation getOperation(int32_t index) const =0
Get the operation for an input tensor.
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.
virtual void setShift(Weights shift)=0
Set the shift value.
int32_t h() const
Get the height.
Definition: NvInfer.h:431
virtual int32_t getNbInputs() const =0
Return number of inputs of the algorithm.
Single gate RNN w/ TANH activation function.
A resize layer in a network definition.
Definition: NvInfer.h:4381
DimsHW()
Construct an empty DimsHW object.
Definition: NvInfer.h:121
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:146
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 void resetOutputType(int32_t index)=0
reset the output type for this layer
virtual UnaryOperation getOperation() const =0
Get the unary operation for the layer.
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 Dims getPaddingNd() const =0
Get the multi-dimension padding for pooling.
Descriptor for four-dimensional data.
Definition: NvInfer.h:310
A Pooling layer in a network definition.
Definition: NvInfer.h:1750
virtual void setAlgorithmSelector(IAlgorithmSelector *selector)=0
Set Algorithm Selector.
virtual Dims getReshapeDimensions() const =0
Get the reshaped dimensions.
virtual std::size_t getWorkspaceSize() const =0
The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
virtual void setWindowSize(int32_t windowSize)=0
Set the LRN window size.
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1023
Layer that represents an unary operation.
Definition: NvInfer.h:3534
int32_t w() const
Get the width.
Definition: NvInfer.h:300
virtual int32_t getK() const =0
Get the k value for the layer.
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.
Builds an engine from a network definition.
Definition: NvInfer.h:6940
virtual bool isExecutionTensor() const =0
Whether the tensor is an execution tensor.
int32_t w() const
Get the width.
Definition: NvInfer.h:174
DimsCHW()
Construct an empty DimsCHW object.
Definition: NvInfer.h:224
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 void setAxis(int32_t axis) noexcept=0
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Elements correspond to different spatial data.
void setInput(int32_t index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
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...
virtual TRT_DEPRECATED IConvolutionLayer * addConvolution(ITensor &input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a convolution layer to the network.
virtual IConvolutionLayer * addConvolutionNd(ITensor &input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension convolution 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.
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.
virtual bool isNetworkInput() const =0
Whether the tensor is a network input.
constexpr int32_t EnumMax< PoolingType >()
Maximum number of elements in PoolingType enum.
Definition: NvInfer.h:1734
Mark the network to be an explicit batch network.
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 TRT_DEPRECATED IPluginLayer * addPluginExt(ITensor *const *inputs, int32_t nbInputs, IPluginExt &plugin)=0
Add a plugin layer to the network using an IPluginExt interface.
virtual bool platformHasTf32() const =0
Determine whether the platform has TF32 support.
Elements correspond to different batch index.
virtual void setGpuAllocator(IGpuAllocator *allocator)=0
Set the GPU allocator.
virtual int32_t getMaxBatchSize() const =0
Get the maximum batch size.
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:4072
virtual bool isNetworkOutput() const =0
Whether the tensor is a network output.
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:1005
virtual ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept=0
Add a trip-count limiter, based on the given tensor.
virtual int32_t getNbGroups() const =0
Get the number of groups for a deconvolution.
virtual void setAverageCountExcludesPadding(bool exclusive)=0
Set whether average pooling uses as a denominator the overlap area between the window and the unpadde...
virtual ITensor * getInput(int32_t index) const =0
Get the layer input corresponding to the given index.
virtual TRT_DEPRECATED DimsHW getDilation() const =0
Get the dilation for a convolution.
virtual int32_t addOptimizationProfile(const IOptimizationProfile *profile) noexcept=0
Add an optimization profile.
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding of the convolution. If the padding is asymmetric, the pre-padding is returned.
virtual EngineCapability getEngineCapability() const =0
Query EngineCapability flow configured for the builder.
virtual IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs)=0
Add a concatenation layer to the network.
virtual Weights getWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW) const =0
Get the weight parameters for an individual gate in the RNN.
virtual void setPrePadding(Dims padding)=0
Set the multi-dimension pre-padding for pooling.
virtual IShapeLayer * addShape(ITensor &input)=0
Add a shape layer to the network.
int32_t c() const
Get the channel count.
Definition: NvInfer.h:411
constexpr int32_t EnumMax< ReduceOperation >()
Maximum number of elements in ReduceOperation enum.
Definition: NvInfer.h:3584
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.
virtual Dims getPostPadding() const =0
Get the padding.
An Activation layer in a network definition.
Definition: NvInfer.h:1662
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:5984
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.
virtual int32_t getWindowSize() const =0
Get the LRN window size.
virtual void setNbOutputMaps(int32_t nbOutputMaps)=0
Set the number of output maps for the convolution.
virtual TRT_DEPRECATED DimsHW getPostPadding() const =0
Get the padding that is applied at the end of the tensor.
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:2302