TensorRT  7.1.0.16
NvInfer.h
Go to the documentation of this file.
1 /*
2  * Copyright 1993-2020 NVIDIA Corporation. All rights reserved.
3  *
4  * NOTICE TO LICENSEE:
5  *
6  * This source code and/or documentation ("Licensed Deliverables") are
7  * subject to NVIDIA intellectual property rights under U.S. and
8  * international Copyright laws.
9  *
10  * These Licensed Deliverables contained herein is PROPRIETARY and
11  * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12  * conditions of a form of NVIDIA software license agreement by and
13  * between NVIDIA and Licensee ("License Agreement") or electronically
14  * accepted by Licensee. Notwithstanding any terms or conditions to
15  * the contrary in the License Agreement, reproduction or disclosure
16  * of the Licensed Deliverables to any third party without the express
17  * written consent of NVIDIA is prohibited.
18  *
19  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20  * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21  * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22  * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23  * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24  * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25  * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26  * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27  * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28  * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32  * OF THESE LICENSED DELIVERABLES.
33  *
34  * U.S. Government End Users. These Licensed Deliverables are a
35  * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36  * 1995), consisting of "commercial computer software" and "commercial
37  * computer software documentation" as such terms are used in 48
38  * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39  * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40  * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41  * U.S. Government End Users acquire the Licensed Deliverables with
42  * only those rights set forth herein.
43  *
44  * Any use of the Licensed Deliverables in individual and commercial
45  * software must include, in the user documentation and internal
46  * comments to the code, the above Disclaimer and U.S. Government End
47  * Users Notice.
48  */
49 
50 #ifndef NV_INFER_H
51 #define NV_INFER_H
52 
53 #include "NvInferRuntime.h"
54 
63 //
66 
72 
78 namespace nvinfer1
79 {
80 
85 class Dims2 : public Dims
86 {
87 public:
92  {
93  nbDims = 2;
94  d[0] = d[1] = 0;
95  }
96 
103  Dims2(int d0, int d1)
104  {
105  nbDims = 2;
106  d[0] = d0;
107  d[1] = d1;
108  }
109 };
110 
115 class DimsHW : public Dims2
116 {
117 public:
122  : Dims2()
123  {
125  }
126 
133  DimsHW(int height, int width)
134  : Dims2(height, width)
135  {
137  }
138 
144  int& h() { return d[0]; }
145 
151  int h() const { return d[0]; }
152 
158  int& w() { return d[1]; }
159 
165  int w() const { return d[1]; }
166 };
167 
172 class Dims3 : public Dims
173 {
174 public:
179  {
180  nbDims = 3;
181  d[0] = d[1] = d[2] = 0;
182  }
183 
191  Dims3(int d0, int d1, int d2)
192  {
193  nbDims = 3;
194  d[0] = d0;
195  d[1] = d1;
196  d[2] = d2;
197  }
198 };
199 
206 class TRT_DEPRECATED DimsCHW : public Dims3
207 {
208 public:
213  : Dims3()
214  {
215  type[0] = DimensionType::kCHANNEL;
216  type[1] = type[2] = DimensionType::kSPATIAL;
217  }
218 
226  DimsCHW(int channels, int height, int width)
227  : Dims3(channels, height, width)
228  {
229  type[0] = DimensionType::kCHANNEL;
230  type[1] = type[2] = DimensionType::kSPATIAL;
231  }
232 
238  int& c() { return d[0]; }
239 
245  int c() const { return d[0]; }
246 
252  int& h() { return d[1]; }
253 
259  int h() const { return d[1]; }
260 
266  int& w() { return d[2]; }
267 
273  int w() const { return d[2]; }
274 };
275 
280 class Dims4 : public Dims
281 {
282 public:
287  {
288  nbDims = 4;
289  d[0] = d[1] = d[2] = d[3] = 0;
290  }
291 
300  Dims4(int d0, int d1, int d2, int d3)
301  {
302  nbDims = 4;
303  d[0] = d0;
304  d[1] = d1;
305  d[2] = d2;
306  d[3] = d3;
307  }
308 };
309 
316 class TRT_DEPRECATED DimsNCHW : public Dims4
317 {
318 public:
323  : Dims4()
324  {
325  type[0] = DimensionType::kINDEX;
326  type[1] = DimensionType::kCHANNEL;
327  type[2] = type[3] = DimensionType::kSPATIAL;
328  }
329 
338  DimsNCHW(int batchSize, int channels, int height, int width)
339  : Dims4(batchSize, channels, height, width)
340  {
341  type[0] = DimensionType::kINDEX;
342  type[1] = DimensionType::kCHANNEL;
343  type[2] = type[3] = DimensionType::kSPATIAL;
344  }
345 
351  int& n() { return d[0]; }
352 
358  int n() const { return d[0]; }
359 
365  int& c() { return d[1]; }
366 
372  int c() const { return d[1]; }
373 
379  int& h() { return d[2]; }
380 
386  int h() const { return d[2]; }
387 
393  int& w() { return d[3]; }
394 
400  int w() const { return d[3]; }
401 };
402 
410 enum class LayerType : int
411 {
412  kCONVOLUTION = 0,
413  kFULLY_CONNECTED = 1,
414  kACTIVATION = 2,
415  kPOOLING = 3,
416  kLRN = 4,
417  kSCALE = 5,
418  kSOFTMAX = 6,
419  kDECONVOLUTION = 7,
420  kCONCATENATION = 8,
421  kELEMENTWISE = 9,
422  kPLUGIN = 10,
423  kRNN = 11,
424  kUNARY = 12,
425  kPADDING = 13,
426  kSHUFFLE = 14,
427  kREDUCE = 15,
428  kTOPK = 16,
429  kGATHER = 17,
430  kMATRIX_MULTIPLY = 18,
431  kRAGGED_SOFTMAX = 19,
432  kCONSTANT = 20,
433  kRNN_V2 = 21,
434  kIDENTITY = 22,
435  kPLUGIN_V2 = 23,
436  kSLICE = 24,
437  kSHAPE = 25,
438  kPARAMETRIC_RELU = 26,
439  kRESIZE = 27,
440  kTRIP_LIMIT = 28,
441  kRECURRENCE = 29,
442  kITERATOR = 30,
443  kLOOP_OUTPUT = 31,
444  kSELECT = 32,
445  kFILL = 33
446 };
447 
448 template <>
449 constexpr inline int EnumMax<LayerType>()
450 {
451  return 34;
452 }
453 
467 class ITensor
468 {
469 public:
482  virtual void setName(const char* name) TRTNOEXCEPT = 0;
483 
491  virtual const char* getName() const TRTNOEXCEPT = 0;
492 
507  virtual void setDimensions(Dims dimensions) TRTNOEXCEPT = 0; // only valid for input tensors
508 
517  virtual Dims getDimensions() const TRTNOEXCEPT = 0;
518 
529  virtual void setType(DataType type) TRTNOEXCEPT = 0;
530 
538  virtual DataType getType() const TRTNOEXCEPT = 0;
539 
550  virtual bool setDynamicRange(float min, float max) TRTNOEXCEPT = 0;
551 
559  TRT_DEPRECATED virtual float getDynamicRange() const TRTNOEXCEPT = 0;
560 
564  virtual bool isNetworkInput() const TRTNOEXCEPT = 0;
565 
569  virtual bool isNetworkOutput() const TRTNOEXCEPT = 0;
570 
571 protected:
572  virtual ~ITensor() {}
573 
574 public:
592  virtual void setBroadcastAcrossBatch(bool broadcastAcrossBatch) TRTNOEXCEPT = 0;
593 
605  virtual bool getBroadcastAcrossBatch() const TRTNOEXCEPT = 0;
606 
612  virtual TensorLocation getLocation() const TRTNOEXCEPT = 0;
613 
624  virtual void setLocation(TensorLocation location) TRTNOEXCEPT = 0;
625 
631  virtual bool dynamicRangeIsSet() const TRTNOEXCEPT = 0;
632 
636  virtual void resetDynamicRange() TRTNOEXCEPT = 0;
637 
643  virtual float getDynamicRangeMin() const TRTNOEXCEPT = 0;
644 
650  virtual float getDynamicRangeMax() const TRTNOEXCEPT = 0;
651 
660  virtual void setAllowedFormats(TensorFormats formats) TRTNOEXCEPT = 0;
661 
670  virtual TensorFormats getAllowedFormats() const TRTNOEXCEPT = 0;
671 
682  virtual bool isShapeTensor() const TRTNOEXCEPT = 0;
683 
698  virtual bool isExecutionTensor() const TRTNOEXCEPT = 0;
699 };
700 
708 class ILayer
709 {
710 public:
716  virtual LayerType getType() const TRTNOEXCEPT = 0;
717 
725  virtual void setName(const char* name) TRTNOEXCEPT = 0;
726 
730 
733  virtual const char* getName() const TRTNOEXCEPT = 0;
734 
738  virtual int getNbInputs() const TRTNOEXCEPT = 0;
739 
748  virtual ITensor* getInput(int index) const TRTNOEXCEPT = 0;
749 
753  virtual int getNbOutputs() const TRTNOEXCEPT = 0;
754 
761  virtual ITensor* getOutput(int index) const TRTNOEXCEPT = 0;
762 
768  //
777  virtual void setInput(int index, ITensor& tensor) TRTNOEXCEPT = 0;
778 
793 
794  virtual void setPrecision(DataType dataType) TRTNOEXCEPT = 0;
795 
802 
803  virtual DataType getPrecision() const TRTNOEXCEPT = 0;
804 
811 
812  virtual bool precisionIsSet() const TRTNOEXCEPT = 0;
813 
818 
819  virtual void resetPrecision() TRTNOEXCEPT = 0;
820 
845 
846  virtual void setOutputType(int index, DataType dataType) TRTNOEXCEPT = 0;
847 
856 
857  virtual DataType getOutputType(int index) const TRTNOEXCEPT = 0;
858 
866 
867  virtual bool outputTypeIsSet(int index) const TRTNOEXCEPT = 0;
868 
875 
876  virtual void resetOutputType(int index) TRTNOEXCEPT = 0;
877 
878 protected:
879  virtual ~ILayer() {}
880 };
881 
1104 enum class PaddingMode : int
1105 {
1106  kEXPLICIT_ROUND_DOWN = 0,
1107  kEXPLICIT_ROUND_UP = 1,
1108  kSAME_UPPER = 2,
1109  kSAME_LOWER = 3,
1110  kCAFFE_ROUND_DOWN = 4,
1111  kCAFFE_ROUND_UP = 5
1112 };
1113 
1114 template <>
1115 constexpr inline int EnumMax<PaddingMode>()
1116 {
1117  return 6;
1118 }
1119 
1133 {
1134 public:
1144  TRT_DEPRECATED virtual void setKernelSize(DimsHW kernelSize) TRTNOEXCEPT = 0;
1145 
1153  TRT_DEPRECATED virtual DimsHW getKernelSize() const TRTNOEXCEPT = 0;
1154 
1162  virtual void setNbOutputMaps(int nbOutputMaps) TRTNOEXCEPT = 0;
1163 
1169  virtual int getNbOutputMaps() const TRTNOEXCEPT = 0;
1170 
1182  TRT_DEPRECATED virtual void setStride(DimsHW stride) TRTNOEXCEPT = 0;
1183 
1189  TRT_DEPRECATED virtual DimsHW getStride() const TRTNOEXCEPT = 0;
1190 
1206  TRT_DEPRECATED virtual void setPadding(DimsHW padding) TRTNOEXCEPT = 0;
1207 
1215  TRT_DEPRECATED virtual DimsHW getPadding() const TRTNOEXCEPT = 0;
1216 
1232  virtual void setNbGroups(int nbGroups) TRTNOEXCEPT = 0;
1233 
1239  virtual int getNbGroups() const TRTNOEXCEPT = 0;
1240 
1250  virtual void setKernelWeights(Weights weights) TRTNOEXCEPT = 0;
1251 
1257  virtual Weights getKernelWeights() const TRTNOEXCEPT = 0;
1258 
1269  virtual void setBiasWeights(Weights weights) TRTNOEXCEPT = 0;
1270 
1276  virtual Weights getBiasWeights() const TRTNOEXCEPT = 0;
1277 
1289  TRT_DEPRECATED virtual void setDilation(DimsHW dilation) TRTNOEXCEPT = 0;
1290 
1298  TRT_DEPRECATED virtual DimsHW getDilation() const TRTNOEXCEPT = 0;
1299 
1300 protected:
1301  virtual ~IConvolutionLayer() {}
1302 
1303 public:
1316  virtual void setPrePadding(Dims padding) TRTNOEXCEPT = 0;
1317 
1323  virtual Dims getPrePadding() const TRTNOEXCEPT = 0;
1324 
1337  virtual void setPostPadding(Dims padding) TRTNOEXCEPT = 0;
1338 
1344  virtual Dims getPostPadding() const TRTNOEXCEPT = 0;
1345 
1355  virtual void setPaddingMode(PaddingMode paddingMode) TRTNOEXCEPT = 0;
1356 
1364  virtual PaddingMode getPaddingMode() const TRTNOEXCEPT = 0;
1365 
1374  virtual void setKernelSizeNd(Dims kernelSize) TRTNOEXCEPT = 0;
1375 
1381  virtual Dims getKernelSizeNd() const TRTNOEXCEPT = 0;
1382 
1392  virtual void setStrideNd(Dims stride) TRTNOEXCEPT = 0;
1393 
1399  virtual Dims getStrideNd() const TRTNOEXCEPT = 0;
1400 
1414  virtual void setPaddingNd(Dims padding) TRTNOEXCEPT = 0;
1415 
1423  virtual Dims getPaddingNd() const TRTNOEXCEPT = 0;
1424 
1434  virtual void setDilationNd(Dims dilation) TRTNOEXCEPT = 0;
1435 
1441  virtual Dims getDilationNd() const TRTNOEXCEPT = 0;
1442 
1459  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
1460 };
1461 
1492 {
1493 public:
1501  virtual void setNbOutputChannels(int nbOutputs) TRTNOEXCEPT = 0;
1502 
1508  virtual int getNbOutputChannels() const TRTNOEXCEPT = 0;
1509 
1515  virtual void setKernelWeights(Weights weights) TRTNOEXCEPT = 0;
1516 
1522  virtual Weights getKernelWeights() const TRTNOEXCEPT = 0;
1523 
1531  virtual void setBiasWeights(Weights weights) TRTNOEXCEPT = 0;
1532 
1538  virtual Weights getBiasWeights() const TRTNOEXCEPT = 0;
1539 
1540 protected:
1541  virtual ~IFullyConnectedLayer() {}
1542 
1543 public:
1560  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
1561 };
1562 
1574 class IActivationLayer : public ILayer
1575 {
1576 public:
1584  virtual void setActivationType(ActivationType type) TRTNOEXCEPT = 0;
1585 
1591  virtual ActivationType getActivationType() const TRTNOEXCEPT = 0;
1592 
1593 protected:
1594  virtual ~IActivationLayer() {}
1595 public:
1606  virtual void setAlpha(float alpha) TRTNOEXCEPT = 0;
1607 
1617  virtual void setBeta(float beta) TRTNOEXCEPT = 0;
1618 
1623  virtual float getAlpha() const TRTNOEXCEPT = 0;
1624 
1629  virtual float getBeta() const TRTNOEXCEPT = 0;
1630 };
1631 
1637 enum class PoolingType : int
1638 {
1639  kMAX = 0, // Maximum over elements
1640  kAVERAGE = 1, // Average over elements. If the tensor is padded, the count includes the padding
1641  kMAX_AVERAGE_BLEND = 2 // Blending between max and average pooling: (1-blendFactor)*maxPool + blendFactor*avgPool
1642 };
1643 
1644 template <>
1645 constexpr inline int EnumMax<PoolingType>()
1646 {
1647  return 3;
1648 }
1649 
1661 class IPoolingLayer : public ILayer
1662 {
1663 public:
1671  virtual void setPoolingType(PoolingType type) TRTNOEXCEPT = 0;
1672 
1678  virtual PoolingType getPoolingType() const TRTNOEXCEPT = 0;
1679 
1689  TRT_DEPRECATED virtual void setWindowSize(DimsHW windowSize) TRTNOEXCEPT = 0;
1690 
1698  TRT_DEPRECATED virtual DimsHW getWindowSize() const TRTNOEXCEPT = 0;
1699 
1711  TRT_DEPRECATED virtual void setStride(DimsHW stride) TRTNOEXCEPT = 0;
1712 
1720  TRT_DEPRECATED virtual DimsHW getStride() const TRTNOEXCEPT = 0;
1721 
1733  TRT_DEPRECATED virtual void setPadding(DimsHW padding) TRTNOEXCEPT = 0;
1734 
1744  TRT_DEPRECATED virtual DimsHW getPadding() const TRTNOEXCEPT = 0;
1745 
1756  virtual void setBlendFactor(float blendFactor) TRTNOEXCEPT = 0;
1757 
1766  virtual float getBlendFactor() const TRTNOEXCEPT = 0;
1767 
1781  virtual void setAverageCountExcludesPadding(bool exclusive) TRTNOEXCEPT = 0;
1782 
1789  virtual bool getAverageCountExcludesPadding() const TRTNOEXCEPT = 0;
1790 
1791 protected:
1792  virtual ~IPoolingLayer() {}
1793 
1794 public:
1806  virtual void setPrePadding(Dims padding) TRTNOEXCEPT = 0;
1807 
1813  virtual Dims getPrePadding() const TRTNOEXCEPT = 0;
1814 
1826  virtual void setPostPadding(Dims padding) TRTNOEXCEPT = 0;
1827 
1833  virtual Dims getPostPadding() const TRTNOEXCEPT = 0;
1834 
1843  virtual void setPaddingMode(PaddingMode paddingMode) TRTNOEXCEPT = 0;
1844 
1851  virtual PaddingMode getPaddingMode() const TRTNOEXCEPT = 0;
1852 
1860  virtual void setWindowSizeNd(Dims windowSize) TRTNOEXCEPT = 0;
1861 
1867  virtual Dims getWindowSizeNd() const TRTNOEXCEPT = 0;
1868 
1878  virtual void setStrideNd(Dims stride) TRTNOEXCEPT = 0;
1879 
1885  virtual Dims getStrideNd() const TRTNOEXCEPT = 0;
1886 
1899  virtual void setPaddingNd(Dims padding) TRTNOEXCEPT = 0;
1900 
1908  virtual Dims getPaddingNd() const TRTNOEXCEPT = 0;
1909 };
1910 
1920 class ILRNLayer : public ILayer
1921 {
1922 public:
1932  virtual void setWindowSize(int windowSize) TRTNOEXCEPT = 0;
1933 
1939  virtual int getWindowSize() const TRTNOEXCEPT = 0;
1940 
1947  virtual void setAlpha(float alpha) TRTNOEXCEPT = 0;
1948 
1954  virtual float getAlpha() const TRTNOEXCEPT = 0;
1955 
1962  virtual void setBeta(float beta) TRTNOEXCEPT = 0;
1963 
1969  virtual float getBeta() const TRTNOEXCEPT = 0;
1970 
1977  virtual void setK(float k) TRTNOEXCEPT = 0;
1978 
1984  virtual float getK() const TRTNOEXCEPT = 0;
1985 
1986 protected:
1987  virtual ~ILRNLayer() {}
1988 };
1989 
1995 enum class ScaleMode : int
1996 {
1997  kUNIFORM = 0,
1998  kCHANNEL = 1,
1999  kELEMENTWISE = 2
2000 };
2001 
2002 template <>
2003 constexpr inline int EnumMax<ScaleMode>()
2004 {
2005  return 3;
2006 }
2007 
2030 class IScaleLayer : public ILayer
2031 {
2032 public:
2038  virtual void setMode(ScaleMode mode) TRTNOEXCEPT = 0;
2039 
2045  virtual ScaleMode getMode() const TRTNOEXCEPT = 0;
2046 
2052  virtual void setShift(Weights shift) TRTNOEXCEPT = 0;
2053 
2059  virtual Weights getShift() const TRTNOEXCEPT = 0;
2060 
2066  virtual void setScale(Weights scale) TRTNOEXCEPT = 0;
2067 
2073  virtual Weights getScale() const TRTNOEXCEPT = 0;
2074 
2080  virtual void setPower(Weights power) TRTNOEXCEPT = 0;
2081 
2087  virtual Weights getPower() const TRTNOEXCEPT = 0;
2088 
2089 protected:
2090  virtual ~IScaleLayer() {}
2091 
2092 public:
2105  virtual int getChannelAxis() const TRTNOEXCEPT = 0;
2106 };
2107 
2119 class ISoftMaxLayer : public ILayer
2120 {
2121 protected:
2122  virtual ~ISoftMaxLayer() {}
2123 public:
2153  virtual void setAxes(uint32_t axes) TRTNOEXCEPT = 0;
2154 
2160  virtual uint32_t getAxes() const TRTNOEXCEPT = 0;
2161 };
2162 
2175 {
2176 protected:
2177  virtual ~IConcatenationLayer() {}
2178 
2179 public:
2190  virtual void setAxis(int axis) TRTNOEXCEPT = 0;
2191 
2197  virtual int getAxis() const TRTNOEXCEPT = 0;
2198 };
2199 
2210 {
2211 public:
2223  TRT_DEPRECATED virtual void setKernelSize(DimsHW kernelSize) TRTNOEXCEPT = 0;
2224 
2232  TRT_DEPRECATED virtual DimsHW getKernelSize() const TRTNOEXCEPT = 0;
2233 
2241  virtual void setNbOutputMaps(int nbOutputMaps) TRTNOEXCEPT = 0;
2242 
2248  virtual int getNbOutputMaps() const TRTNOEXCEPT = 0;
2249 
2261  TRT_DEPRECATED virtual void setStride(DimsHW stride) TRTNOEXCEPT = 0;
2262 
2270  TRT_DEPRECATED virtual DimsHW getStride() const TRTNOEXCEPT = 0;
2271 
2287  TRT_DEPRECATED virtual void setPadding(DimsHW padding) TRTNOEXCEPT = 0;
2288 
2298  TRT_DEPRECATED virtual DimsHW getPadding() const TRTNOEXCEPT = 0;
2299 
2315  virtual void setNbGroups(int nbGroups) TRTNOEXCEPT = 0;
2316 
2322  virtual int getNbGroups() const TRTNOEXCEPT = 0;
2323 
2333  virtual void setKernelWeights(Weights weights) TRTNOEXCEPT = 0;
2334 
2340  virtual Weights getKernelWeights() const TRTNOEXCEPT = 0;
2341 
2352  virtual void setBiasWeights(Weights weights) TRTNOEXCEPT = 0;
2353 
2359  virtual Weights getBiasWeights() const TRTNOEXCEPT = 0;
2360 
2361 protected:
2362  virtual ~IDeconvolutionLayer() {}
2363 
2364 public:
2376  virtual void setPrePadding(Dims padding) TRTNOEXCEPT = 0;
2377 
2383  virtual Dims getPrePadding() const TRTNOEXCEPT = 0;
2384 
2396  virtual void setPostPadding(Dims padding) TRTNOEXCEPT = 0;
2397 
2403  virtual Dims getPostPadding() const TRTNOEXCEPT = 0;
2404 
2414  virtual void setPaddingMode(PaddingMode paddingMode) TRTNOEXCEPT = 0;
2415 
2423  virtual PaddingMode getPaddingMode() const TRTNOEXCEPT = 0;
2424 
2433  virtual void setKernelSizeNd(Dims kernelSize) TRTNOEXCEPT = 0;
2434 
2440  virtual Dims getKernelSizeNd() const TRTNOEXCEPT = 0;
2441 
2452  virtual void setStrideNd(Dims stride) TRTNOEXCEPT = 0;
2453 
2459  virtual Dims getStrideNd() const TRTNOEXCEPT = 0;
2460 
2473  virtual void setPaddingNd(Dims padding) TRTNOEXCEPT = 0;
2474 
2482  virtual Dims getPaddingNd() const TRTNOEXCEPT = 0;
2483 
2490  virtual void setDilationNd(Dims dilation) TRTNOEXCEPT = 0;
2491 
2497  virtual Dims getDilationNd() const TRTNOEXCEPT = 0;
2498 
2516  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
2517 };
2518 
2526 enum class ElementWiseOperation : int
2527 {
2528  kSUM = 0,
2529  kPROD = 1,
2530  kMAX = 2,
2531  kMIN = 3,
2532  kSUB = 4,
2533  kDIV = 5,
2534  kPOW = 6,
2535  kFLOOR_DIV = 7,
2536  kAND = 8,
2537  kOR = 9,
2538  kXOR = 10,
2539  kEQUAL = 11,
2540  kGREATER = 12,
2541  kLESS = 13
2542 };
2543 
2544 template <>
2545 constexpr inline int EnumMax<ElementWiseOperation>()
2546 {
2547  return 14;
2548 }
2549 
2558 //!
2565 {
2566 public:
2576  virtual void setOperation(ElementWiseOperation op) TRTNOEXCEPT = 0;
2577 
2585  virtual ElementWiseOperation getOperation() const TRTNOEXCEPT = 0;
2586 
2587 protected:
2588  virtual ~IElementWiseLayer() {}
2589 };
2590 
2594 class IGatherLayer : public ILayer
2595 {
2596 public:
2603  virtual void setGatherAxis(int axis) TRTNOEXCEPT = 0;
2604 
2610  virtual int getGatherAxis() const TRTNOEXCEPT = 0;
2611 
2618  virtual void setNbElementWiseDims(int k) TRTNOEXCEPT = 0;
2619 
2625  virtual int getNbElementWiseDims() const TRTNOEXCEPT = 0;
2626 
2627 protected:
2628  virtual ~IGatherLayer() {}
2629 };
2630 
2710 enum class RNNOperation : int
2711 {
2712  kRELU = 0,
2713  kTANH = 1,
2714  kLSTM = 2,
2715  kGRU = 3
2716 };
2717 
2718 template <>
2719 constexpr inline int EnumMax<RNNOperation>()
2720 {
2721  return 4;
2722 }
2723 
2731 enum class RNNDirection : int
2732 {
2733  kUNIDIRECTION = 0,
2734  kBIDIRECTION = 1
2735 };
2736 
2737 template <>
2738 constexpr inline int EnumMax<RNNDirection>()
2739 {
2740  return 2;
2741 }
2742 
2758 enum class RNNInputMode : int
2759 {
2760  kLINEAR = 0,
2761  kSKIP = 1
2762 };
2763 
2764 template <>
2765 constexpr inline int EnumMax<RNNInputMode>()
2766 {
2767  return 2;
2768 }
2769 
2783 class TRT_DEPRECATED IRNNLayer : public ILayer
2784 {
2785 public:
2791  virtual unsigned getLayerCount() const TRTNOEXCEPT = 0;
2792 
2801  virtual std::size_t getHiddenSize() const TRTNOEXCEPT = 0;
2802 
2811  virtual int getSeqLength() const TRTNOEXCEPT = 0;
2812 
2818  virtual void setOperation(RNNOperation op) TRTNOEXCEPT = 0;
2819 
2825  virtual RNNOperation getOperation() const TRTNOEXCEPT = 0;
2826 
2832  virtual void setInputMode(RNNInputMode op) TRTNOEXCEPT = 0;
2833 
2839  virtual RNNInputMode getInputMode() const TRTNOEXCEPT = 0;
2840 
2852  virtual void setDirection(RNNDirection op) TRTNOEXCEPT = 0;
2853 
2859  virtual RNNDirection getDirection() const TRTNOEXCEPT = 0;
2860 
2975  virtual void setWeights(Weights weights) TRTNOEXCEPT = 0;
2976 
2982  virtual Weights getWeights() const TRTNOEXCEPT = 0;
2983 
3035  virtual void setBias(Weights bias) TRTNOEXCEPT = 0;
3036 
3042  virtual Weights getBias() const TRTNOEXCEPT = 0;
3043 
3050  virtual int getDataLength() const TRTNOEXCEPT = 0;
3051 
3069  virtual void setHiddenState(ITensor& hidden) TRTNOEXCEPT = 0;
3070 
3076  virtual ITensor* getHiddenState() const TRTNOEXCEPT = 0;
3077 
3097  virtual void setCellState(ITensor& cell) TRTNOEXCEPT = 0;
3098 
3104  virtual ITensor* getCellState() const TRTNOEXCEPT = 0;
3105 
3106 protected:
3107  virtual ~IRNNLayer() {}
3108 };
3109 
3117 enum class RNNGateType : int
3118 {
3119  kINPUT = 0,
3120  kOUTPUT = 1,
3121  kFORGET = 2,
3122  kUPDATE = 3,
3123  kRESET = 4,
3124  kCELL = 5,
3125  kHIDDEN = 6
3126 };
3127 
3128 template <>
3129 constexpr inline int EnumMax<RNNGateType>()
3130 {
3131  return 7;
3132 }
3133 
3143 class IRNNv2Layer : public ILayer
3144 {
3145 public:
3146  virtual int32_t getLayerCount() const TRTNOEXCEPT = 0; //< Get the layer count of the RNN
3147  virtual int32_t getHiddenSize() const TRTNOEXCEPT = 0; //< Get the hidden size of the RNN
3148  virtual int32_t getMaxSeqLength() const TRTNOEXCEPT = 0; //< Get the maximum sequence length of the RNN
3149  virtual int32_t getDataLength() const TRTNOEXCEPT = 0; //< Get the maximum data length of the RNN
3150 
3165  virtual void setSequenceLengths(ITensor& seqLengths) TRTNOEXCEPT = 0;
3166 
3174  virtual ITensor* getSequenceLengths() const TRTNOEXCEPT = 0;
3175 
3180  virtual void setOperation(RNNOperation op) TRTNOEXCEPT = 0;
3181 
3186  virtual RNNOperation getOperation() const TRTNOEXCEPT = 0;
3187 
3192  virtual void setInputMode(RNNInputMode op) TRTNOEXCEPT = 0;
3193 
3198  virtual RNNInputMode getInputMode() const TRTNOEXCEPT = 0;
3199 
3204  virtual void setDirection(RNNDirection op) TRTNOEXCEPT = 0;
3205 
3210  virtual RNNDirection getDirection() const TRTNOEXCEPT = 0;
3211 
3229  virtual void setWeightsForGate(int layerIndex, RNNGateType gate, bool isW, Weights weights) TRTNOEXCEPT = 0;
3230 
3235  virtual Weights getWeightsForGate(int layerIndex, RNNGateType gate, bool isW) const TRTNOEXCEPT = 0;
3236 
3252  virtual void setBiasForGate(int layerIndex, RNNGateType gate, bool isW, Weights bias) TRTNOEXCEPT = 0;
3253 
3258  virtual Weights getBiasForGate(int layerIndex, RNNGateType gate, bool isW) const TRTNOEXCEPT = 0;
3259 
3272  virtual void setHiddenState(ITensor& hidden) TRTNOEXCEPT = 0;
3273 
3278  virtual ITensor* getHiddenState() const TRTNOEXCEPT = 0;
3279 
3294  virtual void setCellState(ITensor& cell) TRTNOEXCEPT = 0;
3295 
3300  virtual ITensor* getCellState() const TRTNOEXCEPT = 0;
3301 
3302 protected:
3303  virtual ~IRNNv2Layer() {}
3304 };
3305 
3313 class TRT_DEPRECATED IOutputDimensionsFormula
3314 {
3315 public:
3331  virtual DimsHW compute(DimsHW inputDims, DimsHW kernelSize, DimsHW stride, DimsHW padding, DimsHW dilation, const char* layerName) const TRTNOEXCEPT = 0;
3332 
3333  virtual ~IOutputDimensionsFormula() {}
3334 };
3335 
3347 class TRT_DEPRECATED IPluginLayer : public ILayer
3348 {
3349 public:
3355  virtual IPlugin& getPlugin() TRTNOEXCEPT = 0;
3356 
3357 protected:
3358  virtual ~IPluginLayer() {}
3359 };
3360 
3370 class IPluginV2Layer : public ILayer
3371 {
3372 public:
3378  virtual IPluginV2& getPlugin() TRTNOEXCEPT = 0;
3379 
3380 protected:
3381  virtual ~IPluginV2Layer() {}
3382 };
3383 
3391 enum class UnaryOperation : int
3392 {
3393  kEXP = 0,
3394  kLOG = 1,
3395  kSQRT = 2,
3396  kRECIP = 3,
3397  kABS = 4,
3398  kNEG = 5,
3399  kSIN = 6,
3400  kCOS = 7,
3401  kTAN = 8,
3402  kSINH = 9,
3403  kCOSH = 10,
3404  kASIN = 11,
3405  kACOS = 12,
3406  kATAN = 13,
3407  kASINH = 14,
3408  kACOSH = 15,
3409  kATANH = 16,
3410  kCEIL = 17,
3411  kFLOOR = 18,
3412  kERF = 19,
3413  kNOT = 20
3414 };
3415 
3416 template <>
3417 constexpr inline int EnumMax<UnaryOperation>()
3418 {
3419  return 21;
3420 }
3421 
3429 class IUnaryLayer : public ILayer
3430 {
3431 public:
3437  virtual void setOperation(UnaryOperation op) TRTNOEXCEPT = 0;
3438 
3444  virtual UnaryOperation getOperation() const TRTNOEXCEPT = 0;
3445 
3446 protected:
3447  virtual ~IUnaryLayer() {}
3448 };
3449 
3468 enum class ReduceOperation : int
3469 {
3470  kSUM = 0,
3471  kPROD = 1,
3472  kMAX = 2,
3473  kMIN = 3,
3474  kAVG = 4
3475 };
3476 
3477 template <>
3478 constexpr inline int EnumMax<ReduceOperation>()
3479 {
3480  return 5;
3481 }
3482 
3490 class IReduceLayer : public ILayer
3491 {
3492 public:
3498  virtual void setOperation(ReduceOperation op) TRTNOEXCEPT = 0;
3499 
3505  virtual ReduceOperation getOperation() const TRTNOEXCEPT = 0;
3506 
3512  virtual void setReduceAxes(uint32_t reduceAxes) TRTNOEXCEPT = 0;
3513 
3519  virtual uint32_t getReduceAxes() const TRTNOEXCEPT = 0;
3520 
3526  virtual void setKeepDimensions(bool keepDimensions) TRTNOEXCEPT = 0;
3527 
3533  virtual bool getKeepDimensions() const TRTNOEXCEPT = 0;
3534 
3535 protected:
3536  virtual ~IReduceLayer() {}
3537 };
3538 
3549 class IPaddingLayer : public ILayer
3550 {
3551 public:
3561  TRT_DEPRECATED virtual void setPrePadding(DimsHW padding) TRTNOEXCEPT = 0;
3562 
3570  TRT_DEPRECATED virtual DimsHW getPrePadding() const TRTNOEXCEPT = 0;
3571 
3581  TRT_DEPRECATED virtual void setPostPadding(DimsHW padding) TRTNOEXCEPT = 0;
3582 
3590  TRT_DEPRECATED virtual DimsHW getPostPadding() const TRTNOEXCEPT = 0;
3591 
3592 protected:
3593  virtual ~IPaddingLayer() {}
3594 
3595 public:
3605  virtual void setPrePaddingNd(Dims padding) TRTNOEXCEPT = 0;
3606 
3614  virtual Dims getPrePaddingNd() const TRTNOEXCEPT = 0;
3615 
3625  virtual void setPostPaddingNd(Dims padding) TRTNOEXCEPT = 0;
3626 
3634  virtual Dims getPostPaddingNd() const TRTNOEXCEPT = 0;
3635 };
3636 
3638 {
3646 };
3647 
3660 class IShuffleLayer : public ILayer
3661 {
3662 public:
3672  virtual void setFirstTranspose(Permutation permutation) TRTNOEXCEPT = 0;
3673 
3681  virtual Permutation getFirstTranspose() const TRTNOEXCEPT = 0;
3682 
3703  virtual void setReshapeDimensions(Dims dimensions) TRTNOEXCEPT = 0;
3704 
3713  virtual Dims getReshapeDimensions() const TRTNOEXCEPT = 0;
3714 
3720  //
3735  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
3736 
3749  virtual void setSecondTranspose(Permutation permutation) TRTNOEXCEPT = 0;
3750 
3758  virtual Permutation getSecondTranspose() const TRTNOEXCEPT = 0;
3759 
3760 protected:
3761  virtual ~IShuffleLayer() {}
3762 
3763 public:
3775  virtual void setZeroIsPlaceholder(bool zeroIsPlaceholder) = 0;
3776 
3785  virtual bool getZeroIsPlaceholder() const = 0;
3786 };
3787 
3793 enum class SliceMode : int
3794 {
3795  kDEFAULT = 0,
3796  kWRAP = 1,
3797 };
3798 
3799 template <>
3800 constexpr inline int EnumMax<SliceMode>()
3801 {
3802  return 2;
3803 }
3804 
3833 class ISliceLayer : public ILayer
3834 {
3835 public:
3845  virtual void setStart(Dims start) TRTNOEXCEPT = 0;
3846 
3857  virtual Dims getStart() const TRTNOEXCEPT = 0;
3858 
3868  virtual void setSize(Dims size) TRTNOEXCEPT = 0;
3869 
3880  virtual Dims getSize() const TRTNOEXCEPT = 0;
3881 
3891  virtual void setStride(Dims stride) TRTNOEXCEPT = 0;
3892 
3903  virtual Dims getStride() const TRTNOEXCEPT = 0;
3904 
3910  virtual void setMode(SliceMode mode) TRTNOEXCEPT = 0;
3911 
3917  virtual SliceMode getMode() const TRTNOEXCEPT = 0;
3918 
3938  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
3939 
3940 protected:
3941  virtual ~ISliceLayer() {}
3942 };
3943 
3956 class IShapeLayer : public ILayer
3957 {
3958 protected:
3959  virtual ~IShapeLayer() {}
3960 };
3961 
3967 enum class TopKOperation : int
3968 {
3969  kMAX = 0,
3970  kMIN = 1,
3971 };
3972 
3973 template <>
3974 constexpr inline int EnumMax<TopKOperation>()
3975 {
3976  return 2;
3977 }
3978 
3986 class ITopKLayer : public ILayer
3987 {
3988 public:
3994  virtual void setOperation(TopKOperation op) TRTNOEXCEPT = 0;
3995 
4001  virtual TopKOperation getOperation() const TRTNOEXCEPT = 0;
4002 
4010  virtual void setK(int k) TRTNOEXCEPT = 0;
4011 
4017  virtual int getK() const TRTNOEXCEPT = 0;
4018 
4024  virtual void setReduceAxes(uint32_t reduceAxes) TRTNOEXCEPT = 0;
4025 
4031  virtual uint32_t getReduceAxes() const TRTNOEXCEPT = 0;
4032 
4033 protected:
4034  virtual ~ITopKLayer() {}
4035 };
4036 
4043 enum class MatrixOperation : int
4044 {
4048  kNONE,
4049 
4051  kTRANSPOSE,
4052 
4062  kVECTOR
4063 };
4064 
4065 template <>
4066 constexpr inline int EnumMax<MatrixOperation>()
4067 {
4068  return 3;
4069 }
4070 
4097 {
4098 public:
4105  virtual void setOperation(int index, MatrixOperation op) TRTNOEXCEPT = 0;
4106 
4112  virtual MatrixOperation getOperation(int index) const TRTNOEXCEPT = 0;
4113 
4122  TRT_DEPRECATED virtual void setTranspose(int index, bool val) TRTNOEXCEPT = 0;
4123 
4131  TRT_DEPRECATED virtual bool getTranspose(int index) const TRTNOEXCEPT = 0;
4132 
4133 protected:
4134  virtual ~IMatrixMultiplyLayer() {}
4135 };
4136 
4152 {
4153 protected:
4154  virtual ~IRaggedSoftMaxLayer() {}
4155 };
4156 
4165 class IIdentityLayer : public ILayer
4166 {
4167 protected:
4168  virtual ~IIdentityLayer() {}
4169 };
4170 
4177 class IConstantLayer : public ILayer
4178 {
4179 public:
4189  virtual void setWeights(Weights weights) TRTNOEXCEPT = 0;
4190 
4196  virtual Weights getWeights() const TRTNOEXCEPT = 0;
4197 
4205  virtual void setDimensions(Dims dimensions) TRTNOEXCEPT = 0;
4206 
4214  virtual Dims getDimensions() const TRTNOEXCEPT = 0;
4215 
4216 protected:
4217  virtual ~IConstantLayer() {}
4218 };
4219 
4228 {
4229 protected:
4230  virtual ~IParametricReLULayer() noexcept {}
4231 };
4232 
4238 enum class ResizeMode : int
4239 {
4240  kNEAREST = 0, // ND (0 < N <= 8) nearest neighbor resizing.
4241  kLINEAR = 1 // Can handle linear (1D), bilinear (2D), and trilinear (3D) resizing.
4242 };
4243 
4244 template <>
4245 constexpr inline int EnumMax<ResizeMode>()
4246 {
4247  return 2;
4248 }
4249 
4270 class IResizeLayer : public ILayer
4271 {
4272 public:
4288  virtual void setOutputDimensions(Dims dimensions) TRTNOEXCEPT = 0;
4289 
4295  virtual Dims getOutputDimensions() const TRTNOEXCEPT = 0;
4296 
4315  virtual void setScales(const float* scales, int nbScales) TRTNOEXCEPT = 0;
4316 
4331  virtual int getScales(int size, float* scales) const TRTNOEXCEPT = 0;
4332 
4340  virtual void setResizeMode(ResizeMode resizeMode) TRTNOEXCEPT = 0;
4341 
4347  virtual ResizeMode getResizeMode() const TRTNOEXCEPT = 0;
4348 
4358  virtual void setAlignCorners(bool alignCorners) TRTNOEXCEPT = 0;
4359 
4365  virtual bool getAlignCorners() const TRTNOEXCEPT = 0;
4366 
4387  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
4388 
4389 protected:
4390  virtual ~IResizeLayer() {}
4391 };
4392 
4394 enum class LoopOutput : int
4395 {
4397  kLAST_VALUE = 0,
4398 
4400  kCONCATENATE = 1,
4401 
4403  kREVERSE = 2
4404 };
4405 
4406 template <>
4407 constexpr inline int EnumMax<LoopOutput>()
4408 {
4409  return 3;
4410 }
4411 
4413 enum class TripLimit : int
4414 {
4415  // Tensor is scalar of type kINT32 that contains the trip count.
4416  kCOUNT = 0,
4417 
4418  // Tensor is a scalar of type kBOOL. Loop terminates when value is false.
4419  kWHILE = 1
4420 };
4421 
4422 template <>
4423 constexpr inline int EnumMax<TripLimit>()
4424 {
4425  return 2;
4426 }
4427 
4428 class ILoop;
4429 
4431 {
4432 public:
4434  virtual ILoop* getLoop() const noexcept = 0;
4435 };
4436 
4438 {
4439 public:
4445  //
4458  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
4459 };
4460 
4479 {
4480 public:
4481  virtual LoopOutput getLoopOutput() const noexcept = 0;
4482 
4495  virtual void setAxis(int axis) noexcept = 0;
4496 
4498  virtual int getAxis() const noexcept = 0;
4499 
4505  //
4520  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
4521 };
4522 
4524 {
4525 public:
4526  virtual TripLimit getTripLimit() const noexcept = 0;
4527 };
4528 
4530 {
4531 public:
4533  virtual void setAxis(int axis) noexcept = 0;
4534 
4536  virtual int getAxis() const noexcept = 0;
4537 
4543  virtual void setReverse(bool reverse) noexcept = 0;
4544 
4546  virtual bool getReverse() const noexcept = 0;
4547 };
4548 
4552 class ILoop
4553 {
4554 public:
4560  //
4562  virtual IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept = 0;
4563 
4580  virtual ITripLimitLayer* addTripLimit(ITensor& tensor, TripLimit limit) noexcept = 0;
4581 
4590  virtual IIteratorLayer* addIterator(ITensor& tensor, int axis = 0, bool reverse = false) noexcept = 0;
4591 
4599  virtual ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int axis = 0) noexcept = 0;
4600 
4609  virtual void setName(const char* name) noexcept = 0;
4610 
4616  virtual const char* getName() const noexcept = 0;
4617 
4618 protected:
4619  virtual ~ILoop() {}
4620 };
4621 
4625 class ISelectLayer : public ILayer
4626 {
4627 protected:
4628  virtual ~ISelectLayer() {}
4629 };
4630 
4638 enum class FillOperation : int
4639 {
4640  kLINSPACE = 0,
4641  kRANDOM_UNIFORM = 1
4642 };
4643 
4644 template <>
4645 constexpr inline int EnumMax<FillOperation>()
4646 {
4647  return 2;
4648 }
4649 
4668 class IFillLayer : public ILayer
4669 {
4670 public:
4679  //
4680  virtual void setDimensions(Dims dimensions) noexcept = 0;
4681 
4692  virtual Dims getDimensions() const noexcept = 0;
4693 
4699  virtual void setOperation(FillOperation op) noexcept = 0;
4700 
4706  virtual FillOperation getOperation() const noexcept = 0;
4707 
4720  //
4721  virtual void setAlpha(double alpha) noexcept = 0;
4722 
4733  virtual double getAlpha() const noexcept = 0;
4734 
4748  virtual void setBeta(double beta) noexcept = 0;
4749 
4760  virtual double getBeta() const noexcept = 0;
4761 
4786  void setInput(int index, ITensor& tensor) _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
4787 
4788 protected:
4789  virtual ~IFillLayer() {}
4790 };
4791 
4812 {
4813 public:
4819 
4849  virtual ITensor* addInput(const char* name, DataType type, Dims dimensions) TRTNOEXCEPT = 0;
4850 
4858  virtual void markOutput(ITensor& tensor) TRTNOEXCEPT = 0;
4859 
4878  TRT_DEPRECATED virtual IConvolutionLayer* addConvolution(ITensor& input, int nbOutputMaps, DimsHW kernelSize,
4879  Weights kernelWeights, Weights biasWeights) TRTNOEXCEPT = 0;
4880 
4897  ITensor& input, int nbOutputs, Weights kernelWeights, Weights biasWeights) TRTNOEXCEPT = 0;
4898 
4913  virtual IActivationLayer* addActivation(ITensor& input, ActivationType type) TRTNOEXCEPT = 0;
4914 
4929  TRT_DEPRECATED virtual IPoolingLayer* addPooling(
4930  ITensor& input, PoolingType type, DimsHW windowSize) TRTNOEXCEPT = 0;
4931 
4946  virtual ILRNLayer* addLRN(ITensor& input, int window, float alpha, float beta, float k) TRTNOEXCEPT = 0;
4947 
4968  virtual IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) TRTNOEXCEPT = 0;
4969 
4978  virtual ISoftMaxLayer* addSoftMax(ITensor& input) TRTNOEXCEPT = 0;
4979 
4992  virtual IConcatenationLayer* addConcatenation(ITensor* const* inputs, int nbInputs) TRTNOEXCEPT = 0;
4993 
5012  TRT_DEPRECATED virtual IDeconvolutionLayer* addDeconvolution(ITensor& input, int nbOutputMaps, DimsHW kernelSize,
5013  Weights kernelWeights, Weights biasWeights) TRTNOEXCEPT = 0;
5014 
5035  virtual IElementWiseLayer* addElementWise(ITensor& input1, ITensor& input2, ElementWiseOperation op) TRTNOEXCEPT = 0;
5036 
5096  TRT_DEPRECATED virtual IRNNLayer* addRNN(ITensor& inputs, int layerCount, std::size_t hiddenSize, int maxSeqLen,
5097  RNNOperation op, RNNInputMode mode, RNNDirection dir, Weights weights, Weights bias) TRTNOEXCEPT = 0;
5098 
5115  TRT_DEPRECATED virtual IPluginLayer* addPlugin(
5116  ITensor* const* inputs, int nbInputs, IPlugin& plugin) TRTNOEXCEPT = 0;
5117 
5130  virtual IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) TRTNOEXCEPT = 0;
5131 
5144  TRT_DEPRECATED virtual IPaddingLayer* addPadding(
5145  ITensor& input, DimsHW prePadding, DimsHW postPadding) TRTNOEXCEPT = 0;
5146 
5156  virtual IShuffleLayer* addShuffle(ITensor& input) TRTNOEXCEPT = 0;
5157 
5170  TRT_DEPRECATED virtual void setPoolingOutputDimensionsFormula(IOutputDimensionsFormula* formula) TRTNOEXCEPT = 0;
5171 
5181  TRT_DEPRECATED virtual IOutputDimensionsFormula& getPoolingOutputDimensionsFormula() const TRTNOEXCEPT = 0;
5182 
5197  TRT_DEPRECATED virtual void setConvolutionOutputDimensionsFormula(
5198  IOutputDimensionsFormula* formula) TRTNOEXCEPT = 0;
5199 
5211  TRT_DEPRECATED virtual IOutputDimensionsFormula& getConvolutionOutputDimensionsFormula() const TRTNOEXCEPT = 0;
5212 
5227  TRT_DEPRECATED virtual void setDeconvolutionOutputDimensionsFormula(
5228  IOutputDimensionsFormula* formula) TRTNOEXCEPT = 0;
5229 
5241  TRT_DEPRECATED virtual IOutputDimensionsFormula& getDeconvolutionOutputDimensionsFormula() const TRTNOEXCEPT = 0;
5242 
5250  virtual int getNbLayers() const TRTNOEXCEPT = 0;
5251 
5261  virtual ILayer* getLayer(int index) const TRTNOEXCEPT = 0;
5262 
5270  virtual int getNbInputs() const TRTNOEXCEPT = 0;
5271 
5281  virtual ITensor* getInput(int index) const TRTNOEXCEPT = 0; // adding inputs invalidates indexing here
5282 
5292  virtual int getNbOutputs() const TRTNOEXCEPT = 0;
5293 
5303  virtual ITensor* getOutput(int index) const TRTNOEXCEPT = 0; // adding outputs invalidates indexing here
5304 
5308  virtual void destroy() TRTNOEXCEPT = 0;
5309 
5310 protected:
5311  virtual ~INetworkDefinition() {}
5312 
5313 public:
5337  virtual IReduceLayer* addReduce(ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) TRTNOEXCEPT = 0;
5338 
5367  virtual ITopKLayer* addTopK(ITensor& input, TopKOperation op, int k, uint32_t reduceAxes) TRTNOEXCEPT = 0;
5368 
5380  virtual IGatherLayer* addGather(ITensor& data, ITensor& indices, int axis) TRTNOEXCEPT = 0;
5381 
5395  virtual IRaggedSoftMaxLayer* addRaggedSoftMax(ITensor& input, ITensor& bounds) TRTNOEXCEPT = 0;
5396 
5412  ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) TRTNOEXCEPT = 0;
5413 
5430  TRT_DEPRECATED virtual IMatrixMultiplyLayer* addMatrixMultiply(
5431  ITensor& input0, bool transpose0, ITensor& input1, bool transpose1) TRTNOEXCEPT = 0;
5432 
5453  virtual IConstantLayer* addConstant(Dims dimensions, Weights weights) TRTNOEXCEPT = 0;
5454 
5516  virtual IRNNv2Layer* addRNNv2(
5517  ITensor& input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen, RNNOperation op) TRTNOEXCEPT = 0;
5518 
5535  TRT_DEPRECATED virtual IPluginLayer* addPluginExt(
5536  ITensor* const* inputs, int nbInputs, IPluginExt& plugin) TRTNOEXCEPT = 0;
5537 
5549  virtual IIdentityLayer* addIdentity(ITensor& input) TRTNOEXCEPT = 0;
5550 
5561  virtual void removeTensor(ITensor& tensor) TRTNOEXCEPT = 0;
5562 
5570  virtual void unmarkOutput(ITensor& tensor) TRTNOEXCEPT = 0;
5571 
5586  virtual IPluginV2Layer* addPluginV2(ITensor* const* inputs, int nbInputs, IPluginV2& plugin) TRTNOEXCEPT = 0;
5587 
5602  virtual ISliceLayer* addSlice(ITensor& input, Dims start, Dims size, Dims stride) TRTNOEXCEPT = 0;
5603 
5621  virtual void setName(const char* name) TRTNOEXCEPT = 0;
5622 
5632  virtual const char* getName() const TRTNOEXCEPT = 0;
5633 
5647  virtual IShapeLayer* addShape(ITensor& input) TRTNOEXCEPT = 0;
5648 
5663  virtual bool hasImplicitBatchDimension() const TRTNOEXCEPT = 0;
5664 
5678  virtual bool markOutputForShapes(ITensor& tensor) TRTNOEXCEPT = 0;
5679 
5687  virtual bool unmarkOutputForShapes(ITensor& tensor) TRTNOEXCEPT = 0;
5688 
5702  virtual IParametricReLULayer* addParametricReLU(ITensor& input, ITensor& slope) noexcept = 0;
5703 
5722  ITensor& input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) TRTNOEXCEPT = 0;
5723 
5738  virtual IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims windowSize) TRTNOEXCEPT = 0;
5739 
5754  //
5758  ITensor& input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) TRTNOEXCEPT = 0;
5759 
5786  virtual IScaleLayer* addScaleNd(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int channelAxis) TRTNOEXCEPT = 0;
5787 
5798  virtual IResizeLayer* addResize(ITensor& input) TRTNOEXCEPT = 0;
5799 
5810  virtual bool hasExplicitPrecision() const TRTNOEXCEPT = 0;
5811 
5821  virtual ILoop* addLoop() noexcept = 0;
5822 
5832  virtual ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) TRTNOEXCEPT = 0;
5833 
5844  virtual IFillLayer* addFill(Dims dimensions, FillOperation op) noexcept = 0;
5845 
5856  virtual IPaddingLayer* addPaddingNd(
5857  ITensor& input, Dims prePadding, Dims postPadding) TRTNOEXCEPT = 0;
5858 };
5859 
5865 enum class CalibrationAlgoType : int
5866 {
5867  kLEGACY_CALIBRATION = 0,
5868  kENTROPY_CALIBRATION = 1,
5869  kENTROPY_CALIBRATION_2 = 2,
5870  kMINMAX_CALIBRATION = 3,
5871 };
5872 
5873 template <>
5874 constexpr inline int EnumMax<CalibrationAlgoType>()
5875 {
5876  return 4;
5877 }
5878 
5891 {
5892 public:
5898  virtual int getBatchSize() const TRTNOEXCEPT = 0;
5899 
5913  virtual bool getBatch(void* bindings[], const char* names[], int nbBindings) TRTNOEXCEPT = 0;
5914 
5929  virtual const void* readCalibrationCache(std::size_t& length) TRTNOEXCEPT = 0;
5930 
5939  virtual void writeCalibrationCache(const void* ptr, std::size_t length) TRTNOEXCEPT = 0;
5940 
5946  virtual CalibrationAlgoType getAlgorithm() TRTNOEXCEPT = 0;
5947 
5948  virtual ~IInt8Calibrator() {}
5949 };
5950 
5956 {
5957 public:
5961  CalibrationAlgoType getAlgorithm() TRTNOEXCEPT override { return CalibrationAlgoType::kENTROPY_CALIBRATION; }
5962 
5963  virtual ~IInt8EntropyCalibrator() {}
5964 };
5965 
5971 {
5972 public:
5976  CalibrationAlgoType getAlgorithm() TRTNOEXCEPT override { return CalibrationAlgoType::kENTROPY_CALIBRATION_2; }
5977 
5978  virtual ~IInt8EntropyCalibrator2() {}
5979 };
5980 
5986 {
5987 public:
5991  CalibrationAlgoType getAlgorithm() TRTNOEXCEPT override { return CalibrationAlgoType::kMINMAX_CALIBRATION; }
5992 
5993  virtual ~IInt8MinMaxCalibrator() {}
5994 };
5995 
5999 class TRT_DEPRECATED IInt8LegacyCalibrator : public IInt8Calibrator
6000 {
6001 public:
6005  CalibrationAlgoType getAlgorithm() TRTNOEXCEPT override { return CalibrationAlgoType::kLEGACY_CALIBRATION; }
6006 
6013  virtual double getQuantile() const TRTNOEXCEPT = 0;
6014 
6021  virtual double getRegressionCutoff() const TRTNOEXCEPT = 0;
6022 
6035  virtual const void* readHistogramCache(std::size_t& length) TRTNOEXCEPT = 0;
6036 
6045  virtual void writeHistogramCache(const void* ptr, std::size_t length) TRTNOEXCEPT = 0;
6046 
6047  virtual ~IInt8LegacyCalibrator() {}
6048 };
6049 
6061 {
6062 public:
6066  virtual TensorFormat getTensorFormat() const TRTNOEXCEPT = 0;
6067 
6071  virtual DataType getDataType() const TRTNOEXCEPT = 0;
6072 
6076  virtual Dims getStrides() const TRTNOEXCEPT = 0;
6077 
6078 protected:
6079  virtual ~IAlgorithmIOInfo() {}
6080 };
6081 
6094 {
6095 public:
6099  virtual int64_t getImplementation() const TRTNOEXCEPT = 0;
6100 
6104  virtual int64_t getTactic() const TRTNOEXCEPT = 0;
6105 
6106 protected:
6107  virtual ~IAlgorithmVariant() {}
6108 };
6109 
6119 {
6120 public:
6125  virtual const char* getName() const TRTNOEXCEPT = 0;
6126 
6133  virtual Dims getDimensions(int32_t index, OptProfileSelector select) const TRTNOEXCEPT = 0;
6134 
6138  virtual int32_t getNbInputs() const TRTNOEXCEPT = 0;
6139 
6143  virtual int32_t getNbOutputs() const TRTNOEXCEPT = 0;
6144 
6145 protected:
6146  virtual ~IAlgorithmContext() {}
6147 };
6148 
6159 {
6160 public:
6167  virtual const IAlgorithmIOInfo& getAlgorithmIOInfo(int32_t index) const TRTNOEXCEPT = 0;
6168 
6172  virtual const IAlgorithmVariant& getAlgorithmVariant() const TRTNOEXCEPT = 0;
6173 
6177  virtual float getTimingMSec() const TRTNOEXCEPT = 0;
6178 
6182  virtual std::size_t getWorkspaceSize() const TRTNOEXCEPT = 0;
6183 
6184 protected:
6185  virtual ~IAlgorithm() {}
6186 };
6187 
6197 {
6198 public:
6212  virtual int32_t selectAlgorithms(const IAlgorithmContext& context, const IAlgorithm* const* choices,
6213  int32_t nbChoices, int32_t* selection) TRTNOEXCEPT = 0;
6224  virtual void reportAlgorithms(const IAlgorithmContext* const* algoContexts, const IAlgorithm* const* algoChoices,
6225  int32_t nbAlgorithms) TRTNOEXCEPT = 0;
6226 
6227  virtual ~IAlgorithmSelector() {}
6228 };
6229 
6236 typedef uint32_t BuilderFlags;
6237 
6245 enum class BuilderFlag : int
6246 {
6247  kFP16 = 0,
6248  kINT8 = 1,
6249  kDEBUG = 2,
6250  kGPU_FALLBACK = 3,
6251  kSTRICT_TYPES = 4,
6252  kREFIT = 5,
6253  kDISABLE_TIMING_CACHE = 6,
6254 };
6255 
6256 template <>
6257 constexpr inline int EnumMax<BuilderFlag>()
6258 {
6259  return 7;
6260 }
6261 
6270 enum class ProfilingVerbosity : int32_t
6271 {
6272  kDEFAULT = 0,
6273  kNONE = 1,
6274  kVERBOSE = 2,
6275 };
6276 
6277 template <>
6278 constexpr inline int32_t EnumMax<ProfilingVerbosity>()
6279 {
6280  return 3;
6281 }
6282 
6289 {
6290 public:
6301  virtual void setMinTimingIterations(int minTiming) TRTNOEXCEPT = 0;
6302 
6310  virtual int getMinTimingIterations() const TRTNOEXCEPT = 0;
6311 
6320  virtual void setAvgTimingIterations(int avgTiming) TRTNOEXCEPT = 0;
6321 
6329  virtual int getAvgTimingIterations() const TRTNOEXCEPT = 0;
6330 
6339  virtual void setEngineCapability(EngineCapability capability) TRTNOEXCEPT = 0;
6340 
6348  virtual EngineCapability getEngineCapability() const TRTNOEXCEPT = 0;
6349 
6355  virtual void setInt8Calibrator(IInt8Calibrator* calibrator) TRTNOEXCEPT = 0;
6356 
6360  virtual IInt8Calibrator* getInt8Calibrator() const TRTNOEXCEPT = 0;
6361 
6369  virtual void setMaxWorkspaceSize(std::size_t workspaceSize) TRTNOEXCEPT = 0;
6370 
6380  virtual std::size_t getMaxWorkspaceSize() const TRTNOEXCEPT = 0;
6381 
6394  virtual void setFlags(BuilderFlags builderFlags) TRTNOEXCEPT = 0;
6395 
6403  virtual BuilderFlags getFlags() const TRTNOEXCEPT = 0;
6404 
6412  virtual void clearFlag(BuilderFlag builderFlag) TRTNOEXCEPT = 0;
6413 
6421  virtual void setFlag(BuilderFlag builderFlag) TRTNOEXCEPT = 0;
6422 
6432  virtual bool getFlag(BuilderFlag builderFlag) const TRTNOEXCEPT = 0;
6433 
6434 
6445  virtual void setDeviceType(const ILayer* layer, DeviceType deviceType) TRTNOEXCEPT = 0;
6446 
6451  virtual DeviceType getDeviceType(const ILayer* layer) const TRTNOEXCEPT = 0;
6452 
6458  virtual bool isDeviceTypeSet(const ILayer* layer) const TRTNOEXCEPT = 0;
6459 
6465  virtual void resetDeviceType(const ILayer* layer) TRTNOEXCEPT = 0;
6466 
6471  virtual bool canRunOnDLA(const ILayer* layer) const TRTNOEXCEPT = 0;
6472 
6483  virtual void setDLACore(int dlaCore) TRTNOEXCEPT = 0;
6484 
6491  virtual int getDLACore() const TRTNOEXCEPT = 0;
6492 
6498  virtual void setDefaultDeviceType(DeviceType deviceType) TRTNOEXCEPT = 0;
6499 
6505  virtual DeviceType getDefaultDeviceType() const TRTNOEXCEPT = 0;
6506 
6512  virtual void reset() TRTNOEXCEPT = 0;
6513 
6519  virtual void destroy() TRTNOEXCEPT = 0;
6520 
6528  virtual void setProfileStream(const cudaStream_t stream) TRTNOEXCEPT = 0;
6529 
6537  virtual cudaStream_t getProfileStream() const TRTNOEXCEPT = 0;
6538 
6550  virtual int addOptimizationProfile(const IOptimizationProfile* profile) noexcept = 0;
6551 
6561  virtual bool setCalibrationProfile(const IOptimizationProfile* profile) noexcept = 0;
6562 
6568  virtual const IOptimizationProfile* getCalibrationProfile() noexcept = 0;
6569 
6578  virtual int getNbOptimizationProfiles() const noexcept = 0;
6579 
6580 protected:
6581  virtual ~IBuilderConfig()
6582  {
6583  }
6584 
6585 public:
6593  virtual void setProfilingVerbosity(ProfilingVerbosity verbosity) TRTNOEXCEPT = 0;
6594 
6603  virtual ProfilingVerbosity getProfilingVerbosity() const TRTNOEXCEPT = 0;
6604 
6609  virtual void setAlgorithmSelector(IAlgorithmSelector* selector) TRTNOEXCEPT = 0;
6610 
6614  virtual IAlgorithmSelector* getAlgorithmSelector() const TRTNOEXCEPT = 0;
6615 
6616 };
6617 
6618 
6628 
6639 {
6644  kEXPLICIT_BATCH = 0,
6645 
6658  kEXPLICIT_PRECISION = 1,
6659 };
6660 template <>
6661 constexpr inline int EnumMax<NetworkDefinitionCreationFlag>()
6662 {
6663  return 2;
6664 }
6665 
6666 
6675 {
6676 public:
6688  TRT_DEPRECATED virtual nvinfer1::INetworkDefinition* createNetwork() TRTNOEXCEPT = 0;
6689 
6698  virtual void setMaxBatchSize(int batchSize) TRTNOEXCEPT = 0;
6699 
6708  virtual int getMaxBatchSize() const TRTNOEXCEPT = 0;
6709 
6719  TRT_DEPRECATED virtual void setMaxWorkspaceSize(std::size_t workspaceSize) TRTNOEXCEPT = 0;
6720 
6730  TRT_DEPRECATED virtual std::size_t getMaxWorkspaceSize() const TRTNOEXCEPT = 0;
6731 
6744  TRT_DEPRECATED virtual void setHalf2Mode(bool mode) TRTNOEXCEPT = 0;
6745 
6753  TRT_DEPRECATED virtual bool getHalf2Mode() const TRTNOEXCEPT = 0;
6754 
6763  TRT_DEPRECATED virtual void setDebugSync(bool sync) TRTNOEXCEPT = 0;
6764 
6772  TRT_DEPRECATED virtual bool getDebugSync() const TRTNOEXCEPT = 0;
6773 
6784  TRT_DEPRECATED virtual void setMinFindIterations(int minFind) TRTNOEXCEPT = 0;
6785 
6793  TRT_DEPRECATED virtual int getMinFindIterations() const TRTNOEXCEPT = 0;
6794 
6805  TRT_DEPRECATED virtual void setAverageFindIterations(int avgFind) TRTNOEXCEPT = 0;
6806 
6814  TRT_DEPRECATED virtual int getAverageFindIterations() const TRTNOEXCEPT = 0;
6815 
6823  TRT_DEPRECATED virtual nvinfer1::ICudaEngine* buildCudaEngine(
6824  nvinfer1::INetworkDefinition& network) TRTNOEXCEPT = 0;
6825 
6829  virtual bool platformHasFastFp16() const TRTNOEXCEPT = 0;
6830 
6834  virtual bool platformHasFastInt8() const TRTNOEXCEPT = 0;
6835 
6839  virtual void destroy() TRTNOEXCEPT = 0;
6840 
6852  TRT_DEPRECATED virtual void setInt8Mode(bool mode) TRTNOEXCEPT = 0;
6853 
6861  TRT_DEPRECATED virtual bool getInt8Mode() const TRTNOEXCEPT = 0;
6862 
6868  TRT_DEPRECATED virtual void setInt8Calibrator(IInt8Calibrator* calibrator) TRTNOEXCEPT = 0;
6869 
6882  TRT_DEPRECATED virtual void setDeviceType(ILayer* layer, DeviceType deviceType) TRTNOEXCEPT = 0;
6883 
6890  TRT_DEPRECATED virtual DeviceType getDeviceType(const ILayer* layer) const TRTNOEXCEPT = 0;
6891 
6899  TRT_DEPRECATED virtual bool isDeviceTypeSet(const ILayer* layer) const TRTNOEXCEPT = 0;
6900 
6908  TRT_DEPRECATED virtual void resetDeviceType(ILayer* layer) TRTNOEXCEPT = 0;
6909 
6916  TRT_DEPRECATED virtual bool canRunOnDLA(const ILayer* layer) const TRTNOEXCEPT = 0;
6917 
6925  TRT_DEPRECATED virtual void setDefaultDeviceType(DeviceType deviceType) TRTNOEXCEPT = 0;
6926 
6932  TRT_DEPRECATED virtual DeviceType getDefaultDeviceType() const TRTNOEXCEPT = 0;
6933 
6941  virtual int getMaxDLABatchSize() const TRTNOEXCEPT = 0;
6942 
6952  TRT_DEPRECATED virtual void allowGPUFallback(bool setFallBackMode) TRTNOEXCEPT = 0;
6953 
6957  virtual int getNbDLACores() const TRTNOEXCEPT = 0;
6958 
6969  TRT_DEPRECATED virtual void setDLACore(int dlaCore) TRTNOEXCEPT = 0;
6970 
6977  TRT_DEPRECATED virtual int getDLACore() const TRTNOEXCEPT = 0;
6978 
6984  TRT_DEPRECATED virtual void reset(nvinfer1::INetworkDefinition& network) TRTNOEXCEPT = 0;
6985 
6986 protected:
6987  virtual ~IBuilder()
6988  {
6989  }
6990 
6991 public:
7003  virtual void setGpuAllocator(IGpuAllocator* allocator) TRTNOEXCEPT = 0;
7004 
7016  TRT_DEPRECATED virtual void setFp16Mode(bool mode) TRTNOEXCEPT = 0;
7017 
7025  TRT_DEPRECATED virtual bool getFp16Mode() const TRTNOEXCEPT = 0;
7026 
7045  TRT_DEPRECATED virtual void setStrictTypeConstraints(bool mode) TRTNOEXCEPT = 0;
7046 
7054  TRT_DEPRECATED virtual bool getStrictTypeConstraints() const TRTNOEXCEPT = 0;
7055 
7061  TRT_DEPRECATED virtual void setRefittable(bool canRefit) TRTNOEXCEPT = 0;
7062 
7070  TRT_DEPRECATED virtual bool getRefittable() const TRTNOEXCEPT = 0;
7071 
7077  TRT_DEPRECATED virtual void setEngineCapability(EngineCapability capability) TRTNOEXCEPT = 0;
7078 
7086  TRT_DEPRECATED virtual EngineCapability getEngineCapability() const TRTNOEXCEPT = 0;
7087 
7093  virtual nvinfer1::IBuilderConfig* createBuilderConfig() TRTNOEXCEPT = 0;
7094 
7102  INetworkDefinition& network, IBuilderConfig& config) TRTNOEXCEPT = 0;
7103 
7104 
7117 
7118 
7129 
7139  //
7142  virtual void setErrorRecorder(IErrorRecorder* recorder) TRTNOEXCEPT = 0;
7143 
7154  virtual IErrorRecorder* getErrorRecorder() const TRTNOEXCEPT = 0;
7155 
7159  virtual void reset() TRTNOEXCEPT = 0;
7160 };
7161 
7162 } // namespace nvinfer1
7163 
7168 extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int version);
7169 
7170 namespace nvinfer1
7171 {
7172 namespace
7173 {
7182 {
7183  return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
7184 }
7185 }
7186 }
7187 
7188 #endif
nvinfer1::IAlgorithmSelector::reportAlgorithms
virtual void reportAlgorithms(const IAlgorithmContext *const *algoContexts, const IAlgorithm *const *algoChoices, int32_t nbAlgorithms)=0
Called by TensorRT to report choices it made.
nvinfer1::IActivationLayer::getBeta
virtual float getBeta() const =0
Get the beta parameter.
nvinfer1::IDeconvolutionLayer::getNbGroups
virtual int getNbGroups() const =0
Get the number of groups for a deconvolution.
nvinfer1::DimsHW::w
int w() const
Get the width.
Definition: NvInfer.h:165
nvinfer1::LayerType::kTOPK
TopK layer.
nvinfer1::IBuilder::getAverageFindIterations
virtual TRT_DEPRECATED int getAverageFindIterations() const =0
Query the number of averaging iterations.
nvinfer1::IBuilder::setHalf2Mode
virtual TRT_DEPRECATED void setHalf2Mode(bool mode)=0
Set whether half2 mode is used.
nvinfer1::IAlgorithm::getAlgorithmIOInfo
virtual const IAlgorithmIOInfo & getAlgorithmIOInfo(int32_t index) const =0
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
nvinfer1::Dims3::Dims3
Dims3()
Construct an empty Dims3 object.
Definition: NvInfer.h:178
nvinfer1::ITensor::getLocation
virtual TensorLocation getLocation() const =0
Get the storage location of a tensor.
nvinfer1::ITensor::getDynamicRangeMax
virtual float getDynamicRangeMax() const =0
Get maximum of dynamic range.
nvinfer1::PaddingMode::kEXPLICIT_ROUND_UP
Use explicit padding, rounding output size up.
nvinfer1::IConvolutionLayer::setKernelSize
virtual TRT_DEPRECATED void setKernelSize(DimsHW kernelSize)=0
Set the HW kernel size of the convolution.
nvinfer1::IBuilder::setInt8Calibrator
virtual TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator)=0
Set Int8 Calibration interface.
nvinfer1::DimsNCHW::h
int & h()
Get the height.
Definition: NvInfer.h:379
nvinfer1::IBuilderConfig::setProfileStream
virtual void setProfileStream(const cudaStream_t stream)=0
Set the cudaStream that is used to profile this network.
nvinfer1::IConvolutionLayer::setDilation
virtual TRT_DEPRECATED void setDilation(DimsHW dilation)=0
Set the dilation for a convolution.
nvinfer1::INetworkDefinition::addLoop
virtual ILoop * addLoop() noexcept=0
Add a loop to the network.
nvinfer1::IPluginV2Layer::getPlugin
virtual IPluginV2 & getPlugin()=0
Get the plugin for the layer.
nvinfer1::LoopOutput::kREVERSE
Output value is concatenation of values of tensor for each iteration, in reverse order.
nvinfer1::ISliceLayer::getSize
virtual Dims getSize() const =0
Get dimensions of the output slice.
nvinfer1::IBuilder::canRunOnDLA
virtual TRT_DEPRECATED bool canRunOnDLA(const ILayer *layer) const =0
Checks if a layer can run on DLA.
nvinfer1::IBuilder::setMaxBatchSize
virtual void setMaxBatchSize(int batchSize)=0
Set the maximum batch size.
nvinfer1::IBuilder::setDeviceType
virtual TRT_DEPRECATED void setDeviceType(ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
nvinfer1::ActivationType
ActivationType
Forward declare IGpuAllocator for use in other interfaces.
Definition: NvInferRuntimeCommon.h:133
nvinfer1::IBuilder::setErrorRecorder
virtual void setErrorRecorder(IErrorRecorder *recorder)=0
Set the ErrorRecorder for this interface.
NvInferRuntime.h
nvinfer1::IBuilder::getMaxDLABatchSize
virtual int getMaxDLABatchSize() const =0
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combi...
nvinfer1::LayerType::kSHAPE
Shape layer.
nvinfer1::IRNNv2Layer::setInputMode
virtual void setInputMode(RNNInputMode op)=0
Set the input mode of the RNN layer.
nvinfer1::IRNNv2Layer::getDirection
virtual RNNDirection getDirection() const =0
Get the direction of the RNN layer.
nvinfer1::ILoop::addIterator
virtual IIteratorLayer * addIterator(ITensor &tensor, int axis=0, bool reverse=false) noexcept=0
Return layer that subscripts tensor by loop iteration.
nvinfer1::INetworkDefinition::setName
virtual void setName(const char *name)=0
Sets the name of the network.
nvinfer1::FillOperation::kRANDOM_UNIFORM
Generate a tensor with random values drawn from a uniform distribution.
nvinfer1::IFullyConnectedLayer
A fully connected layer in a network definition. This layer expects an input tensor of three or more ...
Definition: NvInfer.h:1491
nvinfer1::Permutation
Definition: NvInfer.h:3637
nvinfer1::BuilderFlag::kINT8
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
nvinfer1::IBuilder::setDefaultDeviceType
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...
nvinfer1::ITensor::setLocation
virtual void setLocation(TensorLocation location)=0
Set the storage location of a tensor.
nvinfer1::IBuilder::setEngineCapability
virtual TRT_DEPRECATED void setEngineCapability(EngineCapability capability)=0
Configure the builder to target specified EngineCapability flow.
nvinfer1::IConstantLayer
Layer that represents a constant value.
Definition: NvInfer.h:4177
nvinfer1::IFullyConnectedLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::Dims4::Dims4
Dims4()
Construct an empty Dims2 object.
Definition: NvInfer.h:286
nvinfer1::IActivationLayer::getAlpha
virtual float getAlpha() const =0
Get the alpha parameter.
nvinfer1::IParametricReLULayer
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4227
nvinfer1::BuilderFlag::kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
nvinfer1::RNNInputMode::kSKIP
No operation is performed on the first recurrent layer.
nvinfer1::IDeconvolutionLayer::getKernelWeights
virtual Weights getKernelWeights() const =0
Get the kernel weights for the deconvolution.
nvinfer1::IAlgorithmVariant::getImplementation
virtual int64_t getImplementation() const =0
Return implementation of the algorithm.
nvinfer1::INetworkDefinition::addResize
virtual IResizeLayer * addResize(ITensor &input)=0
Add a resize layer to the network.
nvinfer1::IRNNv2Layer::setDirection
virtual void setDirection(RNNDirection op)=0
Set the direction of the RNN layer.
nvinfer1::IBuilder::resetDeviceType
virtual TRT_DEPRECATED void resetDeviceType(ILayer *layer)=0
reset the DeviceType for this layer
nvinfer1::RNNGateType::kOUTPUT
Output gate (o).
nvinfer1::INetworkDefinition
A network definition for input to the builder.
Definition: NvInfer.h:4811
nvinfer1::RNNGateType::kHIDDEN
Hidden gate (h).
nvinfer1::IPluginLayer
Layer type for plugins.
Definition: NvInfer.h:3347
nvinfer1::IShuffleLayer::setFirstTranspose
virtual void setFirstTranspose(Permutation permutation)=0
Set the permutation applied by the first transpose operation.
nvinfer1::IReduceLayer::setReduceAxes
virtual void setReduceAxes(uint32_t reduceAxes)=0
Set the axes over which to reduce.
nvinfer1::EnumMax< PaddingMode >
constexpr int EnumMax< PaddingMode >()
Maximum number of elements in PaddingMode enum.
Definition: NvInfer.h:1115
nvinfer1::Weights
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:107
nvinfer1::IAlgorithmVariant
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:6093
nvinfer1::LayerType::kPADDING
Padding layer.
nvinfer1::LoopOutput::kCONCATENATE
Output value is concatenation of values of tensor for each iteration, in forward order.
nvinfer1::INetworkDefinition::setConvolutionOutputDimensionsFormula
virtual TRT_DEPRECATED void setConvolutionOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the convolution output dimensions formula.
nvinfer1::INetworkDefinition::unmarkOutputForShapes
virtual bool unmarkOutputForShapes(ITensor &tensor)=0
Undo markOutputForShapes.
nvinfer1::INetworkDefinition::addLRN
virtual ILRNLayer * addLRN(ITensor &input, int window, float alpha, float beta, float k)=0
Add a LRN layer to the network.
nvinfer1::IPaddingLayer::setPrePadding
virtual TRT_DEPRECATED void setPrePadding(DimsHW padding)=0
Set the padding that is applied at the start of the tensor.
nvinfer1::IPaddingLayer
Layer that represents a padding operation.
Definition: NvInfer.h:3549
nvinfer1::ISliceLayer::setMode
virtual void setMode(SliceMode mode)=0
Set the slice mode.
nvinfer1::INetworkDefinition::addSelect
virtual ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput)=0
Add a select layer to the network.
nvinfer1::ITopKLayer::getK
virtual int getK() const =0
Get the k value for the layer.
nvinfer1::DimsCHW
Descriptor for data with one channel dimension and two spatial dimensions.
Definition: NvInfer.h:206
nvinfer1::IConvolutionLayer
A convolution layer in a network definition.
Definition: NvInfer.h:1132
nvinfer1::IUnaryLayer::setOperation
virtual void setOperation(UnaryOperation op)=0
Set the unary operation for the layer.
nvinfer1::IScaleLayer::getChannelAxis
virtual int getChannelAxis() const =0
Get the channel axis.
nvinfer1::IBuilderConfig::setDLACore
virtual void setDLACore(int dlaCore)=0
Sets the DLA core used by the network.
nvinfer1::EnumMax< LoopOutput >
constexpr int EnumMax< LoopOutput >()
Maximum number of elements in LoopOutput enum.
Definition: NvInfer.h:4407
nvinfer1::UnaryOperation
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:3391
nvinfer1::IBuilder::platformHasFastFp16
virtual bool platformHasFastFp16() const =0
Determine whether the platform has fast native fp16.
nvinfer1::ElementWiseOperation::kAND
Logical AND of two elements.
nvinfer1::EnumMax< RNNOperation >
constexpr int EnumMax< RNNOperation >()
Maximum number of elements in RNNOperation enum.
Definition: NvInfer.h:2719
nvinfer1::IIdentityLayer
A layer that represents the identity function.
Definition: NvInfer.h:4165
nvinfer1::IAlgorithm::getAlgorithmVariant
virtual const IAlgorithmVariant & getAlgorithmVariant() const =0
Returns the algorithm variant.
nvinfer1::RNNGateType
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3117
nvinfer1::IIteratorLayer::getReverse
virtual bool getReverse() const noexcept=0
True if and only if reversing input.
nvinfer1::IGatherLayer::setGatherAxis
virtual void setGatherAxis(int axis)=0
Set the axis to gather on. The axis must be less than the number of dimensions in the data input.
nvinfer1::IFullyConnectedLayer::setNbOutputChannels
virtual void setNbOutputChannels(int nbOutputs)=0
Set the number of output channels K from the fully connected layer.
nvinfer1::IShuffleLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::IDeconvolutionLayer::setKernelWeights
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights for the deconvolution.
nvinfer1::IInt8Calibrator::writeCalibrationCache
virtual void writeCalibrationCache(const void *ptr, std::size_t length)=0
Save a calibration cache.
nvinfer1::ProfilingVerbosity
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations.
Definition: NvInfer.h:6270
nvinfer1::ITensor::getDynamicRangeMin
virtual float getDynamicRangeMin() const =0
Get minimum of dynamic range.
nvinfer1::ProfilingVerbosity::kVERBOSE
Register layer names in NVTX message field and register layer detail in NVTX JSON payload field.
nvinfer1::IConvolutionLayer::setPadding
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding of the convolution.
nvinfer1::IBuilder::createNetwork
virtual TRT_DEPRECATED nvinfer1::INetworkDefinition * createNetwork()=0
Create a network definition object where all tensors have an implicit batch dimension.
nvinfer1::INetworkDefinition::addRNN
virtual TRT_DEPRECATED IRNNLayer * addRNN(ITensor &inputs, int layerCount, std::size_t hiddenSize, int maxSeqLen, RNNOperation op, RNNInputMode mode, RNNDirection dir, Weights weights, Weights bias)=0
Add an layerCount deep RNN layer to the network with a sequence length of maxSeqLen and hiddenSize in...
nvinfer1::IAlgorithmSelector
Interface implemented by application for selecting and reporting algorithms of a layer provided by th...
Definition: NvInfer.h:6196
nvinfer1::IBuilderConfig::getAvgTimingIterations
virtual int getAvgTimingIterations() const =0
Query the number of averaging iterations.
nvinfer1::ElementWiseOperation::kOR
Logical OR of two elements.
nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_PRECISION
Mark the network to be an explicit precision network.
nvinfer1::IConvolutionLayer::setKernelSizeNd
virtual void setKernelSizeNd(Dims kernelSize)=0
Set the multi-dimension kernel size of the convolution.
nvinfer1::IDeconvolutionLayer::getPaddingNd
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the deconvolution.
nvinfer1::UnaryOperation::kLOG
Log (base e).
nvinfer1::LayerType::kPLUGIN
Plugin layer.
nvinfer1::EnumMax< UnaryOperation >
constexpr int EnumMax< UnaryOperation >()
Maximum number of elements in UnaryOperation enum.
Definition: NvInfer.h:3417
nvinfer1::NetworkDefinitionCreationFlags
uint32_t NetworkDefinitionCreationFlags
This bitset is capable of representing one or more NetworkDefinitionCreationFlag flags constructed wi...
Definition: NvInfer.h:6627
nvinfer1::IAlgorithm::getTimingMSec
virtual float getTimingMSec() const =0
The time in milliseconds to execute the algorithm.
nvinfer1::IRNNv2Layer::setCellState
virtual void setCellState(ITensor &cell)=0
Set the initial cell state of the LSTM with the provided cell ITensor.
nvinfer1::IDeconvolutionLayer::setPadding
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding of the deconvolution.
nvinfer1::INetworkDefinition::markOutputForShapes
virtual bool markOutputForShapes(ITensor &tensor)=0
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
nvinfer1::IBuilder::setStrictTypeConstraints
virtual TRT_DEPRECATED void setStrictTypeConstraints(bool mode)=0
Set whether or not type constraints are strict.
nvinfer1::ITensor::setDimensions
virtual void setDimensions(Dims dimensions)=0
Set the dimensions of a tensor.
nvinfer1::IConvolutionLayer::getDilationNd
virtual Dims getDilationNd() const =0
Get the multi-dimension dilation of the convolution.
nvinfer1::IBuilder::getDLACore
virtual TRT_DEPRECATED int getDLACore() const =0
Get the DLA core that the engine executes on.
nvinfer1::RNNOperation
RNNOperation
Enumerates the RNN operations that may be performed by an RNN layer.
Definition: NvInfer.h:2710
nvinfer1::IBuilder::setInt8Mode
virtual TRT_DEPRECATED void setInt8Mode(bool mode)=0
Set whether or not quantized 8-bit kernels are permitted.
nvinfer1::UnaryOperation::kSINH
Hyperbolic sine.
nvinfer1::ITripLimitLayer
Definition: NvInfer.h:4523
nvinfer1::UnaryOperation::kSIN
Sine.
nvinfer1::LoopOutput::kLAST_VALUE
Output value is value of tensor for last iteration.
nvinfer1::IPluginV2
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:371
nvinfer1::IConvolutionLayer::setNbGroups
virtual void setNbGroups(int nbGroups)=0
Set the number of groups for a convolution.
nvinfer1::IBuilder::platformHasFastInt8
virtual bool platformHasFastInt8() const =0
Determine whether the platform has fast native int8.
nvinfer1::IAlgorithmIOInfo
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:6060
nvinfer1::ITensor::setType
virtual void setType(DataType type)=0
Set the data type of a tensor.
nvinfer1::INetworkDefinition::addScaleNd
virtual IScaleLayer * addScaleNd(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power, int channelAxis)=0
Add a multi-dimension scale layer to the network.
nvinfer1::MatrixOperation
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:4043
nvinfer1::IBuilder::reset
virtual void reset()=0
Resets the builder state to default values.
nvinfer1::MatrixOperation::kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
nvinfer1::ITopKLayer::getReduceAxes
virtual uint32_t getReduceAxes() const =0
Get the axes to reduce for the layer.
nvinfer1::IInt8MinMaxCalibrator
Definition: NvInfer.h:5985
nvinfer1::LayerType::kSLICE
Slice layer.
nvinfer1::ILoop::getName
virtual const char * getName() const noexcept=0
Return the name of the loop.
nvinfer1::INetworkDefinition::hasExplicitPrecision
virtual bool hasExplicitPrecision() const =0
True if network is an explicit precision network.
nvinfer1::TensorLocation
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:960
nvinfer1::IMatrixMultiplyLayer::getOperation
virtual MatrixOperation getOperation(int index) const =0
Get the operation for an input tensor.
nvinfer1::SliceMode::kWRAP
Coordinates wrap around periodically.
nvinfer1::IPoolingLayer::getPostPadding
virtual Dims getPostPadding() const =0
Get the padding.
nvinfer1::ITensor::setBroadcastAcrossBatch
virtual void setBroadcastAcrossBatch(bool broadcastAcrossBatch)=0
Set whether to enable broadcast of tensor across the batch.
nvinfer1::TensorFormats
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInferRuntimeCommon.h:234
nvinfer1::INetworkDefinition::addUnary
virtual IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation)=0
Add a unary layer to the network.
nvinfer1::Dims4::Dims4
Dims4(int d0, int d1, int d2, int d3)
Construct a Dims4 from 4 elements.
Definition: NvInfer.h:300
nvinfer1::UnaryOperation::kACOSH
Inverse hyperbolic cosine.
nvinfer1::ElementWiseOperation::kSUB
Substract the second element from the first.
nvinfer1::IFillLayer::getDimensions
virtual Dims getDimensions() const noexcept=0
Get the output tensor's dimensions.
nvinfer1::IPaddingLayer::setPostPadding
virtual TRT_DEPRECATED void setPostPadding(DimsHW padding)=0
Set the padding that is applied at the end of the tensor.
nvinfer1::IBuilderConfig::setEngineCapability
virtual void setEngineCapability(EngineCapability capability)=0
Configure the builder to target specified EngineCapability flow.
nvinfer1::IFillLayer::getBeta
virtual double getBeta() const noexcept=0
Get the value of beta parameter.
nvinfer1::ILayer::resetOutputType
virtual void resetOutputType(int index)=0
reset the output type for this layer
nvinfer1::IConvolutionLayer::getNbOutputMaps
virtual int getNbOutputMaps() const =0
Get the number of output maps for the convolution.
nvinfer1::ITensor::getDynamicRange
virtual TRT_DEPRECATED float getDynamicRange() const =0
Get dynamic range for the tensor.
nvinfer1::IBuilderConfig::getProfileStream
virtual cudaStream_t getProfileStream() const =0
Get the cudaStream that is used to profile this network.
nvinfer1::INetworkDefinition::markOutput
virtual void markOutput(ITensor &tensor)=0
Mark a tensor as a network output.
nvinfer1::RNNOperation::kLSTM
Four-gate LSTM network w/o peephole connections.
nvinfer1::DimsNCHW::DimsNCHW
DimsNCHW()
Construct an empty DimsNCHW object.
Definition: NvInfer.h:322
nvinfer1::RNNGateType::kUPDATE
Update gate (z).
nvinfer1::INetworkDefinition::addFullyConnected
virtual IFullyConnectedLayer * addFullyConnected(ITensor &input, int nbOutputs, Weights kernelWeights, Weights biasWeights)=0
Add a fully connected layer to the network.
nvinfer1::IElementWiseLayer::getOperation
virtual ElementWiseOperation getOperation() const =0
Get the binary operation for the layer.
nvinfer1::IShuffleLayer::setZeroIsPlaceholder
virtual void setZeroIsPlaceholder(bool zeroIsPlaceholder)=0
Set meaning of 0 in reshape dimensions.
nvinfer1::ISliceLayer::getMode
virtual SliceMode getMode() const =0
Get the slice mode.
nvinfer1::EnumMax< ProfilingVerbosity >
constexpr int32_t EnumMax< ProfilingVerbosity >()
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInfer.h:6278
nvinfer1::LayerType::kCONCATENATION
Concatenation layer.
nvinfer1::IResizeLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::EnumMax< ScaleMode >
constexpr int EnumMax< ScaleMode >()
Maximum number of elements in ScaleMode enum.
Definition: NvInfer.h:2003
nvinfer1::ISliceLayer::setStride
virtual void setStride(Dims stride)=0
Set the stride for computing the output slice data.
nvinfer1::UnaryOperation::kEXP
Exponentiation.
nvinfer1::IConvolutionLayer::getPostPadding
virtual Dims getPostPadding() const =0
Get the post-padding.
nvinfer1::INetworkDefinition::addPaddingNd
virtual IPaddingLayer * addPaddingNd(ITensor &input, Dims prePadding, Dims postPadding)=0
Add a padding layer to the network. Only 2D padding is currently supported.
nvinfer1::Dims::nbDims
int nbDims
The number of dimensions.
Definition: NvInferRuntimeCommon.h:223
nvinfer1::IConvolutionLayer::getPaddingNd
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding of the convolution.
nvinfer1::TopKOperation
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3967
nvinfer1::LoopOutput
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4394
nvinfer1::IRNNv2Layer
An RNN layer in a network definition, version 2.
Definition: NvInfer.h:3143
nvinfer1::OptProfileSelector
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:979
nvinfer1::MatrixOperation::kVECTOR
nvinfer1::ISliceLayer::setSize
virtual void setSize(Dims size)=0
Set the dimensions of the output slice.
nvinfer1::ITensor::getAllowedFormats
virtual TensorFormats getAllowedFormats() const =0
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
nvinfer1::IBuilder::getDeviceType
virtual TRT_DEPRECATED DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
nvinfer1::EnumMax< ResizeMode >
constexpr int EnumMax< ResizeMode >()
Maximum number of elements in ResizeMode enum.
Definition: NvInfer.h:4245
nvinfer1::IFillLayer::getOperation
virtual FillOperation getOperation() const noexcept=0
Get the fill operation for the layer.
nvinfer1::IBuilderConfig::resetDeviceType
virtual void resetDeviceType(const ILayer *layer)=0
reset the DeviceType for this layer
nvinfer1::IInt8Calibrator::getBatchSize
virtual int getBatchSize() const =0
Get the batch size used for calibration batches.
nvinfer1::IConvolutionLayer::setDilationNd
virtual void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the convolution.
nvinfer1::IRNNLayer
A RNN layer in a network definition.
Definition: NvInfer.h:2783
nvinfer1::IBuilder::getRefittable
virtual TRT_DEPRECATED bool getRefittable() const =0
Query whether or not engines will be refittable.
nvinfer1::IConvolutionLayer::setBiasWeights
virtual void setBiasWeights(Weights weights)=0
Set the bias weights for the convolution.
nvinfer1::INetworkDefinition::addPluginExt
virtual TRT_DEPRECATED IPluginLayer * addPluginExt(ITensor *const *inputs, int nbInputs, IPluginExt &plugin)=0
Add a plugin layer to the network using an IPluginExt interface.
nvinfer1::ILoop::addRecurrence
virtual IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept=0
Create a recurrence layer for this loop with initialValue as its first input.
nvinfer1::IPoolingLayer::getStride
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride for pooling.
nvinfer1::INetworkDefinition::addConstant
virtual IConstantLayer * addConstant(Dims dimensions, Weights weights)=0
Add a constant layer to the network.
nvinfer1::DimsHW
Descriptor for two-dimensional spatial data.
Definition: NvInfer.h:115
nvinfer1::IBuilder::getMinFindIterations
virtual TRT_DEPRECATED int getMinFindIterations() const =0
Query the number of minimization iterations.
nvinfer1::IBuilderConfig::getMinTimingIterations
virtual int getMinTimingIterations() const =0
Query the number of minimization iterations.
nvinfer1::BuilderFlag::kDEBUG
Enable debugging of layers via synchronizing after every layer.
nvinfer1::ElementWiseOperation::kDIV
Divide the first element by the second.
nvinfer1::IBuilderConfig::isDeviceTypeSet
virtual bool isDeviceTypeSet(const ILayer *layer) const =0
whether the DeviceType has been explicitly set for this layer
nvinfer1::IPoolingLayer::setWindowSize
virtual TRT_DEPRECATED void setWindowSize(DimsHW windowSize)=0
Set the window size for pooling.
nvinfer1::ITensor::resetDynamicRange
virtual void resetDynamicRange()=0
Undo effect of setDynamicRange.
nvinfer1::ILoopOutputLayer
Definition: NvInfer.h:4478
nvinfer1::ISliceLayer::getStride
virtual Dims getStride() const =0
Get the stride for the output slice.
nvinfer1::ElementWiseOperation::kFLOOR_DIV
Floor division of the first element by the second.
nvinfer1::IReduceLayer::getReduceAxes
virtual uint32_t getReduceAxes() const =0
Get the axes over which to reduce for the layer.
nvinfer1::IBuilder::setDLACore
virtual TRT_DEPRECATED void setDLACore(int dlaCore)=0
Set the DLA core that the engine must execute on.
nvinfer1::DimsCHW::c
int c() const
Get the channel count.
Definition: NvInfer.h:245
nvinfer1::ITopKLayer::getOperation
virtual TopKOperation getOperation() const =0
Get the operation for the layer.
nvinfer1::ILayer::getNbOutputs
virtual int getNbOutputs() const =0
Get the number of outputs of a layer.
nvinfer1::IFillLayer::setOperation
virtual void setOperation(FillOperation op) noexcept=0
Set the fill operation for the layer.
nvinfer1::INetworkDefinition::addInput
virtual ITensor * addInput(const char *name, DataType type, Dims dimensions)=0
Add an input tensor to the network.
nvinfer1::INetworkDefinition::addFill
virtual IFillLayer * addFill(Dims dimensions, FillOperation op) noexcept=0
Add a fill layer to the network.
nvinfer1::IBuilderConfig::clearFlag
virtual void clearFlag(BuilderFlag builderFlag)=0
clear a single build mode flag.
nvinfer1::ILayer::getOutput
virtual ITensor * getOutput(int index) const =0
Get the layer output corresponding to the given index.
nvinfer1::ILRNLayer::setK
virtual void setK(float k)=0
Set the LRN K value.
nvinfer1::Dims
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:219
nvinfer1::INetworkDefinition::addPoolingNd
virtual IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims windowSize)=0
Add a multi-dimension pooling layer to the network.
nvinfer1::RNNDirection::kUNIDIRECTION
Network iterations from first input to last input.
nvinfer1::IDeconvolutionLayer::getStride
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the deconvolution.
nvinfer1::PaddingMode::kCAFFE_ROUND_UP
Use CAFFE padding, rounding output size up, uses prePadding value.
nvinfer1::ILRNLayer::getWindowSize
virtual int getWindowSize() const =0
Get the LRN window size.
nvinfer1::IConvolutionLayer::getPrePadding
virtual Dims getPrePadding() const =0
Get the pre-padding.
nvinfer1::EnumMax< RNNGateType >
constexpr int EnumMax< RNNGateType >()
Maximum number of elements in RNNGateType enum.
Definition: NvInfer.h:3129
nvinfer1::DimsCHW::w
int w() const
Get the width.
Definition: NvInfer.h:273
nvinfer1::ILogger
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1020
nvinfer1::IBuilder::getFp16Mode
virtual TRT_DEPRECATED bool getFp16Mode() const =0
Query whether 16-bit kernels are permitted.
nvinfer1::IAlgorithmContext
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:6118
nvinfer1::IConvolutionLayer::setPaddingMode
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
nvinfer1::RNNGateType::kRESET
Reset gate (r).
nvinfer1::IScaleLayer::getScale
virtual Weights getScale() const =0
Get the scale value.
nvinfer1::LayerType::kRNN
RNN layer.
nvinfer1::IActivationLayer::setActivationType
virtual void setActivationType(ActivationType type)=0
Set the type of activation to be performed.
nvinfer1::EnumMax< LayerType >
constexpr int EnumMax< LayerType >()
Maximum number of elements in LayerType enum.
Definition: NvInfer.h:449
nvinfer1::IDeconvolutionLayer::setPaddingMode
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
nvinfer1::IPoolingLayer::setWindowSizeNd
virtual void setWindowSizeNd(Dims windowSize)=0
Set the multi-dimension window size for pooling.
nvinfer1::IBuilder::setMaxWorkspaceSize
virtual TRT_DEPRECATED void setMaxWorkspaceSize(std::size_t workspaceSize)=0
Set the maximum workspace size.
nvinfer1::RNNDirection::kBIDIRECTION
Network iterates from first to last and vice versa and outputs concatenated.
nvinfer1::IBuilderConfig::getDeviceType
virtual DeviceType getDeviceType(const ILayer *layer) const =0
Get the device that this layer executes on.
nvinfer1::ScaleMode
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1995
nvinfer1::DimsNCHW::w
int & w()
Get the width.
Definition: NvInfer.h:393
nvinfer1::UnaryOperation::kATAN
Inverse tangent.
nvinfer1::PaddingMode::kSAME_UPPER
Use SAME padding, with prePadding <= postPadding.
nvinfer1::ITensor::isShapeTensor
virtual bool isShapeTensor() const =0
Whether the tensor is a shape tensor.
nvinfer1::IBuilder::getInt8Mode
virtual TRT_DEPRECATED bool getInt8Mode() const =0
Query whether Int8 mode is used.
nvinfer1::INetworkDefinition::addPluginV2
virtual IPluginV2Layer * addPluginV2(ITensor *const *inputs, int nbInputs, IPluginV2 &plugin)=0
Add a plugin layer to the network using the IPluginV2 interface.
nvinfer1::ICudaEngine
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1136
nvinfer1::IFullyConnectedLayer::setBiasWeights
virtual void setBiasWeights(Weights weights)=0
Set the bias weights.
nvinfer1::IBuilder::buildCudaEngine
virtual TRT_DEPRECATED nvinfer1::ICudaEngine * buildCudaEngine(nvinfer1::INetworkDefinition &network)=0
Build a CUDA engine from a network definition.
nvinfer1::ILayer::precisionIsSet
virtual bool precisionIsSet() const =0
whether the computational precision has been set for this layer
nvinfer1::IRaggedSoftMaxLayer
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:4151
nvinfer1::INetworkDefinition::addSlice
virtual ISliceLayer * addSlice(ITensor &input, Dims start, Dims size, Dims stride)=0
Add a slice layer to the network.
nvinfer1::IBuilderConfig::getProfilingVerbosity
virtual ProfilingVerbosity getProfilingVerbosity() const =0
Get verbosity level of layer information exposed in NVTX annotations.
nvinfer1::INetworkDefinition::getPoolingOutputDimensionsFormula
virtual TRT_DEPRECATED IOutputDimensionsFormula & getPoolingOutputDimensionsFormula() const =0
Get the pooling output dimensions formula.
nvinfer1::IPaddingLayer::getPostPaddingNd
virtual Dims getPostPaddingNd() const =0
Get the padding that is applied at the end of the tensor.
nvinfer1::INetworkDefinition::getOutput
virtual ITensor * getOutput(int index) const =0
Get the output tensor specified by the given index.
nvinfer1::IBuilder::buildEngineWithConfig
virtual nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config)=0
Builds an engine for the given INetworkDefinition and given IBuilderConfig.
nvinfer1::IDeconvolutionLayer::getPadding
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding of the deconvolution.
nvinfer1::IBuilderConfig::setInt8Calibrator
virtual void setInt8Calibrator(IInt8Calibrator *calibrator)=0
Set Int8 Calibration interface.
nvinfer1::IDeconvolutionLayer::setPrePadding
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
nvinfer1::ILRNLayer::setAlpha
virtual void setAlpha(float alpha)=0
Set the LRN alpha value.
nvinfer1::IBuilderConfig::setAvgTimingIterations
virtual void setAvgTimingIterations(int avgTiming)=0
Set the number of averaging iterations used when timing layers.
nvinfer1::DeviceType
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:688
nvinfer1::IConvolutionLayer::setPrePadding
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
nvinfer1::LayerType::kCONSTANT
Constant layer.
nvinfer1::IFullyConnectedLayer::getNbOutputChannels
virtual int getNbOutputChannels() const =0
Get the number of output channels K from the fully connected layer.
nvinfer1::ISliceLayer
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3833
nvinfer1::INetworkDefinition::addPadding
virtual TRT_DEPRECATED IPaddingLayer * addPadding(ITensor &input, DimsHW prePadding, DimsHW postPadding)=0
Add a padding layer to the network.
nvinfer1::DimsNCHW::h
int h() const
Get the height.
Definition: NvInfer.h:386
nvinfer1::IReduceLayer::getKeepDimensions
virtual bool getKeepDimensions() const =0
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
nvinfer1::ISliceLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::IDeconvolutionLayer::getNbOutputMaps
virtual int getNbOutputMaps() const =0
Get the number of output feature maps for the deconvolution.
nvinfer1::IAlgorithmSelector::selectAlgorithms
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.
nvinfer1::UnaryOperation::kASIN
Inverse sine.
nvinfer1::IConcatenationLayer::setAxis
virtual void setAxis(int axis)=0
Set the axis along which concatenation occurs.
nvinfer1::ITensor::dynamicRangeIsSet
virtual bool dynamicRangeIsSet() const =0
Query whether dynamic range is set.
nvinfer1::ILayer::setPrecision
virtual void setPrecision(DataType dataType)=0
Set the computational precision of this layer.
nvinfer1::IBuilder::getEngineCapability
virtual TRT_DEPRECATED EngineCapability getEngineCapability() const =0
Query EngineCapability flow configured for the builder.
nvinfer1::IPoolingLayer::getPaddingMode
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
nvinfer1::BuilderFlag::kREFIT
Enable building a refittable engine.
nvinfer1::UnaryOperation::kNEG
Negation.
nvinfer1::IConstantLayer::getDimensions
virtual Dims getDimensions() const =0
Get the dimensions for the layer.
nvinfer1::Dims::type
TRT_DEPRECATED DimensionType type[MAX_DIMS]
The type of each dimension.
Definition: NvInferRuntimeCommon.h:225
nvinfer1::LayerType::kGATHER
Gather layer.
nvinfer1::IIteratorLayer
Definition: NvInfer.h:4529
nvinfer1::IDeconvolutionLayer::getPrePadding
virtual Dims getPrePadding() const =0
Get the pre-padding.
nvinfer1::anonymous_namespace{NvInfer.h}::createInferBuilder
IBuilder * createInferBuilder(ILogger &logger)
Create an instance of an IBuilder class.
Definition: NvInfer.h:7181
nvinfer1::IResizeLayer::getAlignCorners
virtual bool getAlignCorners() const =0
True if align corners has been set.
nvinfer1::IBuilderConfig::getFlag
virtual bool getFlag(BuilderFlag builderFlag) const =0
returns true if the build mode flag is set
nvinfer1::RNNInputMode::kLINEAR
Perform the normal matrix multiplication in the first recurrent layer.
nvinfer1::INetworkDefinition::setPoolingOutputDimensionsFormula
virtual TRT_DEPRECATED void setPoolingOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the pooling output dimensions formula.
nvinfer1::IResizeLayer::setAlignCorners
virtual void setAlignCorners(bool alignCorners)=0
Set whether to align corners while resizing.
nvinfer1::IPoolingLayer::setStride
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Set the stride for pooling.
nvinfer1::ILRNLayer::setBeta
virtual void setBeta(float beta)=0
Set the LRN beta value.
nvinfer1::IScaleLayer::setPower
virtual void setPower(Weights power)=0
Set the power value.
nvinfer1::IAlgorithmContext::getDimensions
virtual Dims getDimensions(int32_t index, OptProfileSelector select) const =0
Get the minimum / optimum / maximum dimensions for input or output tensor.
nvinfer1::IScaleLayer::setScale
virtual void setScale(Weights scale)=0
Set the scale value.
nvinfer1::IMatrixMultiplyLayer::setTranspose
virtual TRT_DEPRECATED void setTranspose(int index, bool val)=0
Set the transpose flag for an input tensor.
nvinfer1::IInt8MinMaxCalibrator::getAlgorithm
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:5991
nvinfer1::IConstantLayer::getWeights
virtual Weights getWeights() const =0
Get the weights for the layer.
nvinfer1::UnaryOperation::kNOT
Logical NOT.
nvinfer1::ITensor::setName
virtual void setName(const char *name)=0
Set the tensor name.
nvinfer1::ElementWiseOperation::kPROD
Product of the two elements.
nvinfer1::IScaleLayer::getPower
virtual Weights getPower() const =0
Get the power value.
nvinfer1::LayerType::kTRIP_LIMIT
Loop Trip limit layer.
nvinfer1::IConcatenationLayer::getAxis
virtual int getAxis() const =0
Get the axis along which concatenation occurs.
nvinfer1::ScaleMode::kCHANNEL
Per-channel coefficients.
nvinfer1::ILayer::getNbInputs
virtual int getNbInputs() const =0
Get the number of inputs of a layer.
nvinfer1
The TensorRT API version 1 namespace.
nvinfer1::TensorFormat
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:249
nvinfer1::LayerType::kREDUCE
Reduce layer.
nvinfer1::ILayer
Base class for all layer classes in a network definition.
Definition: NvInfer.h:708
nvinfer1::INetworkDefinition::hasImplicitBatchDimension
virtual bool hasImplicitBatchDimension() const =0
Query whether the network was created with an implicit batch dimension.
nvinfer1::DimsHW::h
int h() const
Get the height.
Definition: NvInfer.h:151
nvinfer1::IBuilderConfig::setFlag
virtual void setFlag(BuilderFlag builderFlag)=0
Set a single build mode flag.
nvinfer1::IRecurrenceLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::EnumMax< SliceMode >
constexpr int EnumMax< SliceMode >()
Maximum number of elements in SliceMode enum.
Definition: NvInfer.h:3800
nvinfer1::ElementWiseOperation::kSUM
Sum of the two elements.
nvinfer1::IPoolingLayer::getWindowSizeNd
virtual Dims getWindowSizeNd() const =0
Get the multi-dimension window size for pooling.
nvinfer1::INetworkDefinition::addShuffle
virtual IShuffleLayer * addShuffle(ITensor &input)=0
Add a shuffle layer to the network.
nvinfer1::DimsNCHW::c
int c() const
Get the channel count.
Definition: NvInfer.h:372
nvinfer1::EnumMax< ReduceOperation >
constexpr int EnumMax< ReduceOperation >()
Maximum number of elements in ReduceOperation enum.
Definition: NvInfer.h:3478
nvinfer1::INetworkDefinition::removeTensor
virtual void removeTensor(ITensor &tensor)=0
remove a tensor from the network definition.
nvinfer1::ILayer::getPrecision
virtual DataType getPrecision() const =0
get the computational precision of this layer
nvinfer1::IBuilder::getNbDLACores
virtual int getNbDLACores() const =0
Return the number of DLA engines available to this builder.
nvinfer1::EnumMax< CalibrationAlgoType >
constexpr int EnumMax< CalibrationAlgoType >()
Maximum number of elements in CalibrationAlgoType enum.
Definition: NvInfer.h:5874
nvinfer1::IShuffleLayer::setSecondTranspose
virtual void setSecondTranspose(Permutation permutation)=0
Set the permutation applied by the second transpose operation.
nvinfer1::INetworkDefinition::getInput
virtual ITensor * getInput(int index) const =0
Get the input tensor specified by the given index.
nvinfer1::IRNNv2Layer::getHiddenState
virtual ITensor * getHiddenState() const =0
Get the initial hidden state of the RNN.
nvinfer1::IBuilderConfig::setMaxWorkspaceSize
virtual void setMaxWorkspaceSize(std::size_t workspaceSize)=0
Set the maximum workspace size.
nvinfer1::ILoop
Definition: NvInfer.h:4552
nvinfer1::IPluginV2Layer
Layer type for pluginV2.
Definition: NvInfer.h:3370
nvinfer1::INetworkDefinition::addActivation
virtual IActivationLayer * addActivation(ITensor &input, ActivationType type)=0
Add an activation layer to the network.
nvinfer1::INetworkDefinition::getNbOutputs
virtual int getNbOutputs() const =0
Get the number of outputs in the network.
nvinfer1::IBuilder::getErrorRecorder
virtual IErrorRecorder * getErrorRecorder() const =0
get the ErrorRecorder assigned to this interface.
nvinfer1::IPoolingLayer::setPoolingType
virtual void setPoolingType(PoolingType type)=0
Set the type of activation to be performed.
nvinfer1::IShuffleLayer::getSecondTranspose
virtual Permutation getSecondTranspose() const =0
Get the permutation applied by the second transpose operation.
nvinfer1::IFullyConnectedLayer::setKernelWeights
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights, given as a KxC matrix in row-major order.
nvinfer1::IElementWiseLayer
A elementwise layer in a network definition.
Definition: NvInfer.h:2564
nvinfer1::IScaleLayer::getMode
virtual ScaleMode getMode() const =0
Get the scale mode.
nvinfer1::LayerType::kPOOLING
Pooling layer.
nvinfer1::ILRNLayer::getBeta
virtual float getBeta() const =0
Get the LRN beta value.
nvinfer1::INetworkDefinition::addPlugin
virtual TRT_DEPRECATED IPluginLayer * addPlugin(ITensor *const *inputs, int nbInputs, IPlugin &plugin)=0
Add a plugin layer to the network.
nvinfer1::IGatherLayer::setNbElementWiseDims
virtual void setNbElementWiseDims(int k)=0
Set the number of leading dimensions of indices tensor to be handled elementwise. k must be 0 if ther...
nvinfer1::LayerType
LayerType
The type values of layer classes.
Definition: NvInfer.h:410
nvinfer1::DimsHW::h
int & h()
Get the height.
Definition: NvInfer.h:144
nvinfer1::LayerType::kCONVOLUTION
Convolution layer.
nvinfer1::LayerType::kELEMENTWISE
Elementwise layer.
nvinfer1::IFullyConnectedLayer::getBiasWeights
virtual Weights getBiasWeights() const =0
Get the bias weights.
nvinfer1::IPoolingLayer::setPadding
virtual TRT_DEPRECATED void setPadding(DimsHW padding)=0
Set the padding for pooling.
nvinfer1::IDeconvolutionLayer::getKernelSize
virtual TRT_DEPRECATED DimsHW getKernelSize() const =0
Get the HW kernel size of the deconvolution.
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:112
nvinfer1::INetworkDefinition::addSoftMax
virtual ISoftMaxLayer * addSoftMax(ITensor &input)=0
Add a SoftMax layer to the network.
nvinfer1::ITensor::setDynamicRange
virtual bool setDynamicRange(float min, float max)=0
Set dynamic range for the tensor.
nvinfer1::IRNNv2Layer::setOperation
virtual void setOperation(RNNOperation op)=0
Set the operation of the RNN layer.
nvinfer1::ILayer::setName
virtual void setName(const char *name)=0
Set the name of a layer.
nvinfer1::IConvolutionLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::IBuilder::setMinFindIterations
virtual TRT_DEPRECATED void setMinFindIterations(int minFind)=0
Set the number of minimization iterations used when timing layers.
nvinfer1::IDeconvolutionLayer::getBiasWeights
virtual Weights getBiasWeights() const =0
Get the bias weights for the deconvolution.
nvinfer1::DimsCHW::c
int & c()
Get the channel count.
Definition: NvInfer.h:238
nvinfer1::IDeconvolutionLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::ILayer::getType
virtual LayerType getType() const =0
Return the type of a layer.
nvinfer1::IRNNv2Layer::getCellState
virtual ITensor * getCellState() const =0
Get the initial cell state of the RNN.
nvinfer1::RNNGateType::kCELL
Cell gate (c).
nvinfer1::ITensor::getDimensions
virtual Dims getDimensions() const =0
Get the dimensions of a tensor.
nvinfer1::IBuilderConfig::setCalibrationProfile
virtual bool setCalibrationProfile(const IOptimizationProfile *profile) noexcept=0
Add a calibration profile.
nvinfer1::EnumMax< TopKOperation >
constexpr int EnumMax< TopKOperation >()
Maximum number of elements in TopKOperation enum.
Definition: NvInfer.h:3974
nvinfer1::IDeconvolutionLayer::setDilationNd
virtual void setDilationNd(Dims dilation)=0
Set the multi-dimension dilation of the deconvolution.
nvinfer1::UnaryOperation::kFLOOR
Floor.
nvinfer1::DimsNCHW::c
int & c()
Get the channel count.
Definition: NvInfer.h:365
nvinfer1::IPoolingLayer::setPostPadding
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
nvinfer1::IShapeLayer
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3956
nvinfer1::IResizeLayer::setOutputDimensions
virtual void setOutputDimensions(Dims dimensions)=0
Set the output dimensions.
nvinfer1::IRNNv2Layer::setWeightsForGate
virtual void setWeightsForGate(int layerIndex, RNNGateType gate, bool isW, Weights weights)=0
Set the weight parameters for an individual gate in the RNN.
nvinfer1::INetworkDefinition::addParametricReLU
virtual IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept=0
Add a parametric ReLU layer to the network.
nvinfer1::IConvolutionLayer::setKernelWeights
virtual void setKernelWeights(Weights weights)=0
Set the kernel weights for the convolution.
nvinfer1::IConvolutionLayer::setStrideNd
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride of the convolution.
nvinfer1::IBuilderConfig::getInt8Calibrator
virtual IInt8Calibrator * getInt8Calibrator() const =0
Get Int8 Calibration interface.
_TENSORRT_OVERRIDE
#define _TENSORRT_OVERRIDE
Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:62
nvinfer1::ILoopOutputLayer::getAxis
virtual int getAxis() const noexcept=0
Get axis being concatenated over.
nvinfer1::IDeconvolutionLayer::setKernelSize
virtual TRT_DEPRECATED void setKernelSize(DimsHW kernelSize)=0
Set the HW kernel size of the convolution.
nvinfer1::IBuilderConfig::setDefaultDeviceType
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...
nvinfer1::IFillLayer::setDimensions
virtual void setDimensions(Dims dimensions) noexcept=0
Set the output tensor's dimensions.
nvinfer1::IInt8EntropyCalibrator::getAlgorithm
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:5961
nvinfer1::IPaddingLayer::getPrePadding
virtual TRT_DEPRECATED DimsHW getPrePadding() const =0
Get the padding that is applied at the start of the tensor.
nvinfer1::ElementWiseOperation
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2526
nvinfer1::ITensor::getName
virtual const char * getName() const =0
Get the tensor name.
nvinfer1::DimsNCHW::n
int & n()
Get the index count.
Definition: NvInfer.h:351
nvinfer1::SliceMode::kDEFAULT
Fail with error when the coordinates are out of bounds. This is the default.
nvinfer1::DataType
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:163
nvinfer1::IInt8LegacyCalibrator::getAlgorithm
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:6005
nvinfer1::IShuffleLayer::getFirstTranspose
virtual Permutation getFirstTranspose() const =0
Get the permutation applied by the first transpose operation.
nvinfer1::IGatherLayer::getGatherAxis
virtual int getGatherAxis() const =0
Get the axis to gather on.
nvinfer1::IBuilder::setRefittable
virtual TRT_DEPRECATED void setRefittable(bool canRefit)=0
nvinfer1::INetworkDefinition::addMatrixMultiply
virtual IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1)=0
Add a MatrixMultiply layer to the network.
nvinfer1::LayerType::kFILL
Fill layer.
nvinfer1::IBuilderConfig::destroy
virtual void destroy()=0
De-allocates any internally allocated memory.
nvinfer1::INetworkDefinition::addReduce
virtual IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions)=0
Add a reduce layer to the network.
nvinfer1::UnaryOperation::kABS
Absolute value.
nvinfer1::IBuilder::getMaxBatchSize
virtual int getMaxBatchSize() const =0
Get the maximum batch size.
nvinfer1::IShuffleLayer::setReshapeDimensions
virtual void setReshapeDimensions(Dims dimensions)=0
Set the reshaped dimensions.
nvinfer1::BuilderFlag::kFP16
Enable FP16 layer selection, with FP32 fallback.
nvinfer1::RNNOperation::kRELU
Single gate RNN w/ ReLU activation function.
nvinfer1::INetworkDefinition::addConvolution
virtual TRT_DEPRECATED IConvolutionLayer * addConvolution(ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a convolution layer to the network.
nvinfer1::LayerType::kFULLY_CONNECTED
Fully connected layer.
nvinfer1::IActivationLayer::setBeta
virtual void setBeta(float beta)=0
Set the beta parameter (must be finite).
nvinfer1::IBuilder::getMaxWorkspaceSize
virtual TRT_DEPRECATED std::size_t getMaxWorkspaceSize() const =0
Get the maximum workspace size.
nvinfer1::IConstantLayer::setDimensions
virtual void setDimensions(Dims dimensions)=0
Set the dimensions for the layer.
nvinfer1::IReduceLayer::setKeepDimensions
virtual void setKeepDimensions(bool keepDimensions)=0
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
nvinfer1::IDeconvolutionLayer::getPaddingMode
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH
Mark the network to be an explicit batch network.
nvinfer1::IDeconvolutionLayer::getDilationNd
virtual Dims getDilationNd() const =0
Get the multi-dimension dilation of the deconvolution.
nvinfer1::IIteratorLayer::getAxis
virtual int getAxis() const noexcept=0
Get axis being iterated over.
nvinfer1::UnaryOperation::kTAN
Tangent.
nvinfer1::IPluginExt
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:247
nvinfer1::DimsNCHW::w
int w() const
Get the width.
Definition: NvInfer.h:400
nvinfer1::IBuilder::getHalf2Mode
virtual TRT_DEPRECATED bool getHalf2Mode() const =0
Query whether half2 mode is used.
nvinfer1::IPoolingLayer::getPrePadding
virtual Dims getPrePadding() const =0
Get the pre-padding.
nvinfer1::IOptimizationProfile
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1014
nvinfer1::INetworkDefinition::getConvolutionOutputDimensionsFormula
virtual TRT_DEPRECATED IOutputDimensionsFormula & getConvolutionOutputDimensionsFormula() const =0
Get the convolution output dimensions formula.
nvinfer1::ResizeMode
ResizeMode
Enumerates various modes of resize in the resize layer. Resize mode set using setResizeMode().
Definition: NvInfer.h:4238
nvinfer1::IPoolingLayer::setPaddingNd
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding for pooling.
nvinfer1::IRNNv2Layer::getOperation
virtual RNNOperation getOperation() const =0
Get the operation of the RNN layer.
nvinfer1::IFullyConnectedLayer::getKernelWeights
virtual Weights getKernelWeights() const =0
Get the kernel weights.
nvinfer1::IBuilderConfig::getDLACore
virtual int getDLACore() const =0
Get the DLA core that the engine executes on.
nvinfer1::IBuilder::createOptimizationProfile
virtual nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept=0
Create a new optimization profile.
nvinfer1::ElementWiseOperation::kEQUAL
Check if two elements are equal.
nvinfer1::LayerType::kDECONVOLUTION
Deconvolution layer.
nvinfer1::IBuilder::getDebugSync
virtual TRT_DEPRECATED bool getDebugSync() const =0
Query whether the builder will use debug synchronization.
nvinfer1::EnumMax< BuilderFlag >
constexpr int EnumMax< BuilderFlag >()
Maximum number of builder flags in BuilderFlag enum.
Definition: NvInfer.h:6257
nvinfer1::ElementWiseOperation::kXOR
Logical XOR of two elements.
nvinfer1::EnumMax< MatrixOperation >
constexpr int EnumMax< MatrixOperation >()
Maximum number of elements in MatrixOperation enum.
Definition: NvInfer.h:4066
nvinfer1::IScaleLayer::getShift
virtual Weights getShift() const =0
Get the shift value.
nvinfer1::DimsNCHW
Descriptor for data with one index dimension, one channel dimension and two spatial dimensions.
Definition: NvInfer.h:316
nvinfer1::DimsNCHW::DimsNCHW
DimsNCHW(int batchSize, int channels, int height, int width)
Construct a DimsNCHW given batch size, channel count, height and width.
Definition: NvInfer.h:338
nvinfer1::IBuilderConfig::getMaxWorkspaceSize
virtual std::size_t getMaxWorkspaceSize() const =0
Get the maximum workspace size.
nvinfer1::IConcatenationLayer
A concatenation layer in a network definition.
Definition: NvInfer.h:2174
nvinfer1::IShuffleLayer
Layer type for shuffling data.
Definition: NvInfer.h:3660
nvinfer1::ISliceLayer::getStart
virtual Dims getStart() const =0
Get the start offset for the slice layer.
nvinfer1::IPoolingLayer::setStrideNd
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride for pooling.
nvinfer1::IBuilder::destroy
virtual void destroy()=0
Destroy this object.
nvinfer1::ITensor
A tensor in a network definition.
Definition: NvInfer.h:467
nvinfer1::IPoolingLayer::setPaddingMode
virtual void setPaddingMode(PaddingMode paddingMode)=0
Set the padding mode.
nvinfer1::IBuilder::createNetworkV2
virtual nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags)=0
Create a network definition object.
nvinfer1::IRecurrenceLayer
Definition: NvInfer.h:4437
nvinfer1::ILayer::setOutputType
virtual void setOutputType(int index, DataType dataType)=0
Set the output type of this layer.
nvinfer1::RNNDirection
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:2731
nvinfer1::IDeconvolutionLayer::setNbOutputMaps
virtual void setNbOutputMaps(int nbOutputMaps)=0
Set the number of output feature maps for the deconvolution.
nvinfer1::LayerType::kSHUFFLE
Shuffle layer.
nvinfer1::IBuilder::isDeviceTypeSet
virtual TRT_DEPRECATED bool isDeviceTypeSet(const ILayer *layer) const =0
whether the DeviceType has been explicitly set for this layer
nvinfer1::LayerType::kSELECT
Select layer.
nvinfer1::IPoolingLayer::setBlendFactor
virtual void setBlendFactor(float blendFactor)=0
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
nvinfer1::ILoop::setName
virtual void setName(const char *name) noexcept=0
Set the name of the loop.
nvinfer1::IBuilderConfig::reset
virtual void reset()=0
Resets the builder configuration to defaults.
nvinfer1::IConvolutionLayer::getKernelSizeNd
virtual Dims getKernelSizeNd() const =0
Get the multi-dimension kernel size of the convolution.
nvinfer1::IAlgorithmIOInfo::getTensorFormat
virtual TensorFormat getTensorFormat() const =0
Return TensorFormat of the input/output of algorithm.
nvinfer1::IIteratorLayer::setReverse
virtual void setReverse(bool reverse) noexcept=0
nvinfer1::INetworkDefinition::addConcatenation
virtual IConcatenationLayer * addConcatenation(ITensor *const *inputs, int nbInputs)=0
Add a concatenation layer to the network.
nvinfer1::IDeconvolutionLayer::setBiasWeights
virtual void setBiasWeights(Weights weights)=0
Set the bias weights for the deconvolution.
nvinfer1::ILoopBoundaryLayer::getLoop
virtual ILoop * getLoop() const noexcept=0
Return pointer to ILoop associated with this boundary layer.
nvinfer1::ITopKLayer::setOperation
virtual void setOperation(TopKOperation op)=0
Set the operation for the layer.
nvinfer1::ILRNLayer
A LRN layer in a network definition.
Definition: NvInfer.h:1920
nvinfer1::ITensor::getType
virtual DataType getType() const =0
Get the data type of a tensor.
nvinfer1::IShuffleLayer::getZeroIsPlaceholder
virtual bool getZeroIsPlaceholder() const =0
Get meaning of 0 in reshape dimensions.
nvinfer1::IReduceLayer
Layer that represents a reduction operator across Shape, Int32, Float, and Half tensors.
Definition: NvInfer.h:3490
nvinfer1::INetworkDefinition::addTopK
virtual ITopKLayer * addTopK(ITensor &input, TopKOperation op, int k, uint32_t reduceAxes)=0
Add a TopK layer to the network.
nvinfer1::IMatrixMultiplyLayer
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:4096
nvinfer1::IBuilderConfig::setDeviceType
virtual void setDeviceType(const ILayer *layer, DeviceType deviceType)=0
Set the device that this layer must execute on.
nvinfer1::RNNOperation::kTANH
Single gate RNN w/ TANH activation function.
nvinfer1::INetworkDefinition::getName
virtual const char * getName() const =0
Returns the name associated with the network.
nvinfer1::PaddingMode
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:1104
nvinfer1::Dims::d
int d[MAX_DIMS]
The extent of each dimension.
Definition: NvInferRuntimeCommon.h:224
nvinfer1::ElementWiseOperation::kGREATER
Check if element in first tensor is greater than corresponding element in second tensor.
nvinfer1::LayerType::kUNARY
UnaryOp operation Layer.
nvinfer1::IBuilder::createBuilderConfig
virtual nvinfer1::IBuilderConfig * createBuilderConfig()=0
Create a builder configuration object.
nvinfer1::INetworkDefinition::addIdentity
virtual IIdentityLayer * addIdentity(ITensor &input)=0
Add an identity layer.
nvinfer1::PoolingType
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1637
nvinfer1::INetworkDefinition::addRaggedSoftMax
virtual IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds)=0
Add a RaggedSoftMax layer to the network.
nvinfer1::INetworkDefinition::getNbInputs
virtual int getNbInputs() const =0
Get the number of inputs in the network.
nvinfer1::IInt8EntropyCalibrator2
Definition: NvInfer.h:5970
nvinfer1::IDeconvolutionLayer::setKernelSizeNd
virtual void setKernelSizeNd(Dims kernelSize)=0
Set the multi-dimension kernel size of the deconvolution.
nvinfer1::IFillLayer
Generate an output tensor with specified mode.
Definition: NvInfer.h:4668
nvinfer1::IRNNv2Layer::getSequenceLengths
virtual ITensor * getSequenceLengths() const =0
Get the sequence lengths specified for the RNN.
nvinfer1::IConvolutionLayer::setPostPadding
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
nvinfer1::UnaryOperation::kCEIL
Ceiling.
nvinfer1::PaddingMode::kSAME_LOWER
Use SAME padding, with prePadding >= postPadding.
nvinfer1::Dims3
Descriptor for three-dimensional data.
Definition: NvInfer.h:172
nvinfer1::IInt8Calibrator::readCalibrationCache
virtual const void * readCalibrationCache(std::size_t &length)=0
Load a calibration cache.
nvinfer1::IDeconvolutionLayer::setPostPadding
virtual void setPostPadding(Dims padding)=0
Set the post-padding.
nvinfer1::ITensor::getBroadcastAcrossBatch
virtual bool getBroadcastAcrossBatch() const =0
Check if tensor is broadcast across the batch.
nvinfer1::IInt8EntropyCalibrator2::getAlgorithm
CalibrationAlgoType getAlgorithm() override
Definition: NvInfer.h:5976
nvinfer1::UnaryOperation::kRECIP
Reciprocal.
nvinfer1::IInt8Calibrator
Application-implemented interface for calibration.
Definition: NvInfer.h:5890
nvinfer1::IErrorRecorder
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1175
nvinfer1::IConvolutionLayer::setStride
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Get the stride of the convolution.
nvinfer1::IActivationLayer::setAlpha
virtual void setAlpha(float alpha)=0
Set the alpha parameter (must be finite).
nvinfer1::ITopKLayer
Layer that represents a TopK reduction.
Definition: NvInfer.h:3986
nvinfer1::BuilderFlag::kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
nvinfer1::ITensor::setAllowedFormats
virtual void setAllowedFormats(TensorFormats formats)=0
Set allowed formats for this tensor. By default all formats are allowed. Shape tensors (for which isS...
nvinfer1::INetworkDefinition::addConvolutionNd
virtual IConvolutionLayer * addConvolutionNd(ITensor &input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension convolution layer to the network.
nvinfer1::IBuilderConfig::getDefaultDeviceType
virtual DeviceType getDefaultDeviceType() const =0
Get the default DeviceType which was set by setDefaultDeviceType.
nvinfer1::IBuilder::getDefaultDeviceType
virtual TRT_DEPRECATED DeviceType getDefaultDeviceType() const =0
Get the default DeviceType which was set by setDefaultDeviceType.
nvinfer1::IConvolutionLayer::getStride
virtual TRT_DEPRECATED DimsHW getStride() const =0
Get the stride of the convolution.
nvinfer1::ElementWiseOperation::kMIN
Minimum of the two elements.
nvinfer1::PaddingMode::kCAFFE_ROUND_DOWN
Use CAFFE padding, rounding output size down, uses prePadding value.
nvinfer1::IBuilderConfig::setMinTimingIterations
virtual void setMinTimingIterations(int minTiming)=0
Set the number of minimization iterations used when timing layers.
nvinfer1::UnaryOperation::kASINH
Inverse hyperbolic sine.
nvinfer1::ILayer::setInput
virtual void setInput(int index, ITensor &tensor)=0
Replace an input of this layer with a specific tensor.
nvinfer1::ISelectLayer
Definition: NvInfer.h:4625
nvinfer1::LayerType::kSCALE
Scale layer.
nvinfer1::IConstantLayer::setWeights
virtual void setWeights(Weights weights)=0
Set the weights for the layer.
nvinfer1::IBuilderConfig::addOptimizationProfile
virtual int addOptimizationProfile(const IOptimizationProfile *profile) noexcept=0
Add an optimization profile.
nvinfer1::IInt8Calibrator::getAlgorithm
virtual CalibrationAlgoType getAlgorithm()=0
Get the algorithm used by this calibrator.
nvinfer1::EnumMax< PoolingType >
constexpr int EnumMax< PoolingType >()
Maximum number of elements in PoolingType enum.
Definition: NvInfer.h:1645
nvinfer1::LayerType::kSOFTMAX
SoftMax layer.
nvinfer1::SliceMode
SliceMode
Controls how ISliceLayer handles out of bounds coordinates.
Definition: NvInfer.h:3793
nvinfer1::INetworkDefinition::destroy
virtual void destroy()=0
Destroy this INetworkDefinition object.
nvinfer1::IInt8EntropyCalibrator
Definition: NvInfer.h:5955
nvinfer1::ILRNLayer::getK
virtual float getK() const =0
Get the LRN K value.
nvinfer1::LayerType::kRECURRENCE
Loop Recurrence layer.
nvinfer1::ILoopOutputLayer::setAxis
virtual void setAxis(int axis) noexcept=0
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
nvinfer1::ITopKLayer::setReduceAxes
virtual void setReduceAxes(uint32_t reduceAxes)=0
Set which axes to reduce for the layer.
nvinfer1::IElementWiseLayer::setOperation
virtual void setOperation(ElementWiseOperation op)=0
Set the binary operation for the layer.
nvinfer1::IGatherLayer
Definition: NvInfer.h:2594
nvinfer1::DimsHW::DimsHW
DimsHW(int height, int width)
Construct a DimsHW given height and width.
Definition: NvInfer.h:133
nvinfer1::IPoolingLayer::getPoolingType
virtual PoolingType getPoolingType() const =0
Get the type of activation to be performed.
nvinfer1::RNNInputMode
RNNInputMode
Enumerates the RNN input modes that may occur with an RNN layer.
Definition: NvInfer.h:2758
nvinfer1::IActivationLayer::getActivationType
virtual ActivationType getActivationType() const =0
Get the type of activation to be performed.
nvinfer1::Dims2
Descriptor for two-dimensional data.
Definition: NvInfer.h:85
nvinfer1::IScaleLayer::setMode
virtual void setMode(ScaleMode mode)=0
Set the scale mode.
nvinfer1::IConvolutionLayer::getKernelSize
virtual TRT_DEPRECATED DimsHW getKernelSize() const =0
Get the HW kernel size of the convolution.
nvinfer1::FillOperation
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4638
nvinfer1::IAlgorithmContext::getNbOutputs
virtual int32_t getNbOutputs() const =0
Return number of outputs of the algorithm.
nvinfer1::ReduceOperation
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3468
nvinfer1::IIteratorLayer::setAxis
virtual void setAxis(int axis) noexcept=0
Set axis to iterate over.
nvinfer1::INetworkDefinition::addPooling
virtual TRT_DEPRECATED IPoolingLayer * addPooling(ITensor &input, PoolingType type, DimsHW windowSize)=0
Add a pooling layer to the network.
nvinfer1::UnaryOperation::kCOS
Cosine.
nvinfer1::IDeconvolutionLayer::getKernelSizeNd
virtual Dims getKernelSizeNd() const =0
Get the multi-dimension kernel size of the deconvolution.
nvinfer1::IBuilderConfig::canRunOnDLA
virtual bool canRunOnDLA(const ILayer *layer) const =0
Checks if a layer can run on DLA.
nvinfer1::IMatrixMultiplyLayer::getTranspose
virtual TRT_DEPRECATED bool getTranspose(int index) const =0
Get the transpose flag for an input tensor.
nvinfer1::IAlgorithmIOInfo::getStrides
virtual Dims getStrides() const =0
Return strides of the input/output tensor of algorithm.
nvinfer1::UnaryOperation::kATANH
Inverse hyperbolic tangent.
nvinfer1::BuilderFlags
uint32_t BuilderFlags
It is capable of representing one or more BuilderFlags by binary OR operations, e....
Definition: NvInfer.h:6236
nvinfer1::IResizeLayer::getOutputDimensions
virtual Dims getOutputDimensions() const =0
Get the output dimensions.
nvinfer1::IPaddingLayer::setPostPaddingNd
virtual void setPostPaddingNd(Dims padding)=0
Set the padding that is applied at the end of the tensor.
nvinfer1::IReduceLayer::getOperation
virtual ReduceOperation getOperation() const =0
Get the reduce operation for the layer.
nvinfer1::IBuilderConfig::getCalibrationProfile
virtual const IOptimizationProfile * getCalibrationProfile() noexcept=0
Get the current calibration profile.
nvinfer1::Dims::MAX_DIMS
static const int MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:222
nvinfer1::ILoopBoundaryLayer
Definition: NvInfer.h:4430
nvinfer1::IAlgorithm
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:6158
nvinfer1::IAlgorithmVariant::getTactic
virtual int64_t getTactic() const =0
Return tactic of the algorithm.
nvinfer1::LayerType::kIDENTITY
Identity layer.
nvinfer1::DimsCHW::DimsCHW
DimsCHW(int channels, int height, int width)
Construct a DimsCHW given channel count, height and width.
Definition: NvInfer.h:226
nvinfer1::BuilderFlag::kSTRICT_TYPES
Enables strict type constraints.
nvinfer1::IPoolingLayer::getBlendFactor
virtual float getBlendFactor() const =0
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
nvinfer1::EnumMax< RNNDirection >
constexpr int EnumMax< RNNDirection >()
Maximum number of elements in RNNDirection enum.
Definition: NvInfer.h:2738
nvinfer1::LayerType::kPLUGIN_V2
PluginV2 layer.
nvinfer1::IConvolutionLayer::setPaddingNd
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding of the convolution.
nvinfer1::IPaddingLayer::setPrePaddingNd
virtual void setPrePaddingNd(Dims padding)=0
Set the padding that is applied at the start of the tensor.
nvinfer1::DimsCHW::h
int h() const
Get the height.
Definition: NvInfer.h:259
nvinfer1::INetworkDefinition::addDeconvolutionNd
virtual IDeconvolutionLayer * addDeconvolutionNd(ITensor &input, int nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a multi-dimension deconvolution layer to the network.
nvinfer1::IRNNv2Layer::getBiasForGate
virtual Weights getBiasForGate(int layerIndex, RNNGateType gate, bool isW) const =0
Get the bias parameters for an individual gate in the RNN.
nvinfer1::FillOperation::kLINSPACE
Generate evenly spaced numbers over a specified interval.
nvinfer1::IRNNv2Layer::setHiddenState
virtual void setHiddenState(ITensor &hidden)=0
Set the initial hidden state of the RNN with the provided hidden ITensor.
nvinfer1::UnaryOperation::kCOSH
Hyperbolic cosine.
nvinfer1::IAlgorithmContext::getName
virtual const char * getName() const =0
Return name of the algorithm node. This is a unique identifier for the IAlgorithmContext.
nvinfer1::INetworkDefinition::getDeconvolutionOutputDimensionsFormula
virtual TRT_DEPRECATED IOutputDimensionsFormula & getDeconvolutionOutputDimensionsFormula() const =0
Get the deconvolution output dimensions formula.
nvinfer1::IConvolutionLayer::getKernelWeights
virtual Weights getKernelWeights() const =0
Get the kernel weights of the convolution.
nvinfer1::UnaryOperation::kACOS
Inverse cosine.
nvinfer1::IAlgorithmIOInfo::getDataType
virtual DataType getDataType() const =0
Return DataType of the input/output of algorithm.
nvinfer1::IResizeLayer::setResizeMode
virtual void setResizeMode(ResizeMode resizeMode)=0
Set resize mode for an input tensor.
nvinfer1::IInt8LegacyCalibrator
Definition: NvInfer.h:5999
nvinfer1::ElementWiseOperation::kPOW
The first element to the power of the second element.
nvinfer1::ISoftMaxLayer::setAxes
virtual void setAxes(uint32_t axes)=0
Set the axis along which softmax is computed. Currently, only one axis can be set.
nvinfer1::RNNGateType::kINPUT
Input gate (i).
nvinfer1::ILRNLayer::getAlpha
virtual float getAlpha() const =0
Get the LRN alpha value.
nvinfer1::IDeconvolutionLayer::getStrideNd
virtual Dims getStrideNd() const =0
Get the multi-dimension stride of the deconvolution.
nvinfer1::EnumMax< TripLimit >
constexpr int EnumMax< TripLimit >()
Maximum number of elements in TripLimit enum.
Definition: NvInfer.h:4423
nvinfer1::IScaleLayer
A Scale layer in a network definition.
Definition: NvInfer.h:2030
nvinfer1::IBuilder::allowGPUFallback
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.
nvinfer1::IFillLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
replace an input of this layer with a specific tensor.
nvinfer1::ISoftMaxLayer::getAxes
virtual uint32_t getAxes() const =0
Get the axis along which softmax occurs.
nvinfer1::BuilderFlag
BuilderFlag
Definition: NvInfer.h:6245
nvinfer1::ILayer::getOutputType
virtual DataType getOutputType(int index) const =0
get the output type of this layer
nvinfer1::DimsCHW::w
int & w()
Get the width.
Definition: NvInfer.h:266
nvinfer1::TripLimit
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4413
nvinfer1::DimensionType::kINDEX
Elements correspond to different batch index.
nvinfer1::LayerType::kACTIVATION
Activation layer.
nvinfer1::ILayer::getInput
virtual ITensor * getInput(int index) const =0
Get the layer input corresponding to the given index.
nvinfer1::ISoftMaxLayer
A Softmax layer in a network definition.
Definition: NvInfer.h:2119
nvinfer1::IBuilderConfig::setFlags
virtual void setFlags(BuilderFlags builderFlags)=0
Set the build mode flags to turn on builder options for this network.
nvinfer1::MatrixOperation::kNONE
nvinfer1::IInt8Calibrator::getBatch
virtual bool getBatch(void *bindings[], const char *names[], int nbBindings)=0
Get a batch of input for calibration.
nvinfer1::LayerType::kMATRIX_MULTIPLY
Matrix multiply layer.
nvinfer1::IRNNv2Layer::setSequenceLengths
virtual void setSequenceLengths(ITensor &seqLengths)=0
Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths.
nvinfer1::IDeconvolutionLayer::setPaddingNd
virtual void setPaddingNd(Dims padding)=0
Set the multi-dimension padding of the deconvolution.
nvinfer1::NetworkDefinitionCreationFlag
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:6638
nvinfer1::INetworkDefinition::unmarkOutput
virtual void unmarkOutput(ITensor &tensor)=0
unmark a tensor as a network output.
nvinfer1::IBuilderConfig
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:6288
nvinfer1::ILayer::resetPrecision
virtual void resetPrecision()=0
reset the computational precision for this layer
nvinfer1::IBuilderConfig::getNbOptimizationProfiles
virtual int getNbOptimizationProfiles() const noexcept=0
Get number of optimization profiles.
nvinfer1::IBuilder::setAverageFindIterations
virtual TRT_DEPRECATED void setAverageFindIterations(int avgFind)=0
Set the number of averaging iterations used when timing layers.
nvinfer1::IDeconvolutionLayer::setStrideNd
virtual void setStrideNd(Dims stride)=0
Set the multi-dimension stride of the deconvolution.
nvinfer1::IBuilderConfig::getAlgorithmSelector
virtual IAlgorithmSelector * getAlgorithmSelector() const =0
Get Algorithm Selector.
nvinfer1::IBuilder::setDebugSync
virtual TRT_DEPRECATED void setDebugSync(bool sync)=0
Set whether the builder should use debug synchronization.
nvinfer1::IFillLayer::getAlpha
virtual double getAlpha() const noexcept=0
Get the value of alpha parameter.
nvinfer1::DimsHW::w
int & w()
Get the width.
Definition: NvInfer.h:158
nvinfer1::Dims3::Dims3
Dims3(int d0, int d1, int d2)
Construct a Dims3 from 3 elements.
Definition: NvInfer.h:191
nvinfer1::UnaryOperation::kSQRT
Square root.
nvinfer1::IDeconvolutionLayer::setNbGroups
virtual void setNbGroups(int nbGroups)=0
Set the number of groups for a deconvolution.
nvinfer1::LayerType::kRNN_V2
RNNv2 layer.
nvinfer1::IScaleLayer::setShift
virtual void setShift(Weights shift)=0
Set the shift value.
nvinfer1::LayerType::kRAGGED_SOFTMAX
Ragged softmax layer.
nvinfer1::IAlgorithmContext::getNbInputs
virtual int32_t getNbInputs() const =0
Return number of inputs of the algorithm.
nvinfer1::IRNNv2Layer::setBiasForGate
virtual void setBiasForGate(int layerIndex, RNNGateType gate, bool isW, Weights bias)=0
Set the bias parameters for an individual gate in the RNN.
nvinfer1::INetworkDefinition::addDeconvolution
virtual TRT_DEPRECATED IDeconvolutionLayer * addDeconvolution(ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0
Add a deconvolution layer to the network.
nvinfer1::IResizeLayer
A resize layer in a network definition.
Definition: NvInfer.h:4270
nvinfer1::IConvolutionLayer::setNbOutputMaps
virtual void setNbOutputMaps(int nbOutputMaps)=0
Set the number of output maps for the convolution.
nvinfer1::DimsHW::DimsHW
DimsHW()
Construct an empty DimsHW object.
Definition: NvInfer.h:121
nvinfer1::IPlugin
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:143
nvinfer1::ISliceLayer::setStart
virtual void setStart(Dims start)=0
Set the start offset that the slice layer uses to create the output slice.
nvinfer1::INetworkDefinition::setDeconvolutionOutputDimensionsFormula
virtual TRT_DEPRECATED void setDeconvolutionOutputDimensionsFormula(IOutputDimensionsFormula *formula)=0
Set the deconvolution output dimensions formula.
nvinfer1::IUnaryLayer::getOperation
virtual UnaryOperation getOperation() const =0
Get the unary operation for the layer.
nvinfer1::Dims2::Dims2
Dims2(int d0, int d1)
Construct a Dims2 from 2 elements.
Definition: NvInfer.h:103
nvinfer1::IBuilderConfig::getFlags
virtual BuilderFlags getFlags() const =0
Get the set of build mode flags for this builder config. Defaults to BuildMode::kDEFAULT.
nvinfer1::INetworkDefinition::addRNNv2
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...
nvinfer1::IPoolingLayer::getStrideNd
virtual Dims getStrideNd() const =0
Get the multi-dimension stride for pooling.
nvinfer1::IMatrixMultiplyLayer::setOperation
virtual void setOperation(int index, MatrixOperation op)=0
Set the operation for an input tensor.
nvinfer1::IPoolingLayer::getPaddingNd
virtual Dims getPaddingNd() const =0
Get the multi-dimension padding for pooling.
nvinfer1::RNNGateType::kFORGET
Forget gate (f).
nvinfer1::Dims4
Descriptor for four-dimensional data.
Definition: NvInfer.h:280
nvinfer1::IPoolingLayer
A Pooling layer in a network definition.
Definition: NvInfer.h:1661
nvinfer1::IBuilderConfig::setAlgorithmSelector
virtual void setAlgorithmSelector(IAlgorithmSelector *selector)=0
Set Algorithm Selector.
nvinfer1::IShuffleLayer::getReshapeDimensions
virtual Dims getReshapeDimensions() const =0
Get the reshaped dimensions.
nvinfer1::ILRNLayer::setWindowSize
virtual void setWindowSize(int windowSize)=0
Set the LRN window size.
nvinfer1::IAlgorithm::getWorkspaceSize
virtual std::size_t getWorkspaceSize() const =0
The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
nvinfer1::IGpuAllocator
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:977
nvinfer1::IUnaryLayer
Layer that represents an unary operation.
Definition: NvInfer.h:3429
nvinfer1::IFillLayer::setAlpha
virtual void setAlpha(double alpha) noexcept=0
Set the alpha parameter.
nvinfer1::IResizeLayer::getResizeMode
virtual ResizeMode getResizeMode() const =0
Get resize mode for an input tensor.
nvinfer1::LayerType::kLOOP_OUTPUT
Loop output layer.
nvinfer1::IBuilder::setFp16Mode
virtual TRT_DEPRECATED void setFp16Mode(bool mode)=0
Set whether or not 16-bit kernels are permitted.
nvinfer1::INetworkDefinition::getLayer
virtual ILayer * getLayer(int index) const =0
Get the layer specified by the given index.
nvinfer1::IBuilder
Builds an engine from a network definition.
Definition: NvInfer.h:6674
nvinfer1::ITensor::isExecutionTensor
virtual bool isExecutionTensor() const =0
Whether the tensor is an execution tensor.
nvinfer1::DimsCHW::DimsCHW
DimsCHW()
Construct an empty DimsCHW object.
Definition: NvInfer.h:212
nvinfer1::IRNNv2Layer::getInputMode
virtual RNNInputMode getInputMode() const =0
Get the input mode of the RNN layer.
nvinfer1::IPoolingLayer::getPadding
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding for pooling.
nvinfer1::Dims2::Dims2
Dims2()
Construct an empty Dims2 object.
Definition: NvInfer.h:91
nvinfer1::INetworkDefinition::addElementWise
virtual IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op)=0
Add an elementwise layer to the network.
nvinfer1::IBuilderConfig::setProfilingVerbosity
virtual void setProfilingVerbosity(ProfilingVerbosity verbosity)=0
Set verbosity level of layer information exposed in NVTX annotations.
nvinfer1::IPoolingLayer::getAverageCountExcludesPadding
virtual bool getAverageCountExcludesPadding() const =0
Get whether exclusive pooling uses as a denominator the overlap area betwen the window and the unpadd...
nvinfer1::CalibrationAlgoType
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:5865
nvinfer1::INetworkDefinition::addGather
virtual IGatherLayer * addGather(ITensor &data, ITensor &indices, int axis)=0
Add a gather layer to the network.
nvinfer1::ILayer::getName
virtual const char * getName() const =0
Return the name of a layer.
nvinfer1::IPoolingLayer::getWindowSize
virtual TRT_DEPRECATED DimsHW getWindowSize() const =0
Get the window size for pooling.
nvinfer1::RNNOperation::kGRU
Three-gate network consisting of Gated Recurrent Units.
nvinfer1::IConvolutionLayer::getStrideNd
virtual Dims getStrideNd() const =0
Get the multi-dimension stride of the convolution.
nvinfer1::IConvolutionLayer::getBiasWeights
virtual Weights getBiasWeights() const =0
Get the bias weights for the convolution.
nvinfer1::EngineCapability
EngineCapability
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:82
nvinfer1::ITensor::isNetworkInput
virtual bool isNetworkInput() const =0
Whether the tensor is a network input.
nvinfer1::ILoopOutputLayer::setInput
void setInput(int index, ITensor &tensor) _TENSORRT_OVERRIDE=0
Append or replace an input of this layer with a specific tensor.
nvinfer1::IOutputDimensionsFormula
Application-implemented interface to compute layer output sizes.
Definition: NvInfer.h:3313
nvinfer1::IGatherLayer::getNbElementWiseDims
virtual int getNbElementWiseDims() const =0
Get the number of leading dimensions of indices tensor to be handled elementwise.
nvinfer1::LayerType::kRESIZE
Resize Layer.
nvinfer1::IPaddingLayer::getPrePaddingNd
virtual Dims getPrePaddingNd() const =0
Get the padding that is applied at the start of the tensor.
nvinfer1::IReduceLayer::setOperation
virtual void setOperation(ReduceOperation op)=0
Set the reduce operation for the layer.
nvinfer1::IConvolutionLayer::getPaddingMode
virtual PaddingMode getPaddingMode() const =0
Get the padding mode.
nvinfer1::IBuilder::setGpuAllocator
virtual void setGpuAllocator(IGpuAllocator *allocator)=0
Set the GPU allocator.
nvinfer1::DimsNCHW::n
int n() const
Get the index count.
Definition: NvInfer.h:358
nvinfer1::ITensor::isNetworkOutput
virtual bool isNetworkOutput() const =0
Whether the tensor is a network output.
nvinfer1::EnumMax< FillOperation >
constexpr int EnumMax< FillOperation >()
Maximum number of elements in FillOperation enum.
Definition: NvInfer.h:4645
nvinfer1::ILoop::addTripLimit
virtual ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept=0
Add a trip-count limiter, based on the given tensor.
nvinfer1::EnumMax< ElementWiseOperation >
constexpr int EnumMax< ElementWiseOperation >()
Maximum number of elements in ElementWiseOperation enum.
Definition: NvInfer.h:2545
nvinfer1::ILayer::outputTypeIsSet
virtual bool outputTypeIsSet(int index) const =0
whether the output type has been set for this layer
nvinfer1::IConvolutionLayer::getNbGroups
virtual int getNbGroups() const =0
Get the number of groups of the convolution.
nvinfer1::INetworkDefinition::getNbLayers
virtual int getNbLayers() const =0
Get the number of layers in the network.
nvinfer1::LayerType::kLRN
LRN layer.
nvinfer1::IPoolingLayer::setAverageCountExcludesPadding
virtual void setAverageCountExcludesPadding(bool exclusive)=0
Set whether average pooling uses as a denominator the overlap area between the window and the unpadde...
nvinfer1::PaddingMode::kEXPLICIT_ROUND_DOWN
Use explicit padding, rounding output size down.
nvinfer1::IConvolutionLayer::getDilation
virtual TRT_DEPRECATED DimsHW getDilation() const =0
Get the dilation for a convolution.
nvinfer1::IConvolutionLayer::getPadding
virtual TRT_DEPRECATED DimsHW getPadding() const =0
Get the padding of the convolution. If the padding is asymmetric, the pre-padding is returned.
nvinfer1::IResizeLayer::getScales
virtual int getScales(int size, float *scales) const =0
Copies resize scales to scales[0, ..., nbScales-1], where nbScales is the number of scales that were ...
nvinfer1::ILoop::addLoopOutput
virtual ILoopOutputLayer * addLoopOutput(ITensor &tensor, LoopOutput outputKind, int axis=0) noexcept=0
Make an output for this loop, based on the given tensor.
nvinfer1::IBuilderConfig::getEngineCapability
virtual EngineCapability getEngineCapability() const =0
Query EngineCapability flow configured for the builder.
nvinfer1::IPoolingLayer::setPrePadding
virtual void setPrePadding(Dims padding)=0
Set the pre-padding.
nvinfer1::EnumMax< RNNInputMode >
constexpr int EnumMax< RNNInputMode >()
Maximum number of elements in RNNInputMode enum.
Definition: NvInfer.h:2765
nvinfer1::INetworkDefinition::addShape
virtual IShapeLayer * addShape(ITensor &input)=0
Add a shape layer to the network.
nvinfer1::ElementWiseOperation::kLESS
Check if element in first tensor is less than corresponding element in second tensor.
nvinfer1::IDeconvolutionLayer::setStride
virtual TRT_DEPRECATED void setStride(DimsHW stride)=0
Get the stride of the deconvolution.
nvinfer1::DimensionType::kSPATIAL
Elements correspond to different spatial data.
nvinfer1::IDeconvolutionLayer::getPostPadding
virtual Dims getPostPadding() const =0
Get the padding.
nvinfer1::IResizeLayer::setScales
virtual void setScales(const float *scales, int nbScales)=0
Set the resize scales.
nvinfer1::IActivationLayer
An Activation layer in a network definition.
Definition: NvInfer.h:1574
nvinfer1::INetworkDefinition::addScale
virtual IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power)=0
Add a Scale layer to the network.
nvinfer1::LayerType::kITERATOR
Loop Iterator layer.
nvinfer1::IFillLayer::setBeta
virtual void setBeta(double beta) noexcept=0
Set the beta parameter.
nvinfer1::ScaleMode::kUNIFORM
Identical coefficients across all elements of the tensor.
nvinfer1::DimsCHW::h
int & h()
Get the height.
Definition: NvInfer.h:252
nvinfer1::UnaryOperation::kERF
Gauss error function.
nvinfer1::ITopKLayer::setK
virtual void setK(int k)=0
Set the k value for the layer.
nvinfer1::Permutation::order
int order[Dims::MAX_DIMS]
Definition: NvInfer.h:3645
nvinfer1::IPaddingLayer::getPostPadding
virtual TRT_DEPRECATED DimsHW getPostPadding() const =0
Get the padding that is applied at the end of the tensor.
nvinfer1::IRNNv2Layer::getWeightsForGate
virtual Weights getWeightsForGate(int layerIndex, RNNGateType gate, bool isW) const =0
Get the weight parameters for an individual gate in the RNN.
nvinfer1::IBuilder::getStrictTypeConstraints
virtual TRT_DEPRECATED bool getStrictTypeConstraints() const =0
Query whether or not type constraints are strict.
nvinfer1::IDeconvolutionLayer
A deconvolution layer in a network definition.
Definition: NvInfer.h:2209
nvinfer1::LayerType::kPARAMETRIC_RELU
Parametric ReLU layer.