TensorRT 8.6.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4 *
5 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6 * property and proprietary rights in and to this material, related
7 * documentation and any modifications thereto. Any use, reproduction,
8 * disclosure or distribution of this material and related documentation
9 * without an express license agreement from NVIDIA CORPORATION or
10 * its affiliates is strictly prohibited.
11 */
12
13#ifndef NV_INFER_H
14#define NV_INFER_H
15
16#include "NvInferLegacyDims.h"
17#include "NvInferRuntime.h"
18
27//
30
36
42namespace nvinfer1
43{
44
52enum class LayerType : int32_t
53{
54 kCONVOLUTION = 0,
56 kACTIVATION = 2,
57 kPOOLING = 3,
58 kLRN = 4,
59 kSCALE = 5,
60 kSOFTMAX = 6,
61 kDECONVOLUTION = 7,
62 kCONCATENATION = 8,
63 kELEMENTWISE = 9,
64 kPLUGIN = 10,
65 kUNARY = 11,
66 kPADDING = 12,
67 kSHUFFLE = 13,
68 kREDUCE = 14,
69 kTOPK = 15,
70 kGATHER = 16,
71 kMATRIX_MULTIPLY = 17,
72 kRAGGED_SOFTMAX = 18,
73 kCONSTANT = 19,
74 kRNN_V2 = 20,
75 kIDENTITY = 21,
76 kPLUGIN_V2 = 22,
77 kSLICE = 23,
78 kSHAPE = 24,
79 kPARAMETRIC_RELU = 25,
80 kRESIZE = 26,
81 kTRIP_LIMIT = 27,
82 kRECURRENCE = 28,
83 kITERATOR = 29,
84 kLOOP_OUTPUT = 30,
85 kSELECT = 31,
86 kFILL = 32,
87 kQUANTIZE = 33,
88 kDEQUANTIZE = 34,
89 kCONDITION = 35,
92 kSCATTER = 38,
93 kEINSUM = 39,
94 kASSERTION = 40,
95 kONE_HOT = 41,
96 kNON_ZERO = 42,
97 kGRID_SAMPLE = 43,
98 kNMS = 44,
100 kNORMALIZATION = 46,
101 kCAST = 47,
102};
103
109template <>
110constexpr inline int32_t EnumMax<LayerType>() noexcept
111{
112 return 48;
113}
114
121using TensorFormats = uint32_t;
122
128enum class ActivationType : int32_t
129{
130 kRELU = 0,
131 kSIGMOID = 1,
132 kTANH = 2,
133 kLEAKY_RELU = 3,
134 kELU = 4,
135 kSELU = 5,
136 kSOFTSIGN = 6,
137 kSOFTPLUS = 7,
138 kCLIP = 8,
139 kHARD_SIGMOID = 9,
140 kSCALED_TANH = 10,
142};
143
144namespace impl
145{
151template <>
153{
154 static constexpr int32_t kVALUE = 12;
155};
156} // namespace impl
157
174class ITensor : public INoCopy
175{
176public:
191 void setName(char const* name) noexcept
192 {
193 mImpl->setName(name);
194 }
195
203 char const* getName() const noexcept
204 {
205 return mImpl->getName();
206 }
207
222 void setDimensions(Dims dimensions) noexcept
223 {
224 mImpl->setDimensions(dimensions);
225 }
226
235 Dims getDimensions() const noexcept
236 {
237 return mImpl->getDimensions();
238 }
239
250 void setType(DataType type) noexcept
251 {
252 mImpl->setType(type);
253 }
254
262 DataType getType() const noexcept
263 {
264 return mImpl->getType();
265 }
266
277 bool setDynamicRange(float min, float max) noexcept
278 {
279 return mImpl->setDynamicRange(min, max);
280 }
281
285 bool isNetworkInput() const noexcept
286 {
287 return mImpl->isNetworkInput();
288 }
289
293 bool isNetworkOutput() const noexcept
294 {
295 return mImpl->isNetworkOutput();
296 }
297
315 void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
316 {
317 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
318 }
319
331 bool getBroadcastAcrossBatch() const noexcept
332 {
333 return mImpl->getBroadcastAcrossBatch();
334 }
335
342 {
343 return mImpl->getLocation();
344 }
345
356 void setLocation(TensorLocation location) noexcept
357 {
358 mImpl->setLocation(location);
359 }
360
366 bool dynamicRangeIsSet() const noexcept
367 {
368 return mImpl->dynamicRangeIsSet();
369 }
370
374 void resetDynamicRange() noexcept
375 {
376 mImpl->resetDynamicRange();
377 }
378
384 float getDynamicRangeMin() const noexcept
385 {
386 return mImpl->getDynamicRangeMin();
387 }
388
394 float getDynamicRangeMax() const noexcept
395 {
396 return mImpl->getDynamicRangeMax();
397 }
398
413 void setAllowedFormats(TensorFormats formats) noexcept
414 {
415 mImpl->setAllowedFormats(formats);
416 }
417
427 {
428 return mImpl->getAllowedFormats();
429 }
430
461 bool isShapeTensor() const noexcept
462 {
463 return mImpl->isShapeTensor();
464 }
465
484 bool isExecutionTensor() const noexcept
485 {
486 return mImpl->isExecutionTensor();
487 }
488
510 void setDimensionName(int32_t index, char const* name) noexcept
511 {
512 mImpl->setDimensionName(index, name);
513 }
514
525 char const* getDimensionName(int32_t index) const noexcept
526 {
527 return mImpl->getDimensionName(index);
528 }
529
530protected:
531 apiv::VTensor* mImpl;
532 virtual ~ITensor() noexcept = default;
533};
534
542class ILayer : public INoCopy
543{
544public:
550 LayerType getType() const noexcept
551 {
552 return mLayer->getType();
553 }
554
564 void setName(char const* name) noexcept
565 {
566 mLayer->setName(name);
567 }
568
574 char const* getName() const noexcept
575 {
576 return mLayer->getName();
577 }
578
582 int32_t getNbInputs() const noexcept
583 {
584 return mLayer->getNbInputs();
585 }
586
595 ITensor* getInput(int32_t index) const noexcept
596 {
597 return mLayer->getInput(index);
598 }
599
603 int32_t getNbOutputs() const noexcept
604 {
605 return mLayer->getNbOutputs();
606 }
607
614 ITensor* getOutput(int32_t index) const noexcept
615 {
616 return mLayer->getOutput(index);
617 }
618
631 void setInput(int32_t index, ITensor& tensor) noexcept
632 {
633 return mLayer->setInput(index, tensor);
634 }
635
659 void setPrecision(DataType dataType) noexcept
660 {
661 mLayer->setPrecision(dataType);
662 }
663
671 DataType getPrecision() const noexcept
672 {
673 return mLayer->getPrecision();
674 }
675
683 bool precisionIsSet() const noexcept
684 {
685 return mLayer->precisionIsSet();
686 }
687
693 void resetPrecision() noexcept
694 {
695 mLayer->resetPrecision();
696 }
697
731 void setOutputType(int32_t index, DataType dataType) noexcept
732 {
733 mLayer->setOutputType(index, dataType);
734 }
735
745 DataType getOutputType(int32_t index) const noexcept
746 {
747 return mLayer->getOutputType(index);
748 }
749
758 bool outputTypeIsSet(int32_t index) const noexcept
759 {
760 return mLayer->outputTypeIsSet(index);
761 }
762
770 void resetOutputType(int32_t index) noexcept
771 {
772 return mLayer->resetOutputType(index);
773 }
774
788 void setMetadata(char const* metadata) noexcept
789 {
790 mLayer->setMetadata(metadata);
791 }
792
801 char const* getMetadata() const noexcept
802 {
803 return mLayer->getMetadata();
804 }
805
806protected:
807 virtual ~ILayer() noexcept = default;
808 apiv::VLayer* mLayer;
809};
810
1033enum class PaddingMode : int32_t
1034{
1036 kEXPLICIT_ROUND_UP = 1,
1037 kSAME_UPPER = 2,
1038 kSAME_LOWER = 3,
1039 kCAFFE_ROUND_DOWN = 4,
1040 kCAFFE_ROUND_UP = 5
1041};
1042
1043namespace impl
1044{
1050template <>
1052{
1053 static constexpr int32_t kVALUE = 6;
1054};
1055} // namespace impl
1056
1070{
1071public:
1081 TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
1082 {
1083 mImpl->setKernelSize(kernelSize);
1084 }
1085
1094 {
1095 return mImpl->getKernelSize();
1096 }
1097
1105 void setNbOutputMaps(int32_t nbOutputMaps) noexcept
1106 {
1107 mImpl->setNbOutputMaps(nbOutputMaps);
1108 }
1109
1115 int32_t getNbOutputMaps() const noexcept
1116 {
1117 return mImpl->getNbOutputMaps();
1118 }
1119
1131 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
1132 {
1133 mImpl->setStride(stride);
1134 }
1135
1142 {
1143 return mImpl->getStride();
1144 }
1145
1161 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
1162 {
1163 return mImpl->setPadding(padding);
1164 }
1165
1174 {
1175 return mImpl->getPadding();
1176 }
1177
1193 void setNbGroups(int32_t nbGroups) noexcept
1194 {
1195 mImpl->setNbGroups(nbGroups);
1196 }
1197
1203 int32_t getNbGroups() const noexcept
1204 {
1205 return mImpl->getNbGroups();
1206 }
1207
1217 void setKernelWeights(Weights weights) noexcept
1218 {
1219 mImpl->setKernelWeights(weights);
1220 }
1221
1227 Weights getKernelWeights() const noexcept
1228 {
1229 return mImpl->getKernelWeights();
1230 }
1231
1242 void setBiasWeights(Weights weights) noexcept
1243 {
1244 mImpl->setBiasWeights(weights);
1245 }
1246
1252 Weights getBiasWeights() const noexcept
1253 {
1254 return mImpl->getBiasWeights();
1255 }
1256
1268 TRT_DEPRECATED void setDilation(DimsHW dilation) noexcept
1269 {
1270 return mImpl->setDilation(dilation);
1271 }
1272
1281 {
1282 return mImpl->getDilation();
1283 }
1284
1297 void setPrePadding(Dims padding) noexcept
1298 {
1299 mImpl->setPrePadding(padding);
1300 }
1301
1307 Dims getPrePadding() const noexcept
1308 {
1309 return mImpl->getPrePadding();
1310 }
1311
1324 void setPostPadding(Dims padding) noexcept
1325 {
1326 mImpl->setPostPadding(padding);
1327 }
1328
1334 Dims getPostPadding() const noexcept
1335 {
1336 return mImpl->getPostPadding();
1337 }
1338
1348 void setPaddingMode(PaddingMode paddingMode) noexcept
1349 {
1350 mImpl->setPaddingMode(paddingMode);
1351 }
1352
1361 {
1362 return mImpl->getPaddingMode();
1363 }
1364
1373 void setKernelSizeNd(Dims kernelSize) noexcept
1374 {
1375 mImpl->setKernelSizeNd(kernelSize);
1376 }
1377
1383 Dims getKernelSizeNd() const noexcept
1384 {
1385 return mImpl->getKernelSizeNd();
1386 }
1387
1398 void setStrideNd(Dims stride) noexcept
1399 {
1400 mImpl->setStrideNd(stride);
1401 }
1402
1408 Dims getStrideNd() const noexcept
1409 {
1410 return mImpl->getStrideNd();
1411 }
1412
1426 void setPaddingNd(Dims padding) noexcept
1427 {
1428 mImpl->setPaddingNd(padding);
1429 }
1430
1438 Dims getPaddingNd() const noexcept
1439 {
1440 return mImpl->getPaddingNd();
1441 }
1442
1452 void setDilationNd(Dims dilation) noexcept
1453 {
1454 mImpl->setDilationNd(dilation);
1455 }
1456
1462 Dims getDilationNd() const noexcept
1463 {
1464 return mImpl->getDilationNd();
1465 }
1466
1480 using ILayer::setInput;
1481
1482protected:
1483 virtual ~IConvolutionLayer() noexcept = default;
1484 apiv::VConvolutionLayer* mImpl;
1485};
1486
1519{
1520public:
1528 void setNbOutputChannels(int32_t nbOutputs) noexcept
1529 {
1530 mImpl->setNbOutputChannels(nbOutputs);
1531 }
1532
1538 int32_t getNbOutputChannels() const noexcept
1539 {
1540 return mImpl->getNbOutputChannels();
1541 }
1542
1548 void setKernelWeights(Weights weights) noexcept
1549 {
1550 mImpl->setKernelWeights(weights);
1551 }
1552
1558 Weights getKernelWeights() const noexcept
1559 {
1560 return mImpl->getKernelWeights();
1561 }
1562
1570 void setBiasWeights(Weights weights) noexcept
1571 {
1572 mImpl->setBiasWeights(weights);
1573 }
1574
1580 Weights getBiasWeights() const noexcept
1581 {
1582 return mImpl->getBiasWeights();
1583 }
1584
1606 using ILayer::setInput;
1607
1608protected:
1609 virtual ~IFullyConnectedLayer() noexcept = default;
1610 apiv::VFullyConnectedLayer* mImpl;
1611};
1612
1627{
1628public:
1637 {
1638 mImpl->setActivationType(type);
1639 }
1640
1647 {
1648 return mImpl->getActivationType();
1649 }
1650
1661 void setAlpha(float alpha) noexcept
1662 {
1663 mImpl->setAlpha(alpha);
1664 }
1665
1675 void setBeta(float beta) noexcept
1676 {
1677 mImpl->setBeta(beta);
1678 }
1679
1684 float getAlpha() const noexcept
1685 {
1686 return mImpl->getAlpha();
1687 }
1688
1693 float getBeta() const noexcept
1694 {
1695 return mImpl->getBeta();
1696 }
1697
1698protected:
1699 virtual ~IActivationLayer() noexcept = default;
1700 apiv::VActivationLayer* mImpl;
1701};
1702
1708enum class PoolingType : int32_t
1709{
1710 kMAX = 0, // Maximum over elements
1711 kAVERAGE = 1, // Average over elements. If the tensor is padded, the count includes the padding
1712 kMAX_AVERAGE_BLEND = 2 // Blending between max and average pooling: (1-blendFactor)*maxPool + blendFactor*avgPool
1713};
1714
1715namespace impl
1716{
1722template <>
1724{
1725 static constexpr int32_t kVALUE = 3;
1726};
1727} // namespace impl
1728
1740class IPoolingLayer : public ILayer
1741{
1742public:
1750 void setPoolingType(PoolingType type) noexcept
1751 {
1752 mImpl->setPoolingType(type);
1753 }
1754
1761 {
1762 return mImpl->getPoolingType();
1763 }
1764
1774 TRT_DEPRECATED void setWindowSize(DimsHW windowSize) noexcept
1775 {
1776 mImpl->setWindowSize(windowSize);
1777 }
1778
1787 {
1788 return mImpl->getWindowSize();
1789 }
1790
1802 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
1803 {
1804 mImpl->setStride(stride);
1805 }
1806
1815 {
1816 return mImpl->getStride();
1817 }
1818
1830 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
1831 {
1832 mImpl->setPadding(padding);
1833 }
1834
1845 {
1846 return mImpl->getPadding();
1847 }
1848
1859 void setBlendFactor(float blendFactor) noexcept
1860 {
1861 mImpl->setBlendFactor(blendFactor);
1862 }
1863
1872 float getBlendFactor() const noexcept
1873 {
1874 return mImpl->getBlendFactor();
1875 }
1876
1889 void setAverageCountExcludesPadding(bool exclusive) noexcept
1890 {
1891 mImpl->setAverageCountExcludesPadding(exclusive);
1892 }
1893
1901 {
1902 return mImpl->getAverageCountExcludesPadding();
1903 }
1904
1918 void setPrePadding(Dims padding) noexcept
1919 {
1920 mImpl->setPrePadding(padding);
1921 }
1922
1928 Dims getPrePadding() const noexcept
1929 {
1930 return mImpl->getPrePadding();
1931 }
1932
1946 void setPostPadding(Dims padding) noexcept
1947 {
1948 mImpl->setPostPadding(padding);
1949 }
1950
1956 Dims getPostPadding() const noexcept
1957 {
1958 return mImpl->getPostPadding();
1959 }
1960
1969 void setPaddingMode(PaddingMode paddingMode) noexcept
1970 {
1971 mImpl->setPaddingMode(paddingMode);
1972 }
1973
1981 {
1982 return mImpl->getPaddingMode();
1983 }
1984
1993 void setWindowSizeNd(Dims windowSize) noexcept
1994 {
1995 mImpl->setWindowSizeNd(windowSize);
1996 }
1997
2003 Dims getWindowSizeNd() const noexcept
2004 {
2005 return mImpl->getWindowSizeNd();
2006 }
2007
2018 void setStrideNd(Dims stride) noexcept
2019 {
2020 mImpl->setStrideNd(stride);
2021 }
2022
2028 Dims getStrideNd() const noexcept
2029 {
2030 return mImpl->getStrideNd();
2031 }
2032
2047 void setPaddingNd(Dims padding) noexcept
2048 {
2049 mImpl->setPaddingNd(padding);
2050 }
2051
2059 Dims getPaddingNd() const noexcept
2060 {
2061 return mImpl->getPaddingNd();
2062 }
2063
2064protected:
2065 virtual ~IPoolingLayer() noexcept = default;
2066 apiv::VPoolingLayer* mImpl;
2067};
2068
2078class ILRNLayer : public ILayer
2079{
2080public:
2090 void setWindowSize(int32_t windowSize) noexcept
2091 {
2092 mImpl->setWindowSize(windowSize);
2093 }
2094
2100 int32_t getWindowSize() const noexcept
2101 {
2102 return mImpl->getWindowSize();
2103 }
2104
2111 void setAlpha(float alpha) noexcept
2112 {
2113 mImpl->setAlpha(alpha);
2114 }
2115
2121 float getAlpha() const noexcept
2122 {
2123 return mImpl->getAlpha();
2124 }
2125
2132 void setBeta(float beta) noexcept
2133 {
2134 mImpl->setBeta(beta);
2135 }
2136
2142 float getBeta() const noexcept
2143 {
2144 return mImpl->getBeta();
2145 }
2146
2153 void setK(float k) noexcept
2154 {
2155 mImpl->setK(k);
2156 }
2157
2163 float getK() const noexcept
2164 {
2165 return mImpl->getK();
2166 }
2167
2168protected:
2169 virtual ~ILRNLayer() noexcept = default;
2170 apiv::VLRNLayer* mImpl;
2171};
2172
2178enum class ScaleMode : int32_t
2179{
2180 kUNIFORM = 0,
2181 kCHANNEL = 1,
2182 kELEMENTWISE = 2
2183};
2184
2190template <>
2191constexpr inline int32_t EnumMax<ScaleMode>() noexcept
2192{
2193 return 3;
2194}
2195
2222class IScaleLayer : public ILayer
2223{
2224public:
2230 void setMode(ScaleMode mode) noexcept
2231 {
2232 mImpl->setMode(mode);
2233 }
2234
2240 ScaleMode getMode() const noexcept
2241 {
2242 return mImpl->getMode();
2243 }
2244
2250 void setShift(Weights shift) noexcept
2251 {
2252 mImpl->setShift(shift);
2253 }
2254
2260 Weights getShift() const noexcept
2261 {
2262 return mImpl->getShift();
2263 }
2264
2270 void setScale(Weights scale) noexcept
2271 {
2272 mImpl->setScale(scale);
2273 }
2274
2280 Weights getScale() const noexcept
2281 {
2282 return mImpl->getScale();
2283 }
2284
2290 void setPower(Weights power) noexcept
2291 {
2292 mImpl->setPower(power);
2293 }
2294
2300 Weights getPower() const noexcept
2301 {
2302 return mImpl->getPower();
2303 }
2304
2315 int32_t getChannelAxis() const noexcept
2316 {
2317 return mImpl->getChannelAxis();
2318 }
2319
2336 void setChannelAxis(int32_t channelAxis) noexcept
2337 {
2338 mImpl->setChannelAxis(channelAxis);
2339 }
2340
2341protected:
2342 virtual ~IScaleLayer() noexcept = default;
2343 apiv::VScaleLayer* mImpl;
2344};
2345
2367class ISoftMaxLayer : public ILayer
2368{
2369public:
2400 void setAxes(uint32_t axes) noexcept
2401 {
2402 mImpl->setAxes(axes);
2403 }
2404
2410 uint32_t getAxes() const noexcept
2411 {
2412 return mImpl->getAxes();
2413 }
2414
2415protected:
2416 virtual ~ISoftMaxLayer() noexcept = default;
2417 apiv::VSoftMaxLayer* mImpl;
2418};
2419
2433{
2434public:
2447 void setAxis(int32_t axis) noexcept
2448 {
2449 mImpl->setAxis(axis);
2450 }
2451
2457 int32_t getAxis() const noexcept
2458 {
2459 return mImpl->getAxis();
2460 }
2461
2462protected:
2463 virtual ~IConcatenationLayer() noexcept = default;
2464 apiv::VConcatenationLayer* mImpl;
2465};
2466
2475{
2476public:
2488 TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
2489 {
2490 mImpl->setKernelSize(kernelSize);
2491 }
2492
2501 {
2502 return mImpl->getKernelSize();
2503 }
2504
2512 void setNbOutputMaps(int32_t nbOutputMaps) noexcept
2513 {
2514 mImpl->setNbOutputMaps(nbOutputMaps);
2515 }
2516
2522 int32_t getNbOutputMaps() const noexcept
2523 {
2524 return mImpl->getNbOutputMaps();
2525 }
2526
2538 TRT_DEPRECATED void setStride(DimsHW stride) noexcept
2539 {
2540 mImpl->setStride(stride);
2541 }
2542
2551 {
2552 return mImpl->getStride();
2553 }
2554
2570 TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
2571 {
2572 mImpl->setPadding(padding);
2573 }
2574
2585 {
2586 return mImpl->getPadding();
2587 }
2588
2604 void setNbGroups(int32_t nbGroups) noexcept
2605 {
2606 mImpl->setNbGroups(nbGroups);
2607 }
2608
2614 int32_t getNbGroups() const noexcept
2615 {
2616 return mImpl->getNbGroups();
2617 }
2618
2628 void setKernelWeights(Weights weights) noexcept
2629 {
2630 mImpl->setKernelWeights(weights);
2631 }
2632
2638 Weights getKernelWeights() const noexcept
2639 {
2640 return mImpl->getKernelWeights();
2641 }
2642
2653 void setBiasWeights(Weights weights) noexcept
2654 {
2655 mImpl->setBiasWeights(weights);
2656 }
2657
2663 Weights getBiasWeights() const noexcept
2664 {
2665 return mImpl->getBiasWeights();
2666 }
2667
2681 void setPrePadding(Dims padding) noexcept
2682 {
2683 mImpl->setPrePadding(padding);
2684 }
2685
2691 Dims getPrePadding() const noexcept
2692 {
2693 return mImpl->getPrePadding();
2694 }
2695
2709 void setPostPadding(Dims padding) noexcept
2710 {
2711 mImpl->setPostPadding(padding);
2712 }
2713
2719 Dims getPostPadding() const noexcept
2720 {
2721 return mImpl->getPostPadding();
2722 }
2723
2733 void setPaddingMode(PaddingMode paddingMode) noexcept
2734 {
2735 mImpl->setPaddingMode(paddingMode);
2736 }
2737
2746 {
2747 return mImpl->getPaddingMode();
2748 }
2749
2760 void setKernelSizeNd(Dims kernelSize) noexcept
2761 {
2762 mImpl->setKernelSizeNd(kernelSize);
2763 }
2764
2770 Dims getKernelSizeNd() const noexcept
2771 {
2772 return mImpl->getKernelSizeNd();
2773 }
2774
2787 void setStrideNd(Dims stride) noexcept
2788 {
2789 mImpl->setStrideNd(stride);
2790 }
2791
2797 Dims getStrideNd() const noexcept
2798 {
2799 return mImpl->getStrideNd();
2800 }
2801
2815 void setPaddingNd(Dims padding) noexcept
2816 {
2817 mImpl->setPaddingNd(padding);
2818 }
2819
2827 Dims getPaddingNd() const noexcept
2828 {
2829 return mImpl->getPaddingNd();
2830 }
2831
2843 using ILayer::setInput;
2844
2851 void setDilationNd(Dims dilation) noexcept
2852 {
2853 mImpl->setDilationNd(dilation);
2854 }
2855
2861 Dims getDilationNd() const noexcept
2862 {
2863 return mImpl->getDilationNd();
2864 }
2865
2866protected:
2867 virtual ~IDeconvolutionLayer() noexcept = default;
2868 apiv::VDeconvolutionLayer* mImpl;
2869};
2870
2884enum class ElementWiseOperation : int32_t
2885{
2886 kSUM = 0,
2887 kPROD = 1,
2888 kMAX = 2,
2889 kMIN = 3,
2890 kSUB = 4,
2891 kDIV = 5,
2892 kPOW = 6,
2893 kFLOOR_DIV = 7,
2894 kAND = 8,
2895 kOR = 9,
2896 kXOR = 10,
2897 kEQUAL = 11,
2898 kGREATER = 12,
2899 kLESS = 13
2900};
2901
2902namespace impl
2903{
2909template <>
2911{
2912 static constexpr int32_t kVALUE = 14;
2913};
2914} // namespace impl
2915
2936{
2937public:
2948 {
2949 return mImpl->setOperation(op);
2950 }
2951
2960 {
2961 return mImpl->getOperation();
2962 }
2963
2964protected:
2965 apiv::VElementWiseLayer* mImpl;
2966 virtual ~IElementWiseLayer() noexcept = default;
2967};
2968
2974enum class GatherMode : int32_t
2975{
2976 kDEFAULT = 0,
2977 kELEMENT = 1,
2978 kND = 2
2979};
2980
2986template <>
2987constexpr inline int32_t EnumMax<GatherMode>() noexcept
2988{
2989 return 3;
2990}
2991
3070class IGatherLayer : public ILayer
3071{
3072public:
3082 void setGatherAxis(int32_t axis) noexcept
3083 {
3084 mImpl->setGatherAxis(axis);
3085 }
3086
3093 int32_t getGatherAxis() const noexcept
3094 {
3095 return mImpl->getGatherAxis();
3096 }
3097
3114 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
3115 {
3116 mImpl->setNbElementWiseDims(elementWiseDims);
3117 }
3118
3124 int32_t getNbElementWiseDims() const noexcept
3125 {
3126 return mImpl->getNbElementWiseDims();
3127 }
3128
3134 void setMode(GatherMode mode) noexcept
3135 {
3136 mImpl->setMode(mode);
3137 }
3138
3144 GatherMode getMode() const noexcept
3145 {
3146 return mImpl->getMode();
3147 }
3148
3149protected:
3150 apiv::VGatherLayer* mImpl;
3151 virtual ~IGatherLayer() noexcept = default;
3152};
3153
3233enum class RNNOperation : int32_t
3234{
3235 kRELU = 0,
3236 kTANH = 1,
3237 kLSTM = 2,
3238 kGRU = 3
3239};
3240
3246template <>
3247constexpr inline int32_t EnumMax<RNNOperation>() noexcept
3248{
3249 return 4;
3250}
3251
3259enum class RNNDirection : int32_t
3260{
3261 kUNIDIRECTION = 0,
3262 kBIDIRECTION = 1
3263};
3264
3270template <>
3271constexpr inline int32_t EnumMax<RNNDirection>() noexcept
3272{
3273 return 2;
3274}
3275
3291enum class RNNInputMode : int32_t
3292{
3293 kLINEAR = 0,
3294 kSKIP = 1
3295};
3296
3302template <>
3303constexpr inline int32_t EnumMax<RNNInputMode>() noexcept
3304{
3305 return 2;
3306}
3307
3315enum class RNNGateType : int32_t
3316{
3317 kINPUT = 0,
3318 kOUTPUT = 1,
3319 kFORGET = 2,
3320 kUPDATE = 3,
3321 kRESET = 4,
3322 kCELL = 5,
3323 kHIDDEN = 6
3324};
3325
3331template <>
3332constexpr inline int32_t EnumMax<RNNGateType>() noexcept
3333{
3334 return 7;
3335}
3336
3350{
3351public:
3352 int32_t getLayerCount() const noexcept
3353 {
3354 return mImpl->getLayerCount();
3355 }
3356 int32_t getHiddenSize() const noexcept
3357 {
3358 return mImpl->getHiddenSize();
3359 }
3360 int32_t getMaxSeqLength() const noexcept
3361 {
3362 return mImpl->getMaxSeqLength();
3363 }
3364 int32_t getDataLength() const noexcept
3365 {
3366 return mImpl->getDataLength();
3367 }
3368
3383 void setSequenceLengths(ITensor& seqLengths) noexcept
3384 {
3385 return mImpl->setSequenceLengths(seqLengths);
3386 }
3387
3395 ITensor* getSequenceLengths() const noexcept
3396 {
3397 return mImpl->getSequenceLengths();
3398 }
3399
3405 void setOperation(RNNOperation op) noexcept
3406 {
3407 mImpl->setOperation(op);
3408 }
3409
3416 {
3417 return mImpl->getOperation();
3418 }
3419
3425 void setInputMode(RNNInputMode op) noexcept
3426 {
3427 mImpl->setInputMode(op);
3428 }
3429
3436 {
3437 return mImpl->getInputMode();
3438 }
3439
3450 void setDirection(RNNDirection op) noexcept
3451 {
3452 mImpl->setDirection(op);
3453 }
3454
3461 {
3462 return mImpl->getDirection();
3463 }
3464
3518 void setWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights weights) noexcept
3519 {
3520 mImpl->setWeightsForGate(layerIndex, gate, isW, weights);
3521 }
3522
3528 Weights getWeightsForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
3529 {
3530 return mImpl->getWeightsForGate(layerIndex, gate, isW);
3531 }
3532
3552 void setBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW, Weights bias) noexcept
3553 {
3554 mImpl->setBiasForGate(layerIndex, gate, isW, bias);
3555 }
3556
3562 Weights getBiasForGate(int32_t layerIndex, RNNGateType gate, bool isW) const noexcept
3563 {
3564 return mImpl->getBiasForGate(layerIndex, gate, isW);
3565 }
3566
3580 void setHiddenState(ITensor& hidden) noexcept
3581 {
3582 mImpl->setHiddenState(hidden);
3583 }
3584
3590 ITensor* getHiddenState() const noexcept
3591 {
3592 return mImpl->getHiddenState();
3593 }
3594
3610 void setCellState(ITensor& cell) noexcept
3611 {
3612 mImpl->setCellState(cell);
3613 }
3614
3620 ITensor* getCellState() const noexcept
3621 {
3622 return mImpl->getCellState();
3623 }
3624
3625protected:
3626 apiv::VRNNv2Layer* mImpl;
3627 virtual ~IRNNv2Layer() noexcept = default;
3628};
3629
3640{
3641public:
3648 {
3649 return mImpl->getPlugin();
3650 }
3651
3652protected:
3653 apiv::VPluginV2Layer* mImpl;
3654 virtual ~IPluginV2Layer() noexcept = default;
3655};
3656
3674enum class UnaryOperation : int32_t
3675{
3676 kEXP = 0,
3677 kLOG = 1,
3678 kSQRT = 2,
3679 kRECIP = 3,
3680 kABS = 4,
3681 kNEG = 5,
3682 kSIN = 6,
3683 kCOS = 7,
3684 kTAN = 8,
3685 kSINH = 9,
3686 kCOSH = 10,
3687 kASIN = 11,
3688 kACOS = 12,
3689 kATAN = 13,
3690 kASINH = 14,
3691 kACOSH = 15,
3692 kATANH = 16,
3693 kCEIL = 17,
3694 kFLOOR = 18,
3695 kERF = 19,
3696 kNOT = 20,
3697 kSIGN = 21,
3698 kROUND = 22,
3699 kISINF = 23,
3700};
3701
3707template <>
3708constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
3709{
3710 return 24;
3711}
3712
3720class IUnaryLayer : public ILayer
3721{
3722public:
3731 {
3732 mImpl->setOperation(op);
3733 }
3734
3741 {
3742 return mImpl->getOperation();
3743 }
3744
3745protected:
3746 apiv::VUnaryLayer* mImpl;
3747 virtual ~IUnaryLayer() noexcept = default;
3748};
3749
3768enum class ReduceOperation : int32_t
3769{
3770 kSUM = 0,
3771 kPROD = 1,
3772 kMAX = 2,
3773 kMIN = 3,
3774 kAVG = 4
3775};
3776
3782template <>
3783constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
3784{
3785 return 5;
3786}
3787
3795class IReduceLayer : public ILayer
3796{
3797public:
3804 {
3805 mImpl->setOperation(op);
3806 }
3807
3814 {
3815 return mImpl->getOperation();
3816 }
3817
3823 void setReduceAxes(uint32_t reduceAxes) noexcept
3824 {
3825 mImpl->setReduceAxes(reduceAxes);
3826 }
3827
3833 uint32_t getReduceAxes() const noexcept
3834 {
3835 return mImpl->getReduceAxes();
3836 }
3837
3843 void setKeepDimensions(bool keepDimensions) noexcept
3844 {
3845 mImpl->setKeepDimensions(keepDimensions);
3846 }
3847
3853 bool getKeepDimensions() const noexcept
3854 {
3855 return mImpl->getKeepDimensions();
3856 }
3857
3858protected:
3859 apiv::VReduceLayer* mImpl;
3860 virtual ~IReduceLayer() noexcept = default;
3861};
3862
3873class IPaddingLayer : public ILayer
3874{
3875public:
3885 TRT_DEPRECATED void setPrePadding(DimsHW padding) noexcept
3886 {
3887 mImpl->setPrePadding(padding);
3888 }
3889
3898 {
3899 return mImpl->getPrePadding();
3900 }
3901
3911 TRT_DEPRECATED void setPostPadding(DimsHW padding) noexcept
3912 {
3913 mImpl->setPostPadding(padding);
3914 }
3915
3924 {
3925 return mImpl->getPostPadding();
3926 }
3927
3937 void setPrePaddingNd(Dims padding) noexcept
3938 {
3939 mImpl->setPrePaddingNd(padding);
3940 }
3941
3949 Dims getPrePaddingNd() const noexcept
3950 {
3951 return mImpl->getPrePaddingNd();
3952 }
3953
3963 void setPostPaddingNd(Dims padding) noexcept
3964 {
3965 mImpl->setPostPaddingNd(padding);
3966 }
3967
3975 Dims getPostPaddingNd() const noexcept
3976 {
3977 return mImpl->getPostPaddingNd();
3978 }
3979
3980protected:
3981 apiv::VPaddingLayer* mImpl;
3982 virtual ~IPaddingLayer() noexcept = default;
3983};
3984
3986{
3993 int32_t order[Dims::MAX_DIMS];
3994};
3995
4008class IShuffleLayer : public ILayer
4009{
4010public:
4020 void setFirstTranspose(Permutation permutation) noexcept
4021 {
4022 mImpl->setFirstTranspose(permutation);
4023 }
4024
4033 {
4034 return mImpl->getFirstTranspose();
4035 }
4036
4057 void setReshapeDimensions(Dims dimensions) noexcept
4058 {
4059 mImpl->setReshapeDimensions(dimensions);
4060 }
4061
4071 {
4072 return mImpl->getReshapeDimensions();
4073 }
4074
4080 //
4103 using ILayer::setInput;
4104
4117 void setSecondTranspose(Permutation permutation) noexcept
4118 {
4119 mImpl->setSecondTranspose(permutation);
4120 }
4121
4130 {
4131 return mImpl->getSecondTranspose();
4132 }
4133
4145 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
4146 {
4147 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
4148 }
4149
4158 bool getZeroIsPlaceholder() const noexcept
4159 {
4160 return mImpl->getZeroIsPlaceholder();
4161 }
4162
4163protected:
4164 apiv::VShuffleLayer* mImpl;
4165 virtual ~IShuffleLayer() noexcept = default;
4166};
4167
4173enum class SampleMode : int32_t
4174{
4175 kSTRICT_BOUNDS = 0,
4177 kWRAP = 1,
4178 kCLAMP = 2,
4179 kFILL = 3,
4180 kREFLECT = 4,
4183};
4184
4187
4193template <>
4194constexpr inline int32_t EnumMax<SampleMode>() noexcept
4195{
4196 return 5;
4197}
4198
4241class ISliceLayer : public ILayer
4242{
4243public:
4253 void setStart(Dims start) noexcept
4254 {
4255 mImpl->setStart(start);
4256 }
4257
4268 Dims getStart() const noexcept
4269 {
4270 return mImpl->getStart();
4271 }
4272
4282 void setSize(Dims size) noexcept
4283 {
4284 return mImpl->setSize(size);
4285 }
4286
4297 Dims getSize() const noexcept
4298 {
4299 return mImpl->getSize();
4300 }
4301
4311 void setStride(Dims stride) noexcept
4312 {
4313 mImpl->setStride(stride);
4314 }
4315
4326 Dims getStride() const noexcept
4327 {
4328 return mImpl->getStride();
4329 }
4330
4336 void setMode(SliceMode mode) noexcept
4337 {
4338 mImpl->setMode(mode);
4339 }
4340
4346 SliceMode getMode() const noexcept
4347 {
4348 return mImpl->getMode();
4349 }
4350
4374 using ILayer::setInput;
4375
4376protected:
4377 apiv::VSliceLayer* mImpl;
4378 virtual ~ISliceLayer() noexcept = default;
4379};
4380
4393class IShapeLayer : public ILayer
4394{
4395protected:
4396 apiv::VShapeLayer* mImpl;
4397 virtual ~IShapeLayer() noexcept = default;
4398};
4399
4405enum class TopKOperation : int32_t
4406{
4407 kMAX = 0,
4408 kMIN = 1,
4409};
4410
4416template <>
4417constexpr inline int32_t EnumMax<TopKOperation>() noexcept
4418{
4419 return 2;
4420}
4421
4433class ITopKLayer : public ILayer
4434{
4435public:
4441 void setOperation(TopKOperation op) noexcept
4442 {
4443 mImpl->setOperation(op);
4444 }
4445
4452 {
4453 return mImpl->getOperation();
4454 }
4455
4465 void setK(int32_t k) noexcept
4466 {
4467 mImpl->setK(k);
4468 }
4469
4479 int32_t getK() const noexcept
4480 {
4481 return mImpl->getK();
4482 }
4483
4489 void setReduceAxes(uint32_t reduceAxes) noexcept
4490 {
4491 mImpl->setReduceAxes(reduceAxes);
4492 }
4493
4499 uint32_t getReduceAxes() const noexcept
4500 {
4501 return mImpl->getReduceAxes();
4502 }
4503
4518 using ILayer::setInput;
4519
4520protected:
4521 apiv::VTopKLayer* mImpl;
4522 virtual ~ITopKLayer() noexcept = default;
4523};
4524
4531enum class MatrixOperation : int32_t
4532{
4536 kNONE,
4537
4539 kTRANSPOSE,
4540
4551 kVECTOR
4552};
4553
4559template <>
4560constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
4561{
4562 return 3;
4563}
4564
4591{
4592public:
4599 void setOperation(int32_t index, MatrixOperation op) noexcept
4600 {
4601 mImpl->setOperation(index, op);
4602 }
4603
4611 MatrixOperation getOperation(int32_t index) const noexcept
4612 {
4613 return mImpl->getOperation(index);
4614 }
4615
4616protected:
4617 apiv::VMatrixMultiplyLayer* mImpl;
4618 virtual ~IMatrixMultiplyLayer() noexcept = default;
4619};
4620
4642class INonZeroLayer : public ILayer
4643{
4644protected:
4645 virtual ~INonZeroLayer() noexcept = default;
4646 apiv::VNonZeroLayer* mImpl;
4647};
4648
4664{
4665protected:
4666 apiv::VRaggedSoftMaxLayer* mImpl;
4667 virtual ~IRaggedSoftMaxLayer() noexcept = default;
4668};
4669
4698{
4699protected:
4700 apiv::VIdentityLayer* mImpl;
4701 virtual ~IIdentityLayer() noexcept = default;
4702};
4703
4710class ICastLayer : public ILayer
4711{
4712public:
4716 void setToType(DataType toType) noexcept
4717 {
4718 mImpl->setToType(toType);
4719 }
4720
4724 DataType getToType() const noexcept
4725 {
4726 return mImpl->getToType();
4727 }
4728
4729protected:
4730 apiv::VCastLayer* mImpl;
4731 virtual ~ICastLayer() noexcept = default;
4732};
4733
4743{
4744public:
4754 void setWeights(Weights weights) noexcept
4755 {
4756 mImpl->setWeights(weights);
4757 }
4758
4764 Weights getWeights() const noexcept
4765 {
4766 return mImpl->getWeights();
4767 }
4768
4776 void setDimensions(Dims dimensions) noexcept
4777 {
4778 mImpl->setDimensions(dimensions);
4779 }
4780
4788 Dims getDimensions() const noexcept
4789 {
4790 return mImpl->getDimensions();
4791 }
4792
4793protected:
4794 apiv::VConstantLayer* mImpl;
4795 virtual ~IConstantLayer() noexcept = default;
4796};
4797
4808{
4809protected:
4810 apiv::VParametricReLULayer* mImpl;
4811 virtual ~IParametricReLULayer() noexcept = default;
4812};
4813
4819enum class InterpolationMode : int32_t
4820{
4821 kNEAREST = 0,
4822 kLINEAR = 1,
4823 kCUBIC = 2
4824};
4825
4828
4829namespace impl
4830{
4836template <>
4838{
4839 static constexpr int32_t kVALUE = 3;
4840};
4841} // namespace impl
4842
4851{
4864 kALIGN_CORNERS = 0,
4865
4872 kASYMMETRIC = 1,
4873
4880 kHALF_PIXEL = 2,
4881};
4882
4883namespace impl
4884{
4890template <>
4892{
4893 static constexpr int32_t kVALUE = 3;
4894};
4895} // namespace impl
4896
4904enum class ResizeSelector : int32_t
4905{
4907 kFORMULA = 0,
4908
4910 kUPPER = 1,
4911};
4912
4913namespace impl
4914{
4920template <>
4922{
4923 static constexpr int32_t kVALUE = 2;
4924};
4925} // namespace impl
4926
4934enum class ResizeRoundMode : int32_t
4935{
4937 kHALF_UP = 0,
4938
4940 kHALF_DOWN = 1,
4941
4943 kFLOOR = 2,
4944
4946 kCEIL = 3,
4947};
4948
4949namespace impl
4950{
4956template <>
4958{
4959 static constexpr int32_t kVALUE = 4;
4960};
4961} // namespace impl
4962
4999class IResizeLayer : public ILayer
5000{
5001public:
5020 void setOutputDimensions(Dims dimensions) noexcept
5021 {
5022 return mImpl->setOutputDimensions(dimensions);
5023 }
5024
5030 Dims getOutputDimensions() const noexcept
5031 {
5032 return mImpl->getOutputDimensions();
5033 }
5034
5060 void setScales(float const* scales, int32_t nbScales) noexcept
5061 {
5062 mImpl->setScales(scales, nbScales);
5063 }
5064
5079 int32_t getScales(int32_t size, float* scales) const noexcept
5080 {
5081 return mImpl->getScales(size, scales);
5082 }
5083
5091 void setResizeMode(ResizeMode resizeMode) noexcept
5092 {
5093 mImpl->setResizeMode(resizeMode);
5094 }
5095
5101 ResizeMode getResizeMode() const noexcept
5102 {
5103 return mImpl->getResizeMode();
5104 }
5105
5117 TRT_DEPRECATED void setAlignCorners(bool alignCorners) noexcept
5118 {
5119 mImpl->setAlignCorners(alignCorners);
5120 }
5121
5129 TRT_DEPRECATED bool getAlignCorners() const noexcept
5130 {
5131 return mImpl->getAlignCorners();
5132 }
5133
5153 using ILayer::setInput;
5154
5165 {
5166 mImpl->setCoordinateTransformation(coordTransform);
5167 }
5168
5175 {
5176 return mImpl->getCoordinateTransformation();
5177 }
5178
5190 {
5191 mImpl->setSelectorForSinglePixel(selector);
5192 }
5193
5200 {
5201 return mImpl->getSelectorForSinglePixel();
5202 }
5203
5214 {
5215 mImpl->setNearestRounding(value);
5216 }
5217
5224 {
5225 return mImpl->getNearestRounding();
5226 }
5227
5245 void setCubicCoeff(float A) noexcept
5246 {
5247 mImpl->setCubicCoeff(A);
5248 }
5249
5255 float getCubicCoeff() const noexcept
5256 {
5257 return mImpl->getCubicCoeff();
5258 }
5259
5268 void setExcludeOutside(bool excludeFlag) noexcept
5269 {
5270 mImpl->setExcludeOutside(excludeFlag);
5271 }
5272
5278 bool getExcludeOutside() const noexcept
5279 {
5280 return mImpl->getExcludeOutside();
5281 }
5282
5283protected:
5284 virtual ~IResizeLayer() noexcept = default;
5285 apiv::VResizeLayer* mImpl;
5286};
5287
5289enum class LoopOutput : int32_t
5290{
5292 kLAST_VALUE = 0,
5293
5295 kCONCATENATE = 1,
5296
5298 kREVERSE = 2
5299};
5300
5306template <>
5307constexpr inline int32_t EnumMax<LoopOutput>() noexcept
5308{
5309 return 3;
5310}
5311
5313enum class TripLimit : int32_t
5314{
5315
5316 kCOUNT = 0,
5317 kWHILE = 1
5318};
5319
5325template <>
5326constexpr inline int32_t EnumMax<TripLimit>() noexcept
5327{
5328 return 2;
5329}
5330
5331class ILoop;
5332
5334{
5335public:
5337 ILoop* getLoop() const noexcept
5338 {
5339 return mBoundary->getLoop();
5340 }
5341
5342protected:
5343 virtual ~ILoopBoundaryLayer() noexcept = default;
5344 apiv::VLoopBoundaryLayer* mBoundary;
5345};
5346
5353{
5354public:
5357 {
5358 return mBoundary->getConditional();
5359 }
5360
5361protected:
5362 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
5363 apiv::VConditionalBoundaryLayer* mBoundary;
5364};
5365
5370{
5371public:
5372protected:
5373 virtual ~IConditionLayer() noexcept = default;
5374 apiv::VConditionLayer* mImpl;
5375};
5376
5383{
5384public:
5385protected:
5386 virtual ~IIfConditionalOutputLayer() noexcept = default;
5387 apiv::VConditionalOutputLayer* mImpl;
5388};
5389
5394{
5395public:
5396protected:
5397 virtual ~IIfConditionalInputLayer() noexcept = default;
5398 apiv::VConditionalInputLayer* mImpl;
5399};
5400
5423{
5424public:
5435 {
5436 return mImpl->setCondition(condition);
5437 }
5438
5450 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
5451 {
5452 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
5453 }
5454
5463 {
5464 return mImpl->addInput(input);
5465 }
5466
5477 void setName(char const* name) noexcept
5478 {
5479 mImpl->setName(name);
5480 }
5481
5487 char const* getName() const noexcept
5488 {
5489 return mImpl->getName();
5490 }
5491
5492protected:
5493 virtual ~IIfConditional() noexcept = default;
5494 apiv::VIfConditional* mImpl;
5495};
5496
5497
5499{
5500public:
5506 //
5519 using ILayer::setInput;
5520
5521protected:
5522 virtual ~IRecurrenceLayer() noexcept = default;
5523 apiv::VRecurrenceLayer* mImpl;
5524};
5525
5544{
5545public:
5546 LoopOutput getLoopOutput() const noexcept
5547 {
5548 return mImpl->getLoopOutput();
5549 }
5550
5563 void setAxis(int32_t axis) noexcept
5564 {
5565 mImpl->setAxis(axis);
5566 }
5567
5569 int32_t getAxis() const noexcept
5570 {
5571 return mImpl->getAxis();
5572 }
5573
5579 //
5594 using ILayer::setInput;
5595
5596protected:
5597 virtual ~ILoopOutputLayer() noexcept = default;
5598 apiv::VLoopOutputLayer* mImpl;
5599};
5600
5602{
5603public:
5604 TripLimit getTripLimit() const noexcept
5605 {
5606 return mImpl->getTripLimit();
5607 }
5608
5609protected:
5610 virtual ~ITripLimitLayer() noexcept = default;
5611 apiv::VTripLimitLayer* mImpl;
5612};
5613
5615{
5616public:
5618 void setAxis(int32_t axis) noexcept
5619 {
5620 mImpl->setAxis(axis);
5621 }
5622
5624 int32_t getAxis() const noexcept
5625 {
5626 return mImpl->getAxis();
5627 }
5628
5634 void setReverse(bool reverse) noexcept
5635 {
5636 mImpl->setReverse(reverse);
5637 }
5638
5640 bool getReverse() const noexcept
5641 {
5642 return mImpl->getReverse();
5643 }
5644
5645protected:
5646 virtual ~IIteratorLayer() noexcept = default;
5647 apiv::VIteratorLayer* mImpl;
5648};
5649
5655class ILoop : public INoCopy
5656{
5657public:
5664 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
5665 {
5666 return mImpl->addRecurrence(initialValue);
5667 }
5668
5686 {
5687 return mImpl->addTripLimit(tensor, limit);
5688 }
5689
5698 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
5699 {
5700 return mImpl->addIterator(tensor, axis, reverse);
5701 }
5702
5710 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
5711 {
5712 return mImpl->addLoopOutput(tensor, outputKind, axis);
5713 }
5714
5725 void setName(char const* name) noexcept
5726 {
5727 mImpl->setName(name);
5728 }
5729
5735 char const* getName() const noexcept
5736 {
5737 return mImpl->getName();
5738 }
5739
5740protected:
5741 virtual ~ILoop() noexcept = default;
5742 apiv::VLoop* mImpl;
5743};
5744
5748class ISelectLayer : public ILayer
5749{
5750protected:
5751 virtual ~ISelectLayer() noexcept = default;
5752 apiv::VSelectLayer* mImpl;
5753};
5754
5770{
5771public:
5780 void setMessage(char const* message) noexcept
5781 {
5782 mImpl->setMessage(message);
5783 }
5784
5790 char const* getMessage() const noexcept
5791 {
5792 return mImpl->getMessage();
5793 }
5794
5795protected:
5796 virtual ~IAssertionLayer() noexcept = default;
5797
5798 apiv::VAssertionLayer* mImpl;
5799};
5800
5808enum class FillOperation : int32_t
5809{
5810 kLINSPACE = 0,
5811 kRANDOM_UNIFORM = 1,
5812 kRANDOM_NORMAL = 2
5813};
5814
5820template <>
5821constexpr inline int32_t EnumMax<FillOperation>() noexcept
5822{
5823 return 3;
5824}
5825
5851class IFillLayer : public ILayer
5852{
5853public:
5862 //
5863 void setDimensions(Dims dimensions) noexcept
5864 {
5865 mImpl->setDimensions(dimensions);
5866 }
5867
5878 Dims getDimensions() const noexcept
5879 {
5880 return mImpl->getDimensions();
5881 }
5882
5888 void setOperation(FillOperation op) noexcept
5889 {
5890 mImpl->setOperation(op);
5891 }
5892
5899 {
5900 return mImpl->getOperation();
5901 }
5902
5916 //
5917 void setAlpha(double alpha) noexcept
5918 {
5919 mImpl->setAlpha(alpha);
5920 }
5921
5932 double getAlpha() const noexcept
5933 {
5934 return mImpl->getAlpha();
5935 }
5936
5951 void setBeta(double beta) noexcept
5952 {
5953 mImpl->setBeta(beta);
5954 }
5955
5966 double getBeta() const noexcept
5967 {
5968 return mImpl->getBeta();
5969 }
5970
6003 using ILayer::setInput;
6004
6005protected:
6006 virtual ~IFillLayer() noexcept = default;
6007 apiv::VFillLayer* mImpl;
6008};
6009
6068{
6069public:
6078 int32_t getAxis() const noexcept
6079 {
6080 return mImpl->getAxis();
6081 }
6089 void setAxis(int32_t axis) noexcept
6090 {
6091 mImpl->setAxis(axis);
6092 }
6093
6094protected:
6095 virtual ~IQuantizeLayer() noexcept = default;
6096 apiv::VQuantizeLayer* mImpl;
6097};
6098
6154{
6155public:
6164 int32_t getAxis() const noexcept
6165 {
6166 return mImpl->getAxis();
6167 }
6175 void setAxis(int32_t axis) noexcept
6176 {
6177 mImpl->setAxis(axis);
6178 }
6179
6180protected:
6181 virtual ~IDequantizeLayer() noexcept = default;
6182 apiv::VDequantizeLayer* mImpl;
6183};
6184
6220class IEinsumLayer : public ILayer
6221{
6222public:
6232 bool setEquation(char const* equation) noexcept
6233 {
6234 return mImpl->setEquation(equation);
6235 }
6236
6242 char const* getEquation() const noexcept
6243 {
6244 return mImpl->getEquation();
6245 }
6246
6247protected:
6248 virtual ~IEinsumLayer() noexcept = default;
6249 apiv::VEinsumLayer* mImpl;
6250};
6251
6257enum class ScatterMode : int32_t
6258{
6259 kELEMENT = 0,
6260 kND = 1,
6261};
6262
6268template <>
6269constexpr inline int32_t EnumMax<ScatterMode>() noexcept
6270{
6271 return 2;
6272}
6273
6330class IScatterLayer : public ILayer
6331{
6332public:
6338 void setMode(ScatterMode mode) noexcept
6339 {
6340 mImpl->setMode(mode);
6341 }
6342
6348 ScatterMode getMode() const noexcept
6349 {
6350 return mImpl->getMode();
6351 }
6352
6358 void setAxis(int32_t axis) noexcept
6359 {
6360 mImpl->setAxis(axis);
6361 }
6362
6366 int32_t getAxis() const noexcept
6367 {
6368 return mImpl->getAxis();
6369 }
6370
6371protected:
6372 apiv::VScatterLayer* mImpl;
6373 virtual ~IScatterLayer() noexcept = default;
6374}; // class IScatterLayer
6375
6403class IOneHotLayer : public ILayer
6404{
6405public:
6411 void setAxis(int32_t axis) noexcept
6412 {
6413 mImpl->setAxis(axis);
6414 }
6415
6419 int32_t getAxis() const noexcept
6420 {
6421 return mImpl->getAxis();
6422 }
6423
6424protected:
6425 apiv::VOneHotLayer* mImpl;
6426};
6427
6439{
6440public:
6447 {
6448 mImpl->setInterpolationMode(mode);
6449 }
6450
6459 {
6460 return mImpl->getInterpolationMode();
6461 }
6462
6468 void setAlignCorners(bool alignCorners) noexcept
6469 {
6470 mImpl->setAlignCorners(alignCorners);
6471 }
6472
6480 bool getAlignCorners() const noexcept
6481 {
6482 return mImpl->getAlignCorners();
6483 }
6484
6492 bool setSampleMode(SampleMode mode) noexcept
6493 {
6494 return mImpl->setSampleMode(mode);
6495 }
6496
6504 SampleMode getSampleMode() const noexcept
6505 {
6506 return mImpl->getSampleMode();
6507 }
6508
6509protected:
6510 apiv::VGridSampleLayer* mImpl;
6511 virtual ~IGridSampleLayer() noexcept = default;
6512}; // class IGridSampleLayer
6513
6519enum class BoundingBoxFormat : int32_t
6520{
6522 kCORNER_PAIRS = 0,
6524 kCENTER_SIZES = 1
6525};
6526
6532template <>
6533constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6534{
6535 return 2;
6536}
6537
6581class INMSLayer : public ILayer
6582{
6583public:
6594 {
6595 mImpl->setBoundingBoxFormat(fmt);
6596 }
6597
6606 {
6607 return mImpl->getBoundingBoxFormat();
6608 }
6609
6619 void setTopKBoxLimit(int32_t limit) noexcept
6620 {
6621 mImpl->setTopKBoxLimit(limit);
6622 }
6623
6629 int32_t getTopKBoxLimit() const noexcept
6630 {
6631 return mImpl->getTopKBoxLimit();
6632 }
6633
6652 using ILayer::setInput;
6653
6654protected:
6655 apiv::VNMSLayer* mImpl;
6656 virtual ~INMSLayer() noexcept = default;
6657}; // class INMSLayer
6658
6671{
6672public:
6681 void setBatchAxis(int32_t batchAxis) noexcept
6682 {
6683 mImpl->setBatchAxis(batchAxis);
6684 }
6685
6691 int32_t getBatchAxis() const noexcept
6692 {
6693 return mImpl->getBatchAxis();
6694 }
6695
6704 void setSequenceAxis(int32_t sequenceAxis) noexcept
6705 {
6706 mImpl->setSequenceAxis(sequenceAxis);
6707 }
6708
6714 int32_t getSequenceAxis() const noexcept
6715 {
6716 return mImpl->getSequenceAxis();
6717 }
6718
6719protected:
6720 apiv::VReverseSequenceLayer* mImpl;
6721 virtual ~IReverseSequenceLayer() noexcept = default;
6722}; // class IReverseSequenceLayer
6723
6740
6742{
6743public:
6750 void setEpsilon(float eps) noexcept
6751 {
6752 return mImpl->setEpsilon(eps);
6753 }
6754
6759 float getEpsilon() const noexcept
6760 {
6761 return mImpl->getEpsilon();
6762 }
6763
6768 void setAxes(uint32_t axesMask) noexcept
6769 {
6770 return mImpl->setAxes(axesMask);
6771 }
6772
6777 uint32_t getAxes() const noexcept
6778 {
6779 return mImpl->getAxes();
6780 }
6781
6797 void setNbGroups(int32_t nbGroups) noexcept
6798 {
6799 return mImpl->setNbGroups(nbGroups);
6800 }
6801
6806 int32_t getNbGroups() const noexcept
6807 {
6808 return mImpl->getNbGroups();
6809 }
6810
6824 void setComputePrecision(DataType type) noexcept
6825 {
6826 return mImpl->setComputePrecision(type);
6827 }
6828
6834 {
6835 return mImpl->getComputePrecision();
6836 }
6837
6838protected:
6839 apiv::VNormalizationLayer* mImpl;
6840 virtual ~INormalizationLayer() noexcept = default;
6841};
6842
6863{
6864public:
6865 virtual ~INetworkDefinition() noexcept = default;
6866
6904 ITensor* addInput(char const* name, DataType type, Dims dimensions) noexcept
6905 {
6906 return mImpl->addInput(name, type, dimensions);
6907 }
6908
6918 void markOutput(ITensor& tensor) noexcept
6919 {
6920 mImpl->markOutput(tensor);
6921 }
6922
6942 ITensor& input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
6943 {
6944 return mImpl->addConvolution(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
6945 }
6946
6965 ITensor& input, int32_t nbOutputs, Weights kernelWeights, Weights biasWeights) noexcept
6966 {
6967 return mImpl->addFullyConnected(input, nbOutputs, kernelWeights, biasWeights);
6968 }
6969
6985 {
6986 return mImpl->addActivation(input, type);
6987 }
6988
7004 {
7005 return mImpl->addPooling(input, type, windowSize);
7006 }
7007
7022 ILRNLayer* addLRN(ITensor& input, int32_t window, float alpha, float beta, float k) noexcept
7023 {
7024 return mImpl->addLRN(input, window, alpha, beta, k);
7025 }
7026
7049 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
7050 {
7051 return mImpl->addScale(input, mode, shift, scale, power);
7052 }
7053
7063 {
7064 return mImpl->addSoftMax(input);
7065 }
7066
7079 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
7080 {
7081 return mImpl->addConcatenation(inputs, nbInputs);
7082 }
7083
7103 ITensor& input, int32_t nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7104 {
7105 return mImpl->addDeconvolution(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7106 }
7107
7131 {
7132 return mImpl->addElementWise(input1, input2, op);
7133 }
7134
7152 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
7153 {
7154 return mImpl->addUnary(input, operation);
7155 }
7156
7169 TRT_DEPRECATED IPaddingLayer* addPadding(ITensor& input, DimsHW prePadding, DimsHW postPadding) noexcept
7170 {
7171 return mImpl->addPadding(input, prePadding, postPadding);
7172 }
7173
7184 {
7185 return mImpl->addShuffle(input);
7186 }
7187
7200 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
7201 {
7202 return mImpl->addOneHot(indices, values, depth, axis);
7203 }
7204
7212 int32_t getNbLayers() const noexcept
7213 {
7214 return mImpl->getNbLayers();
7215 }
7216
7226 ILayer* getLayer(int32_t index) const noexcept
7227 {
7228 return mImpl->getLayer(index);
7229 }
7230
7238 int32_t getNbInputs() const noexcept
7239 {
7240 return mImpl->getNbInputs();
7241 }
7242
7254 ITensor* getInput(int32_t index) const noexcept
7255 {
7256 return mImpl->getInput(index);
7257 }
7258
7268 int32_t getNbOutputs() const noexcept
7269 {
7270 return mImpl->getNbOutputs();
7271 }
7272
7284 ITensor* getOutput(int32_t index) const noexcept
7285 {
7286 return mImpl->getOutput(index);
7287 }
7288
7296 TRT_DEPRECATED void destroy() noexcept
7297 {
7298 delete this;
7299 }
7300
7324 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7325 {
7326 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7327 }
7328
7358 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7359 {
7360 return mImpl->addTopK(input, op, k, reduceAxes);
7361 }
7362
7374 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7375 {
7376 return mImpl->addGather(data, indices, axis);
7377 }
7378
7390 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7391 {
7392 return mImpl->addGatherV2(data, indices, mode);
7393 }
7394
7409 {
7410 return mImpl->addRaggedSoftMax(input, bounds);
7411 }
7412
7430 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7431 {
7432 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7433 }
7434
7445 {
7446 return mImpl->addNonZero(input);
7447 }
7448
7471 IConstantLayer* addConstant(Dims dimensions, Weights weights) noexcept
7472 {
7473 return mImpl->addConstant(dimensions, weights);
7474 }
7475
7542 ITensor& input, int32_t layerCount, int32_t hiddenSize, int32_t maxSeqLen, RNNOperation op) noexcept
7543 {
7544 return mImpl->addRNNv2(input, layerCount, hiddenSize, maxSeqLen, op);
7545 }
7546
7557 {
7558 return mImpl->addIdentity(input);
7559 }
7560
7571 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7572 {
7573 return mImpl->addCast(input, toType);
7574 }
7575
7586 void removeTensor(ITensor& tensor) noexcept
7587 {
7588 mImpl->removeTensor(tensor);
7589 }
7590
7598 void unmarkOutput(ITensor& tensor) noexcept
7599 {
7600 mImpl->unmarkOutput(tensor);
7601 }
7602
7617 IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7618 {
7619 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7620 }
7621
7636 ISliceLayer* addSlice(ITensor& input, Dims start, Dims size, Dims stride) noexcept
7637 {
7638 return mImpl->addSlice(input, start, size, stride);
7639 }
7640
7660 void setName(char const* name) noexcept
7661 {
7662 mImpl->setName(name);
7663 }
7664
7674 char const* getName() const noexcept
7675 {
7676 return mImpl->getName();
7677 }
7678
7690 IShapeLayer* addShape(ITensor& input) noexcept
7691 {
7692 return mImpl->addShape(input);
7693 }
7694
7708 bool hasImplicitBatchDimension() const noexcept
7709 {
7710 return mImpl->hasImplicitBatchDimension();
7711 }
7712
7726 bool markOutputForShapes(ITensor& tensor) noexcept
7727 {
7728 return mImpl->markOutputForShapes(tensor);
7729 }
7730
7738 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7739 {
7740 return mImpl->unmarkOutputForShapes(tensor);
7741 }
7742
7757 {
7758 return mImpl->addParametricReLU(input, slope);
7759 }
7760
7779 ITensor& input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7780 {
7781 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7782 }
7783
7798 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims windowSize) noexcept
7799 {
7800 return mImpl->addPoolingNd(input, type, windowSize);
7801 }
7802
7817 //
7821 ITensor& input, int32_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7822 {
7823 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7824 }
7825
7858 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7859 {
7860 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7861 }
7862
7874 {
7875 return mImpl->addResize(input);
7876 }
7877
7888 {
7889 return mImpl->hasExplicitPrecision();
7890 }
7891
7903 ILoop* addLoop() noexcept
7904 {
7905 return mImpl->addLoop();
7906 }
7907
7943 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7944 {
7945 return mImpl->addSelect(condition, thenInput, elseInput);
7946 }
7947
7960 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7961 {
7962 return mImpl->addAssertion(condition, message);
7963 }
7964
7983 IFillLayer* addFill(Dims dimensions, FillOperation op) noexcept
7984 {
7985 return mImpl->addFill(dimensions, op);
7986 }
7987
8000 TRT_DEPRECATED IPaddingLayer* addPaddingNd(ITensor& input, Dims prePadding, Dims postPadding) noexcept
8001 {
8002 return mImpl->addPaddingNd(input, prePadding, postPadding);
8003 }
8004
8023 bool setWeightsName(Weights weights, char const* name) noexcept
8024 {
8025 return mImpl->setWeightsName(weights, name);
8026 }
8027
8039 //
8042 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8043 {
8044 mImpl->setErrorRecorder(recorder);
8045 }
8046
8058 {
8059 return mImpl->getErrorRecorder();
8060 }
8061
8077 {
8078 return mImpl->addDequantize(input, scale);
8079 }
8080
8096 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
8097 {
8098 return mImpl->addScatter(data, indices, updates, mode);
8099 }
8100
8115 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale) noexcept
8116 {
8117 return mImpl->addQuantize(input, scale);
8118 }
8119
8131 {
8132 return mImpl->addIfConditional();
8133 }
8134
8144 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
8145 {
8146 return mImpl->addEinsum(inputs, nbInputs, equation);
8147 }
8148
8161 {
8162 return mImpl->addGridSample(input, grid);
8163 }
8164
8178 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8179 {
8180 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8181 }
8182
8196 {
8197 return mImpl->addReverseSequence(input, sequenceLens);
8198 }
8199
8222 ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8223 {
8224 return mImpl->addNormalization(input, scale, bias, axesMask);
8225 }
8226
8233 virtual IBuilder& getBuilder() const noexcept
8234 {
8235 return mImpl->getBuilder();
8236 }
8237
8238protected:
8239 apiv::VNetworkDefinition* mImpl;
8240};
8241
8247enum class CalibrationAlgoType : int32_t
8248{
8253};
8254
8260template <>
8261constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8262{
8263 return 4;
8264}
8265
8278{
8279public:
8285 virtual int32_t getBatchSize() const noexcept = 0;
8286
8300 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8301
8316 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8317
8326 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8327
8333 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8334
8335 virtual ~IInt8Calibrator() noexcept = default;
8336};
8337
8343{
8344public:
8349 {
8351 }
8352
8353 virtual ~IInt8EntropyCalibrator() noexcept = default;
8354};
8355
8361{
8362public:
8367 {
8369 }
8370
8371 virtual ~IInt8EntropyCalibrator2() noexcept = default;
8372};
8373
8378{
8379public:
8384 {
8386 }
8387
8388 virtual ~IInt8MinMaxCalibrator() noexcept = default;
8389};
8390
8396{
8397public:
8402 {
8404 }
8405
8412 virtual double getQuantile() const noexcept = 0;
8413
8420 virtual double getRegressionCutoff() const noexcept = 0;
8421
8434 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8435
8444 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8445
8446 virtual ~IInt8LegacyCalibrator() noexcept = default;
8447};
8448
8460{
8461public:
8471 {
8472 return mImpl->getTensorFormat();
8473 }
8474
8480 DataType getDataType() const noexcept
8481 {
8482 return mImpl->getDataType();
8483 }
8484
8491 Dims getStrides() const noexcept
8492 {
8493 return mImpl->getStrides();
8494 }
8495
8501 int64_t getVectorizedDim() const noexcept
8502 {
8503 return mImpl->getVectorizedDim();
8504 }
8505
8512 int64_t getComponentsPerElement() const noexcept
8513 {
8514 return mImpl->getComponentsPerElement();
8515 }
8516
8517protected:
8518 virtual ~IAlgorithmIOInfo() noexcept = default;
8519 apiv::VAlgorithmIOInfo* mImpl;
8520};
8521
8534{
8535public:
8539 int64_t getImplementation() const noexcept
8540 {
8541 return mImpl->getImplementation();
8542 }
8543
8547 int64_t getTactic() const noexcept
8548 {
8549 return mImpl->getTactic();
8550 }
8551
8552protected:
8553 virtual ~IAlgorithmVariant() noexcept = default;
8554 apiv::VAlgorithmVariant* mImpl;
8555};
8556
8566{
8567public:
8572 char const* getName() const noexcept
8573 {
8574 return mImpl->getName();
8575 }
8576
8583 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8584 {
8585 return mImpl->getDimensions(index, select);
8586 }
8587
8591 int32_t getNbInputs() const noexcept
8592 {
8593 return mImpl->getNbInputs();
8594 }
8595
8599 int32_t getNbOutputs() const noexcept
8600 {
8601 return mImpl->getNbOutputs();
8602 }
8603
8604protected:
8605 virtual ~IAlgorithmContext() noexcept = default;
8606 apiv::VAlgorithmContext* mImpl;
8607};
8608
8618class IAlgorithm : public INoCopy
8619{
8620public:
8631 TRT_DEPRECATED IAlgorithmIOInfo const& getAlgorithmIOInfo(int32_t index) const noexcept
8632 {
8633 return mImpl->getAlgorithmIOInfo(index);
8634 }
8635
8640 {
8641 return mImpl->getAlgorithmVariant();
8642 }
8643
8647 float getTimingMSec() const noexcept
8648 {
8649 return mImpl->getTimingMSec();
8650 }
8651
8655 std::size_t getWorkspaceSize() const noexcept
8656 {
8657 return mImpl->getWorkspaceSize();
8658 }
8659
8668 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8669 {
8670 return mImpl->getAlgorithmIOInfoByIndex(index);
8671 }
8672
8673protected:
8674 virtual ~IAlgorithm() noexcept = default;
8675 apiv::VAlgorithm* mImpl;
8676}; // IAlgorithm
8677
8687{
8688public:
8703 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8704 int32_t nbChoices, int32_t* selection) noexcept = 0;
8715 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8716 int32_t nbAlgorithms) noexcept = 0;
8717
8718 virtual ~IAlgorithmSelector() noexcept = default;
8719};
8720
8727using QuantizationFlags = uint32_t;
8728
8736enum class QuantizationFlag : int32_t
8737{
8742};
8743
8749template <>
8750constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8751{
8752 return 1;
8753}
8754
8761using BuilderFlags = uint32_t;
8762
8770enum class BuilderFlag : int32_t
8771{
8772 kFP16 = 0,
8773 kINT8 = 1,
8774 kDEBUG = 2,
8775 kGPU_FALLBACK = 3,
8776
8789
8790 kREFIT = 5,
8792
8796 kTF32 = 7,
8797
8799 kSPARSE_WEIGHTS = 8,
8800
8807 kSAFETY_SCOPE = 9,
8808
8811
8815
8819 kDIRECT_IO = 12,
8820
8823
8830
8840
8849
8852 kFP8 = 17
8853};
8854
8860template <>
8861constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8862{
8863 return 18;
8864}
8865
8876class ITimingCache : public INoCopy
8877{
8878public:
8879 virtual ~ITimingCache() noexcept = default;
8880
8890 nvinfer1::IHostMemory* serialize() const noexcept
8891 {
8892 return mImpl->serialize();
8893 }
8894
8914 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8915 {
8916 return mImpl->combine(inputCache, ignoreMismatch);
8917 }
8918
8924 bool reset() noexcept
8925 {
8926 return mImpl->reset();
8927 }
8928
8929protected:
8930 apiv::VTimingCache* mImpl;
8931};
8932
8940enum class MemoryPoolType : int32_t
8941{
8949 kWORKSPACE = 0,
8950
8958
8964 kDLA_LOCAL_DRAM = 2,
8965
8971 kDLA_GLOBAL_DRAM = 3,
8972
8980 kTACTIC_DRAM = 4,
8981};
8982
8988template <>
8989constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
8990{
8991 return 5;
8992}
8993
9002enum class PreviewFeature : int32_t
9003{
9015
9031
9038};
9039namespace impl
9040{
9046template <>
9048{
9049 static constexpr int32_t kVALUE = 3;
9050};
9051} // namespace impl
9052
9056enum class HardwareCompatibilityLevel : int32_t
9057{
9060 kNONE = 0,
9061
9066 kAMPERE_PLUS = 1,
9067};
9068
9069namespace impl
9070{
9076template <>
9078{
9079 static constexpr int32_t kVALUE = 2;
9080};
9081} // namespace impl
9082
9091{
9092public:
9093 virtual ~IBuilderConfig() noexcept = default;
9094
9107 TRT_DEPRECATED virtual void setMinTimingIterations(int32_t minTiming) noexcept
9108 {
9109 mImpl->setMinTimingIterations(minTiming);
9110 }
9111
9121 TRT_DEPRECATED virtual int32_t getMinTimingIterations() const noexcept
9122 {
9123 return mImpl->getMinTimingIterations();
9124 }
9125
9134 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9135 {
9136 mImpl->setAvgTimingIterations(avgTiming);
9137 }
9138
9146 int32_t getAvgTimingIterations() const noexcept
9147 {
9148 return mImpl->getAvgTimingIterations();
9149 }
9150
9159 void setEngineCapability(EngineCapability capability) noexcept
9160 {
9161 mImpl->setEngineCapability(capability);
9162 }
9163
9172 {
9173 return mImpl->getEngineCapability();
9174 }
9175
9181 void setInt8Calibrator(IInt8Calibrator* calibrator) noexcept
9182 {
9183 mImpl->setInt8Calibrator(calibrator);
9184 }
9185
9190 {
9191 return mImpl->getInt8Calibrator();
9192 }
9193
9204 TRT_DEPRECATED void setMaxWorkspaceSize(std::size_t workspaceSize) noexcept
9205 {
9206 mImpl->setMaxWorkspaceSize(workspaceSize);
9207 }
9208
9221 TRT_DEPRECATED std::size_t getMaxWorkspaceSize() const noexcept
9222 {
9223 return mImpl->getMaxWorkspaceSize();
9224 }
9225
9238 void setFlags(BuilderFlags builderFlags) noexcept
9239 {
9240 mImpl->setFlags(builderFlags);
9241 }
9242
9250 BuilderFlags getFlags() const noexcept
9251 {
9252 return mImpl->getFlags();
9253 }
9254
9262 void clearFlag(BuilderFlag builderFlag) noexcept
9263 {
9264 mImpl->clearFlag(builderFlag);
9265 }
9266
9274 void setFlag(BuilderFlag builderFlag) noexcept
9275 {
9276 mImpl->setFlag(builderFlag);
9277 }
9278
9286 bool getFlag(BuilderFlag builderFlag) const noexcept
9287 {
9288 return mImpl->getFlag(builderFlag);
9289 }
9290
9302 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9303 {
9304 mImpl->setDeviceType(layer, deviceType);
9305 }
9306
9311 DeviceType getDeviceType(ILayer const* layer) const noexcept
9312 {
9313 return mImpl->getDeviceType(layer);
9314 }
9315
9321 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9322 {
9323 return mImpl->isDeviceTypeSet(layer);
9324 }
9325
9331 void resetDeviceType(ILayer const* layer) noexcept
9332 {
9333 mImpl->resetDeviceType(layer);
9334 }
9335
9340 bool canRunOnDLA(ILayer const* layer) const noexcept
9341 {
9342 return mImpl->canRunOnDLA(layer);
9343 }
9344
9355 void setDLACore(int32_t dlaCore) noexcept
9356 {
9357 mImpl->setDLACore(dlaCore);
9358 }
9359
9364 int32_t getDLACore() const noexcept
9365 {
9366 return mImpl->getDLACore();
9367 }
9368
9374 void setDefaultDeviceType(DeviceType deviceType) noexcept
9375 {
9376 mImpl->setDefaultDeviceType(deviceType);
9377 }
9378
9385 {
9386 return mImpl->getDefaultDeviceType();
9387 }
9388
9394 void reset() noexcept
9395 {
9396 mImpl->reset();
9397 }
9398
9408 TRT_DEPRECATED void destroy() noexcept
9409 {
9410 delete this;
9411 }
9412
9420 void setProfileStream(const cudaStream_t stream) noexcept
9421 {
9422 return mImpl->setProfileStream(stream);
9423 }
9424
9432 cudaStream_t getProfileStream() const noexcept
9433 {
9434 return mImpl->getProfileStream();
9435 }
9436
9448 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9449 {
9450 return mImpl->addOptimizationProfile(profile);
9451 }
9452
9461 int32_t getNbOptimizationProfiles() const noexcept
9462 {
9463 return mImpl->getNbOptimizationProfiles();
9464 }
9465
9474 {
9475 mImpl->setProfilingVerbosity(verbosity);
9476 }
9477
9487 {
9488 return mImpl->getProfilingVerbosity();
9489 }
9490
9496 {
9497 mImpl->setAlgorithmSelector(selector);
9498 }
9499
9504 {
9505 return mImpl->getAlgorithmSelector();
9506 }
9507
9518 bool setCalibrationProfile(IOptimizationProfile const* profile) noexcept
9519 {
9520 return mImpl->setCalibrationProfile(profile);
9521 }
9522
9529 {
9530 return mImpl->getCalibrationProfile();
9531 }
9532
9546 {
9547 mImpl->setQuantizationFlags(flags);
9548 }
9549
9558 {
9559 return mImpl->getQuantizationFlags();
9560 }
9561
9570 {
9571 mImpl->clearQuantizationFlag(flag);
9572 }
9573
9582 {
9583 mImpl->setQuantizationFlag(flag);
9584 }
9585
9593 bool getQuantizationFlag(QuantizationFlag flag) const noexcept
9594 {
9595 return mImpl->getQuantizationFlag(flag);
9596 }
9597
9615 bool setTacticSources(TacticSources tacticSources) noexcept
9616 {
9617 return mImpl->setTacticSources(tacticSources);
9618 }
9619
9631 {
9632 return mImpl->getTacticSources();
9633 }
9634
9649 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9650 {
9651 return mImpl->createTimingCache(blob, size);
9652 }
9653
9672 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9673 {
9674 return mImpl->setTimingCache(cache, ignoreMismatch);
9675 }
9676
9683 {
9684 return mImpl->getTimingCache();
9685 }
9686
9714 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9715 {
9716 mImpl->setMemoryPoolLimit(pool, poolSize);
9717 }
9718
9733 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9734 {
9735 return mImpl->getMemoryPoolLimit(pool);
9736 }
9737
9751 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9752 {
9753 mImpl->setPreviewFeature(feature, enable);
9754 }
9755
9765 bool getPreviewFeature(PreviewFeature feature) const noexcept
9766 {
9767 return mImpl->getPreviewFeature(feature);
9768 }
9769
9785 void setBuilderOptimizationLevel(int32_t level) noexcept
9786 {
9787 mImpl->setBuilderOptimizationLevel(level);
9788 }
9789
9798 {
9799 return mImpl->getBuilderOptimizationLevel();
9800 }
9801
9813 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9814 {
9815 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9816 }
9817
9827 {
9828 return mImpl->getHardwareCompatibilityLevel();
9829 }
9830
9839 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9840 {
9841 mImpl->setPluginsToSerialize(paths, nbPaths);
9842 }
9843
9852 char const* getPluginToSerialize(int32_t index) const noexcept
9853 {
9854 return mImpl->getPluginToSerialize(index);
9855 }
9856
9862 int32_t getNbPluginsToSerialize() const noexcept
9863 {
9864 return mImpl->getNbPluginsToSerialize();
9865 }
9866
9891 void setMaxAuxStreams(int32_t nbStreams) noexcept
9892 {
9893 mImpl->setMaxAuxStreams(nbStreams);
9894 }
9895
9901 int32_t getMaxAuxStreams() const noexcept
9902 {
9903 return mImpl->getMaxAuxStreams();
9904 }
9905
9906protected:
9907 apiv::VBuilderConfig* mImpl;
9908};
9909
9917
9927{
9933 kEXPLICIT_BATCH = 0,
9934
9938};
9939
9945template <>
9946constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
9947{
9948 return 2;
9949}
9950
9958class IBuilder : public INoCopy
9959{
9960public:
9961 virtual ~IBuilder() noexcept = default;
9962
9973 TRT_DEPRECATED void setMaxBatchSize(int32_t batchSize) noexcept
9974 {
9975 mImpl->setMaxBatchSize(batchSize);
9976 }
9977
9988 TRT_DEPRECATED int32_t getMaxBatchSize() const noexcept
9989 {
9990 return mImpl->getMaxBatchSize();
9991 }
9992
9996 bool platformHasFastFp16() const noexcept
9997 {
9998 return mImpl->platformHasFastFp16();
9999 }
10000
10004 bool platformHasFastInt8() const noexcept
10005 {
10006 return mImpl->platformHasFastInt8();
10007 }
10008
10016 TRT_DEPRECATED void destroy() noexcept
10017 {
10018 delete this;
10019 }
10020
10028 int32_t getMaxDLABatchSize() const noexcept
10029 {
10030 return mImpl->getMaxDLABatchSize();
10031 }
10032
10036 int32_t getNbDLACores() const noexcept
10037 {
10038 return mImpl->getNbDLACores();
10039 }
10040
10052 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10053 {
10054 mImpl->setGpuAllocator(allocator);
10055 }
10056
10063 {
10064 return mImpl->createBuilderConfig();
10065 }
10066
10078 INetworkDefinition& network, IBuilderConfig& config) noexcept
10079 {
10080 return mImpl->buildEngineWithConfig(network, config);
10081 }
10082
10096 {
10097 return mImpl->createNetworkV2(flags);
10098 }
10099
10110 {
10111 return mImpl->createOptimizationProfile();
10112 }
10113
10125 //
10128 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10129 {
10130 mImpl->setErrorRecorder(recorder);
10131 }
10132
10144 {
10145 return mImpl->getErrorRecorder();
10146 }
10147
10151 void reset() noexcept
10152 {
10153 mImpl->reset();
10154 }
10155
10159 bool platformHasTf32() const noexcept
10160 {
10161 return mImpl->platformHasTf32();
10162 }
10163
10179 {
10180 return mImpl->buildSerializedNetwork(network, config);
10181 }
10182
10202 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10203 {
10204 return mImpl->isNetworkSupported(network, config);
10205 }
10206
10212 ILogger* getLogger() const noexcept
10213 {
10214 return mImpl->getLogger();
10215 }
10216
10226 bool setMaxThreads(int32_t maxThreads) noexcept
10227 {
10228 return mImpl->setMaxThreads(maxThreads);
10229 }
10230
10240 int32_t getMaxThreads() const noexcept
10241 {
10242 return mImpl->getMaxThreads();
10243 }
10244
10251 {
10252 return mImpl->getPluginRegistry();
10253 }
10254
10255protected:
10256 apiv::VBuilder* mImpl;
10257};
10258
10259} // namespace nvinfer1
10260
10265extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10266
10267namespace nvinfer1
10268{
10269namespace
10270{
10271
10279inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10280{
10281 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10282}
10283
10284} // namespace
10285
10299 nvinfer1::EngineCapability capability) noexcept;
10300
10301namespace safe
10302{
10304class IPluginRegistry;
10305} // namespace safe
10306
10315 nvinfer1::EngineCapability capability) noexcept;
10316
10317} // namespace nvinfer1
10318
10319#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:54
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:76
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:40
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:41
Definition: NvInferRuntimeBase.h:179
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:182
Descriptor for two-dimensional spatial data.
Definition: NvInferLegacyDims.h:70
An Activation layer in a network definition.
Definition: NvInfer.h:1627
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1675
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1636
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1646
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1684
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1693
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1661
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:8566
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8599
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8591
char const * getName() const noexcept
Return name of the algorithm node. This is a unique identifier for the IAlgorithmContext.
Definition: NvInfer.h:8572
virtual ~IAlgorithmContext() noexcept=default
Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for input or output tensor.
Definition: NvInfer.h:8583
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8619
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:8655
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8647
IAlgorithmIOInfo const * getAlgorithmIOInfoByIndex(int32_t index) const noexcept
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Definition: NvInfer.h:8668
virtual ~IAlgorithm() noexcept=default
TRT_DEPRECATED IAlgorithmIOInfo const & getAlgorithmIOInfo(int32_t index) const noexcept
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Definition: NvInfer.h:8631
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8639
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8460
virtual ~IAlgorithmIOInfo() noexcept=default
TRT_DEPRECATED TensorFormat getTensorFormat() const noexcept
Return TensorFormat of the input/output of algorithm.
Definition: NvInfer.h:8470
int64_t getVectorizedDim() const noexcept
Return the index of the vectorized dimension or -1 for non-vectorized formats.
Definition: NvInfer.h:8501
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8491
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8480
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8512
Interface implemented by application for selecting and reporting algorithms of a layer provided by th...
Definition: NvInfer.h:8687
virtual void reportAlgorithms(IAlgorithmContext const *const *algoContexts, IAlgorithm const *const *algoChoices, int32_t nbAlgorithms) noexcept=0
Called by TensorRT to report choices it made.
virtual int32_t selectAlgorithms(IAlgorithmContext const &context, IAlgorithm const *const *choices, int32_t nbChoices, int32_t *selection) noexcept=0
Select Algorithms for a layer from the given list of algorithm choices.
virtual ~IAlgorithmSelector() noexcept=default
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8534
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8547
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8539
An assertion layer in a network.
Definition: NvInfer.h:5770
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:5780
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5790
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9091
virtual TRT_DEPRECATED int32_t getMinTimingIterations() const noexcept
Query the number of minimization iterations.
Definition: NvInfer.h:9121
IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9528
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9714
void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9581
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9649
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9751
void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:9181
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9765
void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9569
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9797
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9615
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9839
bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9593
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9733
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9364
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9862
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9302
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9159
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9901
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9286
void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9545
bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9518
virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
Set the number of averaging iterations used when timing layers.
Definition: NvInfer.h:9134
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9473
IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9503
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9461
QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9557
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9682
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9394
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9672
TRT_DEPRECATED void destroy() noexcept
Delete this IBuilderConfig.
Definition: NvInfer.h:9408
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9852
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9171
void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9495
TRT_DEPRECATED void setMaxWorkspaceSize(std::size_t workspaceSize) noexcept
Set the maximum workspace size.
Definition: NvInfer.h:9204
TRT_DEPRECATED std::size_t getMaxWorkspaceSize() const noexcept
Get the maximum workspace size.
Definition: NvInfer.h:9221
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9384
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9250
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9238
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9630
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9331
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9355
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9826
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9262
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9448
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:9907
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9146
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:9374
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9274
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9311
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9340
cudaStream_t getProfileStream() const noexcept
Get the cuda stream that is used to profile this network.
Definition: NvInfer.h:9432
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9813
IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:9189
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9891
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9486
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9321
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9785
void setProfileStream(const cudaStream_t stream) noexcept
Set the cuda stream that is used to profile this network.
Definition: NvInfer.h:9420
Builds an engine from a network definition.
Definition: NvInfer.h:9959
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:10028
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10036
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10143
apiv::VBuilder * mImpl
Definition: NvInfer.h:10256
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10212
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:10202
bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:10159
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10240
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10250
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInfer.h:10016
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10109
bool platformHasFastFp16() const noexcept
Determine whether the platform has fast native fp16.
Definition: NvInfer.h:9996
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10052
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10095
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10062
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10151
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10226
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10128
bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:10004
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10178
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED int32_t getMaxBatchSize() const noexcept
Get the maximum batch size.
Definition: NvInfer.h:9988
TRT_DEPRECATED nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds an engine for the given INetworkDefinition and given IBuilderConfig.
Definition: NvInfer.h:10077
A cast layer in a network.
Definition: NvInfer.h:4711
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:4730
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:4724
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:4716
A concatenation layer in a network definition.
Definition: NvInfer.h:2433
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2447
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2457
virtual ~IConcatenationLayer() noexcept=default
Definition: NvInfer.h:5370
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:4743
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:4754
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:4764
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:4794
void setDimensions(Dims dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:4776
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:4788
A convolution layer in a network definition.
Definition: NvInfer.h:1070
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:1173
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride of the convolution.
Definition: NvInfer.h:1141
TRT_DEPRECATED DimsHW getDilation() const noexcept
Get the dilation for a convolution.
Definition: NvInfer.h:1280
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1398
void setKernelSizeNd(Dims kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1373
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1307
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1252
int32_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1203
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1348
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Get the stride of the convolution.
Definition: NvInfer.h:1131
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1438
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1408
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding of the convolution.
Definition: NvInfer.h:1161
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1227
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1426
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1462
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1217
void setDilationNd(Dims dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1452
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1334
TRT_DEPRECATED void setDilation(DimsHW dilation) noexcept
Set the dilation for a convolution.
Definition: NvInfer.h:1268
void setNbGroups(int32_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1193
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1360
int32_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1115
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1297
virtual ~IConvolutionLayer() noexcept=default
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1242
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1383
void setNbOutputMaps(int32_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1105
TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
Set the HW kernel size of the convolution.
Definition: NvInfer.h:1081
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1324
TRT_DEPRECATED DimsHW getKernelSize() const noexcept
Get the HW kernel size of the convolution.
Definition: NvInfer.h:1093
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1543
A deconvolution layer in a network definition.
Definition: NvInfer.h:2475
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2653
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Set the stride of the deconvolution.
Definition: NvInfer.h:2538
void setNbOutputMaps(int32_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2512
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2638
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2681
TRT_DEPRECATED DimsHW getPadding() const noexcept
Get the padding of the deconvolution.
Definition: NvInfer.h:2584
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2797
int32_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2614
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2861
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2663
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2628
void setDilationNd(Dims dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2851
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride of the deconvolution.
Definition: NvInfer.h:2550
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding of the deconvolution.
Definition: NvInfer.h:2570
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2719
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2770
void setKernelSizeNd(Dims kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2760
virtual ~IDeconvolutionLayer() noexcept=default
TRT_DEPRECATED void setKernelSize(DimsHW kernelSize) noexcept
Set the HW kernel size of the convolution.
Definition: NvInfer.h:2488
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2787
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2827
void setNbGroups(int32_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2604
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2733
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2815
TRT_DEPRECATED DimsHW getKernelSize() const noexcept
Get the HW kernel size of the deconvolution.
Definition: NvInfer.h:2500
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2709
int32_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2522
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2691
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2745
A Dequantize layer in a network definition.
Definition: NvInfer.h:6154
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:6164
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:6175
An Einsum layer in a network.
Definition: NvInfer.h:6221
bool setEquation(char const *equation) noexcept
Set the equation. The equation is a comma-separated list of subscript labels, where each label refers...
Definition: NvInfer.h:6232
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:6242
A elementwise layer in a network definition.
Definition: NvInfer.h:2936
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2965
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2959
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2947
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeBase.h:694
Generate an output tensor with specified mode.
Definition: NvInfer.h:5852
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5898
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5888
void setDimensions(Dims dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5863
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5951
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5932
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5917
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5878
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5966
virtual ~IFillLayer() noexcept=default
A fully connected layer in a network definition. This layer expects an input tensor of three or more ...
Definition: NvInfer.h:1519
virtual ~IFullyConnectedLayer() noexcept=default
void setNbOutputChannels(int32_t nbOutputs) noexcept
Set the number of output channels K from the fully connected layer.
Definition: NvInfer.h:1528
Weights getKernelWeights() const noexcept
Get the kernel weights.
Definition: NvInfer.h:1558
void setBiasWeights(Weights weights) noexcept
Set the bias weights.
Definition: NvInfer.h:1570
void setKernelWeights(Weights weights) noexcept
Set the kernel weights, given as a KxC matrix in row-major order.
Definition: NvInfer.h:1548
int32_t getNbOutputChannels() const noexcept
Get the number of output channels K from the fully connected layer.
Definition: NvInfer.h:1538
Weights getBiasWeights() const noexcept
Get the bias weights.
Definition: NvInfer.h:1580
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:3071
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:3082
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:3114
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:3150
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:3124
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:3134
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:3093
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:3144
virtual ~IGatherLayer() noexcept=default
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeBase.h:367
A GridSample layer in a network definition.
Definition: NvInfer.h:6439
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6446
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6492
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6468
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6510
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6504
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6458
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6480
virtual ~IGridSampleLayer() noexcept=default
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:144
A layer that represents the identity function.
Definition: NvInfer.h:4698
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:4700
virtual ~IIdentityLayer() noexcept=default
Definition: NvInfer.h:5353
IIfConditional * getConditional() const noexcept
Return pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:5356
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Definition: NvInfer.h:5423
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:5462
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:5487
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:5434
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:5450
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:5477
Definition: NvInfer.h:5394
virtual ~IIfConditionalInputLayer() noexcept=default
Definition: NvInfer.h:5383
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:8278
virtual int32_t getBatchSize() const noexcept=0
Get the batch size used for calibration batches.
Definition: NvInfer.h:8361
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8366
virtual ~IInt8EntropyCalibrator2() noexcept=default
Definition: NvInfer.h:8343
virtual ~IInt8EntropyCalibrator() noexcept=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8348
Definition: NvInfer.h:8396
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8401
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:8378
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8383
virtual ~IInt8MinMaxCalibrator() noexcept=default
Definition: NvInfer.h:5615
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Definition: NvInfer.h:5634
bool getReverse() const noexcept
True if and only if reversing input.
Definition: NvInfer.h:5640
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:5624
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:5618
A LRN layer in a network definition.
Definition: NvInfer.h:2079
int32_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:2100
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:2121
void setWindowSize(int32_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:2090
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:2153
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:2111
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:2132
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:2142
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:2163
Base class for all layer classes in a network definition.
Definition: NvInfer.h:543
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:683
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:788
void setPrecision(DataType dataType) noexcept
Set the computational precision of this layer.
Definition: NvInfer.h:659
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:564
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:693
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:582
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:801
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:745
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:671
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:574
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:603
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:758
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:614
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:631
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:770
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:595
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer.
Definition: NvInfer.h:731
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:550
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeBase.h:505
Definition: NvInfer.h:5334
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Return pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:5337
Definition: NvInfer.h:5656
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:5725
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:5685
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:5698
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:5710
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:5735
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:5664
Definition: NvInfer.h:5544
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:5569
LoopOutput getLoopOutput() const noexcept
Definition: NvInfer.h:5546
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:5563
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:4591
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:4617
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:4611
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:4599
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6582
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6619
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6593
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6605
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6655
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6629
A network definition for input to the builder.
Definition: NvInfer.h:6863
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:7617
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:7778
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8076
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:7079
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:7102
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:7183
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8221
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7660
ILRNLayer * addLRN(ITensor &input, int32_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:7022
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7358
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7960
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7571
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:7857
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7674
TRT_DEPRECATED bool hasExplicitPrecision() const noexcept
True if network is an explicit precision network.
Definition: NvInfer.h:7887
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7756
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7284
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7254
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7738
IFillLayer * addFill(Dims dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7983
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7903
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:7820
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6984
virtual ~INetworkDefinition() noexcept=default
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8233
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8178
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7226
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:7541
TRT_DEPRECATED IFullyConnectedLayer * addFullyConnected(ITensor &input, int32_t nbOutputs, Weights kernelWeights, Weights biasWeights) noexcept
Add a fully connected layer to the network.
Definition: NvInfer.h:6964
IIfConditional * addIfConditional() noexcept
Add an If-conditional layer to the network.
Definition: NvInfer.h:8130
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8057
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8195
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7238
bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7708
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7323
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:7152
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:8160
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7586
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7943
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:8096
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7212
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8239
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7798
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7726
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:7200
TRT_DEPRECATED IPaddingLayer * addPadding(ITensor &input, DimsHW prePadding, DimsHW postPadding) noexcept
Add a padding layer to the network.
Definition: NvInfer.h:7169
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:7049
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7598
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7556
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7390
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:6941
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8115
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:7130
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8042
ISliceLayer * addSlice(ITensor &input, Dims start, Dims size, Dims stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7636
IConstantLayer * addConstant(Dims dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7471
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7408
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7690
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:7374
TRT_DEPRECATED IPoolingLayer * addPooling(ITensor &input, PoolingType type, DimsHW windowSize) noexcept
Add a pooling layer to the network.
Definition: NvInfer.h:7003
TRT_DEPRECATED void destroy() noexcept
Destroy this INetworkDefinition object.
Definition: NvInfer.h:7296
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7873
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7429
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:7062
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:8144
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6918
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7444
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7268
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:8000
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:8023
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:43
Definition: NvInfer.h:4643
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6742
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6759
int32_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6806
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6777
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6750
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6833
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6839
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6768
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6824
void setNbGroups(int32_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6797
A OneHot layer in a network definition.
Definition: NvInfer.h:6404
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6425
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:6411
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6419
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1293
Layer that represents a padding operation.
Definition: NvInfer.h:3874
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3975
TRT_DEPRECATED DimsHW getPrePadding() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3897
TRT_DEPRECATED void setPostPadding(DimsHW padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3911
virtual ~IPaddingLayer() noexcept=default
TRT_DEPRECATED void setPrePadding(DimsHW padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3885
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3949
TRT_DEPRECATED DimsHW getPostPadding() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3923
void setPostPaddingNd(Dims padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3963
void setPrePaddingNd(Dims padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3937
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3981
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4808
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:4810
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:50
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:98
Layer type for pluginV2.
Definition: NvInfer.h:3640
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:3653
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:3647
A Pooling layer in a network definition.
Definition: NvInfer.h:1741
TRT_DEPRECATED DimsHW getStride() const noexcept
Get the stride for pooling.
Definition: NvInfer.h:1814
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1760
void setWindowSizeNd(Dims windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1993
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1980
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1956
TRT_DEPRECATED void setStride(DimsHW stride) noexcept
Set the stride for pooling.
Definition: NvInfer.h:1802
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1900
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1928
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1750
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1969
TRT_DEPRECATED void setWindowSize(DimsHW windowSize) noexcept
Set the window size for pooling.
Definition: NvInfer.h:1774
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:2003
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:1889
void setPaddingNd(Dims padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:2047
void setPrePadding(Dims padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1918
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1872
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:2028
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:2059
TRT_DEPRECATED DimsHW getWindowSize() const noexcept
Get the window size for pooling.
Definition: NvInfer.h:1786
TRT_DEPRECATED DimsHW getPadding() const noexcept
Get the padding for pooling.
Definition: NvInfer.h:1844
void setStrideNd(Dims stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:2018
void setPostPadding(Dims padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1946
TRT_DEPRECATED void setPadding(DimsHW padding) noexcept
Set the padding for pooling.
Definition: NvInfer.h:1830
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1859
A Quantize layer in a network definition.
Definition: NvInfer.h:6068
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:6089
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:6078
virtual ~IQuantizeLayer() noexcept=default
An RNN layer in a network definition, version 2.
Definition: NvInfer.h:3350
void setDirection(RNNDirection op) noexcept
Set the direction of the RNN layer.
Definition: NvInfer.h:3450
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:3552
void setCellState(ITensor &cell) noexcept
Set the initial cell state of the LSTM with the provided cell ITensor.
Definition: NvInfer.h:3610
int32_t getDataLength() const noexcept
Get the embedding length of the RNN.
Definition: NvInfer.h:3364
void setInputMode(RNNInputMode op) noexcept
Set the input mode of the RNN layer.
Definition: NvInfer.h:3425
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:3562
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:3518
void setOperation(RNNOperation op) noexcept
Set the operation of the RNN layer.
Definition: NvInfer.h:3405
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:3528
RNNDirection getDirection() const noexcept
Get the direction of the RNN layer.
Definition: NvInfer.h:3460
void setSequenceLengths(ITensor &seqLengths) noexcept
Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths.
Definition: NvInfer.h:3383
RNNInputMode getInputMode() const noexcept
Get the input mode of the RNN layer.
Definition: NvInfer.h:3435
ITensor * getHiddenState() const noexcept
Get the initial hidden state of the RNN.
Definition: NvInfer.h:3590
ITensor * getCellState() const noexcept
Get the initial cell state of the RNN.
Definition: NvInfer.h:3620
int32_t getMaxSeqLength() const noexcept
Get the maximum sequence length of the RNN.
Definition: NvInfer.h:3360
int32_t getLayerCount() const noexcept
Get the layer count of the RNN.
Definition: NvInfer.h:3352
apiv::VRNNv2Layer * mImpl
Definition: NvInfer.h:3626
ITensor * getSequenceLengths() const noexcept
Get the sequence lengths specified for the RNN.
Definition: NvInfer.h:3395
RNNOperation getOperation() const noexcept
Get the operation of the RNN layer.
Definition: NvInfer.h:3415
virtual ~IRNNv2Layer() noexcept=default
int32_t getHiddenSize() const noexcept
Get the hidden size of the RNN.
Definition: NvInfer.h:3356
void setHiddenState(ITensor &hidden) noexcept
Set the initial hidden state of the RNN with the provided hidden ITensor.
Definition: NvInfer.h:3580
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:4664
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:4666
virtual ~IRaggedSoftMaxLayer() noexcept=default
Definition: NvInfer.h:5499
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:3796
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:3843
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:3803
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:3813
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:3833
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:3823
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:3859
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:3853
A resize layer in a network definition.
Definition: NvInfer.h:5000
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:5189
void setOutputDimensions(Dims dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:5020
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:5213
virtual ~IResizeLayer() noexcept=default
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:5079
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:5245
ResizeMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:5101
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:5060
void setResizeMode(ResizeMode resizeMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:5091
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:5255
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:5199
TRT_DEPRECATED bool getAlignCorners() const noexcept
True if align corners has been set.
Definition: NvInfer.h:5129
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:5164
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:5268
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:5030
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:5223
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:5278
TRT_DEPRECATED void setAlignCorners(bool alignCorners) noexcept
Set whether to align corners while resizing.
Definition: NvInfer.h:5117
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:5174
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6671
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6704
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6691
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6720
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6714
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6681
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:2223
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:2280
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:2300
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:2270
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:2290
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:2240
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:2250
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:2336
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:2260
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:2230
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:2315
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:6331
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:6338
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:6372
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:6358
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:6366
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:6348
virtual ~IScatterLayer() noexcept=default
Definition: NvInfer.h:5749
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:4394
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:4396
Layer type for shuffling data.
Definition: NvInfer.h:4009
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:4164
void setReshapeDimensions(Dims dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:4057
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:4020
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:4117
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:4070
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:4032
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:4129
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:4158
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:4145
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:4242
void setMode(SliceMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:4336
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:4377
virtual ~ISliceLayer() noexcept=default
void setStride(Dims stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:4311
void setStart(Dims start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:4253
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:4268
void setSize(Dims size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:4282
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:4297
SliceMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:4346
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:4326
A Softmax layer in a network definition.
Definition: NvInfer.h:2368
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2400
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2410
virtual ~ISoftMaxLayer() noexcept=default
A tensor in a network definition.
Definition: NvInfer.h:175
bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:277
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:413
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:341
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:374
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:191
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:484
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:250
bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:366
void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:356
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:203
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:461
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:394
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:285
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:293
bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the batch.
Definition: NvInfer.h:331
void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the batch.
Definition: NvInfer.h:315
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:262
apiv::VTensor * mImpl
Definition: NvInfer.h:531
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:384
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:510
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:525
void setDimensions(Dims dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:222
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:235
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:426
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8877
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8914
virtual ~ITimingCache() noexcept=default
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8930
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8924
Layer that represents a TopK reduction.
Definition: NvInfer.h:4434
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:4465
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:4489
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:4451
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:4521
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:4441
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:4479
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:4499
virtual ~ITopKLayer() noexcept=default
Definition: NvInfer.h:5602
TripLimit getTripLimit() const noexcept
Definition: NvInfer.h:5604
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:3721
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:3730
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:3746
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:3740
virtual ~IUnaryLayer() noexcept=default
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:126
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferSafeRuntime.h:961
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:1505
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4905
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:69
nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:8941
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:2179
@ 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:8727
HardwareCompatibilityLevel
Definition: NvInfer.h:9057
constexpr int32_t EnumMax< RNNDirection >() noexcept
Definition: NvInfer.h:3271
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6520
@ kCENTER_SIZES
(x_center, y_center, width, height) where (x_center, y_center) is the center point of the box
@ kCORNER_PAIRS
(x1, y1, x2, y2) where (x1, y1) and (x2, y2) are any pair of diagonal corners
constexpr int32_t EnumMax< BuilderFlag >() noexcept
Definition: NvInfer.h:8861
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:110
constexpr int32_t EnumMax< RNNGateType >() noexcept
Definition: NvInfer.h:3332
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8261
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:3675
@ kISINF
Return true if input value equals +/- infinity for floating-point data type.
@ 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 floating-point data type.
@ 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
Definition: NvInfer.h:3783
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:5326
constexpr int32_t EnumMax< RNNInputMode >() noexcept
Definition: NvInfer.h:3303
RNNInputMode
Enumerates the RNN input modes that may occur with an RNN layer.
Definition: NvInfer.h:3292
@ 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:129
@ 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:5809
@ kLINSPACE
Generate evenly spaced numbers over a specified interval.
@ kRANDOM_UNIFORM
Generate a tensor with random values drawn from a uniform distribution.
@ kRANDOM_NORMAL
Generate a tensor with random values drawn from a normal distribution.
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4935
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
nvinfer1::safe::IPluginRegistry * getBuilderSafePluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Safety engine, or nullptr if no registry exists.
RNNGateType
Identifies an individual gate within an RNN cell.
Definition: NvInfer.h:3316
@ 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:1034
@ 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:5314
@ 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:9916
PreviewFeature
Define preview features.
Definition: NvInfer.h:9003
@ kDISABLE_EXTERNAL_TACTIC_SOURCES_FOR_CORE_0805
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2987
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:120
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8761
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:599
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:2191
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:8248
LayerType
The type values of layer classes.
Definition: NvInfer.h:53
@ kGRID_SAMPLE
Grid sample layer.
@ kRAGGED_SOFTMAX
Ragged softmax layer.
@ kDECONVOLUTION
Deconvolution layer.
@ kREDUCE
Reduce layer.
@ kASSERTION
Assertion layer.
@ kTOPK
TopK layer.
@ kRESIZE
Resize Layer.
@ kCAST
Cast layer.
@ kPADDING
Padding layer.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition layer.
@ kCONDITIONAL_INPUT
Conditional Input layer.
@ kIDENTITY
Identity layer.
@ kNORMALIZATION
Normalization layer.
@ kQUANTIZE
Quantize layer.
@ kSCATTER
Scatter layer.
@ kCONVOLUTION
Convolution layer.
@ kPARAMETRIC_RELU
Parametric ReLU layer.
@ kCONCATENATION
Concatenation layer.
@ kONE_HOT
OneHot layer.
@ kREVERSE_SEQUENCE
Reverse sequence 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.
@ kNON_ZERO
NonZero layer.
@ kRNN_V2
RNNv2 layer.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Definition: NvInfer.h:8750
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:4174
@ kCLAMP
Out of bounds indices are clamped to bounds.
@ kSTRICT_BOUNDS
Fail with error when the coordinates are out of bounds.
@ kWRAP
Coordinates wrap around periodically.
GatherMode
Control form of IGatherLayer.
Definition: NvInfer.h:2975
@ 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:121
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1517
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:9927
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2885
@ kSUB
Subtract 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:8737
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:4194
RNNDirection
Enumerates the RNN direction that may be performed by an RNN layer.
Definition: NvInfer.h:3260
@ kBIDIRECTION
Network iterates from first to last and vice versa and outputs concatenated.
@ kUNIDIRECTION
Network iterations from first input to last input.
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:4820
@ kNEAREST
ND (0 < N <= 8) nearest neighbor resizing.
@ kCUBIC
Supports bicubic (2D) interpolation.
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:8771
@ 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
Definition: NvInfer.h:4417
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeBase.h:209
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:8989
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:4406
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:3769
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:5307
RNNOperation
Enumerates the RNN operations that may be performed by an RNN layer.
Definition: NvInfer.h:3234
@ kGRU
Three-gate network consisting of Gated Recurrent Units.
@ kLSTM
Four-gate LSTM network w/o peephole connections.
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:9946
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:6258
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:4532
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:4851
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:3708
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:5290
@ 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< BoundingBoxFormat >() noexcept
Definition: NvInfer.h:6533
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:4560
constexpr int32_t EnumMax< RNNOperation >() noexcept
Definition: NvInfer.h:3247
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1709
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5821
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:216
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1253
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:6269
Definition: NvInfer.h:3986
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:105