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)
1730 kMAX_AVERAGE_BLEND = 2
2895 virtual uint32_t getLayerCount()
const TRTNOEXCEPT = 0;
2905 virtual std::size_t getHiddenSize()
const TRTNOEXCEPT = 0;
2915 virtual int32_t getSeqLength()
const TRTNOEXCEPT = 0;
3154 virtual int32_t getDataLength()
const TRTNOEXCEPT = 0;
3253 virtual int32_t getLayerCount()
const TRTNOEXCEPT = 0;
3254 virtual int32_t getHiddenSize()
const TRTNOEXCEPT = 0;
3255 virtual int32_t getMaxSeqLength()
const TRTNOEXCEPT = 0;
3256 virtual int32_t getDataLength()
const TRTNOEXCEPT = 0;
4594 virtual LoopOutput getLoopOutput()
const noexcept = 0;
4608 virtual void setAxis(int32_t axis) noexcept = 0;
4611 virtual int32_t
getAxis()
const noexcept = 0;
4639 virtual TripLimit getTripLimit()
const noexcept = 0;
4646 virtual void setAxis(int32_t axis) noexcept = 0;
4649 virtual int32_t
getAxis()
const noexcept = 0;
4656 virtual void setReverse(
bool reverse) noexcept = 0;
4659 virtual bool getReverse()
const noexcept = 0;
4722 virtual void setName(
const char* name) noexcept = 0;
4729 virtual const char*
getName()
const noexcept = 0;
4835 virtual void setAlpha(
double alpha) noexcept = 0;
4847 virtual double getAlpha()
const noexcept = 0;
4862 virtual void setBeta(
double beta) noexcept = 0;
4874 virtual double getBeta()
const noexcept = 0;
6016 kLEGACY_CALIBRATION = 0,
6017 kENTROPY_CALIBRATION = 1,
6018 kENTROPY_CALIBRATION_2 = 2,
6019 kMINMAX_CALIBRATION = 3,
6063 virtual bool getBatch(
void* bindings[],
const char* names[], int32_t nbBindings)
TRTNOEXCEPT = 0;
6364 int32_t nbChoices, int32_t* selection)
TRTNOEXCEPT = 0;
7469 extern "C" TENSORRTAPI
void* createInferBuilder_INTERNAL(
void* logger, int32_t version);
7484 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:4507
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:2645
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:3901
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 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 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:1580
Definition: NvInfer.h:3746
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:4290
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:4340
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.
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:4927
Layer type for plugins.
Definition: NvInfer.h:3454
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:6244
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:3658
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:1219
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:4277
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:739
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:6457
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:6347
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:2861
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:1202
uint32_t NetworkDefinitionCreationFlags
This bitset is capable of representing one or more NetworkDefinitionCreationFlag flags constructed wi...
Definition: NvInfer.h:6922
virtual float getTimingMSec() const =0
The time in milliseconds to execute the algorithm.
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:4636
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:433
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:6211
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:6479
virtual uint32_t getReduceAxes() const =0
Get the axes to reduce for the layer.
Definition: NvInfer.h:6135
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:243
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:6466
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:3250
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:2887
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:6406
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:6024
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:4351
virtual void resetDynamicRange()=0
Undo effect of setDynamicRange.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:258
Definition: NvInfer.h:4591
virtual Dims getStride() const =0
Get the stride for the output slice.
virtual TRT_DEPRECATED 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 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:3754
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:1109
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:2097
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:6269
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:4759
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:1190
uint32_t QuantizationFlags
Represents a collection of one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:6387
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:4261
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:2625
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:3942
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:2821
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:2088
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]
Definition: NvInferRuntimeCommon.h:233
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3576
Definition: NvInfer.h:4642
virtual Dims getPrePadding() const =0
Get the pre-padding.
IBuilder * createInferBuilder(ILogger &logger)
Create an instance of an IBuilder class.
Definition: NvInfer.h:7482
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:6426
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:6141
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:793
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:4176
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 void setMaxWorkspaceSize(std::size_t workspaceSize)=0
Set the maximum workspace size.
Definition: NvInfer.h:4665
Layer type for pluginV2.
Definition: NvInfer.h:3477
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:2664
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.
Tensor is a scalar of type kBOOL. Loop terminates when value is false.
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3221
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.
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:3498
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:4064
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:6933
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:6111
ND (0 < N <= 8) nearest neighbor resizing.
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:6156
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:1190
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:4083
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:4152
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:6958
virtual Dims getPrePadding() const =0
Get the pre-padding.
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1067
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:1726
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 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:6499
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:2268
Layer type for shuffling data.
Definition: NvInfer.h:3769
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:2811
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:4550
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:3234
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:2013
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:2833
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:4527
Layer that represents a reduction operator across Shape, Int32, Float, and Half tensors.
Definition: NvInfer.h:3599
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:4206
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:6444
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:4751
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:6120
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:4782
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:4359
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:6396
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:6126
Application-implemented interface for calibration.
Definition: NvInfer.h:6040
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1266
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:4095
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:1031
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:4738
constexpr int32_t EnumMax< RNNDirection >()
Maximum number of elements in RNNDirection enum.
Definition: NvInfer.h:2841
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:6105
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:2694
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:4536
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:6417
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:4521
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:4543
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:6309
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:3525
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.
constexpr int32_t EnumMax< RNNInputMode >()
Maximum number of elements in RNNInputMode enum.
Definition: NvInfer.h:2869
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:6150
constexpr int32_t EnumMax< TacticSource >()
Maximum number of tactic sources in TacticSource enum.
Definition: NvInfer.h:6488
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:2124
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:2213
virtual void setFlags(BuilderFlags builderFlags)=0
Set the build mode flags to turn on builder options for this network.
Tensor is scalar of type kINT32 that contains the trip count.
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:6506
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:3909
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:4384
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 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:1751
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:1066
Layer that represents an unary operation.
Definition: NvInfer.h:3537
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:6970
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 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:1735
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:4075
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:1048
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 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:3587
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:1663
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:6014
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:2303