TensorRT 8.2.1
NvInfer.h
Go to the documentation of this file.
1/*
2 * Copyright 1993-2021 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 "NvInferLegacyDims.h"
54#include "NvInferRuntime.h"
55
64//
67
73
79namespace nvinfer1
80{
81
89enum class LayerType : int32_t
90{
91 kCONVOLUTION = 0,
93 kACTIVATION = 2,
94 kPOOLING = 3,
95 kLRN = 4,
96 kSCALE = 5,
97 kSOFTMAX = 6,
98 kDECONVOLUTION = 7,
99 kCONCATENATION = 8,
100 kELEMENTWISE = 9,
101 kPLUGIN = 10,
102 kUNARY = 11,
103 kPADDING = 12,
104 kSHUFFLE = 13,
105 kREDUCE = 14,
106 kTOPK = 15,
107 kGATHER = 16,
108 kMATRIX_MULTIPLY = 17,
109 kRAGGED_SOFTMAX = 18,
110 kCONSTANT = 19,
111 kRNN_V2 = 20,
112 kIDENTITY = 21,
113 kPLUGIN_V2 = 22,
114 kSLICE = 23,
115 kSHAPE = 24,
116 kPARAMETRIC_RELU = 25,
117 kRESIZE = 26,
118 kTRIP_LIMIT = 27,
119 kRECURRENCE = 28,
120 kITERATOR = 29,
121 kLOOP_OUTPUT = 30,
122 kSELECT = 31,
123 kFILL = 32,
124 kQUANTIZE = 33,
125 kDEQUANTIZE = 34,
126 kCONDITION = 35,
127 kCONDITIONAL_INPUT = 36,
129 kSCATTER = 38,
130 kEINSUM = 39,
131 kASSERTION = 40,
132};
133
135template <>
136constexpr inline int32_t EnumMax<LayerType>() noexcept
137{
138 return 41;
139}
140
147using TensorFormats = uint32_t;
148
154enum class ActivationType : int32_t
155{
156 kRELU = 0,
157 kSIGMOID = 1,
158 kTANH = 2,
159 kLEAKY_RELU = 3,
160 kELU = 4,
161 kSELU = 5,
162 kSOFTSIGN = 6,
163 kSOFTPLUS = 7,
164 kCLIP = 8,
165 kHARD_SIGMOID = 9,
166 kSCALED_TANH = 10,
168};
169
170namespace impl
171{
173template <>
175{
176 static constexpr int32_t kVALUE = 12;
177};
178} // namespace impl
179
195class ITensor : public INoCopy
196{
197public:
210 void setName(const char* name) noexcept
211 {
212 mImpl->setName(name);
213 }
214
222 const char* getName() const noexcept
223 {
224 return mImpl->getName();
225 }
226
241 void setDimensions(Dims dimensions) noexcept
242 {
243 mImpl->setDimensions(dimensions);
244 }
245
254 Dims getDimensions() const noexcept
255 {
256 return mImpl->getDimensions();
257 }
258
269 void setType(DataType type) noexcept
270 {
271 mImpl->setType(type);
272 }
273
281 DataType getType() const noexcept
282 {
283 return mImpl->getType();
284 }
285
296 bool setDynamicRange(float min, float max) noexcept
297 {
298 return mImpl->setDynamicRange(min, max);
299 }
300
304 bool isNetworkInput() const noexcept
305 {
306 return mImpl->isNetworkInput();
307 }
308
312 bool isNetworkOutput() const noexcept
313 {
314 return mImpl->isNetworkOutput();
315 }
316
334 void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
335 {
336 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
337 }
338
350 bool getBroadcastAcrossBatch() const noexcept
351 {
352 return mImpl->getBroadcastAcrossBatch();
353 }
354
361 {
362 return mImpl->getLocation();
363 }
364
375 void setLocation(TensorLocation location) noexcept
376 {
377 mImpl->setLocation(location);
378 }
379
385 bool dynamicRangeIsSet() const noexcept
386 {
387 return mImpl->dynamicRangeIsSet();
388 }
389
393 void resetDynamicRange() noexcept
394 {
395 mImpl->resetDynamicRange();
396 }
397
403 float getDynamicRangeMin() const noexcept
404 {
405 return mImpl->getDynamicRangeMin();
406 }
407
413 float getDynamicRangeMax() const noexcept
414 {
415 return mImpl->getDynamicRangeMax();
416 }
417
432 void setAllowedFormats(TensorFormats formats) noexcept
433 {
434 mImpl->setAllowedFormats(formats);
435 }
436
446 {
447 return mImpl->getAllowedFormats();
448 }
449
479 bool isShapeTensor() const noexcept
480 {
481 return mImpl->isShapeTensor();
482 }
483
502 bool isExecutionTensor() const noexcept
503 {
504 return mImpl->isExecutionTensor();
505 }
506
507protected:
508 apiv::VTensor* mImpl;
509 virtual ~ITensor() noexcept = default;
510};
511
519class ILayer : public INoCopy
520{
521public:
527 LayerType getType() const noexcept
528 {
529 return mLayer->getType();
530 }
531
539 void setName(const char* name) noexcept
540 {
541 mLayer->setName(name);
542 }
543
547
550 const char* getName() const noexcept
551 {
552 return mLayer->getName();
553 }
554
558 int32_t getNbInputs() const noexcept
559 {
560 return mLayer->getNbInputs();
561 }
562
571 ITensor* getInput(int32_t index) const noexcept
572 {
573 return mLayer->getInput(index);
574 }
575
579 int32_t getNbOutputs() const noexcept
580 {
581 return mLayer->getNbOutputs();
582 }
583
590 ITensor* getOutput(int32_t index) const noexcept
591 {
592 return mLayer->getOutput(index);
593 }
594
607 void setInput(int32_t index, ITensor& tensor) noexcept
608 {
609 return mLayer->setInput(index, tensor);
610 }
611
633 void setPrecision(DataType dataType) noexcept
634 {
635 mLayer->setPrecision(dataType);
636 }
637
645 DataType getPrecision() const noexcept
646 {
647 return mLayer->getPrecision();
648 }
649
657 bool precisionIsSet() const noexcept
658 {
659 return mLayer->precisionIsSet();
660 }
661
667 void resetPrecision() noexcept
668 {
669 mLayer->resetPrecision();
670 }
671
705 void setOutputType(int32_t index, DataType dataType) noexcept
706 {
707 mLayer->setOutputType(index, dataType);
708 }
709
719 DataType getOutputType(int32_t index) const noexcept
720 {
721 return mLayer->getOutputType(index);
722 }
723
732 bool outputTypeIsSet(int32_t index) const noexcept
733 {
734 return mLayer->outputTypeIsSet(index);
735 }
736
744 void resetOutputType(int32_t index) noexcept
745 {
746 return mLayer->resetOutputType(index);
747 }
748
749protected:
750 virtual ~ILayer() noexcept = default;
751 apiv::VLayer* mLayer;
752};
753
976enum class PaddingMode : int32_t
977{
980 kSAME_UPPER = 2,
981 kSAME_LOWER = 3,
983 kCAFFE_ROUND_UP = 5
984};
985
986namespace impl
987{
989template <>
991{
992 static constexpr int32_t kVALUE = 6;
993};
994} // namespace impl
995
1009{
1010public:
1020 TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
1021 {
1022 mImpl->setKernelSize(kernelSize);
1023 }
1024
1033 {
1034 return mImpl->getKernelSize();
1035 }
1036
1044 void setNbOutputMaps(int32_t nbOutputMaps) noexcept
1045 {
1046 mImpl->setNbOutputMaps(nbOutputMaps);
1047 }
1048
1054 int32_t getNbOutputMaps() const noexcept
1055 {
1056 return mImpl->getNbOutputMaps();
1057 }
1058
1070 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
1071 {
1072 mImpl->setStride(stride);
1073 }
1074
1081 {
1082 return mImpl->getStride();
1083 }
1084
1100 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
1101 {
1102 return mImpl->setPadding(padding);
1103 }
1104
1113 {
1114 return mImpl->getPadding();
1115 }
1116
1132 void setNbGroups(int32_t nbGroups) noexcept
1133 {
1134 mImpl->setNbGroups(nbGroups);
1135 }
1136
1142 int32_t getNbGroups() const noexcept
1143 {
1144 return mImpl->getNbGroups();
1145 }
1146
1156 void setKernelWeights(Weights weights) noexcept
1157 {
1158 mImpl->setKernelWeights(weights);
1159 }
1160
1166 Weights getKernelWeights() const noexcept
1167 {
1168 return mImpl->getKernelWeights();
1169 }
1170
1181 void setBiasWeights(Weights weights) noexcept
1182 {
1183 mImpl->setBiasWeights(weights);
1184 }
1185
1191 Weights getBiasWeights() const noexcept
1192 {
1193 return mImpl->getBiasWeights();
1194 }
1195
1207 TRT_DEPRECATED void setDilation(DimsHW dilation) noexcept
1208 {
1209 return mImpl->setDilation(dilation);
1210 }
1211
1220 {
1221 return mImpl->getDilation();
1222 }
1223
1236 void setPrePadding(Dims padding) noexcept
1237 {
1238 mImpl->setPrePadding(padding);
1239 }
1240
1246 Dims getPrePadding() const noexcept
1247 {
1248 return mImpl->getPrePadding();
1249 }
1250
1263 void setPostPadding(Dims padding) noexcept
1264 {
1265 mImpl->setPostPadding(padding);
1266 }
1267
1273 Dims getPostPadding() const noexcept
1274 {
1275 return mImpl->getPostPadding();
1276 }
1277
1287 void setPaddingMode(PaddingMode paddingMode) noexcept
1288 {
1289 mImpl->setPaddingMode(paddingMode);
1290 }
1291
1300 {
1301 return mImpl->getPaddingMode();
1302 }
1303
1312 void setKernelSizeNd(Dims kernelSize) noexcept
1313 {
1314 mImpl->setKernelSizeNd(kernelSize);
1315 }
1316
1322 Dims getKernelSizeNd() const noexcept
1323 {
1324 return mImpl->getKernelSizeNd();
1325 }
1326
1337 void setStrideNd(Dims stride) noexcept
1338 {
1339 mImpl->setStrideNd(stride);
1340 }
1341
1347 Dims getStrideNd() const noexcept
1348 {
1349 return mImpl->getStrideNd();
1350 }
1351
1365 void setPaddingNd(Dims padding) noexcept
1366 {
1367 mImpl->setPaddingNd(padding);
1368 }
1369
1377 Dims getPaddingNd() const noexcept
1378 {
1379 return mImpl->getPaddingNd();
1380 }
1381
1391 void setDilationNd(Dims dilation) noexcept
1392 {
1393 mImpl->setDilationNd(dilation);
1394 }
1395
1401 Dims getDilationNd() const noexcept
1402 {
1403 return mImpl->getDilationNd();
1404 }
1405
1427 using ILayer::setInput;
1428
1429protected:
1430 virtual ~IConvolutionLayer() noexcept = default;
1431 apiv::VConvolutionLayer* mImpl;
1432};
1433
1464{
1465public:
1473 void setNbOutputChannels(int32_t nbOutputs) noexcept
1474 {
1475 mImpl->setNbOutputChannels(nbOutputs);
1476 }
1477
1483 int32_t getNbOutputChannels() const noexcept
1484 {
1485 return mImpl->getNbOutputChannels();
1486 }
1487
1493 void setKernelWeights(Weights weights) noexcept
1494 {
1495 mImpl->setKernelWeights(weights);
1496 }
1497
1503 Weights getKernelWeights() const noexcept
1504 {
1505 return mImpl->getKernelWeights();
1506 }
1507
1515 void setBiasWeights(Weights weights) noexcept
1516 {
1517 mImpl->setBiasWeights(weights);
1518 }
1519
1525 Weights getBiasWeights() const noexcept
1526 {
1527 return mImpl->getBiasWeights();
1528 }
1529
1551 using ILayer::setInput;
1552
1553protected:
1554 virtual ~IFullyConnectedLayer() noexcept = default;
1555 apiv::VFullyConnectedLayer* mImpl;
1556};
1557
1570{
1571public:
1580 {
1581 mImpl->setActivationType(type);
1582 }
1583
1590 {
1591 return mImpl->getActivationType();
1592 }
1593
1604 void setAlpha(float alpha) noexcept
1605 {
1606 mImpl->setAlpha(alpha);
1607 }
1608
1618 void setBeta(float beta) noexcept
1619 {
1620 mImpl->setBeta(beta);
1621 }
1622
1627 float getAlpha() const noexcept
1628 {
1629 return mImpl->getAlpha();
1630 }
1631
1636 float getBeta() const noexcept
1637 {
1638 return mImpl->getBeta();
1639 }
1640
1641protected:
1642 virtual ~IActivationLayer() noexcept = default;
1643 apiv::VActivationLayer* mImpl;
1644};
1645
1651enum class PoolingType : int32_t
1652{
1653 kMAX = 0, // Maximum over elements
1654 kAVERAGE = 1, // Average over elements. If the tensor is padded, the count includes the padding
1655 kMAX_AVERAGE_BLEND = 2 // Blending between max and average pooling: (1-blendFactor)*maxPool + blendFactor*avgPool
1656};
1657
1658namespace impl
1659{
1661template <>
1663{
1664 static constexpr int32_t kVALUE = 3;
1665};
1666} // namespace impl
1667
1679class IPoolingLayer : public ILayer
1680{
1681public:
1689 void setPoolingType(PoolingType type) noexcept
1690 {
1691 mImpl->setPoolingType(type);
1692 }
1693
1700 {
1701 return mImpl->getPoolingType();
1702 }
1703
1713 TRT_DEPRECATED void setWindowSize(DimsHW windowSize) noexcept
1714 {
1715 mImpl->setWindowSize(windowSize);
1716 }
1717
1726 {
1727 return mImpl->getWindowSize();
1728 }
1729
1741 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
1742 {
1743 mImpl->setStride(stride);
1744 }
1745
1754 {
1755 return mImpl->getStride();
1756 }
1757
1769 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
1770 {
1771 mImpl->setPadding(padding);
1772 }
1773
1784 {
1785 return mImpl->getPadding();
1786 }
1787
1798 void setBlendFactor(float blendFactor) noexcept
1799 {
1800 mImpl->setBlendFactor(blendFactor);
1801 }
1802
1811 float getBlendFactor() const noexcept
1812 {
1813 return mImpl->getBlendFactor();
1814 }
1815
1828 void setAverageCountExcludesPadding(bool exclusive) noexcept
1829 {
1830 mImpl->setAverageCountExcludesPadding(exclusive);
1831 }
1832
1840 {
1841 return mImpl->getAverageCountExcludesPadding();
1842 }
1843
1857 void setPrePadding(Dims padding) noexcept
1858 {
1859 mImpl->setPrePadding(padding);
1860 }
1861
1867 Dims getPrePadding() const noexcept
1868 {
1869 return mImpl->getPrePadding();
1870 }
1871
1885 void setPostPadding(Dims padding) noexcept
1886 {
1887 mImpl->setPostPadding(padding);
1888 }
1889
1895 Dims getPostPadding() const noexcept
1896 {
1897 return mImpl->getPostPadding();
1898 }
1899
1908 void setPaddingMode(PaddingMode paddingMode) noexcept
1909 {
1910 mImpl->setPaddingMode(paddingMode);
1911 }
1912
1920 {
1921 return mImpl->getPaddingMode();
1922 }
1923
1932 void setWindowSizeNd(Dims windowSize) noexcept
1933 {
1934 mImpl->setWindowSizeNd(windowSize);
1935 }
1936
1942 Dims getWindowSizeNd() const noexcept
1943 {
1944 return mImpl->getWindowSizeNd();
1945 }
1946
1957 void setStrideNd(Dims stride) noexcept
1958 {
1959 mImpl->setStrideNd(stride);
1960 }
1961
1967 Dims getStrideNd() const noexcept
1968 {
1969 return mImpl->getStrideNd();
1970 }
1971
1986 void setPaddingNd(Dims padding) noexcept
1987 {
1988 mImpl->setPaddingNd(padding);
1989 }
1990
1998 Dims getPaddingNd() const noexcept
1999 {
2000 return mImpl->getPaddingNd();
2001 }
2002
2003protected:
2004 virtual ~IPoolingLayer() noexcept = default;
2005 apiv::VPoolingLayer* mImpl;
2006};
2007
2017class ILRNLayer : public ILayer
2018{
2019public:
2029 void setWindowSize(int32_t windowSize) noexcept
2030 {
2031 mImpl->setWindowSize(windowSize);
2032 }
2033
2039 int32_t getWindowSize() const noexcept
2040 {
2041 return mImpl->getWindowSize();
2042 }
2043
2050 void setAlpha(float alpha) noexcept
2051 {
2052 mImpl->setAlpha(alpha);
2053 }
2054
2060 float getAlpha() const noexcept
2061 {
2062 return mImpl->getAlpha();
2063 }
2064
2071 void setBeta(float beta) noexcept
2072 {
2073 mImpl->setBeta(beta);
2074 }
2075
2081 float getBeta() const noexcept
2082 {
2083 return mImpl->getBeta();
2084 }
2085
2092 void setK(float k) noexcept
2093 {
2094 mImpl->setK(k);
2095 }
2096
2102 float getK() const noexcept
2103 {
2104 return mImpl->getK();
2105 }
2106
2107protected:
2108 virtual ~ILRNLayer() noexcept = default;
2109 apiv::VLRNLayer* mImpl;
2110};
2111
2117enum class ScaleMode : int32_t
2118{
2119 kUNIFORM = 0,
2120 kCHANNEL = 1,
2121 kELEMENTWISE = 2
2122};
2123
2125template <>
2126constexpr inline int32_t EnumMax<ScaleMode>() noexcept
2127{
2128 return 3;
2129}
2130
2157class IScaleLayer : public ILayer
2158{
2159public:
2165 void setMode(ScaleMode mode) noexcept
2166 {
2167 mImpl->setMode(mode);
2168 }
2169
2175 ScaleMode getMode() const noexcept
2176 {
2177 return mImpl->getMode();
2178 }
2179
2185 void setShift(Weights shift) noexcept
2186 {
2187 mImpl->setShift(shift);
2188 }
2189
2195 Weights getShift() const noexcept
2196 {
2197 return mImpl->getShift();
2198 }
2199
2205 void setScale(Weights scale) noexcept
2206 {
2207 mImpl->setScale(scale);
2208 }
2209
2215 Weights getScale() const noexcept
2216 {
2217 return mImpl->getScale();
2218 }
2219
2225 void setPower(Weights power) noexcept
2226 {
2227 mImpl->setPower(power);
2228 }
2229
2235 Weights getPower() const noexcept
2236 {
2237 return mImpl->getPower();
2238 }
2239
2250 int32_t getChannelAxis() const noexcept
2251 {
2252 return mImpl->getChannelAxis();
2253 }
2254
2271 void setChannelAxis(int32_t channelAxis) noexcept
2272 {
2273 mImpl->setChannelAxis(channelAxis);
2274 }
2275
2276protected:
2277 virtual ~IScaleLayer() noexcept = default;
2278 apiv::VScaleLayer* mImpl;
2279};
2280
2292class ISoftMaxLayer : public ILayer
2293{
2294public:
2325 void setAxes(uint32_t axes) noexcept
2326 {
2327 mImpl->setAxes(axes);
2328 }
2329
2335 uint32_t getAxes() const noexcept
2336 {
2337 return mImpl->getAxes();
2338 }
2339
2340protected:
2341 virtual ~ISoftMaxLayer() noexcept = default;
2342 apiv::VSoftMaxLayer* mImpl;
2343};
2344
2358{
2359public:
2370 void setAxis(int32_t axis) noexcept
2371 {
2372 mImpl->setAxis(axis);
2373 }
2374
2380 int32_t getAxis() const noexcept
2381 {
2382 return mImpl->getAxis();
2383 }
2384
2385protected:
2386 virtual ~IConcatenationLayer() noexcept = default;
2387 apiv::VConcatenationLayer* mImpl;
2388};
2389
2398{
2399public:
2411 TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
2412 {
2413 mImpl->setKernelSize(kernelSize);
2414 }
2415
2424 {
2425 return mImpl->getKernelSize();
2426 }
2427
2435 void setNbOutputMaps(int32_t nbOutputMaps) noexcept
2436 {
2437 mImpl->setNbOutputMaps(nbOutputMaps);
2438 }
2439
2445 int32_t getNbOutputMaps() const noexcept
2446 {
2447 return mImpl->getNbOutputMaps();
2448 }
2449
2462 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
2463 {
2464 mImpl->setStride(stride);
2465 }
2466
2475 {
2476 return mImpl->getStride();
2477 }
2478
2494 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
2495 {
2496 mImpl->setPadding(padding);
2497 }
2498
2509 {
2510 return mImpl->getPadding();
2511 }
2512
2528 void setNbGroups(int32_t nbGroups) noexcept
2529 {
2530 mImpl->setNbGroups(nbGroups);
2531 }
2532
2538 int32_t getNbGroups() const noexcept
2539 {
2540 return mImpl->getNbGroups();
2541 }
2542
2552 void setKernelWeights(Weights weights) noexcept
2553 {
2554 mImpl->setKernelWeights(weights);
2555 }
2556
2562 Weights getKernelWeights() const noexcept
2563 {
2564 return mImpl->getKernelWeights();
2565 }
2566
2577 void setBiasWeights(Weights weights) noexcept
2578 {
2579 mImpl->setBiasWeights(weights);
2580 }
2581
2587 Weights getBiasWeights() const noexcept
2588 {
2589 return mImpl->getBiasWeights();
2590 }
2591
2605 void setPrePadding(Dims padding) noexcept
2606 {
2607 mImpl->setPrePadding(padding);
2608 }
2609
2615 Dims getPrePadding() const noexcept
2616 {
2617 return mImpl->getPrePadding();
2618 }
2619
2633 void setPostPadding(Dims padding) noexcept
2634 {
2635 mImpl->setPostPadding(padding);
2636 }
2637
2643 Dims getPostPadding() const noexcept
2644 {
2645 return mImpl->getPostPadding();
2646 }
2647
2657 void setPaddingMode(PaddingMode paddingMode) noexcept
2658 {
2659 mImpl->setPaddingMode(paddingMode);
2660 }
2661
2670 {
2671 return mImpl->getPaddingMode();
2672 }
2673
2684 void setKernelSizeNd(Dims kernelSize) noexcept
2685 {
2686 mImpl->setKernelSizeNd(kernelSize);
2687 }
2688
2694 Dims getKernelSizeNd() const noexcept
2695 {
2696 return mImpl->getKernelSizeNd();
2697 }
2698
2712 void setStrideNd(Dims stride) noexcept
2713 {
2714 mImpl->setStrideNd(stride);
2715 }
2716
2722 Dims getStrideNd() const noexcept
2723 {
2724 return mImpl->getStrideNd();
2725 }
2726
2740 void setPaddingNd(Dims padding) noexcept
2741 {
2742 mImpl->setPaddingNd(padding);
2743 }
2744
2752 Dims getPaddingNd() const noexcept
2753 {
2754 return mImpl->getPaddingNd();
2755 }
2756
2778 using ILayer::setInput;
2779
2786 void setDilationNd(Dims dilation) noexcept
2787 {
2788 mImpl->setDilationNd(dilation);
2789 }
2790
2796 Dims getDilationNd() const noexcept
2797 {
2798 return mImpl->getDilationNd();
2799 }
2800
2801protected:
2802 virtual ~IDeconvolutionLayer() noexcept = default;
2803 apiv::VDeconvolutionLayer* mImpl;
2804};
2805
2813enum class ElementWiseOperation : int32_t
2814{
2815 kSUM = 0,
2816 kPROD = 1,
2817 kMAX = 2,
2818 kMIN = 3,
2819 kSUB = 4,
2820 kDIV = 5,
2821 kPOW = 6,
2822 kFLOOR_DIV = 7,
2823 kAND = 8,
2824 kOR = 9,
2825 kXOR = 10,
2826 kEQUAL = 11,
2827 kGREATER = 12,
2828 kLESS = 13
2829};
2830
2831namespace impl
2832{
2834template <>
2836{
2837 static constexpr int32_t kVALUE = 14;
2838};
2839} // namespace impl
2840
2854//!
2861{
2862public:
2873 {
2874 return mImpl->setOperation(op);
2875 }
2876
2885 {
2886 return mImpl->getOperation();
2887 }
2888
2889protected:
2890 apiv::VElementWiseLayer* mImpl;
2891 virtual ~IElementWiseLayer() noexcept = default;
2892};
2893
2899enum class GatherMode : int32_t
2900{
2901 kDEFAULT = 0,
2902 kELEMENT = 1,
2903 kND = 2
2904};
2905
2907template <>
2908constexpr inline int32_t EnumMax<GatherMode>() noexcept
2909{
2910 return 3;
2911}
2912
2991class IGatherLayer : public ILayer
2992{
2993public:
3003 void setGatherAxis(int32_t axis) noexcept
3004 {
3005 mImpl->setGatherAxis(axis);
3006 }
3007
3014 int32_t getGatherAxis() const noexcept
3015 {
3016 return mImpl->getGatherAxis();
3017 }
3018
3035 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
3036 {
3037 mImpl->setNbElementWiseDims(elementWiseDims);
3038 }
3039
3045 int32_t getNbElementWiseDims() const noexcept
3046 {
3047 return mImpl->getNbElementWiseDims();
3048 }
3049
3055 void setMode(GatherMode mode) noexcept
3056 {
3057 mImpl->setMode(mode);
3058 }
3059
3065 GatherMode getMode() const noexcept
3066 {
3067 return mImpl->getMode();
3068 }
3069
3070protected:
3071 apiv::VGatherLayer* mImpl;
3072 virtual ~IGatherLayer() noexcept = default;
3073};
3074
3154enum class RNNOperation : int32_t
3155{
3156 kRELU = 0,
3157 kTANH = 1,
3158 kLSTM = 2,
3159 kGRU = 3
3160};
3161
3163template <>
3164constexpr inline int32_t EnumMax<RNNOperation>() noexcept
3165{
3166 return 4;
3167}
3168
3176enum class RNNDirection : int32_t
3177{
3178 kUNIDIRECTION = 0,
3179 kBIDIRECTION = 1
3180};
3181
3183template <>
3184constexpr inline int32_t EnumMax<RNNDirection>() noexcept
3185{
3186 return 2;
3187}
3188
3204enum class RNNInputMode : int32_t
3205{
3206 kLINEAR = 0,
3207 kSKIP = 1
3208};
3209
3211template <>
3212constexpr inline int32_t EnumMax<RNNInputMode>() noexcept
3213{
3214 return 2;
3215}
3216
3224enum class RNNGateType : int32_t
3225{
3226 kINPUT = 0,
3227 kOUTPUT = 1,
3228 kFORGET = 2,
3229 kUPDATE = 3,
3230 kRESET = 4,
3231 kCELL = 5,
3232 kHIDDEN = 6
3233};
3234
3235template <>
3236constexpr inline int32_t EnumMax<RNNGateType>() noexcept
3237{
3238 return 7;
3239}
3240
3253{
3254public:
3255 int32_t getLayerCount() const noexcept
3256 {
3257 return mImpl->getLayerCount();
3258 }
3259 int32_t getHiddenSize() const noexcept
3260 {
3261 return mImpl->getHiddenSize();
3262 }
3263 int32_t getMaxSeqLength() const noexcept
3264 {
3265 return mImpl->getMaxSeqLength();
3266 }
3267 int32_t getDataLength() const noexcept
3268 {
3269 return mImpl->getDataLength();
3270 }
3271
3286 void setSequenceLengths(ITensor& seqLengths) noexcept
3287 {
3288 return mImpl->setSequenceLengths(seqLengths);
3289 }
3290
3298 ITensor* getSequenceLengths() const noexcept
3299 {
3300 return mImpl->getSequenceLengths();
3301 }
3302
3307 void setOperation(RNNOperation op) noexcept
3308 {
3309 mImpl->setOperation(op);
3310 }
3311
3317 {
3318 return mImpl->getOperation();
3319 }
3320
3325 void setInputMode(RNNInputMode op) noexcept
3326 {
3327 mImpl->setInputMode(op);
3328 }
3329
3335 {
3336 return mImpl->getInputMode();
3337 }
3338
3349 void setDirection(RNNDirection op) noexcept
3350 {
3351 mImpl->setDirection(op);
3352 }
3353
3359 {
3360 return mImpl->getDirection();
3361 }
3362
3417 void setWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights weights) noexcept
3418 {
3419 mImpl->setWeightsForGate(layerIndex, gate, isW, weights);
3420 }
3421
3426 Weights getWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
3427 {
3428 return mImpl->getWeightsForGate(layerIndex, gate, isW);
3429 }
3430
3451 void setBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights bias) noexcept
3452 {
3453 mImpl->setBiasForGate(layerIndex, gate, isW, bias);
3454 }
3455
3460 Weights getBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
3461 {
3462 return mImpl->getBiasForGate(layerIndex, gate, isW);
3463 }
3464
3477 void setHiddenState(ITensor& hidden) noexcept
3478 {
3479 mImpl->setHiddenState(hidden);
3480 }
3481
3486 ITensor* getHiddenState() const noexcept
3487 {
3488 return mImpl->getHiddenState();
3489 }
3490
3505 void setCellState(ITensor& cell) noexcept
3506 {
3507 mImpl->setCellState(cell);
3508 }
3509
3514 ITensor* getCellState() const noexcept
3515 {
3516 return mImpl->getCellState();
3517 }
3518
3519protected:
3520 apiv::VRNNv2Layer* mImpl;
3521 virtual ~IRNNv2Layer() noexcept = default;
3522};
3523
3534{
3535public:
3542 {
3543 return mImpl->getPlugin();
3544 }
3545
3546protected:
3547 apiv::VPluginV2Layer* mImpl;
3548 virtual ~IPluginV2Layer() noexcept = default;
3549};
3550
3558enum class UnaryOperation : int32_t
3559{
3560 kEXP = 0,
3561 kLOG = 1,
3562 kSQRT = 2,
3563 kRECIP = 3,
3564 kABS = 4,
3565 kNEG = 5,
3566 kSIN = 6,
3567 kCOS = 7,
3568 kTAN = 8,
3569 kSINH = 9,
3570 kCOSH = 10,
3571 kASIN = 11,
3572 kACOS = 12,
3573 kATAN = 13,
3574 kASINH = 14,
3575 kACOSH = 15,
3576 kATANH = 16,
3577 kCEIL = 17,
3578 kFLOOR = 18,
3579 kERF = 19,
3580 kNOT = 20,
3581 kSIGN = 21,
3582 kROUND = 22
3583};
3584
3586template <>
3587constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
3588{
3589 return 23;
3590}
3591
3599class IUnaryLayer : public ILayer
3600{
3601public:
3608 {
3609 mImpl->setOperation(op);
3610 }
3611
3618 {
3619 return mImpl->getOperation();
3620 }
3621
3622protected:
3623 apiv::VUnaryLayer* mImpl;
3624 virtual ~IUnaryLayer() noexcept = default;
3625};
3626
3645enum class ReduceOperation : int32_t
3646{
3647 kSUM = 0,
3648 kPROD = 1,
3649 kMAX = 2,
3650 kMIN = 3,
3651 kAVG = 4
3652};
3653
3655template <>
3656constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
3657{
3658 return 5;
3659}
3660
3668class IReduceLayer : public ILayer
3669{
3670public:
3677 {
3678 mImpl->setOperation(op);
3679 }
3680
3687 {
3688 return mImpl->getOperation();
3689 }
3690
3696 void setReduceAxes(uint32_t reduceAxes) noexcept
3697 {
3698 mImpl->setReduceAxes(reduceAxes);
3699 }
3700
3706 uint32_t getReduceAxes() const noexcept
3707 {
3708 return mImpl->getReduceAxes();
3709 }
3710
3716 void setKeepDimensions(bool keepDimensions) noexcept
3717 {
3718 mImpl->setKeepDimensions(keepDimensions);
3719 }
3720
3726 bool getKeepDimensions() const noexcept
3727 {
3728 return mImpl->getKeepDimensions();
3729 }
3730
3731protected:
3732 apiv::VReduceLayer* mImpl;
3733 virtual ~IReduceLayer() noexcept = default;
3734};
3735
3746class IPaddingLayer : public ILayer
3747{
3748public:
3758 TRT_DEPRECATED void setPrePadding(DimsHW padding) noexcept
3759 {
3760 mImpl->setPrePadding(padding);
3761 }
3762
3771 {
3772 return mImpl->getPrePadding();
3773 }
3774
3784 TRT_DEPRECATED void setPostPadding(DimsHW padding) noexcept
3785 {
3786 mImpl->setPostPadding(padding);
3787 }
3788
3797 {
3798 return mImpl->getPostPadding();
3799 }
3800
3810 void setPrePaddingNd(Dims padding) noexcept
3811 {
3812 mImpl->setPrePaddingNd(padding);
3813 }
3814
3822 Dims getPrePaddingNd() const noexcept
3823 {
3824 return mImpl->getPrePaddingNd();
3825 }
3826
3836 void setPostPaddingNd(Dims padding) noexcept
3837 {
3838 mImpl->setPostPaddingNd(padding);
3839 }
3840
3848 Dims getPostPaddingNd() const noexcept
3849 {
3850 return mImpl->getPostPaddingNd();
3851 }
3852
3853protected:
3854 apiv::VPaddingLayer* mImpl;
3855 virtual ~IPaddingLayer() noexcept = default;
3856};
3857
3859{
3866 int32_t order[Dims::MAX_DIMS];
3867};
3868
3881class IShuffleLayer : public ILayer
3882{
3883public:
3893 void setFirstTranspose(Permutation permutation) noexcept
3894 {
3895 mImpl->setFirstTranspose(permutation);
3896 }
3897
3906 {
3907 return mImpl->getFirstTranspose();
3908 }
3909
3930 void setReshapeDimensions(Dims dimensions) noexcept
3931 {
3932 mImpl->setReshapeDimensions(dimensions);
3933 }
3934
3944 {
3945 return mImpl->getReshapeDimensions();
3946 }
3947
3953 //
3976 using ILayer::setInput;
3977
3990 void setSecondTranspose(Permutation permutation) noexcept
3991 {
3992 mImpl->setSecondTranspose(permutation);
3993 }
3994
4003 {
4004 return mImpl->getSecondTranspose();
4005 }
4006
4018 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
4019 {
4020 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
4021 }
4022
4031 bool getZeroIsPlaceholder() const noexcept
4032 {
4033 return mImpl->getZeroIsPlaceholder();
4034 }
4035
4036protected:
4037 apiv::VShuffleLayer* mImpl;
4038 virtual ~IShuffleLayer() noexcept = default;
4039};
4040
4046enum class SliceMode : int32_t
4047{
4048 kDEFAULT = 0,
4049 kWRAP = 1,
4050 kCLAMP = 2,
4051 kFILL = 3,
4052 kREFLECT = 4,
4055};
4056
4058template <>
4059constexpr inline int32_t EnumMax<SliceMode>() noexcept
4060{
4061 return 5;
4062}
4063
4097class ISliceLayer : public ILayer
4098{
4099public:
4109 void setStart(Dims start) noexcept
4110 {
4111 mImpl->setStart(start);
4112 }
4113
4124 Dims getStart() const noexcept
4125 {
4126 return mImpl->getStart();
4127 }
4128
4138 void setSize(Dims size) noexcept
4139 {
4140 return mImpl->setSize(size);
4141 }
4142
4153 Dims getSize() const noexcept
4154 {
4155 return mImpl->getSize();
4156 }
4157
4167 void setStride(Dims stride) noexcept
4168 {
4169 mImpl->setStride(stride);
4170 }
4171
4182 Dims getStride() const noexcept
4183 {
4184 return mImpl->getStride();
4185 }
4186
4192 void setMode(SliceMode mode) noexcept
4193 {
4194 mImpl->setMode(mode);
4195 }
4196
4202 SliceMode getMode() const noexcept
4203 {
4204 return mImpl->getMode();
4205 }
4206
4228 using ILayer::setInput;
4229
4230protected:
4231 apiv::VSliceLayer* mImpl;
4232 virtual ~ISliceLayer() noexcept = default;
4233};
4234
4247class IShapeLayer : public ILayer
4248{
4249protected:
4250 apiv::VShapeLayer* mImpl;
4251 virtual ~IShapeLayer() noexcept = default;
4252};
4253
4259enum class TopKOperation : int32_t
4260{
4261 kMAX = 0,
4262 kMIN = 1,
4263};
4264
4266template <>
4267constexpr inline int32_t EnumMax<TopKOperation>() noexcept
4268{
4269 return 2;
4270}
4271
4279class ITopKLayer : public ILayer
4280{
4281public:
4287 void setOperation(TopKOperation op) noexcept
4288 {
4289 mImpl->setOperation(op);
4290 }
4291
4298 {
4299 return mImpl->getOperation();
4300 }
4301
4309 void setK(int32_t k) noexcept
4310 {
4311 mImpl->setK(k);
4312 }
4313
4319 int32_t getK() const noexcept
4320 {
4321 return mImpl->getK();
4322 }
4323
4329 void setReduceAxes(uint32_t reduceAxes) noexcept
4330 {
4331 mImpl->setReduceAxes(reduceAxes);
4332 }
4333
4339 uint32_t getReduceAxes() const noexcept
4340 {
4341 return mImpl->getReduceAxes();
4342 }
4343
4344protected:
4345 apiv::VTopKLayer* mImpl;
4346 virtual ~ITopKLayer() noexcept = default;
4347};
4348
4355enum class MatrixOperation : int32_t
4356{
4360 kNONE,
4361
4363 kTRANSPOSE,
4364
4374 kVECTOR
4375};
4376
4378template <>
4379constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
4380{
4381 return 3;
4382}
4383
4410{
4411public:
4418 void setOperation(int32_t index, MatrixOperation op) noexcept
4419 {
4420 mImpl->setOperation(index, op);
4421 }
4422
4428 MatrixOperation getOperation(int32_t index) const noexcept
4429 {
4430 return mImpl->getOperation(index);
4431 }
4432
4433protected:
4434 apiv::VMatrixMultiplyLayer* mImpl;
4435 virtual ~IMatrixMultiplyLayer() noexcept = default;
4436};
4437
4453{
4454protected:
4455 apiv::VRaggedSoftMaxLayer* mImpl;
4456 virtual ~IRaggedSoftMaxLayer() noexcept = default;
4457};
4458
4472{
4473protected:
4474 apiv::VIdentityLayer* mImpl;
4475 virtual ~IIdentityLayer() noexcept = default;
4476};
4477
4486{
4487public:
4497 void setWeights(Weights weights) noexcept
4498 {
4499 mImpl->setWeights(weights);
4500 }
4501
4507 Weights getWeights() const noexcept
4508 {
4509 return mImpl->getWeights();
4510 }
4511
4519 void setDimensions(Dims dimensions) noexcept
4520 {
4521 mImpl->setDimensions(dimensions);
4522 }
4523
4531 Dims getDimensions() const noexcept
4532 {
4533 return mImpl->getDimensions();
4534 }
4535
4536protected:
4537 apiv::VConstantLayer* mImpl;
4538 virtual ~IConstantLayer() noexcept = default;
4539};
4540
4549{
4550protected:
4551 apiv::VParametricReLULayer* mImpl;
4552 virtual ~IParametricReLULayer() noexcept = default;
4553};
4554
4560enum class ResizeMode : int32_t
4561{
4562 kNEAREST = 0,
4563 kLINEAR = 1
4564};
4565
4566namespace impl
4567{
4569template <>
4571{
4572 static constexpr int32_t kVALUE = 2;
4573};
4574} // namespace impl
4575
4584{
4597 kALIGN_CORNERS = 0,
4598
4605 kASYMMETRIC = 1,
4606
4613 kHALF_PIXEL = 2,
4614};
4615
4616namespace impl
4617{
4619template <>
4621{
4622 static constexpr int32_t kVALUE = 3;
4623};
4624} // namespace impl
4625
4633enum class ResizeSelector : int32_t
4634{
4636 kFORMULA = 0,
4637
4639 kUPPER = 1,
4640};
4641
4642namespace impl
4643{
4645template <>
4647{
4648 static constexpr int32_t kVALUE = 2;
4649};
4650} // namespace impl
4651
4659enum class ResizeRoundMode : int32_t
4660{
4662 kHALF_UP = 0,
4663
4665 kHALF_DOWN = 1,
4666
4668 kFLOOR = 2,
4669
4671 kCEIL = 3,
4672};
4673
4674namespace impl
4675{
4677template <>
4679{
4680 static constexpr int32_t kVALUE = 4;
4681};
4682} // namespace impl
4683
4705class IResizeLayer : public ILayer
4706{
4707public:
4726 void setOutputDimensions(Dims dimensions) noexcept
4727 {
4728 return mImpl->setOutputDimensions(dimensions);
4729 }
4730
4736 Dims getOutputDimensions() const noexcept
4737 {
4738 return mImpl->getOutputDimensions();
4739 }
4740
4766 void setScales(const float* scales, int32_t nbScales) noexcept
4767 {
4768 mImpl->setScales(scales, nbScales);
4769 }
4770
4785 int32_t getScales(int32_t size, float* scales) const noexcept
4786 {
4787 return mImpl->getScales(size, scales);
4788 }
4789
4799 void setResizeMode(ResizeMode resizeMode) noexcept
4800 {
4801 mImpl->setResizeMode(resizeMode);
4802 }
4803
4809 ResizeMode getResizeMode() const noexcept
4810 {
4811 return mImpl->getResizeMode();
4812 }
4813
4826 TRT_DEPRECATED void setAlignCorners(bool alignCorners) noexcept
4827 {
4828 mImpl->setAlignCorners(alignCorners);
4829 }
4830
4839 TRT_DEPRECATED bool getAlignCorners() const noexcept
4840 {
4841 return mImpl->getAlignCorners();
4842 }
4843
4863 using ILayer::setInput;
4864
4877 {
4878 mImpl->setCoordinateTransformation(coordTransform);
4879 }
4880
4887 {
4888 return mImpl->getCoordinateTransformation();
4889 }
4890
4904 {
4905 mImpl->setSelectorForSinglePixel(selector);
4906 }
4907
4914 {
4915 return mImpl->getSelectorForSinglePixel();
4916 }
4917
4930 {
4931 mImpl->setNearestRounding(value);
4932 }
4933
4940 {
4941 return mImpl->getNearestRounding();
4942 }
4943
4944protected:
4945 virtual ~IResizeLayer() noexcept = default;
4946 apiv::VResizeLayer* mImpl;
4947};
4948
4950enum class LoopOutput : int32_t
4951{
4953 kLAST_VALUE = 0,
4954
4956 kCONCATENATE = 1,
4957
4959 kREVERSE = 2
4960};
4961
4963template <>
4964constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4965{
4966 return 3;
4967}
4968
4970enum class TripLimit : int32_t
4971{
4972
4973 kCOUNT = 0,
4974 kWHILE = 1
4975};
4976
4978template <>
4979constexpr inline int32_t EnumMax<TripLimit>() noexcept
4980{
4981 return 2;
4982}
4983
4984class ILoop;
4985
4987{
4988public:
4990 ILoop* getLoop() const noexcept
4991 {
4992 return mBoundary->getLoop();
4993 }
4994
4995protected:
4996 virtual ~ILoopBoundaryLayer() noexcept = default;
4997 apiv::VLoopBoundaryLayer* mBoundary;
4998};
4999
5006{
5007public:
5010 {
5011 return mBoundary->getConditional();
5012 }
5013
5014protected:
5015 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
5016 apiv::VConditionalBoundaryLayer* mBoundary;
5017};
5018
5023{
5024public:
5025protected:
5026 virtual ~IConditionLayer() noexcept = default;
5027 apiv::VConditionLayer* mImpl;
5028};
5029
5036{
5037public:
5038protected:
5039 virtual ~IIfConditionalOutputLayer() noexcept = default;
5040 apiv::VConditionalOutputLayer* mImpl;
5041};
5042
5047{
5048public:
5049protected:
5050 virtual ~IIfConditionalInputLayer() noexcept = default;
5051 apiv::VConditionalInputLayer* mImpl;
5052};
5053
5076{
5077public:
5088 {
5089 return mImpl->setCondition(condition);
5090 }
5091
5103 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
5104 {
5105 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
5106 }
5107
5116 {
5117 return mImpl->addInput(input);
5118 }
5119
5128 void setName(const char* name) noexcept
5129 {
5130 mImpl->setName(name);
5131 }
5132
5138 const char* getName() const noexcept
5139 {
5140 return mImpl->getName();
5141 }
5142
5143protected:
5144 virtual ~IIfConditional() noexcept = default;
5145 apiv::VIfConditional* mImpl;
5146};
5147
5148
5150{
5151public:
5157 //
5170 using ILayer::setInput;
5171
5172protected:
5173 virtual ~IRecurrenceLayer() noexcept = default;
5174 apiv::VRecurrenceLayer* mImpl;
5175};
5176
5195{
5196public:
5197 LoopOutput getLoopOutput() const noexcept
5198 {
5199 return mImpl->getLoopOutput();
5200 }
5201
5214 void setAxis(int32_t axis) noexcept
5215 {
5216 mImpl->setAxis(axis);
5217 }
5218
5220 int32_t getAxis() const noexcept
5221 {
5222 return mImpl->getAxis();
5223 }
5224
5230 //
5245 using ILayer::setInput;
5246
5247protected:
5248 virtual ~ILoopOutputLayer() noexcept = default;
5249 apiv::VLoopOutputLayer* mImpl;
5250};
5251
5253{
5254public:
5255 TripLimit getTripLimit() const noexcept
5256 {
5257 return mImpl->getTripLimit();
5258 }
5259
5260protected:
5261 virtual ~ITripLimitLayer() noexcept = default;
5262 apiv::VTripLimitLayer* mImpl;
5263};
5264
5266{
5267public:
5269 void setAxis(int32_t axis) noexcept
5270 {
5271 mImpl->setAxis(axis);
5272 }
5273
5275 int32_t getAxis() const noexcept
5276 {
5277 return mImpl->getAxis();
5278 }
5279
5285 void setReverse(bool reverse) noexcept
5286 {
5287 mImpl->setReverse(reverse);
5288 }
5289
5291 bool getReverse() const noexcept
5292 {
5293 return mImpl->getReverse();
5294 }
5295
5296protected:
5297 virtual ~IIteratorLayer() noexcept = default;
5298 apiv::VIteratorLayer* mImpl;
5299};
5300
5306class ILoop : public INoCopy
5307{
5308public:
5315 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
5316 {
5317 return mImpl->addRecurrence(initialValue);
5318 }
5319
5337 {
5338 return mImpl->addTripLimit(tensor, limit);
5339 }
5340
5349 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
5350 {
5351 return mImpl->addIterator(tensor, axis, reverse);
5352 }
5353
5361 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
5362 {
5363 return mImpl->addLoopOutput(tensor, outputKind, axis);
5364 }
5365
5374 void setName(const char* name) noexcept
5375 {
5376 mImpl->setName(name);
5377 }
5378
5384 const char* getName() const noexcept
5385 {
5386 return mImpl->getName();
5387 }
5388
5389protected:
5390 virtual ~ILoop() noexcept = default;
5391 apiv::VLoop* mImpl;
5392};
5393
5397class ISelectLayer : public ILayer
5398{
5399protected:
5400 virtual ~ISelectLayer() noexcept = default;
5401 apiv::VSelectLayer* mImpl;
5402};
5403
5419{
5420public:
5429 void setMessage(const char* message) noexcept
5430 {
5431 mImpl->setMessage(message);
5432 }
5433
5439 const char* getMessage() const noexcept
5440 {
5441 return mImpl->getMessage();
5442 }
5443
5444protected:
5445 virtual ~IAssertionLayer() noexcept = default;
5446
5447 apiv::VAssertionLayer* mImpl;
5448};
5449
5457enum class FillOperation : int32_t
5458{
5459 kLINSPACE = 0,
5460 kRANDOM_UNIFORM = 1
5461};
5462
5464template <>
5465constexpr inline int32_t EnumMax<FillOperation>() noexcept
5466{
5467 return 2;
5468}
5469
5495class IFillLayer : public ILayer
5496{
5497public:
5506 //
5507 void setDimensions(Dims dimensions) noexcept
5508 {
5509 mImpl->setDimensions(dimensions);
5510 }
5511
5522 Dims getDimensions() const noexcept
5523 {
5524 return mImpl->getDimensions();
5525 }
5526
5532 void setOperation(FillOperation op) noexcept
5533 {
5534 mImpl->setOperation(op);
5535 }
5536
5543 {
5544 return mImpl->getOperation();
5545 }
5546
5559 //
5560 void setAlpha(double alpha) noexcept
5561 {
5562 mImpl->setAlpha(alpha);
5563 }
5564
5575 double getAlpha() const noexcept
5576 {
5577 return mImpl->getAlpha();
5578 }
5579
5593 void setBeta(double beta) noexcept
5594 {
5595 mImpl->setBeta(beta);
5596 }
5597
5608 double getBeta() const noexcept
5609 {
5610 return mImpl->getBeta();
5611 }
5612
5639 using ILayer::setInput;
5640
5641protected:
5642 virtual ~IFillLayer() noexcept = default;
5643 apiv::VFillLayer* mImpl;
5644};
5645
5704{
5705public:
5714 int32_t getAxis() const noexcept
5715 {
5716 return mImpl->getAxis();
5717 }
5725 void setAxis(int32_t axis) noexcept
5726 {
5727 mImpl->setAxis(axis);
5728 }
5729
5730protected:
5731 virtual ~IQuantizeLayer() noexcept = default;
5732 apiv::VQuantizeLayer* mImpl;
5733};
5734
5791{
5792public:
5801 int32_t getAxis() const noexcept
5802 {
5803 return mImpl->getAxis();
5804 }
5812 void setAxis(int32_t axis) noexcept
5813 {
5814 mImpl->setAxis(axis);
5815 }
5816
5817protected:
5818 virtual ~IDequantizeLayer() noexcept = default;
5819 apiv::VDequantizeLayer* mImpl;
5820};
5821
5858class IEinsumLayer : public ILayer
5859{
5860public:
5870 bool setEquation(const char* equation) noexcept
5871 {
5872 return mImpl->setEquation(equation);
5873 }
5874
5880 const char* getEquation() const noexcept
5881 {
5882 return mImpl->getEquation();
5883 }
5884
5885protected:
5886 virtual ~IEinsumLayer() noexcept = default;
5887 apiv::VEinsumLayer* mImpl;
5888};
5889
5895enum class ScatterMode : int32_t
5896{
5897 kELEMENT = 0,
5898 kND = 1,
5899};
5900
5902template <>
5903constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5904{
5905 return 2;
5906}
5907
5961//!
5964class IScatterLayer : public ILayer
5965{
5966public:
5972 void setMode(ScatterMode mode) noexcept
5973 {
5974 mImpl->setMode(mode);
5975 }
5976
5982 ScatterMode getMode() const noexcept
5983 {
5984 return mImpl->getMode();
5985 }
5986
5992 void setAxis(int32_t axis) noexcept
5993 {
5994 mImpl->setAxis(axis);
5995 }
5996
6000 int32_t getAxis() const noexcept
6001 {
6002 return mImpl->getAxis();
6003 }
6004
6005protected:
6006 apiv::VScatterLayer* mImpl;
6007 virtual ~IScatterLayer() noexcept = default;
6008}; // class IScatterLayer
6009
6030{
6031public:
6032 virtual ~INetworkDefinition() noexcept = default;
6033
6069 ITensor* addInput(const char* name, DataType type, Dims dimensions) noexcept
6070 {
6071 return mImpl->addInput(name, type, dimensions);
6072 }
6073
6083 void markOutput(ITensor& tensor) noexcept
6084 {
6085 mImpl->markOutput(tensor);
6086 }
6087
6107 ITensor& input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
6108 {
6109 return mImpl->addConvolution(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
6110 }
6111
6128 ITensor& input, int32_t nbOutputs, Weights kernelWeights, Weights biasWeights) noexcept
6129 {
6130 return mImpl->addFullyConnected(input, nbOutputs, kernelWeights, biasWeights);
6131 }
6132
6148 {
6149 return mImpl->addActivation(input, type);
6150 }
6151
6167 {
6168 return mImpl->addPooling(input, type, windowSize);
6169 }
6170
6185 ILRNLayer* addLRN(ITensor& input, int32_t window, float alpha, float beta, float k) noexcept
6186 {
6187 return mImpl->addLRN(input, window, alpha, beta, k);
6188 }
6189
6212 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6213 {
6214 return mImpl->addScale(input, mode, shift, scale, power);
6215 }
6216
6226 {
6227 return mImpl->addSoftMax(input);
6228 }
6229
6242 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6243 {
6244 return mImpl->addConcatenation(inputs, nbInputs);
6245 }
6246
6266 ITensor& input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
6267 {
6268 return mImpl->addDeconvolution(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
6269 }
6270
6292 {
6293 return mImpl->addElementWise(input1, input2, op);
6294 }
6295
6311 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6312 {
6313 return mImpl->addUnary(input, operation);
6314 }
6315
6328 TRT_DEPRECATED IPaddingLayer* addPadding(ITensor& input, DimsHW prePadding, DimsHW postPadding) noexcept
6329 {
6330 return mImpl->addPadding(input, prePadding, postPadding);
6331 }
6332
6343 {
6344 return mImpl->addShuffle(input);
6345 }
6346
6354 int32_t getNbLayers() const noexcept
6355 {
6356 return mImpl->getNbLayers();
6357 }
6358
6368 ILayer* getLayer(int32_t index) const noexcept
6369 {
6370 return mImpl->getLayer(index);
6371 }
6372
6380 int32_t getNbInputs() const noexcept
6381 {
6382 return mImpl->getNbInputs();
6383 }
6384
6396 ITensor* getInput(int32_t index) const noexcept
6397 {
6398 return mImpl->getInput(index);
6399 }
6400
6410 int32_t getNbOutputs() const noexcept
6411 {
6412 return mImpl->getNbOutputs();
6413 }
6414
6426 ITensor* getOutput(int32_t index) const noexcept
6427 {
6428 return mImpl->getOutput(index);
6429 }
6430
6438 TRT_DEPRECATED void destroy() noexcept
6439 {
6440 delete this;
6441 }
6442
6467 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
6468 {
6469 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
6470 }
6471
6500 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
6501 {
6502 return mImpl->addTopK(input, op, k, reduceAxes);
6503 }
6504
6516 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
6517 {
6518 return mImpl->addGather(data, indices, axis);
6519 }
6520
6533 {
6534 return mImpl->addGatherV2(data, indices, mode);
6535 }
6536
6551 {
6552 return mImpl->addRaggedSoftMax(input, bounds);
6553 }
6554
6570 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
6571 {
6572 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
6573 }
6574
6595 IConstantLayer* addConstant(Dims dimensions, Weights weights) noexcept
6596 {
6597 return mImpl->addConstant(dimensions, weights);
6598 }
6599
6664 ITensor& input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen, RNNOperation op) noexcept
6665 {
6666 return mImpl->addRNNv2(input, layerCount, hiddenSize, maxSeqLen, op);
6667 }
6668
6681 {
6682 return mImpl->addIdentity(input);
6683 }
6684
6695 void removeTensor(ITensor& tensor) noexcept
6696 {
6697 mImpl->removeTensor(tensor);
6698 }
6699
6707 void unmarkOutput(ITensor& tensor) noexcept
6708 {
6709 mImpl->unmarkOutput(tensor);
6710 }
6711
6726 IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
6727 {
6728 return mImpl->addPluginV2(inputs, nbInputs, plugin);
6729 }
6730
6745 ISliceLayer* addSlice(ITensor& input, Dims start, Dims size, Dims stride) noexcept
6746 {
6747 return mImpl->addSlice(input, start, size, stride);
6748 }
6749
6767 void setName(const char* name) noexcept
6768 {
6769 mImpl->setName(name);
6770 }
6771
6781 const char* getName() const noexcept
6782 {
6783 return mImpl->getName();
6784 }
6785
6799 IShapeLayer* addShape(ITensor& input) noexcept
6800 {
6801 return mImpl->addShape(input);
6802 }
6803
6818 bool hasImplicitBatchDimension() const noexcept
6819 {
6820 return mImpl->hasImplicitBatchDimension();
6821 }
6822
6836 bool markOutputForShapes(ITensor& tensor) noexcept
6837 {
6838 return mImpl->markOutputForShapes(tensor);
6839 }
6840
6848 bool unmarkOutputForShapes(ITensor& tensor) noexcept
6849 {
6850 return mImpl->unmarkOutputForShapes(tensor);
6851 }
6852
6867 {
6868 return mImpl->addParametricReLU(input, slope);
6869 }
6870
6889 ITensor& input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
6890 {
6891 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
6892 }
6893
6908 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims windowSize) noexcept
6909 {
6910 return mImpl->addPoolingNd(input, type, windowSize);
6911 }
6912
6927 //
6931 ITensor& input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
6932 {
6933 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
6934 }
6935
6967 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
6968 {
6969 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
6970 }
6971
6983 {
6984 return mImpl->addResize(input);
6985 }
6986
7000 {
7001 return mImpl->hasExplicitPrecision();
7002 }
7003
7015 ILoop* addLoop() noexcept
7016 {
7017 return mImpl->addLoop();
7018 }
7019
7053 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7054 {
7055 return mImpl->addSelect(condition, thenInput, elseInput);
7056 }
7057
7070 IAssertionLayer* addAssertion(ITensor& condition, const char* message) noexcept
7071 {
7072 return mImpl->addAssertion(condition, message);
7073 }
7074
7088 IFillLayer* addFill(Dims dimensions, FillOperation op) noexcept
7089 {
7090 return mImpl->addFill(dimensions, op);
7091 }
7092
7105 TRT_DEPRECATED IPaddingLayer* addPaddingNd(ITensor& input, Dims prePadding, Dims postPadding) noexcept
7106 {
7107 return mImpl->addPaddingNd(input, prePadding, postPadding);
7108 }
7109
7125 bool setWeightsName(Weights weights, const char* name) noexcept
7126 {
7127 return mImpl->setWeightsName(weights, name);
7128 }
7129
7141 //
7144 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7145 {
7146 mImpl->setErrorRecorder(recorder);
7147 }
7148
7160 {
7161 return mImpl->getErrorRecorder();
7162 }
7163
7179 {
7180 return mImpl->addDequantize(input, scale);
7181 }
7182
7198 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7199 {
7200 return mImpl->addScatter(data, indices, updates, mode);
7201 }
7202
7217 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale) noexcept
7218 {
7219 return mImpl->addQuantize(input, scale);
7220 }
7221
7233 {
7234 return mImpl->addIfConditional();
7235 }
7236
7246 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, const char* equation) noexcept
7247 {
7248 return mImpl->addEinsum(inputs, nbInputs, equation);
7249 }
7250
7251protected:
7252 apiv::VNetworkDefinition* mImpl;
7253};
7254
7260enum class CalibrationAlgoType : int32_t
7261{
7262 kLEGACY_CALIBRATION = 0,
7263 kENTROPY_CALIBRATION = 1,
7264 kENTROPY_CALIBRATION_2 = 2,
7265 kMINMAX_CALIBRATION = 3,
7266};
7267
7269template <>
7270constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
7271{
7272 return 4;
7273}
7274
7287{
7288public:
7294 virtual int32_t getBatchSize() const noexcept = 0;
7295
7309 virtual bool getBatch(void* bindings[], const char* names[], int32_t nbBindings) noexcept = 0;
7310
7325 virtual const void* readCalibrationCache(std::size_t& length) noexcept = 0;
7326
7335 virtual void writeCalibrationCache(const void* ptr, std::size_t length) noexcept = 0;
7336
7342 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
7343
7344 virtual ~IInt8Calibrator() noexcept = default;
7345};
7346
7352{
7353public:
7358 {
7359 return CalibrationAlgoType::kENTROPY_CALIBRATION;
7360 }
7361
7362 virtual ~IInt8EntropyCalibrator() noexcept = default;
7363};
7364
7370{
7371public:
7376 {
7377 return CalibrationAlgoType::kENTROPY_CALIBRATION_2;
7378 }
7379
7380 virtual ~IInt8EntropyCalibrator2() noexcept = default;
7381};
7382
7387{
7388public:
7393 {
7394 return CalibrationAlgoType::kMINMAX_CALIBRATION;
7395 }
7396
7397 virtual ~IInt8MinMaxCalibrator() noexcept = default;
7398};
7399
7405{
7406public:
7411 {
7412 return CalibrationAlgoType::kLEGACY_CALIBRATION;
7413 }
7414
7421 virtual double getQuantile() const noexcept = 0;
7422
7429 virtual double getRegressionCutoff() const noexcept = 0;
7430
7443 virtual const void* readHistogramCache(std::size_t& length) noexcept = 0;
7444
7453 virtual void writeHistogramCache(const void* ptr, std::size_t length) noexcept = 0;
7454
7455 virtual ~IInt8LegacyCalibrator() noexcept = default;
7456};
7457
7469{
7470public:
7475 {
7476 return mImpl->getTensorFormat();
7477 }
7478
7482 DataType getDataType() const noexcept
7483 {
7484 return mImpl->getDataType();
7485 }
7486
7490 Dims getStrides() const noexcept
7491 {
7492 return mImpl->getStrides();
7493 }
7494
7495protected:
7496 virtual ~IAlgorithmIOInfo() noexcept = default;
7497 apiv::VAlgorithmIOInfo* mImpl;
7498};
7499
7512{
7513public:
7517 int64_t getImplementation() const noexcept
7518 {
7519 return mImpl->getImplementation();
7520 }
7521
7525 int64_t getTactic() const noexcept
7526 {
7527 return mImpl->getTactic();
7528 }
7529
7530protected:
7531 virtual ~IAlgorithmVariant() noexcept = default;
7532 apiv::VAlgorithmVariant* mImpl;
7533};
7534
7544{
7545public:
7550 const char* getName() const noexcept
7551 {
7552 return mImpl->getName();
7553 }
7554
7561 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
7562 {
7563 return mImpl->getDimensions(index, select);
7564 }
7565
7569 int32_t getNbInputs() const noexcept
7570 {
7571 return mImpl->getNbInputs();
7572 }
7573
7577 int32_t getNbOutputs() const noexcept
7578 {
7579 return mImpl->getNbOutputs();
7580 }
7581
7582protected:
7583 virtual ~IAlgorithmContext() noexcept = default;
7584 apiv::VAlgorithmContext* mImpl;
7585};
7586
7596class IAlgorithm : public INoCopy
7597{
7598public:
7609 TRT_DEPRECATED const IAlgorithmIOInfo& getAlgorithmIOInfo(int32_t index) const noexcept
7610 {
7611 return mImpl->getAlgorithmIOInfo(index);
7612 }
7613
7618 {
7619 return mImpl->getAlgorithmVariant();
7620 }
7621
7625 float getTimingMSec() const noexcept
7626 {
7627 return mImpl->getTimingMSec();
7628 }
7629
7633 std::size_t getWorkspaceSize() const noexcept
7634 {
7635 return mImpl->getWorkspaceSize();
7636 }
7637
7646 const IAlgorithmIOInfo* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
7647 {
7648 return mImpl->getAlgorithmIOInfoByIndex(index);
7649 }
7650
7651protected:
7652 virtual ~IAlgorithm() noexcept = default;
7653 apiv::VAlgorithm* mImpl;
7654}; // IAlgorithm
7655
7665{
7666public:
7681 virtual int32_t selectAlgorithms(const IAlgorithmContext& context, const IAlgorithm* const* choices,
7682 int32_t nbChoices, int32_t* selection) noexcept
7683 = 0;
7694 virtual void reportAlgorithms(const IAlgorithmContext* const* algoContexts, const IAlgorithm* const* algoChoices,
7695 int32_t nbAlgorithms) noexcept
7696 = 0;
7697
7698 virtual ~IAlgorithmSelector() noexcept = default;
7699};
7700
7707using QuantizationFlags = uint32_t;
7708
7716enum class QuantizationFlag : int32_t
7717{
7722};
7723
7725template <>
7726constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
7727{
7728 return 1;
7729}
7730
7737using BuilderFlags = uint32_t;
7738
7746enum class BuilderFlag : int32_t
7747{
7748 kFP16 = 0,
7749 kINT8 = 1,
7750 kDEBUG = 2,
7751 kGPU_FALLBACK = 3,
7752
7762 kSTRICT_TYPES TRT_DEPRECATED_ENUM = 4,
7763
7764 kREFIT = 5,
7766
7770 kTF32 = 7,
7771
7773 kSPARSE_WEIGHTS = 8,
7774
7781 kSAFETY_SCOPE = 9,
7782
7785
7789
7793 kDIRECT_IO = 12,
7794
7797};
7798
7800template <>
7801constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
7802{
7803 return 14;
7804}
7805
7816class ITimingCache : public INoCopy
7817{
7818public:
7819 virtual ~ITimingCache() noexcept = default;
7820
7831 {
7832 return mImpl->serialize();
7833 }
7834
7854 bool combine(const ITimingCache& inputCache, bool ignoreMismatch) noexcept
7855 {
7856 return mImpl->combine(inputCache, ignoreMismatch);
7857 }
7858
7864 bool reset() noexcept
7865 {
7866 return mImpl->reset();
7867 }
7868
7869protected:
7870 apiv::VTimingCache* mImpl;
7871};
7872
7879{
7880public:
7881 virtual ~IBuilderConfig() noexcept = default;
7882
7893 virtual void setMinTimingIterations(int32_t minTiming) noexcept
7894 {
7895 mImpl->setMinTimingIterations(minTiming);
7896 }
7897
7905 virtual int32_t getMinTimingIterations() const noexcept
7906 {
7907 return mImpl->getMinTimingIterations();
7908 }
7909
7918 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
7919 {
7920 mImpl->setAvgTimingIterations(avgTiming);
7921 }
7922
7930 int32_t getAvgTimingIterations() const noexcept
7931 {
7932 return mImpl->getAvgTimingIterations();
7933 }
7934
7943 void setEngineCapability(EngineCapability capability) noexcept
7944 {
7945 mImpl->setEngineCapability(capability);
7946 }
7947
7956 {
7957 return mImpl->getEngineCapability();
7958 }
7959
7965 void setInt8Calibrator(IInt8Calibrator* calibrator) noexcept
7966 {
7967 mImpl->setInt8Calibrator(calibrator);
7968 }
7969
7974 {
7975 return mImpl->getInt8Calibrator();
7976 }
7977
7985 void setMaxWorkspaceSize(std::size_t workspaceSize) noexcept
7986 {
7987 mImpl->setMaxWorkspaceSize(workspaceSize);
7988 }
7989
7999 std::size_t getMaxWorkspaceSize() const noexcept
8000 {
8001 return mImpl->getMaxWorkspaceSize();
8002 }
8003
8016 void setFlags(BuilderFlags builderFlags) noexcept
8017 {
8018 mImpl->setFlags(builderFlags);
8019 }
8020
8028 BuilderFlags getFlags() const noexcept
8029 {
8030 return mImpl->getFlags();
8031 }
8032
8040 void clearFlag(BuilderFlag builderFlag) noexcept
8041 {
8042 mImpl->clearFlag(builderFlag);
8043 }
8044
8052 void setFlag(BuilderFlag builderFlag) noexcept
8053 {
8054 mImpl->setFlag(builderFlag);
8055 }
8056
8064 bool getFlag(BuilderFlag builderFlag) const noexcept
8065 {
8066 return mImpl->getFlag(builderFlag);
8067 }
8068
8079 void setDeviceType(const ILayer* layer, DeviceType deviceType) noexcept
8080 {
8081 mImpl->setDeviceType(layer, deviceType);
8082 }
8083
8088 DeviceType getDeviceType(const ILayer* layer) const noexcept
8089 {
8090 return mImpl->getDeviceType(layer);
8091 }
8092
8098 bool isDeviceTypeSet(const ILayer* layer) const noexcept
8099 {
8100 return mImpl->isDeviceTypeSet(layer);
8101 }
8102
8108 void resetDeviceType(const ILayer* layer) noexcept
8109 {
8110 mImpl->resetDeviceType(layer);
8111 }
8112
8117 bool canRunOnDLA(const ILayer* layer) const noexcept
8118 {
8119 return mImpl->canRunOnDLA(layer);
8120 }
8121
8132 void setDLACore(int32_t dlaCore) noexcept
8133 {
8134 mImpl->setDLACore(dlaCore);
8135 }
8136
8143 int32_t getDLACore() const noexcept
8144 {
8145 return mImpl->getDLACore();
8146 }
8147
8153 void setDefaultDeviceType(DeviceType deviceType) noexcept
8154 {
8155 mImpl->setDefaultDeviceType(deviceType);
8156 }
8157
8164 {
8165 return mImpl->getDefaultDeviceType();
8166 }
8167
8173 void reset() noexcept
8174 {
8175 mImpl->reset();
8176 }
8177
8187 TRT_DEPRECATED void destroy() noexcept
8188 {
8189 delete this;
8190 }
8191
8199 void setProfileStream(const cudaStream_t stream) noexcept
8200 {
8201 return mImpl->setProfileStream(stream);
8202 }
8203
8211 cudaStream_t getProfileStream() const noexcept
8212 {
8213 return mImpl->getProfileStream();
8214 }
8215
8227 int32_t addOptimizationProfile(const IOptimizationProfile* profile) noexcept
8228 {
8229 return mImpl->addOptimizationProfile(profile);
8230 }
8231
8240 int32_t getNbOptimizationProfiles() const noexcept
8241 {
8242 return mImpl->getNbOptimizationProfiles();
8243 }
8244
8253 {
8254 mImpl->setProfilingVerbosity(verbosity);
8255 }
8256
8266 {
8267 return mImpl->getProfilingVerbosity();
8268 }
8269
8275 {
8276 mImpl->setAlgorithmSelector(selector);
8277 }
8278
8283 {
8284 return mImpl->getAlgorithmSelector();
8285 }
8286
8297 bool setCalibrationProfile(const IOptimizationProfile* profile) noexcept
8298 {
8299 return mImpl->setCalibrationProfile(profile);
8300 }
8301
8308 {
8309 return mImpl->getCalibrationProfile();
8310 }
8311
8325 {
8326 mImpl->setQuantizationFlags(flags);
8327 }
8328
8337 {
8338 return mImpl->getQuantizationFlags();
8339 }
8340
8349 {
8350 mImpl->clearQuantizationFlag(flag);
8351 }
8352
8361 {
8362 mImpl->setQuantizationFlag(flag);
8363 }
8364
8372 bool getQuantizationFlag(QuantizationFlag flag) const noexcept
8373 {
8374 return mImpl->getQuantizationFlag(flag);
8375 }
8376
8397 bool setTacticSources(TacticSources tacticSources) noexcept
8398 {
8399 return mImpl->setTacticSources(tacticSources);
8400 }
8401
8413 {
8414 return mImpl->getTacticSources();
8415 }
8416
8431 nvinfer1::ITimingCache* createTimingCache(const void* blob, std::size_t size) const noexcept
8432 {
8433 return mImpl->createTimingCache(blob, size);
8434 }
8435
8454 bool setTimingCache(const ITimingCache& cache, bool ignoreMismatch) noexcept
8455 {
8456 return mImpl->setTimingCache(cache, ignoreMismatch);
8457 }
8458
8465 {
8466 return mImpl->getTimingCache();
8467 }
8468
8469protected:
8470 apiv::VBuilderConfig* mImpl;
8471};
8472
8480
8491{
8496 kEXPLICIT_BATCH = 0,
8497
8510 kEXPLICIT_PRECISION TRT_DEPRECATED_ENUM = 1,
8511};
8512
8514template <>
8515constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
8516{
8517 return 2;
8518}
8519
8527class IBuilder : public INoCopy
8528{
8529public:
8530 virtual ~IBuilder() noexcept = default;
8531
8540 void setMaxBatchSize(int32_t batchSize) noexcept
8541 {
8542 mImpl->setMaxBatchSize(batchSize);
8543 }
8544
8553 int32_t getMaxBatchSize() const noexcept
8554 {
8555 return mImpl->getMaxBatchSize();
8556 }
8557
8561 bool platformHasFastFp16() const noexcept
8562 {
8563 return mImpl->platformHasFastFp16();
8564 }
8565
8569 bool platformHasFastInt8() const noexcept
8570 {
8571 return mImpl->platformHasFastInt8();
8572 }
8573
8581 TRT_DEPRECATED void destroy() noexcept
8582 {
8583 delete this;
8584 }
8585
8593 int32_t getMaxDLABatchSize() const noexcept
8594 {
8595 return mImpl->getMaxDLABatchSize();
8596 }
8597
8601 int32_t getNbDLACores() const noexcept
8602 {
8603 return mImpl->getNbDLACores();
8604 }
8605
8617 void setGpuAllocator(IGpuAllocator* allocator) noexcept
8618 {
8619 mImpl->setGpuAllocator(allocator);
8620 }
8621
8628 {
8629 return mImpl->createBuilderConfig();
8630 }
8631
8643 INetworkDefinition& network, IBuilderConfig& config) noexcept
8644 {
8645 return mImpl->buildEngineWithConfig(network, config);
8646 }
8647
8660 {
8661 return mImpl->createNetworkV2(flags);
8662 }
8663
8674 {
8675 return mImpl->createOptimizationProfile();
8676 }
8677
8689 //
8692 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8693 {
8694 mImpl->setErrorRecorder(recorder);
8695 }
8696
8708 {
8709 return mImpl->getErrorRecorder();
8710 }
8711
8715 void reset() noexcept
8716 {
8717 mImpl->reset();
8718 }
8719
8723 bool platformHasTf32() const noexcept
8724 {
8725 return mImpl->platformHasTf32();
8726 }
8727
8743 {
8744 return mImpl->buildSerializedNetwork(network, config);
8745 }
8746
8766 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
8767 {
8768 return mImpl->isNetworkSupported(network, config);
8769 }
8770
8776 ILogger* getLogger() const noexcept
8777 {
8778 return mImpl->getLogger();
8779 }
8780
8781protected:
8782 apiv::VBuilder* mImpl;
8783};
8784
8785} // namespace nvinfer1
8786
8791extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
8792
8793namespace nvinfer1
8794{
8795namespace
8796{
8797
8805inline IBuilder* createInferBuilder(ILogger& logger) noexcept
8806{
8807 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
8808}
8809
8810} // namespace
8811} // namespace nvinfer1
8812
8813#endif // NV_INFER_H
#define TRT_DEPRECATED
< Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:77
Definition: NvInferRuntimeCommon.h:190
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeCommon.h:193
Descriptor for two-dimensional spatial data.
Definition: NvInferLegacyDims.h:101
An Activation layer in a network definition.
Definition: NvInfer.h:1570
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1618
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1579
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1589
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1627
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1636
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1604
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:7544
const char * getName() const noexcept
Return name of the algorithm node. This is a unique identifier for the IAlgorithmContext.
Definition: NvInfer.h:7550
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:7577
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:7569
Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for input or output tensor.
Definition: NvInfer.h:7561
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:7597
std::size_t getWorkspaceSize() const noexcept
The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
Definition: NvInfer.h:7633
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:7625
TRT_DEPRECATED const IAlgorithmIOInfo & getAlgorithmIOInfo(int32_t index) const noexcept
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Definition: NvInfer.h:7609
const IAlgorithmVariant & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:7617
const IAlgorithmIOInfo * getAlgorithmIOInfoByIndex(int32_t index) const noexcept
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Definition: NvInfer.h:7646
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:7469
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm.
Definition: NvInfer.h:7490
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:7482
TensorFormat getTensorFormat() const noexcept
Return TensorFormat of the input/output of algorithm.
Definition: NvInfer.h:7474
Interface implemented by application for selecting and reporting algorithms of a layer provided by th...
Definition: NvInfer.h:7665
virtual int32_t selectAlgorithms(const IAlgorithmContext &context, const IAlgorithm *const *choices, int32_t nbChoices, int32_t *selection) noexcept=0
Select Algorithms for a layer from the given list of algorithm choices.
virtual void reportAlgorithms(const IAlgorithmContext *const *algoContexts, const IAlgorithm *const *algoChoices, int32_t nbAlgorithms) noexcept=0
Called by TensorRT to report choices it made.
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:7512
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:7525
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:7517
An assertion layer in a network.
Definition: NvInfer.h:5419
void setMessage(const char *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:5429
const char * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5439
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:7879
DeviceType getDeviceType(const ILayer *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:8088
void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:8360
const IOptimizationProfile * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:8307
virtual void setMinTimingIterations(int32_t minTiming) noexcept
Set the number of minimization iterations used when timing layers.
Definition: NvInfer.h:7893
void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:7965
void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:8348
void setDeviceType(const ILayer *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:8079
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:8397
bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:8372
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:8143
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:7943
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:8064
void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:8324
virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
Set the number of averaging iterations used when timing layers.
Definition: NvInfer.h:7918
std::size_t getMaxWorkspaceSize() const noexcept
Get the maximum workspace size.
Definition: NvInfer.h:7999
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8252
nvinfer1::ITimingCache * createTimingCache(const void *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:8431
IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:8282
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:8240
QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:8336
bool setCalibrationProfile(const IOptimizationProfile *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:8297
virtual int32_t getMinTimingIterations() const noexcept
Query the number of minimization iterations.
Definition: NvInfer.h:7905
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:8173
TRT_DEPRECATED void destroy() noexcept
Delete this IBuilderConfig.
Definition: NvInfer.h:8187
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:7955
void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:8274
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:8163
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:8028
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:8016
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:8412
bool setTimingCache(const ITimingCache &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:8454
bool canRunOnDLA(const ILayer *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:8117
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network.
Definition: NvInfer.h:8132
void setMaxWorkspaceSize(std::size_t workspaceSize) noexcept
Set the maximum workspace size.
Definition: NvInfer.h:7985
int32_t addOptimizationProfile(const IOptimizationProfile *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:8227
const nvinfer1::ITimingCache * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:8464
bool isDeviceTypeSet(const ILayer *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:8098
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:8040
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:7930
void setDefaultDeviceType(DeviceType deviceType) noexcept
Sets the default DeviceType to be used by the builder. It ensures that all the layers that can run on...
Definition: NvInfer.h:8153
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:8052
cudaStream_t getProfileStream() const noexcept
Get the cuda stream that is used to profile this network.
Definition: NvInfer.h:8211
IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:7973
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8265
void resetDeviceType(const ILayer *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:8108
void setProfileStream(const cudaStream_t stream) noexcept
Set the cuda stream that is used to profile this network.
Definition: NvInfer.h:8199
Builds an engine from a network definition.
Definition: NvInfer.h:8528
int32_t getMaxDLABatchSize() const noexcept
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combi...
Definition: NvInfer.h:8593
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:8601
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8707
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:8776
bool isNetworkSupported(INetworkDefinition const &network, IBuilderConfig const &config) const noexcept
Checks that a network is within the scope of the IBuilderConfig settings.
Definition: NvInfer.h:8766
bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:8723
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInfer.h:8581
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size.
Definition: NvInfer.h:8553
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:8673
bool platformHasFastFp16() const noexcept
Determine whether the platform has fast native fp16.
Definition: NvInfer.h:8561
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:8617
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:8659
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:8627
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:8715
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8692
bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:8569
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:8742
TRT_DEPRECATED nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds an engine for the given INetworkDefinition and given IBuilderConfig.
Definition: NvInfer.h:8642
void setMaxBatchSize(int32_t batchSize) noexcept
Set the maximum batch size.
Definition: NvInfer.h:8540
A concatenation layer in a network definition.
Definition: NvInfer.h:2358
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2370
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2380
Definition: NvInfer.h:5023
Layer that represents a constant value.
Definition: NvInfer.h:4486
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:4497
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:4507
void setDimensions(Dims dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:4519
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:4531
A convolution layer in a network definition.
Definition: NvInfer.h:1009
TRT_DEPRECATED DimsHW getPadding() const noexcept
Get the padding of the convolution. If the padding is asymmetric, the pre-padding is returned.
Definition: NvInfer.h:1112
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride of the convolution.
Definition: NvInfer.h:1080
TRT_DEPRECATED DimsHW getDilation() const noexcept
Get the dilation for a convolution.
Definition: NvInfer.h:1219
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1337
void setKernelSizeNd(Dims kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1312
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1246
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1191
int32_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1142
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1287
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Get the stride of the convolution.
Definition: NvInfer.h:1070
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1377
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1347
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding of the convolution.
Definition: NvInfer.h:1100
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1166
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1365
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1401
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1156
void setDilationNd(Dims dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1391
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1273
TRT_DEPRECATED void setDilation(DimsHW dilation) noexcept
Set the dilation for a convolution.
Definition: NvInfer.h:1207
void setNbGroups(int32_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1132
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1299
int32_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1054
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1236
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1181
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1322
void setNbOutputMaps(int32_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1044
TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
Set the HW kernel size of the convolution.
Definition: NvInfer.h:1020
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1263
TRT_DEPRECATED DimsHW getKernelSize() const noexcept
Get the HW kernel size of the convolution.
Definition: NvInfer.h:1032
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1310
A deconvolution layer in a network definition.
Definition: NvInfer.h:2398
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2577
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Set the stride of the deconvolution.
Definition: NvInfer.h:2462
void setNbOutputMaps(int32_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2435
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2562
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2605
TRT_DEPRECATED DimsHW getPadding() const noexcept
Get the padding of the deconvolution.
Definition: NvInfer.h:2508
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2722
int32_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2538
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2796
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2587
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2552
void setDilationNd(Dims dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2786
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride of the deconvolution.
Definition: NvInfer.h:2474
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding of the deconvolution.
Definition: NvInfer.h:2494
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2643
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2694
void setKernelSizeNd(Dims kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2684
TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
Set the HW kernel size of the convolution.
Definition: NvInfer.h:2411
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2712
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2752
void setNbGroups(int32_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2528
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2657
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2740
TRT_DEPRECATED DimsHW getKernelSize() const noexcept
Get the HW kernel size of the deconvolution.
Definition: NvInfer.h:2423
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2633
int32_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2445
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2615
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2669
A Dequantize layer in a network definition.
Definition: NvInfer.h:5791
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5801
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5812
An Einsum layer in a network.
Definition: NvInfer.h:5859
bool setEquation(const char *equation) noexcept
Set the equation. The equation is a comma-separated list of subscript labels, where each label refers...
Definition: NvInfer.h:5870
const char * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5880
A elementwise layer in a network definition.
Definition: NvInfer.h:2861
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2884
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2872
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1693
Generate an output tensor with specified mode.
Definition: NvInfer.h:5496
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5542
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5532
void setDimensions(Dims dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5507
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5593
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5575
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5560
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5522
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5608
A fully connected layer in a network definition. This layer expects an input tensor of three or more ...
Definition: NvInfer.h:1464
void setNbOutputChannels(int32_t nbOutputs) noexcept
Set the number of output channels K from the fully connected layer.
Definition: NvInfer.h:1473
Weights getKernelWeights() const noexcept
Get the kernel weights.
Definition: NvInfer.h:1503
void setBiasWeights(Weights weights) noexcept
Set the bias weights.
Definition: NvInfer.h:1515
void setKernelWeights(Weights weights) noexcept
Set the kernel weights, given as a KxC matrix in row-major order.
Definition: NvInfer.h:1493
int32_t getNbOutputChannels() const noexcept
Get the number of output channels K from the fully connected layer.
Definition: NvInfer.h:1483
Weights getBiasWeights() const noexcept
Get the bias weights.
Definition: NvInfer.h:1525
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2992
void setGatherAxis(int32_t axis) noexcept
Set the axis used by GatherMode::kELEMENTS and GatherMode::kDEFAULT The axis must be less than the nu...
Definition: NvInfer.h:3003
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise. The gathering of in...
Definition: NvInfer.h:3035
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:3045
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:3055
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:3014
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:3065
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1372
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:175
A layer that represents the identity function.
Definition: NvInfer.h:4472
Definition: NvInfer.h:5006
IIfConditional * getConditional() const noexcept
Return pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:5009
Definition: NvInfer.h:5076
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:5115
void setName(const char *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:5128
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:5087
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:5103
const char * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:5138
Definition: NvInfer.h:5047
Definition: NvInfer.h:5036
Application-implemented interface for calibration.
Definition: NvInfer.h:7287
virtual int32_t getBatchSize() const noexcept=0
Get the batch size used for calibration batches.
Definition: NvInfer.h:7370
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7375
Definition: NvInfer.h:7352
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7357
Definition: NvInfer.h:7405
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7410
virtual double getQuantile() const noexcept=0
The quantile (between 0 and 1) that will be used to select the region maximum when the quantile metho...
Definition: NvInfer.h:7387
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7392
Definition: NvInfer.h:5266
void setReverse(bool reverse) noexcept
Definition: NvInfer.h:5285
bool getReverse() const noexcept
True if and only if reversing input.
Definition: NvInfer.h:5291
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:5275
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:5269
A LRN layer in a network definition.
Definition: NvInfer.h:2018
int32_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:2039
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:2060
void setWindowSize(int32_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:2029
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:2092
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:2050
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:2071
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:2081
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:2102
Base class for all layer classes in a network definition.
Definition: NvInfer.h:520
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:657
void setPrecision(DataType dataType) noexcept
Set the computational precision of this layer.
Definition: NvInfer.h:633
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:667
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:558
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:719
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:645
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:579
void setName(const char *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:539
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:732
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:590
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:607
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:744
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:571
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer.
Definition: NvInfer.h:705
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:527
const char * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:550
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1506
Definition: NvInfer.h:4987
ILoop * getLoop() const noexcept
Return pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4990
Definition: NvInfer.h:5307
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:5336
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:5349
ILoopOutputLayer * addLoopOutput(ITensor &tensor, LoopOutput outputKind, int32_t axis=0) noexcept
Make an output for this loop, based on the given tensor.
Definition: NvInfer.h:5361
const char * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:5384
void setName(const char *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:5374
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:5315
Definition: NvInfer.h:5195
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:5220
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:5214
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:4410
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:4428
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:4418
A network definition for input to the builder.
Definition: NvInfer.h:6030
IPluginV2Layer * addPluginV2(ITensor *const *inputs, int32_t nbInputs, IPluginV2 &plugin) noexcept
Add a plugin layer to the network using the IPluginV2 interface.
Definition: NvInfer.h:6726
IConvolutionLayer * addConvolutionNd(ITensor &input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a multi-dimension convolution layer to the network.
Definition: NvInfer.h:6888
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7178
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6242
TRT_DEPRECATED IDeconvolutionLayer * addDeconvolution(ITensor &input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a deconvolution layer to the network.
Definition: NvInfer.h:6265
ITensor * addInput(const char *name, DataType type, Dims dimensions) noexcept
Add an input tensor to the network.
Definition: NvInfer.h:6069
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode)
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:6532
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6342
ILRNLayer * addLRN(ITensor &input, int32_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6185
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:6500
IAssertionLayer * addAssertion(ITensor &condition, const char *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7070
IScaleLayer * addScaleNd(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
Add a multi-dimension scale layer to the network.
Definition: NvInfer.h:6966
TRT_DEPRECATED bool hasExplicitPrecision() const noexcept
True if network is an explicit precision network.
Definition: NvInfer.h:6999
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:6866
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6426
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6396
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:6848
IFillLayer * addFill(Dims dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7088
IFullyConnectedLayer * addFullyConnected(ITensor &input, int32_t nbOutputs, Weights kernelWeights, Weights biasWeights) noexcept
Add a fully connected layer to the network.
Definition: NvInfer.h:6127
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7015
IDeconvolutionLayer * addDeconvolutionNd(ITensor &input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a multi-dimension deconvolution layer to the network.
Definition: NvInfer.h:6930
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6147
void setName(const char *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:6767
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6368
TRT_DEPRECATED IRNNv2Layer * addRNNv2(ITensor &input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen, RNNOperation op) noexcept
Add an layerCount deep RNN layer to the network with hiddenSize internal states that can take a batch...
Definition: NvInfer.h:6663
IIfConditional * addIfConditional() noexcept
Add an If-conditional layer to the network.
Definition: NvInfer.h:7232
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7159
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6380
bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:6818
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:6466
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6311
const char * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:6781
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:6695
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7053
IScatterLayer * addScatter(ITensor &data, ITensor &indices, ITensor &updates, ScatterMode mode) noexcept
Add a Scatter layer to the network with specified mode and axis=0.
Definition: NvInfer.h:7198
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6354
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:6908
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:6836
TRT_DEPRECATED IPaddingLayer * addPadding(ITensor &input, DimsHW prePadding, DimsHW postPadding) noexcept
Add a padding layer to the network.
Definition: NvInfer.h:6328
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6212
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:6707
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:6680
TRT_DEPRECATED IConvolutionLayer * addConvolution(ITensor &input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a convolution layer to the network.
Definition: NvInfer.h:6106
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7217
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6291
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7144
ISliceLayer * addSlice(ITensor &input, Dims start, Dims size, Dims stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:6745
IConstantLayer * addConstant(Dims dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:6595
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:6550
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:6799
IGatherLayer * addGather(ITensor &data, ITensor &indices, int32_t axis) noexcept
Add gather with mode GatherMode::kDEFAULT and specified axis and nbElementWiseDims=0.
Definition: NvInfer.h:6516
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, const char *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7246
TRT_DEPRECATED IPoolingLayer * addPooling(ITensor &input, PoolingType type, DimsHW windowSize) noexcept
Add a pooling layer to the network.
Definition: NvInfer.h:6166
TRT_DEPRECATED void destroy() noexcept
Destroy this INetworkDefinition object.
Definition: NvInfer.h:6438
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:6982
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:6569
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6225
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6083
bool setWeightsName(Weights weights, const char *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7125
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6410
TRT_DEPRECATED IPaddingLayer * addPaddingNd(ITensor &input, Dims prePadding, Dims postPadding) noexcept
Add a padding layer to the network. Only 2D padding is currently supported.
Definition: NvInfer.h:7105
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:80
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1094
Layer that represents a padding operation.
Definition: NvInfer.h:3747
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3848
TRT_DEPRECATED DimsHW getPrePadding() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3770
TRT_DEPRECATED void setPostPadding(DimsHW padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3784
TRT_DEPRECATED void setPrePadding(DimsHW padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3758
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3822
TRT_DEPRECATED DimsHW getPostPadding() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3796
void setPostPaddingNd(Dims padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3836
void setPrePaddingNd(Dims padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3810
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4549
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:411
Layer type for pluginV2.
Definition: NvInfer.h:3534
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:3541
A Pooling layer in a network definition.
Definition: NvInfer.h:1680
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride for pooling.
Definition: NvInfer.h:1753
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1699
void setWindowSizeNd(Dims windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1932
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1919
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1895
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Set the stride for pooling.
Definition: NvInfer.h:1741
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1839
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1867
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1689
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1908
TRT_DEPRECATED void setWindowSize(DimsHW windowSize) noexcept
Set the window size for pooling.
Definition: NvInfer.h:1713
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1942
void setAverageCountExcludesPadding(bool exclusive) noexcept
Set whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1828
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1986
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1857
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1811
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1967
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1998
TRT_DEPRECATED DimsHW getWindowSize() const noexcept
Get the window size for pooling.
Definition: NvInfer.h:1725
TRT_DEPRECATED DimsHW getPadding() const noexcept
Get the padding for pooling.
Definition: NvInfer.h:1783
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1957
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1885
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding for pooling.
Definition: NvInfer.h:1769
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1798
A Quantize layer in a network definition.
Definition: NvInfer.h:5704
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5725
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5714
An RNN layer in a network definition, version 2.
Definition: NvInfer.h:3253
void setDirection(RNNDirection op) noexcept
Set the direction of the RNN layer.
Definition: NvInfer.h:3349
void setBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights bias) noexcept
Set the bias parameters for an individual gate in the RNN.
Definition: NvInfer.h:3451
void setCellState(ITensor &cell) noexcept
Set the initial cell state of the LSTM with the provided cell ITensor.
Definition: NvInfer.h:3505
int32_t getDataLength() const noexcept
Get the maximum data length of the RNN.
Definition: NvInfer.h:3267
void setInputMode(RNNInputMode op) noexcept
Set the input mode of the RNN layer.
Definition: NvInfer.h:3325
Weights getBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
Get the bias parameters for an individual gate in the RNN.
Definition: NvInfer.h:3460
void setWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights weights) noexcept
Set the weight parameters for an individual gate in the RNN.
Definition: NvInfer.h:3417
void setOperation(RNNOperation op) noexcept
Set the operation of the RNN layer.
Definition: NvInfer.h:3307
Weights getWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
Get the weight parameters for an individual gate in the RNN.
Definition: NvInfer.h:3426
RNNDirection getDirection() const noexcept
Get the direction of the RNN layer.
Definition: NvInfer.h:3358
void setSequenceLengths(ITensor &seqLengths) noexcept
Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths.
Definition: NvInfer.h:3286
RNNInputMode getInputMode() const noexcept
Get the input mode of the RNN layer.
Definition: NvInfer.h:3334
ITensor * getHiddenState() const noexcept
Get the initial hidden state of the RNN.
Definition: NvInfer.h:3486
ITensor * getCellState() const noexcept
Get the initial cell state of the RNN.
Definition: NvInfer.h:3514
int32_t getMaxSeqLength() const noexcept
Get the maximum sequence length of the RNN.
Definition: NvInfer.h:3263
int32_t getLayerCount() const noexcept
Get the layer count of the RNN.
Definition: NvInfer.h:3255
ITensor * getSequenceLengths() const noexcept
Get the sequence lengths specified for the RNN.
Definition: NvInfer.h:3298
RNNOperation getOperation() const noexcept
Get the operation of the RNN layer.
Definition: NvInfer.h:3316
int32_t getHiddenSize() const noexcept
Get the hidden size of the RNN.
Definition: NvInfer.h:3259
void setHiddenState(ITensor &hidden) noexcept
Set the initial hidden state of the RNN with the provided hidden ITensor.
Definition: NvInfer.h:3477
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:4453
Definition: NvInfer.h:5150
Layer that represents a reduction operator across Shape, Int32, Float, Half, and Int8 tensors.
Definition: NvInfer.h:3669
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:3716
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:3676
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:3686
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:3706
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:3696
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:3726
A resize layer in a network definition.
Definition: NvInfer.h:4706
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4903
void setOutputDimensions(Dims dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4726
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4929
int32_t getScales(int32_t size, float *scales) const noexcept
Copies resize scales to scales[0, ..., nbScales-1], where nbScales is the number of scales that were ...
Definition: NvInfer.h:4785
ResizeMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4809
void setResizeMode(ResizeMode resizeMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4799
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4913
TRT_DEPRECATED bool getAlignCorners() const noexcept
True if align corners has been set.
Definition: NvInfer.h:4839
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4876
void setScales(const float *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4766
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4736
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4939
TRT_DEPRECATED void setAlignCorners(bool alignCorners) noexcept
Set whether to align corners while resizing.
Definition: NvInfer.h:4826
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4886
A Scale layer in a network definition.
Definition: NvInfer.h:2158
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:2215
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:2235
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:2205
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:2225
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:2175
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:2185
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:2271
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:2195
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:2165
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:2250
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5965
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5972
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5992
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:6000
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5982
Definition: NvInfer.h:5398
Layer type for getting shape of a tensor.
Definition: NvInfer.h:4248
Layer type for shuffling data.
Definition: NvInfer.h:3882
void setReshapeDimensions(Dims dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3930
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3893
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3990
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3943
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3905
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:4002
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:4031
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:4018
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:4098
void setMode(SliceMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:4192
void setStride(Dims stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:4167
void setStart(Dims start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:4109
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:4124
void setSize(Dims size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:4138
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:4153
SliceMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:4202
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:4182
A Softmax layer in a network definition.
Definition: NvInfer.h:2293
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2325
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2335
A tensor in a network definition.
Definition: NvInfer.h:196
bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:296
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for this tensor. By default all formats are allowed. Shape tensors (for which isS...
Definition: NvInfer.h:432
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:360
void setName(const char *name) noexcept
Set the tensor name.
Definition: NvInfer.h:210
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:393
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:502
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:269
bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:385
void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:375
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:479
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:413
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:304
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:312
bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the batch.
Definition: NvInfer.h:350
void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the batch.
Definition: NvInfer.h:334
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:281
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:403
void setDimensions(Dims dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:241
const char * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:222
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:254
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:445
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:7817
nvinfer1::IHostMemory * serialize() const noexcept
Serialize a timing cache to IHostMemory object.
Definition: NvInfer.h:7830
bool combine(const ITimingCache &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:7854
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:7864
Layer that represents a TopK reduction.
Definition: NvInfer.h:4280
void setK(int32_t k) noexcept
Set the k value for the layer.
Definition: NvInfer.h:4309
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:4329
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:4297
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:4287
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:4319
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:4339
Definition: NvInfer.h:5253
Layer that represents an unary operation.
Definition: NvInfer.h:3600
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:3607
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:3617
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:157
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:8805
The TensorRT API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:1275
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4634
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:106
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:2118
@ kUNIFORM
Identical coefficients across all elements of the tensor.
@ kCHANNEL
Per-channel coefficients.
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:7707
constexpr int32_t EnumMax< RNNDirection >() noexcept
Maximum number of elements in RNNDirection enum.
Definition: NvInfer.h:3184
constexpr int32_t EnumMax< BuilderFlag >() noexcept
Maximum number of builder flags in BuilderFlag enum.
Definition: NvInfer.h:7801
constexpr int32_t EnumMax< LayerType >() noexcept
Maximum number of elements in LayerType enum.
Definition: NvInfer.h:136
constexpr int32_t EnumMax< RNNGateType >() noexcept
Maximum number of elements in RNNGateType enum.
Definition: NvInfer.h:3236
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Maximum number of elements in CalibrationAlgoType enum.
Definition: NvInfer.h:7270
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:3559
@ kCOSH
Hyperbolic cosine.
@ kACOSH
Inverse hyperbolic cosine.
@ kERF
Gauss error function.
@ kACOS
Inverse cosine.
@ kABS
Absolute value.
@ kSINH
Hyperbolic sine.
@ kROUND
Round to nearest even for float datatype.
@ kATANH
Inverse hyperbolic tangent.
@ kASINH
Inverse hyperbolic sine.
@ kSIGN
Sign, If input > 0, output 1; if input < 0, output -1; if input == 0, output 0.
@ kEXP
Exponentiation.
@ kATAN
Inverse tangent.
constexpr int32_t EnumMax< ReduceOperation >() noexcept
Maximum number of elements in ReduceOperation enum.
Definition: NvInfer.h:3656
constexpr int32_t EnumMax< TripLimit >() noexcept
Maximum number of elements in TripLimit enum.
Definition: NvInfer.h:4979
constexpr int32_t EnumMax< RNNInputMode >() noexcept
Maximum number of elements in RNNInputMode enum.
Definition: NvInfer.h:3212
RNNInputMode
Enumerates the RNN input modes that may occur with an RNN layer.
Definition: NvInfer.h:3205
@ kSKIP
No operation is performed on the first recurrent layer.
@ kLINEAR
Perform the normal matrix multiplication in the first recurrent layer.
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:155
@ kSELU
Selu activation: x>0 ? beta * x : beta * (alpha*exp(x) - alpha)
@ kTANH
TanH activation.
@ kSCALED_TANH
Scaled tanh activation: alpha*tanh(beta*x)
@ kRELU
Rectified linear activation.
@ kELU
Elu activation: x>=0 ? x : alpha * (exp(x) - 1).
@ kLEAKY_RELU
LeakyRelu activation: x>=0 ? x : alpha * x.
@ kSOFTSIGN
Softsign activation: x / (1+|x|)
@ kHARD_SIGMOID
Hard sigmoid activation: max(0, min(1, alpha*x+beta))
@ kTHRESHOLDED_RELU
Thresholded ReLU activation: x>alpha ? x : 0.
@ kSIGMOID
Sigmoid activation.
@ kCLIP
Clip activation: max(alpha, min(beta, x))
@ kSOFTPLUS
Parametric softplus activation: alpha*log(exp(beta*x)+1)
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:5458
@ kLINSPACE
Generate evenly spaced numbers over a specified interval.
@ kRANDOM_UNIFORM
Generate a tensor with random values drawn from a uniform distribution.
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4660
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3225
@ kUPDATE
Update gate (z).
@ kHIDDEN
Hidden gate (h).
@ kFORGET
Forget gate (f).
@ kOUTPUT
Output gate (o).
@ kRESET
Reset gate (r).
@ kINPUT
Input gate (i).
@ kCELL
Cell gate (c).
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:977
@ kSAME_LOWER
Use SAME padding, with prePadding >= postPadding.
@ kEXPLICIT_ROUND_DOWN
Use explicit padding, rounding output size down.
@ kCAFFE_ROUND_DOWN
Use CAFFE padding, rounding output size down, uses prePadding value.
@ kEXPLICIT_ROUND_UP
Use explicit padding, rounding output size up.
@ kCAFFE_ROUND_UP
Use CAFFE padding, rounding output size up, uses prePadding value.
@ kSAME_UPPER
Use SAME padding, with prePadding <= postPadding.
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4971
@ kWHILE
Tensor is a scalar of type kBOOL. Loop terminates when value is false.
@ kCOUNT
Tensor is scalar of type kINT32 that contains the trip count.
uint32_t NetworkDefinitionCreationFlags
Represents one or more NetworkDefinitionCreationFlag flags using binary OR operations....
Definition: NvInfer.h:8479
constexpr int32_t EnumMax< GatherMode >() noexcept
Maximum number of elements in GatherMode enum.
Definition: NvInfer.h:2908
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:151
uint32_t BuilderFlags
Represents one or more QuantizationFlag values using binary OR operations, e.g., 1U << BuilderFlag::k...
Definition: NvInfer.h:7737
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:633
constexpr int32_t EnumMax< ScaleMode >() noexcept
Maximum number of elements in ScaleMode enum.
Definition: NvInfer.h:2126
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:7261
LayerType
The type values of layer classes.
Definition: NvInfer.h:90
@ kRAGGED_SOFTMAX
Ragged softmax layer.
@ kDECONVOLUTION
Deconvolution layer.
@ kREDUCE
Reduce layer.
@ kASSERTION
Assertion layer.
@ kTOPK
TopK layer.
@ kRESIZE
Resize Layer.
@ kPADDING
Padding layer.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition layer.
@ kCONDITIONAL_INPUT
Conditional Input layer.
@ kIDENTITY
Identity layer.
@ kQUANTIZE
Quantize layer.
@ kSCATTER
Scatter layer.
@ kCONVOLUTION
Convolution layer.
@ kPARAMETRIC_RELU
Parametric ReLU layer.
@ kCONCATENATION
Concatenation layer.
@ kSLICE
Slice layer.
@ kEINSUM
Einsum layer.
@ kSOFTMAX
SoftMax layer.
@ kSHAPE
Shape layer.
@ kFULLY_CONNECTED
Fully connected layer.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kGATHER
Gather layer.
@ kUNARY
UnaryOp operation Layer.
@ kACTIVATION
Activation layer.
@ kELEMENTWISE
Elementwise layer.
@ kSELECT
Select layer.
@ kPLUGIN_V2
PluginV2 layer.
@ kLOOP_OUTPUT
Loop output layer.
@ kCONDITIONAL_OUTPUT
Conditional Output layer.
@ kCONSTANT
Constant layer.
@ kRNN_V2
RNNv2 layer.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
SliceMode
Controls how ISliceLayer handles out of bounds coordinates.
Definition: NvInfer.h:4047
@ kCLAMP
Out of bounds indices are clamped to bounds.
@ kWRAP
Coordinates wrap around periodically.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Maximum number of quantization flags in QuantizationFlag enum.
Definition: NvInfer.h:7726
GatherMode
Control form of IGatherLayer.
Definition: NvInfer.h:2900
@ kDEFAULT
Similar to ONNX Gather.
@ kELEMENT
Similar to ONNX GatherElements.
@ kND
Similar to ONNX GatherND.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:147
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1287
ResizeMode
Enumerates various modes of resize in the resize layer. Resize mode set using setResizeMode().
Definition: NvInfer.h:4561
@ kNEAREST
ND (0 < N <= 8) nearest neighbor resizing.
constexpr int32_t EnumMax< SliceMode >() noexcept
Maximum number of elements in SliceMode enum.
Definition: NvInfer.h:4059
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:8491
@ kEXPLICIT_BATCH
Mark the network to be an explicit batch network.
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2814
@ kSUB
Substract the second element from the first.
@ kSUM
Sum of the two elements.
@ kPROD
Product of the two elements.
@ kFLOOR_DIV
Floor division of the first element by the second.
@ kEQUAL
Check if two elements are equal.
@ kAND
Logical AND of two elements.
@ kOR
Logical OR of two elements.
@ kMIN
Minimum of the two elements.
@ kPOW
The first element to the power of the second element.
@ kLESS
Check if element in first tensor is less than corresponding element in second tensor.
@ kGREATER
Check if element in first tensor is greater than corresponding element in second tensor.
@ kXOR
Logical XOR of two elements.
@ kDIV
Divide the first element by the second.
QuantizationFlag
List of valid flags for quantizing the network to int8.
Definition: NvInfer.h:7717
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:3177
@ kBIDIRECTION
Network iterates from first to last and vice versa and outputs concatenated.
@ kUNIDIRECTION
Network iterations from first input to last input.
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:7747
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kFP16
Enable FP16 layer selection, with FP32 fallback.
@ kINT8
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
@ kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
@ kREFIT
Enable building a refittable engine.
@ kOBEY_PRECISION_CONSTRAINTS
Require that layers execute in specified precisions. Build fails otherwise.
@ kREJECT_EMPTY_ALGORITHMS
Fail if IAlgorithmSelector::selectAlgorithms returns an empty set of algorithms.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Maximum number of elements in TopKOperation enum.
Definition: NvInfer.h:4267
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:221
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:4260
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3646
constexpr int32_t EnumMax< LoopOutput >() noexcept
Maximum number of elements in LoopOutput enum.
Definition: NvInfer.h:4964
RNNOperation
Enumerates the RNN operations that may be performed by an RNN layer.
Definition: NvInfer.h:3155
@ kGRU
Three-gate network consisting of Gated Recurrent Units.
@ kLSTM
Four-gate LSTM network w/o peephole connections.
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Maximum number of elements in NetworkDefinitionCreationFlag enum.
Definition: NvInfer.h:8515
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5896
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:4356
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:4584
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Maximum number of elements in UnaryOperation enum.
Definition: NvInfer.h:3587
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4951
@ kLAST_VALUE
Output value is value of tensor for last iteration.
@ kCONCATENATE
Output value is concatenation of values of tensor for each iteration, in forward order.
@ kREVERSE
Output value is concatenation of values of tensor for each iteration, in reverse order.
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Maximum number of elements in MatrixOperation enum.
Definition: NvInfer.h:4379
constexpr int32_t EnumMax< RNNOperation >() noexcept
Maximum number of elements in RNNOperation enum.
Definition: NvInfer.h:3164
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1652
constexpr int32_t EnumMax< FillOperation >() noexcept
Maximum number of elements in FillOperation enum.
Definition: NvInfer.h:5465
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:247
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1058
constexpr int32_t EnumMax< ScatterMode >() noexcept
Maximum number of elements in ScatterMode enum.
Definition: NvInfer.h:5903
Definition: NvInfer.h:3859
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:136