TensorRT 10.11.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h"
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110};
111
117template <>
118constexpr inline int32_t EnumMax<LayerType>() noexcept
119{
120 return 51;
121}
122
129using TensorFormats = uint32_t;
130
136enum class ActivationType : int32_t
137{
138 kRELU = 0,
139 kSIGMOID = 1,
140 kTANH = 2,
141 kLEAKY_RELU = 3,
142 kELU = 4,
143 kSELU = 5,
144 kSOFTSIGN = 6,
145 kSOFTPLUS = 7,
146 kCLIP = 8,
147 kHARD_SIGMOID = 9,
148 kSCALED_TANH = 10,
149 kTHRESHOLDED_RELU = 11,
150 kGELU_ERF = 12,
151 kGELU_TANH = 13
152};
153
154namespace impl
155{
161template <>
163{
164 static constexpr int32_t kVALUE = 14;
165};
166} // namespace impl
167
182class ITensor : public INoCopy
183{
184public:
200 void setName(char const* name) noexcept
201 {
202 mImpl->setName(name);
203 }
204
212 char const* getName() const noexcept
213 {
214 return mImpl->getName();
215 }
216
231 void setDimensions(Dims const& dimensions) noexcept
232 {
233 mImpl->setDimensions(dimensions);
234 }
235
245 Dims getDimensions() const noexcept
246 {
247 return mImpl->getDimensions();
248 }
249
279 void setType(DataType type) noexcept
280 {
281 mImpl->setType(type);
282 }
283
294 DataType getType() const noexcept
295 {
296 return mImpl->getType();
297 }
298
311 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
312 {
313 return mImpl->setDynamicRange(min, max);
314 }
315
319 bool isNetworkInput() const noexcept
320 {
321 return mImpl->isNetworkInput();
322 }
323
327 bool isNetworkOutput() const noexcept
328 {
329 return mImpl->isNetworkOutput();
330 }
331
344 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
345 {
346 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
347 }
348
359 {
360 return mImpl->getBroadcastAcrossBatch();
361 }
362
371 {
372 return mImpl->getLocation();
373 }
374
390 {
391 mImpl->setLocation(location);
392 }
393
401 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
402 {
403 return mImpl->dynamicRangeIsSet();
404 }
405
409 void resetDynamicRange() noexcept
410 {
411 mImpl->resetDynamicRange();
412 }
413
419 float getDynamicRangeMin() const noexcept
420 {
421 return mImpl->getDynamicRangeMin();
422 }
423
429 float getDynamicRangeMax() const noexcept
430 {
431 return mImpl->getDynamicRangeMax();
432 }
433
451 void setAllowedFormats(TensorFormats formats) noexcept
452 {
453 mImpl->setAllowedFormats(formats);
454 }
455
465 {
466 return mImpl->getAllowedFormats();
467 }
468
495 bool isShapeTensor() const noexcept
496 {
497 return mImpl->isShapeTensor();
498 }
499
516 bool isExecutionTensor() const noexcept
517 {
518 return mImpl->isExecutionTensor();
519 }
520
542 void setDimensionName(int32_t index, char const* name) noexcept
543 {
544 mImpl->setDimensionName(index, name);
545 }
546
557 char const* getDimensionName(int32_t index) const noexcept
558 {
559 return mImpl->getDimensionName(index);
560 }
561
562protected:
563 apiv::VTensor* mImpl;
564 virtual ~ITensor() noexcept = default;
565};
566
574class ILayer : public INoCopy
575{
576public:
582 LayerType getType() const noexcept
583 {
584 return mLayer->getType();
585 }
586
596 void setName(char const* name) noexcept
597 {
598 mLayer->setName(name);
599 }
600
606 char const* getName() const noexcept
607 {
608 return mLayer->getName();
609 }
610
614 int32_t getNbInputs() const noexcept
615 {
616 return mLayer->getNbInputs();
617 }
618
627 ITensor* getInput(int32_t index) const noexcept
628 {
629 return mLayer->getInput(index);
630 }
631
635 int32_t getNbOutputs() const noexcept
636 {
637 return mLayer->getNbOutputs();
638 }
639
645 ITensor* getOutput(int32_t index) const noexcept
646 {
647 return mLayer->getOutput(index);
648 }
649
662 void setInput(int32_t index, ITensor& tensor) noexcept
663 {
664 return mLayer->setInput(index, tensor);
665 }
666
693 void setPrecision(DataType dataType) noexcept
694 {
695 mLayer->setPrecision(dataType);
696 }
697
705 DataType getPrecision() const noexcept
706 {
707 return mLayer->getPrecision();
708 }
709
717 bool precisionIsSet() const noexcept
718 {
719 return mLayer->precisionIsSet();
720 }
721
727 void resetPrecision() noexcept
728 {
729 mLayer->resetPrecision();
730 }
731
774 void setOutputType(int32_t index, DataType dataType) noexcept
775 {
776 mLayer->setOutputType(index, dataType);
777 }
778
789 DataType getOutputType(int32_t index) const noexcept
790 {
791 return mLayer->getOutputType(index);
792 }
793
803 bool outputTypeIsSet(int32_t index) const noexcept
804 {
805 return mLayer->outputTypeIsSet(index);
806 }
807
815 void resetOutputType(int32_t index) noexcept
816 {
817 return mLayer->resetOutputType(index);
818 }
819
833 void setMetadata(char const* metadata) noexcept
834 {
835 mLayer->setMetadata(metadata);
836 }
837
846 char const* getMetadata() const noexcept
847 {
848 return mLayer->getMetadata();
849 }
850
851protected:
852 virtual ~ILayer() noexcept = default;
853 apiv::VLayer* mLayer;
854};
855
1012enum class PaddingMode : int32_t
1013{
1015 kEXPLICIT_ROUND_UP = 1,
1016 kSAME_UPPER = 2,
1017 kSAME_LOWER = 3,
1018};
1019
1020namespace impl
1021{
1027template <>
1029{
1030 static constexpr int32_t kVALUE = 4;
1031};
1032} // namespace impl
1033
1047{
1048public:
1056 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1057 {
1058 mImpl->setNbOutputMaps(nbOutputMaps);
1059 }
1060
1066 int64_t getNbOutputMaps() const noexcept
1067 {
1068 return mImpl->getNbOutputMaps();
1069 }
1070
1086 void setNbGroups(int64_t nbGroups) noexcept
1087 {
1088 mImpl->setNbGroups(nbGroups);
1089 }
1090
1096 int64_t getNbGroups() const noexcept
1097 {
1098 return mImpl->getNbGroups();
1099 }
1100
1110 void setKernelWeights(Weights weights) noexcept
1111 {
1112 mImpl->setKernelWeights(weights);
1113 }
1114
1120 Weights getKernelWeights() const noexcept
1121 {
1122 return mImpl->getKernelWeights();
1123 }
1124
1135 void setBiasWeights(Weights weights) noexcept
1136 {
1137 mImpl->setBiasWeights(weights);
1138 }
1139
1145 Weights getBiasWeights() const noexcept
1146 {
1147 return mImpl->getBiasWeights();
1148 }
1149
1162 void setPrePadding(Dims const& padding) noexcept
1163 {
1164 mImpl->setPrePadding(padding);
1165 }
1166
1172 Dims getPrePadding() const noexcept
1173 {
1174 return mImpl->getPrePadding();
1175 }
1176
1189 void setPostPadding(Dims const& padding) noexcept
1190 {
1191 mImpl->setPostPadding(padding);
1192 }
1193
1199 Dims getPostPadding() const noexcept
1200 {
1201 return mImpl->getPostPadding();
1202 }
1203
1213 void setPaddingMode(PaddingMode paddingMode) noexcept
1214 {
1215 mImpl->setPaddingMode(paddingMode);
1216 }
1217
1226 {
1227 return mImpl->getPaddingMode();
1228 }
1229
1238 void setKernelSizeNd(Dims const& kernelSize) noexcept
1239 {
1240 mImpl->setKernelSizeNd(kernelSize);
1241 }
1242
1248 Dims getKernelSizeNd() const noexcept
1249 {
1250 return mImpl->getKernelSizeNd();
1251 }
1252
1263 void setStrideNd(Dims const& stride) noexcept
1264 {
1265 mImpl->setStrideNd(stride);
1266 }
1267
1273 Dims getStrideNd() const noexcept
1274 {
1275 return mImpl->getStrideNd();
1276 }
1277
1291 void setPaddingNd(Dims const& padding) noexcept
1292 {
1293 mImpl->setPaddingNd(padding);
1294 }
1295
1303 Dims getPaddingNd() const noexcept
1304 {
1305 return mImpl->getPaddingNd();
1306 }
1307
1317 void setDilationNd(Dims const& dilation) noexcept
1318 {
1319 mImpl->setDilationNd(dilation);
1320 }
1321
1327 Dims getDilationNd() const noexcept
1328 {
1329 return mImpl->getDilationNd();
1330 }
1331
1346 using ILayer::setInput;
1347
1348protected:
1349 virtual ~IConvolutionLayer() noexcept = default;
1350 apiv::VConvolutionLayer* mImpl;
1351};
1352
1367{
1368public:
1377 {
1378 mImpl->setActivationType(type);
1379 }
1380
1387 {
1388 return mImpl->getActivationType();
1389 }
1390
1401 void setAlpha(float alpha) noexcept
1402 {
1403 mImpl->setAlpha(alpha);
1404 }
1405
1415 void setBeta(float beta) noexcept
1416 {
1417 mImpl->setBeta(beta);
1418 }
1419
1424 float getAlpha() const noexcept
1425 {
1426 return mImpl->getAlpha();
1427 }
1428
1433 float getBeta() const noexcept
1434 {
1435 return mImpl->getBeta();
1436 }
1437
1438protected:
1439 virtual ~IActivationLayer() noexcept = default;
1440 apiv::VActivationLayer* mImpl;
1441};
1442
1448enum class PoolingType : int32_t
1449{
1450 kMAX = 0,
1451 kAVERAGE = 1,
1453};
1454
1455namespace impl
1456{
1462template <>
1464{
1465 static constexpr int32_t kVALUE = 3;
1466};
1467} // namespace impl
1468
1480class IPoolingLayer : public ILayer
1481{
1482public:
1490 void setPoolingType(PoolingType type) noexcept
1491 {
1492 mImpl->setPoolingType(type);
1493 }
1494
1501 {
1502 return mImpl->getPoolingType();
1503 }
1504
1515 void setBlendFactor(float blendFactor) noexcept
1516 {
1517 mImpl->setBlendFactor(blendFactor);
1518 }
1519
1528 float getBlendFactor() const noexcept
1529 {
1530 return mImpl->getBlendFactor();
1531 }
1532
1542 void setAverageCountExcludesPadding(bool exclusive) noexcept
1543 {
1544 mImpl->setAverageCountExcludesPadding(exclusive);
1545 }
1546
1554 {
1555 return mImpl->getAverageCountExcludesPadding();
1556 }
1557
1571 void setPrePadding(Dims const& padding) noexcept
1572 {
1573 mImpl->setPrePadding(padding);
1574 }
1575
1581 Dims getPrePadding() const noexcept
1582 {
1583 return mImpl->getPrePadding();
1584 }
1585
1599 void setPostPadding(Dims const& padding) noexcept
1600 {
1601 mImpl->setPostPadding(padding);
1602 }
1603
1609 Dims getPostPadding() const noexcept
1610 {
1611 return mImpl->getPostPadding();
1612 }
1613
1622 void setPaddingMode(PaddingMode paddingMode) noexcept
1623 {
1624 mImpl->setPaddingMode(paddingMode);
1625 }
1626
1634 {
1635 return mImpl->getPaddingMode();
1636 }
1637
1646 void setWindowSizeNd(Dims const& windowSize) noexcept
1647 {
1648 mImpl->setWindowSizeNd(windowSize);
1649 }
1650
1656 Dims getWindowSizeNd() const noexcept
1657 {
1658 return mImpl->getWindowSizeNd();
1659 }
1660
1671 void setStrideNd(Dims const& stride) noexcept
1672 {
1673 mImpl->setStrideNd(stride);
1674 }
1675
1681 Dims getStrideNd() const noexcept
1682 {
1683 return mImpl->getStrideNd();
1684 }
1685
1700 void setPaddingNd(Dims const& padding) noexcept
1701 {
1702 mImpl->setPaddingNd(padding);
1703 }
1704
1712 Dims getPaddingNd() const noexcept
1713 {
1714 return mImpl->getPaddingNd();
1715 }
1716
1717protected:
1718 virtual ~IPoolingLayer() noexcept = default;
1719 apiv::VPoolingLayer* mImpl;
1720};
1721
1731class ILRNLayer : public ILayer
1732{
1733public:
1743 void setWindowSize(int64_t windowSize) noexcept
1744 {
1745 mImpl->setWindowSize(windowSize);
1746 }
1747
1753 int64_t getWindowSize() const noexcept
1754 {
1755 return mImpl->getWindowSize();
1756 }
1757
1765 void setAlpha(float alpha) noexcept
1766 {
1767 mImpl->setAlpha(alpha);
1768 }
1769
1775 float getAlpha() const noexcept
1776 {
1777 return mImpl->getAlpha();
1778 }
1779
1787 void setBeta(float beta) noexcept
1788 {
1789 mImpl->setBeta(beta);
1790 }
1791
1797 float getBeta() const noexcept
1798 {
1799 return mImpl->getBeta();
1800 }
1801
1809 void setK(float k) noexcept
1810 {
1811 mImpl->setK(k);
1812 }
1813
1819 float getK() const noexcept
1820 {
1821 return mImpl->getK();
1822 }
1823
1824protected:
1825 virtual ~ILRNLayer() noexcept = default;
1826 apiv::VLRNLayer* mImpl;
1827};
1828
1834enum class ScaleMode : int32_t
1835{
1836 kUNIFORM = 0,
1837 kCHANNEL = 1,
1838 kELEMENTWISE = 2
1839};
1840
1846template <>
1847constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1848{
1849 return 3;
1850}
1851
1877class IScaleLayer : public ILayer
1878{
1879public:
1885 void setMode(ScaleMode mode) noexcept
1886 {
1887 mImpl->setMode(mode);
1888 }
1889
1895 ScaleMode getMode() const noexcept
1896 {
1897 return mImpl->getMode();
1898 }
1899
1905 void setShift(Weights shift) noexcept
1906 {
1907 mImpl->setShift(shift);
1908 }
1909
1915 Weights getShift() const noexcept
1916 {
1917 return mImpl->getShift();
1918 }
1919
1925 void setScale(Weights scale) noexcept
1926 {
1927 mImpl->setScale(scale);
1928 }
1929
1935 Weights getScale() const noexcept
1936 {
1937 return mImpl->getScale();
1938 }
1939
1945 void setPower(Weights power) noexcept
1946 {
1947 mImpl->setPower(power);
1948 }
1949
1955 Weights getPower() const noexcept
1956 {
1957 return mImpl->getPower();
1958 }
1959
1970 int32_t getChannelAxis() const noexcept
1971 {
1972 return mImpl->getChannelAxis();
1973 }
1974
1991 void setChannelAxis(int32_t channelAxis) noexcept
1992 {
1993 mImpl->setChannelAxis(channelAxis);
1994 }
1995
1996protected:
1997 virtual ~IScaleLayer() noexcept = default;
1998 apiv::VScaleLayer* mImpl;
1999};
2000
2021class ISoftMaxLayer : public ILayer
2022{
2023public:
2044 void setAxes(uint32_t axes) noexcept
2045 {
2046 mImpl->setAxes(axes);
2047 }
2048
2054 uint32_t getAxes() const noexcept
2055 {
2056 return mImpl->getAxes();
2057 }
2058
2059protected:
2060 virtual ~ISoftMaxLayer() noexcept = default;
2061 apiv::VSoftMaxLayer* mImpl;
2062};
2063
2077{
2078public:
2090 void setAxis(int32_t axis) noexcept
2091 {
2092 mImpl->setAxis(axis);
2093 }
2094
2100 int32_t getAxis() const noexcept
2101 {
2102 return mImpl->getAxis();
2103 }
2104
2105protected:
2106 virtual ~IConcatenationLayer() noexcept = default;
2107 apiv::VConcatenationLayer* mImpl;
2108};
2109
2118{
2119public:
2127 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2128 {
2129 mImpl->setNbOutputMaps(nbOutputMaps);
2130 }
2131
2137 int64_t getNbOutputMaps() const noexcept
2138 {
2139 return mImpl->getNbOutputMaps();
2140 }
2141
2157 void setNbGroups(int64_t nbGroups) noexcept
2158 {
2159 mImpl->setNbGroups(nbGroups);
2160 }
2161
2167 int64_t getNbGroups() const noexcept
2168 {
2169 return mImpl->getNbGroups();
2170 }
2171
2181 void setKernelWeights(Weights weights) noexcept
2182 {
2183 mImpl->setKernelWeights(weights);
2184 }
2185
2191 Weights getKernelWeights() const noexcept
2192 {
2193 return mImpl->getKernelWeights();
2194 }
2195
2206 void setBiasWeights(Weights weights) noexcept
2207 {
2208 mImpl->setBiasWeights(weights);
2209 }
2210
2216 Weights getBiasWeights() const noexcept
2217 {
2218 return mImpl->getBiasWeights();
2219 }
2220
2233 void setPrePadding(Dims const& padding) noexcept
2234 {
2235 mImpl->setPrePadding(padding);
2236 }
2237
2243 Dims getPrePadding() const noexcept
2244 {
2245 return mImpl->getPrePadding();
2246 }
2247
2260 void setPostPadding(Dims const& padding) noexcept
2261 {
2262 mImpl->setPostPadding(padding);
2263 }
2264
2270 Dims getPostPadding() const noexcept
2271 {
2272 return mImpl->getPostPadding();
2273 }
2274
2284 void setPaddingMode(PaddingMode paddingMode) noexcept
2285 {
2286 mImpl->setPaddingMode(paddingMode);
2287 }
2288
2297 {
2298 return mImpl->getPaddingMode();
2299 }
2300
2311 void setKernelSizeNd(Dims const& kernelSize) noexcept
2312 {
2313 mImpl->setKernelSizeNd(kernelSize);
2314 }
2315
2321 Dims getKernelSizeNd() const noexcept
2322 {
2323 return mImpl->getKernelSizeNd();
2324 }
2325
2338 void setStrideNd(Dims const& stride) noexcept
2339 {
2340 mImpl->setStrideNd(stride);
2341 }
2342
2348 Dims getStrideNd() const noexcept
2349 {
2350 return mImpl->getStrideNd();
2351 }
2352
2366 void setPaddingNd(Dims const& padding) noexcept
2367 {
2368 mImpl->setPaddingNd(padding);
2369 }
2370
2378 Dims getPaddingNd() const noexcept
2379 {
2380 return mImpl->getPaddingNd();
2381 }
2382
2395 using ILayer::setInput;
2396
2404 void setDilationNd(Dims const& dilation) noexcept
2405 {
2406 mImpl->setDilationNd(dilation);
2407 }
2408
2414 Dims getDilationNd() const noexcept
2415 {
2416 return mImpl->getDilationNd();
2417 }
2418
2419protected:
2420 virtual ~IDeconvolutionLayer() noexcept = default;
2421 apiv::VDeconvolutionLayer* mImpl;
2422};
2423
2438enum class ElementWiseOperation : int32_t
2439{
2440 kSUM = 0,
2441 kPROD = 1,
2442 kMAX = 2,
2443 kMIN = 3,
2444 kSUB = 4,
2445 kDIV = 5,
2446 kPOW = 6,
2447 kFLOOR_DIV = 7,
2448 kAND = 8,
2449 kOR = 9,
2450 kXOR = 10,
2451 kEQUAL = 11,
2452 kGREATER = 12,
2453 kLESS = 13
2454};
2455
2456namespace impl
2457{
2463template <>
2465{
2466 static constexpr int32_t kVALUE = 14;
2467};
2468} // namespace impl
2469
2490{
2491public:
2502 {
2503 return mImpl->setOperation(op);
2504 }
2505
2514 {
2515 return mImpl->getOperation();
2516 }
2517
2518protected:
2519 apiv::VElementWiseLayer* mImpl;
2520 virtual ~IElementWiseLayer() noexcept = default;
2521};
2522
2528enum class GatherMode : int32_t
2529{
2530 kDEFAULT = 0,
2531 kELEMENT = 1,
2532 kND = 2
2533};
2534
2540template <>
2541constexpr inline int32_t EnumMax<GatherMode>() noexcept
2542{
2543 return 3;
2544}
2545
2622class IGatherLayer : public ILayer
2623{
2624public:
2634 void setGatherAxis(int32_t axis) noexcept
2635 {
2636 mImpl->setGatherAxis(axis);
2637 }
2638
2646 int32_t getGatherAxis() const noexcept
2647 {
2648 return mImpl->getGatherAxis();
2649 }
2650
2669 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2670 {
2671 mImpl->setNbElementWiseDims(elementWiseDims);
2672 }
2673
2679 int32_t getNbElementWiseDims() const noexcept
2680 {
2681 return mImpl->getNbElementWiseDims();
2682 }
2683
2689 void setMode(GatherMode mode) noexcept
2690 {
2691 mImpl->setMode(mode);
2692 }
2693
2699 GatherMode getMode() const noexcept
2700 {
2701 return mImpl->getMode();
2702 }
2703
2704protected:
2705 apiv::VGatherLayer* mImpl;
2706 virtual ~IGatherLayer() noexcept = default;
2707};
2708
2721{
2722public:
2729 {
2730 return mImpl->getPlugin();
2731 }
2732
2733protected:
2734 apiv::VPluginV2Layer* mImpl;
2735 virtual ~IPluginV2Layer() noexcept = default;
2736};
2737
2748{
2749public:
2756 {
2757 return mImpl->getPlugin();
2758 }
2759
2760protected:
2761 apiv::VPluginV3Layer* mImpl;
2762 virtual ~IPluginV3Layer() noexcept = default;
2763};
2764
2781enum class UnaryOperation : int32_t
2782{
2783 kEXP = 0,
2784 kLOG = 1,
2785 kSQRT = 2,
2786 kRECIP = 3,
2787 kABS = 4,
2788 kNEG = 5,
2789 kSIN = 6,
2790 kCOS = 7,
2791 kTAN = 8,
2792 kSINH = 9,
2793 kCOSH = 10,
2794 kASIN = 11,
2795 kACOS = 12,
2796 kATAN = 13,
2797 kASINH = 14,
2798 kACOSH = 15,
2799 kATANH = 16,
2800 kCEIL = 17,
2801 kFLOOR = 18,
2802 kERF = 19,
2803 kNOT = 20,
2804 kSIGN = 21,
2805 kROUND = 22,
2806 kISINF = 23,
2807 kISNAN = 24,
2808};
2809
2815template <>
2816constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2817{
2818 return 25;
2819}
2820
2828class IUnaryLayer : public ILayer
2829{
2830public:
2839 {
2840 mImpl->setOperation(op);
2841 }
2842
2849 {
2850 return mImpl->getOperation();
2851 }
2852
2853protected:
2854 apiv::VUnaryLayer* mImpl;
2855 virtual ~IUnaryLayer() noexcept = default;
2856};
2857
2876enum class ReduceOperation : int32_t
2877{
2878 kSUM = 0,
2879 kPROD = 1,
2880 kMAX = 2,
2881 kMIN = 3,
2882 kAVG = 4
2883};
2884
2890template <>
2891constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2892{
2893 return 5;
2894}
2895
2903class IReduceLayer : public ILayer
2904{
2905public:
2912 {
2913 mImpl->setOperation(op);
2914 }
2915
2922 {
2923 return mImpl->getOperation();
2924 }
2925
2931 void setReduceAxes(uint32_t reduceAxes) noexcept
2932 {
2933 mImpl->setReduceAxes(reduceAxes);
2934 }
2935
2941 uint32_t getReduceAxes() const noexcept
2942 {
2943 return mImpl->getReduceAxes();
2944 }
2945
2951 void setKeepDimensions(bool keepDimensions) noexcept
2952 {
2953 mImpl->setKeepDimensions(keepDimensions);
2954 }
2955
2961 bool getKeepDimensions() const noexcept
2962 {
2963 return mImpl->getKeepDimensions();
2964 }
2965
2966protected:
2967 apiv::VReduceLayer* mImpl;
2968 virtual ~IReduceLayer() noexcept = default;
2969};
2970
2983class IPaddingLayer : public ILayer
2984{
2985public:
2995 void setPrePaddingNd(Dims const& padding) noexcept
2996 {
2997 mImpl->setPrePaddingNd(padding);
2998 }
2999
3007 Dims getPrePaddingNd() const noexcept
3008 {
3009 return mImpl->getPrePaddingNd();
3010 }
3011
3021 void setPostPaddingNd(Dims const& padding) noexcept
3022 {
3023 mImpl->setPostPaddingNd(padding);
3024 }
3025
3033 Dims getPostPaddingNd() const noexcept
3034 {
3035 return mImpl->getPostPaddingNd();
3036 }
3037
3038protected:
3039 apiv::VPaddingLayer* mImpl;
3040 virtual ~IPaddingLayer() noexcept = default;
3041};
3042
3049{
3056 int32_t order[Dims::MAX_DIMS];
3057};
3058
3071class IShuffleLayer : public ILayer
3072{
3073public:
3083 void setFirstTranspose(Permutation permutation) noexcept
3084 {
3085 mImpl->setFirstTranspose(permutation);
3086 }
3087
3096 {
3097 return mImpl->getFirstTranspose();
3098 }
3099
3123 void setReshapeDimensions(Dims const& dimensions) noexcept
3124 {
3125 mImpl->setReshapeDimensions(dimensions);
3126 }
3127
3137 {
3138 return mImpl->getReshapeDimensions();
3139 }
3140
3146 //
3169 using ILayer::setInput;
3170
3183 void setSecondTranspose(Permutation permutation) noexcept
3184 {
3185 mImpl->setSecondTranspose(permutation);
3186 }
3187
3196 {
3197 return mImpl->getSecondTranspose();
3198 }
3199
3211 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3212 {
3213 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3214 }
3215
3224 bool getZeroIsPlaceholder() const noexcept
3225 {
3226 return mImpl->getZeroIsPlaceholder();
3227 }
3228
3229protected:
3230 apiv::VShuffleLayer* mImpl;
3231 virtual ~IShuffleLayer() noexcept = default;
3232};
3233
3239enum class SampleMode : int32_t
3240{
3241 kSTRICT_BOUNDS = 0,
3242 kWRAP = 1,
3243 kCLAMP = 2,
3244 kFILL = 3,
3245 kREFLECT = 4,
3248};
3249
3255template <>
3256constexpr inline int32_t EnumMax<SampleMode>() noexcept
3257{
3258 return 5;
3259}
3260
3323class ISliceLayer : public ILayer
3324{
3325public:
3335 void setStart(Dims const& start) noexcept
3336 {
3337 mImpl->setStart(start);
3338 }
3339
3350 Dims getStart() const noexcept
3351 {
3352 return mImpl->getStart();
3353 }
3354
3364 void setSize(Dims const& size) noexcept
3365 {
3366 return mImpl->setSize(size);
3367 }
3368
3379 Dims getSize() const noexcept
3380 {
3381 return mImpl->getSize();
3382 }
3383
3393 void setStride(Dims const& stride) noexcept
3394 {
3395 mImpl->setStride(stride);
3396 }
3397
3408 Dims getStride() const noexcept
3409 {
3410 return mImpl->getStride();
3411 }
3412
3418 void setMode(SampleMode mode) noexcept
3419 {
3420 mImpl->setMode(mode);
3421 }
3422
3428 SampleMode getMode() const noexcept
3429 {
3430 return mImpl->getMode();
3431 }
3432
3460 using ILayer::setInput;
3461
3471 void setAxes(Dims const& axes) noexcept
3472 {
3473 mImpl->setAxes(axes);
3474 }
3475
3486 Dims getAxes() const noexcept
3487 {
3488 return mImpl->getAxes();
3489 }
3490
3491protected:
3492 apiv::VSliceLayer* mImpl;
3493 virtual ~ISliceLayer() noexcept = default;
3494};
3495
3508class IShapeLayer : public ILayer
3509{
3510protected:
3511 apiv::VShapeLayer* mImpl;
3512 virtual ~IShapeLayer() noexcept = default;
3513};
3514
3520enum class TopKOperation : int32_t
3521{
3522 kMAX = 0,
3523 kMIN = 1,
3524};
3525
3531template <>
3532constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3533{
3534 return 2;
3535}
3536
3548class ITopKLayer : public ILayer
3549{
3550public:
3556 void setOperation(TopKOperation op) noexcept
3557 {
3558 mImpl->setOperation(op);
3559 }
3560
3567 {
3568 return mImpl->getOperation();
3569 }
3570
3580 void setK(int32_t k) noexcept
3581 {
3582 mImpl->setK(k);
3583 }
3584
3594 int32_t getK() const noexcept
3595 {
3596 return mImpl->getK();
3597 }
3598
3604 void setReduceAxes(uint32_t reduceAxes) noexcept
3605 {
3606 mImpl->setReduceAxes(reduceAxes);
3607 }
3608
3614 uint32_t getReduceAxes() const noexcept
3615 {
3616 return mImpl->getReduceAxes();
3617 }
3618
3633 using ILayer::setInput;
3634
3635protected:
3636 apiv::VTopKLayer* mImpl;
3637 virtual ~ITopKLayer() noexcept = default;
3638};
3639
3646enum class MatrixOperation : int32_t
3647{
3651 kNONE = 0,
3652
3654 kTRANSPOSE = 1,
3655
3666 kVECTOR = 2,
3667};
3668
3674template <>
3675constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3676{
3677 return 3;
3678}
3679
3706{
3707public:
3716 void setOperation(int32_t index, MatrixOperation op) noexcept
3717 {
3718 mImpl->setOperation(index, op);
3719 }
3720
3728 MatrixOperation getOperation(int32_t index) const noexcept
3729 {
3730 return mImpl->getOperation(index);
3731 }
3732
3733protected:
3734 apiv::VMatrixMultiplyLayer* mImpl;
3735 virtual ~IMatrixMultiplyLayer() noexcept = default;
3736};
3737
3759class INonZeroLayer : public ILayer
3760{
3761protected:
3762 virtual ~INonZeroLayer() noexcept = default;
3763 apiv::VNonZeroLayer* mImpl;
3764};
3765
3781{
3782protected:
3783 apiv::VRaggedSoftMaxLayer* mImpl;
3784 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3785};
3786
3831{
3832protected:
3833 apiv::VIdentityLayer* mImpl;
3834 virtual ~IIdentityLayer() noexcept = default;
3835};
3836
3843class ICastLayer : public ILayer
3844{
3845public:
3853 void setToType(DataType toType) noexcept
3854 {
3855 mImpl->setToType(toType);
3856 }
3857
3864 DataType getToType() const noexcept
3865 {
3866 return mImpl->getToType();
3867 }
3868
3869protected:
3870 apiv::VCastLayer* mImpl;
3871 virtual ~ICastLayer() noexcept = default;
3872};
3873
3883{
3884public:
3893 void setWeights(Weights weights) noexcept
3894 {
3895 mImpl->setWeights(weights);
3896 }
3897
3903 Weights getWeights() const noexcept
3904 {
3905 return mImpl->getWeights();
3906 }
3907
3915 void setDimensions(Dims const& dimensions) noexcept
3916 {
3917 mImpl->setDimensions(dimensions);
3918 }
3919
3927 Dims getDimensions() const noexcept
3928 {
3929 return mImpl->getDimensions();
3930 }
3931
3932protected:
3933 apiv::VConstantLayer* mImpl;
3934 virtual ~IConstantLayer() noexcept = default;
3935};
3936
3947{
3948protected:
3949 apiv::VParametricReLULayer* mImpl;
3950 virtual ~IParametricReLULayer() noexcept = default;
3951};
3952
3958enum class InterpolationMode : int32_t
3959{
3960 kNEAREST = 0,
3961 kLINEAR = 1,
3962 kCUBIC = 2
3963};
3964
3965namespace impl
3966{
3972template <>
3974{
3975 static constexpr int32_t kVALUE = 3;
3976};
3977} // namespace impl
3978
3987{
4000 kALIGN_CORNERS = 0,
4001
4008 kASYMMETRIC = 1,
4009
4016 kHALF_PIXEL = 2,
4017};
4018
4019namespace impl
4020{
4026template <>
4028{
4029 static constexpr int32_t kVALUE = 3;
4030};
4031} // namespace impl
4032
4040enum class ResizeSelector : int32_t
4041{
4043 kFORMULA = 0,
4044
4046 kUPPER = 1,
4047};
4048
4049namespace impl
4050{
4056template <>
4058{
4059 static constexpr int32_t kVALUE = 2;
4060};
4061} // namespace impl
4062
4070enum class ResizeRoundMode : int32_t
4071{
4073 kHALF_UP = 0,
4074
4076 kHALF_DOWN = 1,
4077
4079 kFLOOR = 2,
4080
4082 kCEIL = 3,
4083};
4084
4085namespace impl
4086{
4092template <>
4094{
4095 static constexpr int32_t kVALUE = 4;
4096};
4097} // namespace impl
4098
4135class IResizeLayer : public ILayer
4136{
4137public:
4156 void setOutputDimensions(Dims const& dimensions) noexcept
4157 {
4158 return mImpl->setOutputDimensions(dimensions);
4159 }
4160
4166 Dims getOutputDimensions() const noexcept
4167 {
4168 return mImpl->getOutputDimensions();
4169 }
4170
4196 void setScales(float const* scales, int32_t nbScales) noexcept
4197 {
4198 mImpl->setScales(scales, nbScales);
4199 }
4200
4215 int32_t getScales(int32_t size, float* scales) const noexcept
4216 {
4217 return mImpl->getScales(size, scales);
4218 }
4219
4227 void setResizeMode(InterpolationMode interpolationMode) noexcept
4228 {
4229 mImpl->setResizeMode(interpolationMode);
4230 }
4231
4238 {
4239 return mImpl->getResizeMode();
4240 }
4241
4261 using ILayer::setInput;
4262
4273 {
4274 mImpl->setCoordinateTransformation(coordTransform);
4275 }
4276
4283 {
4284 return mImpl->getCoordinateTransformation();
4285 }
4286
4298 {
4299 mImpl->setSelectorForSinglePixel(selector);
4300 }
4301
4308 {
4309 return mImpl->getSelectorForSinglePixel();
4310 }
4311
4322 {
4323 mImpl->setNearestRounding(value);
4324 }
4325
4332 {
4333 return mImpl->getNearestRounding();
4334 }
4335
4353 void setCubicCoeff(float A) noexcept
4354 {
4355 mImpl->setCubicCoeff(A);
4356 }
4357
4363 float getCubicCoeff() const noexcept
4364 {
4365 return mImpl->getCubicCoeff();
4366 }
4367
4376 void setExcludeOutside(bool excludeFlag) noexcept
4377 {
4378 mImpl->setExcludeOutside(excludeFlag);
4379 }
4380
4386 bool getExcludeOutside() const noexcept
4387 {
4388 return mImpl->getExcludeOutside();
4389 }
4390
4391protected:
4392 virtual ~IResizeLayer() noexcept = default;
4393 apiv::VResizeLayer* mImpl;
4394};
4395
4401enum class LoopOutput : int32_t
4402{
4404 kLAST_VALUE = 0,
4405
4407 kCONCATENATE = 1,
4408
4410 kREVERSE = 2
4411};
4412
4418template <>
4419constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4420{
4421 return 3;
4422}
4423
4429enum class TripLimit : int32_t
4430{
4431
4432 kCOUNT = 0,
4433 kWHILE = 1
4434};
4435
4441template <>
4442constexpr inline int32_t EnumMax<TripLimit>() noexcept
4443{
4444 return 2;
4445}
4446
4447class ILoop;
4448
4463{
4464public:
4468 ILoop* getLoop() const noexcept
4469 {
4470 return mBoundary->getLoop();
4471 }
4472
4473protected:
4474 virtual ~ILoopBoundaryLayer() noexcept = default;
4475 apiv::VLoopBoundaryLayer* mBoundary;
4476};
4477
4486{
4487public:
4492 {
4493 return mBoundary->getConditional();
4494 }
4495
4496protected:
4497 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4498 apiv::VConditionalBoundaryLayer* mBoundary;
4499};
4500
4507{
4508public:
4509protected:
4510 virtual ~IConditionLayer() noexcept = default;
4511 apiv::VConditionLayer* mImpl;
4512};
4513
4524{
4525public:
4526protected:
4527 virtual ~IIfConditionalOutputLayer() noexcept = default;
4528 apiv::VConditionalOutputLayer* mImpl;
4529};
4530
4537{
4538public:
4539protected:
4540 virtual ~IIfConditionalInputLayer() noexcept = default;
4541 apiv::VConditionalInputLayer* mImpl;
4542};
4543
4569{
4570public:
4581 {
4582 return mImpl->setCondition(condition);
4583 }
4584
4598 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4599 {
4600 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4601 }
4602
4611 {
4612 return mImpl->addInput(input);
4613 }
4614
4625 void setName(char const* name) noexcept
4626 {
4627 mImpl->setName(name);
4628 }
4629
4635 char const* getName() const noexcept
4636 {
4637 return mImpl->getName();
4638 }
4639
4640protected:
4641 virtual ~IIfConditional() noexcept = default;
4642 apiv::VIfConditional* mImpl;
4643};
4644
4653{
4654public:
4660 //
4673 using ILayer::setInput;
4674
4675protected:
4676 virtual ~IRecurrenceLayer() noexcept = default;
4677 apiv::VRecurrenceLayer* mImpl;
4678};
4679
4700{
4701public:
4705 LoopOutput getLoopOutput() const noexcept
4706 {
4707 return mImpl->getLoopOutput();
4708 }
4709
4722 void setAxis(int32_t axis) noexcept
4723 {
4724 mImpl->setAxis(axis);
4725 }
4726
4730 int32_t getAxis() const noexcept
4731 {
4732 return mImpl->getAxis();
4733 }
4734
4740 //
4755 using ILayer::setInput;
4756
4757protected:
4758 virtual ~ILoopOutputLayer() noexcept = default;
4759 apiv::VLoopOutputLayer* mImpl;
4760};
4761
4774{
4775public:
4779 TripLimit getTripLimit() const noexcept
4780 {
4781 return mImpl->getTripLimit();
4782 }
4783
4784protected:
4785 virtual ~ITripLimitLayer() noexcept = default;
4786 apiv::VTripLimitLayer* mImpl;
4787};
4788
4800{
4801public:
4805 void setAxis(int32_t axis) noexcept
4806 {
4807 mImpl->setAxis(axis);
4808 }
4809
4813 int32_t getAxis() const noexcept
4814 {
4815 return mImpl->getAxis();
4816 }
4817
4827 void setReverse(bool reverse) noexcept
4828 {
4829 mImpl->setReverse(reverse);
4830 }
4831
4837 bool getReverse() const noexcept
4838 {
4839 return mImpl->getReverse();
4840 }
4841
4842protected:
4843 virtual ~IIteratorLayer() noexcept = default;
4844 apiv::VIteratorLayer* mImpl;
4845};
4846
4857class ILoop : public INoCopy
4858{
4859public:
4866 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4867 {
4868 return mImpl->addRecurrence(initialValue);
4869 }
4870
4888 {
4889 return mImpl->addTripLimit(tensor, limit);
4890 }
4891
4900 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4901 {
4902 return mImpl->addIterator(tensor, axis, reverse);
4903 }
4904
4913 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4914 {
4915 return mImpl->addLoopOutput(tensor, outputKind, axis);
4916 }
4917
4928 void setName(char const* name) noexcept
4929 {
4930 mImpl->setName(name);
4931 }
4932
4938 char const* getName() const noexcept
4939 {
4940 return mImpl->getName();
4941 }
4942
4943protected:
4944 virtual ~ILoop() noexcept = default;
4945 apiv::VLoop* mImpl;
4946};
4947
4960class ISelectLayer : public ILayer
4961{
4962protected:
4963 virtual ~ISelectLayer() noexcept = default;
4964 apiv::VSelectLayer* mImpl;
4965};
4966
4983{
4984public:
4993 void setMessage(char const* message) noexcept
4994 {
4995 mImpl->setMessage(message);
4996 }
4997
5003 char const* getMessage() const noexcept
5004 {
5005 return mImpl->getMessage();
5006 }
5007
5008protected:
5009 virtual ~IAssertionLayer() noexcept = default;
5010
5011 apiv::VAssertionLayer* mImpl;
5012};
5013
5021enum class FillOperation : int32_t
5022{
5038 kLINSPACE = 0,
5039
5041 kRANDOM_UNIFORM = 1,
5042
5044 kRANDOM_NORMAL = 2
5045};
5046
5052template <>
5053constexpr inline int32_t EnumMax<FillOperation>() noexcept
5054{
5055 return 3;
5056}
5057
5093class IFillLayer : public ILayer
5094{
5095public:
5104 //
5105 void setDimensions(Dims const& dimensions) noexcept
5106 {
5107 mImpl->setDimensions(dimensions);
5108 }
5109
5120 Dims getDimensions() const noexcept
5121 {
5122 return mImpl->getDimensions();
5123 }
5124
5130 void setOperation(FillOperation op) noexcept
5131 {
5132 mImpl->setOperation(op);
5133 }
5134
5141 {
5142 return mImpl->getOperation();
5143 }
5144
5158 //
5159 void setAlpha(double alpha) noexcept
5160 {
5161 mImpl->setAlpha(alpha);
5162 }
5163
5174 double getAlpha() const noexcept
5175 {
5176 return mImpl->getAlpha();
5177 }
5178
5193 void setBeta(double beta) noexcept
5194 {
5195 mImpl->setBeta(beta);
5196 }
5197
5208 double getBeta() const noexcept
5209 {
5210 return mImpl->getBeta();
5211 }
5212
5253 using ILayer::setInput;
5254
5268 //
5269 void setAlphaInt64(int64_t alpha) noexcept
5270 {
5271 mImpl->setAlphaInt64(alpha);
5272 }
5273
5284 int64_t getAlphaInt64() const noexcept
5285 {
5286 return mImpl->getAlphaInt64();
5287 }
5288
5303 void setBetaInt64(int64_t beta) noexcept
5304 {
5305 mImpl->setBetaInt64(beta);
5306 }
5307
5318 int64_t getBetaInt64() const noexcept
5319 {
5320 return mImpl->getBetaInt64();
5321 }
5322
5326 bool isAlphaBetaInt64() const noexcept
5327 {
5328 return mImpl->isAlphaBetaInt64();
5329 }
5330
5343 void setToType(DataType toType) noexcept
5344 {
5345 mImpl->setToType(toType);
5346 }
5347
5355 DataType getToType() const noexcept
5356 {
5357 return mImpl->getToType();
5358 }
5359
5360protected:
5361 virtual ~IFillLayer() noexcept = default;
5362 apiv::VFillLayer* mImpl;
5363};
5364
5440{
5441public:
5450 int32_t getAxis() const noexcept
5451 {
5452 return mImpl->getAxis();
5453 }
5461 void setAxis(int32_t axis) noexcept
5462 {
5463 mImpl->setAxis(axis);
5464 }
5465
5477 void setToType(DataType toType) noexcept
5478 {
5479 mImpl->setToType(toType);
5480 }
5481
5489 DataType getToType() const noexcept
5490 {
5491 return mImpl->getToType();
5492 }
5493
5494protected:
5495 virtual ~IQuantizeLayer() noexcept = default;
5496 apiv::VQuantizeLayer* mImpl;
5497};
5498
5571{
5572public:
5581 int32_t getAxis() const noexcept
5582 {
5583 return mImpl->getAxis();
5584 }
5592 void setAxis(int32_t axis) noexcept
5593 {
5594 mImpl->setAxis(axis);
5595 }
5596
5608 void setToType(DataType toType) noexcept
5609 {
5610 mImpl->setToType(toType);
5611 }
5612
5620 DataType getToType() const noexcept
5621 {
5622 return mImpl->getToType();
5623 }
5624
5625protected:
5626 virtual ~IDequantizeLayer() noexcept = default;
5627 apiv::VDequantizeLayer* mImpl;
5628};
5629
5648{
5649public:
5661 using ILayer::setInput;
5662
5675 void setToType(DataType toType) noexcept
5676 {
5677 mImpl->setToType(toType);
5678 }
5679
5688 DataType getToType() const noexcept
5689 {
5690 return mImpl->getToType();
5691 }
5692
5700 void setScaleType(DataType scaleType) noexcept
5701 {
5702 mImpl->setScaleType(scaleType);
5703 }
5704
5713 DataType getScaleType() const noexcept
5714 {
5715 return mImpl->getScaleType();
5716 }
5717
5726 void setAxis(int32_t axis) noexcept
5727 {
5728 mImpl->setAxis(axis);
5729 }
5730
5736 int32_t getAxis() const noexcept
5737 {
5738 return mImpl->getAxis();
5739 }
5740
5749 void setBlockSize(int32_t size) noexcept
5750 {
5751 mImpl->setBlockSize(size);
5752 }
5753
5759 int32_t getBlockSize() const noexcept
5760 {
5761 return mImpl->getBlockSize();
5762 }
5763
5764protected:
5765 virtual ~IDynamicQuantizeLayer() noexcept = default;
5766 apiv::VDynamicQuantizeLayer* mImpl;
5767};
5768
5805class IEinsumLayer : public ILayer
5806{
5807public:
5817 bool setEquation(char const* equation) noexcept
5818 {
5819 return mImpl->setEquation(equation);
5820 }
5821
5827 char const* getEquation() const noexcept
5828 {
5829 return mImpl->getEquation();
5830 }
5831
5832protected:
5833 virtual ~IEinsumLayer() noexcept = default;
5834 apiv::VEinsumLayer* mImpl;
5835};
5836
5844enum class ScatterMode : int32_t
5845{
5846 kELEMENT = 0,
5847 kND = 1,
5848};
5849
5855template <>
5856constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5857{
5858 return 2;
5859}
5860
5918class IScatterLayer : public ILayer
5919{
5920public:
5926 void setMode(ScatterMode mode) noexcept
5927 {
5928 mImpl->setMode(mode);
5929 }
5930
5936 ScatterMode getMode() const noexcept
5937 {
5938 return mImpl->getMode();
5939 }
5940
5946 void setAxis(int32_t axis) noexcept
5947 {
5948 mImpl->setAxis(axis);
5949 }
5950
5954 int32_t getAxis() const noexcept
5955 {
5956 return mImpl->getAxis();
5957 }
5958
5959protected:
5960 apiv::VScatterLayer* mImpl;
5961 virtual ~IScatterLayer() noexcept = default;
5962}; // class IScatterLayer
5963
5990class IOneHotLayer : public ILayer
5991{
5992public:
5998 void setAxis(int32_t axis) noexcept
5999 {
6000 mImpl->setAxis(axis);
6001 }
6002
6006 int32_t getAxis() const noexcept
6007 {
6008 return mImpl->getAxis();
6009 }
6010
6011protected:
6012 apiv::VOneHotLayer* mImpl;
6013 virtual ~IOneHotLayer() noexcept = default;
6014};
6015
6028{
6029public:
6036 {
6037 mImpl->setInterpolationMode(mode);
6038 }
6039
6048 {
6049 return mImpl->getInterpolationMode();
6050 }
6051
6057 void setAlignCorners(bool alignCorners) noexcept
6058 {
6059 mImpl->setAlignCorners(alignCorners);
6060 }
6061
6069 bool getAlignCorners() const noexcept
6070 {
6071 return mImpl->getAlignCorners();
6072 }
6073
6081 bool setSampleMode(SampleMode mode) noexcept
6082 {
6083 return mImpl->setSampleMode(mode);
6084 }
6085
6093 SampleMode getSampleMode() const noexcept
6094 {
6095 return mImpl->getSampleMode();
6096 }
6097
6098protected:
6099 apiv::VGridSampleLayer* mImpl;
6100 virtual ~IGridSampleLayer() noexcept = default;
6101}; // class IGridSampleLayer
6102
6110enum class BoundingBoxFormat : int32_t
6111{
6113 kCORNER_PAIRS = 0,
6115 kCENTER_SIZES = 1
6116};
6117
6123template <>
6124constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6125{
6126 return 2;
6127}
6128
6175class INMSLayer : public ILayer
6176{
6177public:
6188 {
6189 mImpl->setBoundingBoxFormat(fmt);
6190 }
6191
6200 {
6201 return mImpl->getBoundingBoxFormat();
6202 }
6203
6213 void setTopKBoxLimit(int32_t limit) noexcept
6214 {
6215 mImpl->setTopKBoxLimit(limit);
6216 }
6217
6223 int32_t getTopKBoxLimit() const noexcept
6224 {
6225 return mImpl->getTopKBoxLimit();
6226 }
6227
6246 using ILayer::setInput;
6247
6248protected:
6249 apiv::VNMSLayer* mImpl;
6250 virtual ~INMSLayer() noexcept = default;
6251}; // class INMSLayer
6252
6266{
6267public:
6276 void setBatchAxis(int32_t batchAxis) noexcept
6277 {
6278 mImpl->setBatchAxis(batchAxis);
6279 }
6280
6286 int32_t getBatchAxis() const noexcept
6287 {
6288 return mImpl->getBatchAxis();
6289 }
6290
6299 void setSequenceAxis(int32_t sequenceAxis) noexcept
6300 {
6301 mImpl->setSequenceAxis(sequenceAxis);
6302 }
6303
6309 int32_t getSequenceAxis() const noexcept
6310 {
6311 return mImpl->getSequenceAxis();
6312 }
6313
6314protected:
6315 apiv::VReverseSequenceLayer* mImpl;
6316 virtual ~IReverseSequenceLayer() noexcept = default;
6317}; // class IReverseSequenceLayer
6318
6338{
6339public:
6347 void setEpsilon(float eps) noexcept
6348 {
6349 return mImpl->setEpsilon(eps);
6350 }
6351
6357 float getEpsilon() const noexcept
6358 {
6359 return mImpl->getEpsilon();
6360 }
6361
6367 void setAxes(uint32_t axesMask) noexcept
6368 {
6369 return mImpl->setAxes(axesMask);
6370 }
6371
6377 uint32_t getAxes() const noexcept
6378 {
6379 return mImpl->getAxes();
6380 }
6381
6398 void setNbGroups(int64_t nbGroups) noexcept
6399 {
6400 return mImpl->setNbGroups(nbGroups);
6401 }
6402
6408 int64_t getNbGroups() const noexcept
6409 {
6410 return mImpl->getNbGroups();
6411 }
6412
6434 void setComputePrecision(DataType type) noexcept
6435 {
6436 return mImpl->setComputePrecision(type);
6437 }
6438
6445 {
6446 return mImpl->getComputePrecision();
6447 }
6448
6449protected:
6450 apiv::VNormalizationLayer* mImpl;
6451 virtual ~INormalizationLayer() noexcept = default;
6452};
6453
6454
6463class ISqueezeLayer : public ILayer
6464{
6465public:
6478 using ILayer::setInput;
6479
6480protected:
6481 apiv::VSqueezeLayer* mImpl;
6482 virtual ~ISqueezeLayer() noexcept = default;
6483};
6484
6493{
6494public:
6507 using ILayer::setInput;
6508
6509protected:
6510 apiv::VUnsqueezeLayer* mImpl;
6511 virtual ~IUnsqueezeLayer() noexcept = default;
6512};
6513
6525enum class CumulativeOperation : int32_t
6526{
6527 kSUM = 0,
6528};
6529
6530namespace impl
6531{
6532
6538template <>
6540{
6541 static constexpr int32_t kVALUE = 1;
6542};
6543
6544} // namespace impl
6545
6574{
6575public:
6586 {
6587 return mImpl->setOperation(op);
6588 }
6589
6598 {
6599 return mImpl->getOperation();
6600 }
6601
6609 void setExclusive(bool exclusive) noexcept
6610 {
6611 mImpl->setExclusive(exclusive);
6612 }
6613
6621 bool getExclusive() const noexcept
6622 {
6623 return mImpl->getExclusive();
6624 }
6625
6633 void setReverse(bool reverse) noexcept
6634 {
6635 mImpl->setReverse(reverse);
6636 }
6637
6645 bool getReverse() const noexcept
6646 {
6647 return mImpl->getReverse();
6648 }
6649
6650protected:
6651 apiv::VCumulativeLayer* mImpl;
6652 virtual ~ICumulativeLayer() noexcept = default;
6653};
6654
6673{
6674public:
6675 virtual ~INetworkDefinition() noexcept = default;
6676
6712 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6713 {
6714 return mImpl->addInput(name, type, dimensions);
6715 }
6716
6726 void markOutput(ITensor& tensor) noexcept
6727 {
6728 mImpl->markOutput(tensor);
6729 }
6730
6744 bool markDebug(ITensor& tensor) noexcept
6745 {
6746 return mImpl->markDebug(tensor);
6747 }
6748
6760 bool unmarkDebug(ITensor& tensor) noexcept
6761 {
6762 return mImpl->unmarkDebug(tensor);
6763 }
6764
6770 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6771 {
6772 return mImpl->isDebugTensor(tensor);
6773 }
6774
6791 {
6792 return mImpl->addActivation(input, type);
6793 }
6794
6809 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6810 {
6811 return mImpl->addLRN(input, window, alpha, beta, k);
6812 }
6813
6835 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6836 {
6837 return mImpl->addScale(input, mode, shift, scale, power);
6838 }
6839
6849 {
6850 return mImpl->addSoftMax(input);
6851 }
6852
6865 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6866 {
6867 return mImpl->addConcatenation(inputs, nbInputs);
6868 }
6869
6893 {
6894 return mImpl->addElementWise(input1, input2, op);
6895 }
6896
6914 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6915 {
6916 return mImpl->addUnary(input, operation);
6917 }
6918
6929 {
6930 return mImpl->addShuffle(input);
6931 }
6932
6945 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6946 {
6947 return mImpl->addOneHot(indices, values, depth, axis);
6948 }
6949
6957 int32_t getNbLayers() const noexcept
6958 {
6959 return mImpl->getNbLayers();
6960 }
6961
6971 ILayer* getLayer(int32_t index) const noexcept
6972 {
6973 return mImpl->getLayer(index);
6974 }
6975
6983 int32_t getNbInputs() const noexcept
6984 {
6985 return mImpl->getNbInputs();
6986 }
6987
6999 ITensor* getInput(int32_t index) const noexcept
7000 {
7001 return mImpl->getInput(index);
7002 }
7003
7013 int32_t getNbOutputs() const noexcept
7014 {
7015 return mImpl->getNbOutputs();
7016 }
7017
7029 ITensor* getOutput(int32_t index) const noexcept
7030 {
7031 return mImpl->getOutput(index);
7032 }
7033
7056 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7057 {
7058 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7059 }
7060
7088 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7089 {
7090 return mImpl->addTopK(input, op, k, reduceAxes);
7091 }
7092
7104 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7105 {
7106 return mImpl->addGather(data, indices, axis);
7107 }
7108
7120 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7121 {
7122 return mImpl->addGatherV2(data, indices, mode);
7123 }
7124
7140 {
7141 return mImpl->addRaggedSoftMax(input, bounds);
7142 }
7143
7161 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7162 {
7163 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7164 }
7165
7176 {
7177 return mImpl->addNonZero(input);
7178 }
7179
7199 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7200 {
7201 return mImpl->addConstant(dimensions, weights);
7202 }
7203
7214 {
7215 return mImpl->addIdentity(input);
7216 }
7217
7228 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7229 {
7230 return mImpl->addCast(input, toType);
7231 }
7232
7243 void removeTensor(ITensor& tensor) noexcept
7244 {
7245 mImpl->removeTensor(tensor);
7246 }
7247
7255 void unmarkOutput(ITensor& tensor) noexcept
7256 {
7257 mImpl->unmarkOutput(tensor);
7258 }
7259
7276 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7277 {
7278 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7279 }
7280
7294 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
7295 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
7296 {
7297 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
7298 }
7299
7314 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7315 {
7316 return mImpl->addSlice(input, start, size, stride);
7317 }
7318
7338 void setName(char const* name) noexcept
7339 {
7340 mImpl->setName(name);
7341 }
7342
7352 char const* getName() const noexcept
7353 {
7354 return mImpl->getName();
7355 }
7356
7368 IShapeLayer* addShape(ITensor& input) noexcept
7369 {
7370 return mImpl->addShape(input);
7371 }
7372
7383 {
7384 return mImpl->hasImplicitBatchDimension();
7385 }
7386
7393 {
7394 return mImpl->getFlags();
7395 }
7396
7404 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7405 {
7406 return mImpl->getFlag(networkDefinitionCreationFlag);
7407 }
7408
7421 bool markOutputForShapes(ITensor& tensor) noexcept
7422 {
7423 return mImpl->markOutputForShapes(tensor);
7424 }
7425
7433 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7434 {
7435 return mImpl->unmarkOutputForShapes(tensor);
7436 }
7437
7452 {
7453 return mImpl->addParametricReLU(input, slope);
7454 }
7455
7474 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7475 {
7476 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7477 }
7478
7493 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7494 {
7495 return mImpl->addPoolingNd(input, type, windowSize);
7496 }
7497
7512 //
7516 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7517 {
7518 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7519 }
7520
7553 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7554 {
7555 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7556 }
7557
7570 {
7571 return mImpl->addResize(input);
7572 }
7573
7583 ILoop* addLoop() noexcept
7584 {
7585 return mImpl->addLoop();
7586 }
7587
7599 {
7600 return mImpl->addIfConditional();
7601 }
7602
7637 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7638 {
7639 return mImpl->addSelect(condition, thenInput, elseInput);
7640 }
7641
7654 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7655 {
7656 return mImpl->addAssertion(condition, message);
7657 }
7658
7679 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7680 {
7681 return mImpl->addFill(dimensions, op);
7682 }
7683
7705 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7706 {
7707 return mImpl->addFillV2(dimensions, op, outputType);
7708 }
7709
7721 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7722 {
7723 return mImpl->addPaddingNd(input, prePadding, postPadding);
7724 }
7725
7745 bool setWeightsName(Weights weights, char const* name) noexcept
7746 {
7747 return mImpl->setWeightsName(weights, name);
7748 }
7749
7761 //
7764 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7765 {
7766 mImpl->setErrorRecorder(recorder);
7767 }
7768
7780 {
7781 return mImpl->getErrorRecorder();
7782 }
7783
7801 {
7802 return mImpl->addDequantize(input, scale);
7803 }
7804
7822 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7823 {
7824 return mImpl->addDequantizeV2(input, scale, outputType);
7825 }
7826
7842 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7843 {
7844 return mImpl->addScatter(data, indices, updates, mode);
7845 }
7846
7864 {
7865 return mImpl->addQuantize(input, scale);
7866 }
7867
7885 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7886 {
7887 return mImpl->addQuantizeV2(input, scale, outputType);
7888 }
7889
7911 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
7912 {
7913 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
7914 }
7915
7926 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7927 {
7928 return mImpl->addEinsum(inputs, nbInputs, equation);
7929 }
7930
7945 {
7946 return mImpl->addGridSample(input, grid);
7947 }
7948
7962 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7963 {
7964 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7965 }
7966
7980 {
7981 return mImpl->addReverseSequence(input, sequenceLens);
7982 }
7983
8005 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8006 {
8007 return mImpl->addNormalization(input, scale, bias, axesMask);
8008 }
8009
8027 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8028 {
8029 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8030 }
8031
8038 virtual IBuilder& getBuilder() const noexcept
8039 {
8040 return mImpl->getBuilder();
8041 }
8042
8051 bool markWeightsRefittable(char const* name) noexcept
8052 {
8053 return mImpl->markWeightsRefittable(name);
8054 }
8055
8063 bool unmarkWeightsRefittable(char const* name) noexcept
8064 {
8065 return mImpl->unmarkWeightsRefittable(name);
8066 }
8067
8076 bool areWeightsMarkedRefittable(char const* name) const noexcept
8077 {
8078 return mImpl->areWeightsMarkedRefittable(name);
8079 }
8080
8095 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8096 {
8097 return mImpl->addSqueeze(input, axes);
8098 }
8099
8117 {
8118 return mImpl->addUnsqueeze(input, axes);
8119 }
8120
8121protected:
8122 apiv::VNetworkDefinition* mImpl;
8123};
8124
8132enum class CalibrationAlgoType : int32_t
8133{
8138};
8139
8145template <>
8146constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8147{
8148 return 4;
8149}
8150
8165{
8166public:
8174 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
8175
8190 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8191
8206 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8207
8216 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8217
8223 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8224
8225 ~IInt8Calibrator() noexcept override = default;
8226};
8227
8228namespace v_1_0
8229{
8231{
8232public:
8236 InterfaceInfo getInterfaceInfo() const noexcept override
8237 {
8238 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
8239 }
8240
8245 {
8247 }
8248
8249 ~IInt8EntropyCalibrator() noexcept override = default;
8250};
8251} // namespace v_1_0
8252
8267
8268namespace v_1_0
8269{
8271{
8272public:
8276 InterfaceInfo getInterfaceInfo() const noexcept override
8277 {
8278 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
8279 }
8280
8285 {
8287 }
8288
8289 ~IInt8EntropyCalibrator2() noexcept override = default;
8290};
8291} // namespace v_1_0
8292
8307
8308namespace v_1_0
8309{
8311{
8312public:
8316 InterfaceInfo getInterfaceInfo() const noexcept override
8317 {
8318 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
8319 }
8320
8325 {
8327 }
8328
8329 ~IInt8MinMaxCalibrator() noexcept override = default;
8330};
8331} // namespace v_1_0
8332
8346
8347namespace v_1_0
8348{
8350{
8351public:
8355 InterfaceInfo getInterfaceInfo() const noexcept override
8356 {
8357 return InterfaceInfo{"IInt8Calibrator", 1, 0};
8358 }
8359
8364 {
8366 }
8367
8374 virtual double getQuantile() const noexcept = 0;
8375
8382 virtual double getRegressionCutoff() const noexcept = 0;
8383
8396 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8397
8406 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8407
8408 ~IInt8LegacyCalibrator() noexcept override = default;
8409};
8410} // namespace v_1_0
8411
8426
8440{
8441public:
8447 DataType getDataType() const noexcept
8448 {
8449 return mImpl->getDataType();
8450 }
8451
8458 Dims getStrides() const noexcept
8459 {
8460 return mImpl->getStrides();
8461 }
8462
8468 int64_t getVectorizedDim() const noexcept
8469 {
8470 return mImpl->getVectorizedDim();
8471 }
8472
8479 int64_t getComponentsPerElement() const noexcept
8480 {
8481 return mImpl->getComponentsPerElement();
8482 }
8483
8484protected:
8485 virtual ~IAlgorithmIOInfo() noexcept = default;
8486 apiv::VAlgorithmIOInfo* mImpl;
8487};
8488
8503{
8504public:
8508 int64_t getImplementation() const noexcept
8509 {
8510 return mImpl->getImplementation();
8511 }
8512
8516 int64_t getTactic() const noexcept
8517 {
8518 return mImpl->getTactic();
8519 }
8520
8521protected:
8522 virtual ~IAlgorithmVariant() noexcept = default;
8523 apiv::VAlgorithmVariant* mImpl;
8524};
8525
8537{
8538public:
8544 char const* getName() const noexcept
8545 {
8546 return mImpl->getName();
8547 }
8548
8556 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8557 {
8558 return mImpl->getDimensions(index, select);
8559 }
8560
8564 int32_t getNbInputs() const noexcept
8565 {
8566 return mImpl->getNbInputs();
8567 }
8568
8572 int32_t getNbOutputs() const noexcept
8573 {
8574 return mImpl->getNbOutputs();
8575 }
8576
8577protected:
8578 virtual ~IAlgorithmContext() noexcept = default;
8579 apiv::VAlgorithmContext* mImpl;
8580};
8581
8596{
8597public:
8602 {
8603 return mImpl->getAlgorithmVariant();
8604 }
8605
8609 float getTimingMSec() const noexcept
8610 {
8611 return mImpl->getTimingMSec();
8612 }
8613
8617 std::size_t getWorkspaceSize() const noexcept
8618 {
8619 return mImpl->getWorkspaceSize();
8620 }
8621
8631 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8632 {
8633 return mImpl->getAlgorithmIOInfoByIndex(index);
8634 }
8635
8636protected:
8637 virtual ~IAlgorithm() noexcept = default;
8638 apiv::VAlgorithm* mImpl;
8639}; // IAlgorithm
8640
8641namespace v_1_0
8642{
8644{
8645public:
8649 InterfaceInfo getInterfaceInfo() const noexcept override
8650 {
8651 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8652 }
8667 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8668 int32_t nbChoices, int32_t* selection) noexcept = 0;
8669
8680 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8681 int32_t nbAlgorithms) noexcept = 0;
8682
8683 virtual ~IAlgorithmSelector() noexcept = default;
8684};
8685} // namespace v_1_0
8686
8700
8707using QuantizationFlags = uint32_t;
8708
8718enum class QuantizationFlag : int32_t
8719{
8724};
8725
8731template <>
8732constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8733{
8734 return 1;
8735}
8736
8754enum class RuntimePlatform : int32_t
8755{
8758 kSAME_AS_BUILD = 0,
8759
8762 kWINDOWS_AMD64 = 1,
8763};
8764
8765namespace impl
8766{
8772template <>
8774{
8775 static constexpr int32_t kVALUE = 2;
8776};
8777} // namespace impl
8778
8785using BuilderFlags = uint32_t;
8786
8794enum class BuilderFlag : int32_t
8795{
8797 kFP16 = 0,
8798
8800 kINT8 = 1,
8801
8803 kDEBUG = 2,
8804
8806 kGPU_FALLBACK = 3,
8807
8809 kREFIT = 4,
8810
8813
8817 kTF32 = 6,
8818
8820 kSPARSE_WEIGHTS = 7,
8821
8828 kSAFETY_SCOPE = 8,
8829
8832
8836
8842
8846
8853
8859
8865 kFP8 = 15,
8866
8870
8873 kBF16 = 17,
8874
8880
8882 kSTRIP_PLAN = 19,
8883
8886
8893 kREFIT_IDENTICAL = 20,
8894
8920 kWEIGHT_STREAMING = 21,
8921
8923 kINT4 = 22,
8924
8929 kREFIT_INDIVIDUAL = 23,
8930
8939 kSTRICT_NANS = 24,
8940
8942 kMONITOR_MEMORY = 25,
8943
8945 kFP4 = 26,
8946
8949};
8950
8956template <>
8957constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8958{
8959 return 28;
8960}
8961
8962namespace v_1_0
8963{
8977{
8978 uint8_t data[16];
8979};
8980
8989{
8991 uint64_t tacticHash;
8995 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8996};
8997} // namespace v_1_0
8998
9012class ITimingCache : public INoCopy
9013{
9014public:
9015 virtual ~ITimingCache() noexcept = default;
9016
9026 nvinfer1::IHostMemory* serialize() const noexcept
9027 {
9028 return mImpl->serialize();
9029 }
9030
9050 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
9051 {
9052 return mImpl->combine(inputCache, ignoreMismatch);
9053 }
9054
9060 bool reset() noexcept
9061 {
9062 return mImpl->reset();
9063 }
9064
9079 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
9080 {
9081 return mImpl->queryKeys(keyBuffer, capacity);
9082 }
9083
9096 TimingCacheValue query(TimingCacheKey const& key) const noexcept
9097 {
9098 return mImpl->query(key);
9099 }
9100
9118 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
9119 {
9120 return mImpl->update(key, value);
9121 }
9122
9123protected:
9124 apiv::VTimingCache* mImpl;
9125};
9126
9134enum class MemoryPoolType : int32_t
9135{
9142 kWORKSPACE = 0,
9143
9151
9157 kDLA_LOCAL_DRAM = 2,
9158
9164 kDLA_GLOBAL_DRAM = 3,
9165
9173 kTACTIC_DRAM = 4,
9174
9188};
9189
9195template <>
9196constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9197{
9198 return 6;
9199}
9200
9209enum class PreviewFeature : int32_t
9210{
9217
9222
9229};
9230
9231namespace impl
9232{
9238template <>
9240{
9241 static constexpr int32_t kVALUE = 3;
9242};
9243} // namespace impl
9244
9253enum class HardwareCompatibilityLevel : int32_t
9254{
9257 kNONE = 0,
9258
9270 kAMPERE_PLUS = 1,
9271
9281};
9282
9283namespace impl
9284{
9290template <>
9292{
9293 static constexpr int32_t kVALUE = 3;
9294};
9295} // namespace impl
9296
9305enum class TilingOptimizationLevel : int32_t
9306{
9308 kNONE = 0,
9309
9311 kFAST = 1,
9312
9315 kMODERATE = 2,
9316
9318 kFULL = 3
9319
9320};
9321
9322namespace impl
9323{
9329template <>
9331{
9332 static constexpr int32_t kVALUE = 4;
9333};
9334} // namespace impl
9335
9336namespace v_1_0
9337{
9339{
9340public:
9341 IProgressMonitor() = default;
9342 virtual ~IProgressMonitor() noexcept = default;
9343
9347 InterfaceInfo getInterfaceInfo() const noexcept override
9348 {
9349 return InterfaceInfo{"IProgressMonitor", 1, 0};
9350 }
9351
9371 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9372
9385 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9386
9398 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9399
9400}; // class IProgressMonitor
9401} // namespace v_1_0
9402
9423
9432{
9433public:
9434 virtual ~IBuilderConfig() noexcept = default;
9435
9444 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9445 {
9446 mImpl->setAvgTimingIterations(avgTiming);
9447 }
9448
9456 int32_t getAvgTimingIterations() const noexcept
9457 {
9458 return mImpl->getAvgTimingIterations();
9459 }
9460
9469 void setEngineCapability(EngineCapability capability) noexcept
9470 {
9471 mImpl->setEngineCapability(capability);
9472 }
9473
9482 {
9483 return mImpl->getEngineCapability();
9484 }
9485
9494 {
9495 mImpl->setInt8Calibrator(calibrator);
9496 }
9497
9504 {
9505 return mImpl->getInt8Calibrator();
9506 }
9507
9520 void setFlags(BuilderFlags builderFlags) noexcept
9521 {
9522 mImpl->setFlags(builderFlags);
9523 }
9524
9532 BuilderFlags getFlags() const noexcept
9533 {
9534 return mImpl->getFlags();
9535 }
9536
9544 void clearFlag(BuilderFlag builderFlag) noexcept
9545 {
9546 mImpl->clearFlag(builderFlag);
9547 }
9548
9556 void setFlag(BuilderFlag builderFlag) noexcept
9557 {
9558 mImpl->setFlag(builderFlag);
9559 }
9560
9568 bool getFlag(BuilderFlag builderFlag) const noexcept
9569 {
9570 return mImpl->getFlag(builderFlag);
9571 }
9572
9585 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9586 {
9587 mImpl->setDeviceType(layer, deviceType);
9588 }
9589
9595 DeviceType getDeviceType(ILayer const* layer) const noexcept
9596 {
9597 return mImpl->getDeviceType(layer);
9598 }
9599
9607 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9608 {
9609 return mImpl->isDeviceTypeSet(layer);
9610 }
9611
9617 void resetDeviceType(ILayer const* layer) noexcept
9618 {
9619 mImpl->resetDeviceType(layer);
9620 }
9621
9627 bool canRunOnDLA(ILayer const* layer) const noexcept
9628 {
9629 return mImpl->canRunOnDLA(layer);
9630 }
9631
9643 void setDLACore(int32_t dlaCore) noexcept
9644 {
9645 mImpl->setDLACore(dlaCore);
9646 }
9647
9653 int32_t getDLACore() const noexcept
9654 {
9655 return mImpl->getDLACore();
9656 }
9657
9664 void setDefaultDeviceType(DeviceType deviceType) noexcept
9665 {
9666 mImpl->setDefaultDeviceType(deviceType);
9667 }
9668
9675 {
9676 return mImpl->getDefaultDeviceType();
9677 }
9678
9684 void reset() noexcept
9685 {
9686 mImpl->reset();
9687 }
9688
9696 void setProfileStream(const cudaStream_t stream) noexcept
9697 {
9698 return mImpl->setProfileStream(stream);
9699 }
9700
9708 cudaStream_t getProfileStream() const noexcept
9709 {
9710 return mImpl->getProfileStream();
9711 }
9712
9725 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9726 {
9727 return mImpl->addOptimizationProfile(profile);
9728 }
9729
9738 int32_t getNbOptimizationProfiles() const noexcept
9739 {
9740 return mImpl->getNbOptimizationProfiles();
9741 }
9742
9751 {
9752 mImpl->setProfilingVerbosity(verbosity);
9753 }
9754
9764 {
9765 return mImpl->getProfilingVerbosity();
9766 }
9767
9776 {
9777 mImpl->setAlgorithmSelector(selector);
9778 }
9779
9786 {
9787 return mImpl->getAlgorithmSelector();
9788 }
9789
9804 {
9805 return mImpl->setCalibrationProfile(profile);
9806 }
9807
9816 {
9817 return mImpl->getCalibrationProfile();
9818 }
9819
9835 {
9836 mImpl->setQuantizationFlags(flags);
9837 }
9838
9849 {
9850 return mImpl->getQuantizationFlags();
9851 }
9852
9863 {
9864 mImpl->clearQuantizationFlag(flag);
9865 }
9866
9877 {
9878 mImpl->setQuantizationFlag(flag);
9879 }
9880
9891 {
9892 return mImpl->getQuantizationFlag(flag);
9893 }
9894
9912 bool setTacticSources(TacticSources tacticSources) noexcept
9913 {
9914 return mImpl->setTacticSources(tacticSources);
9915 }
9916
9928 {
9929 return mImpl->getTacticSources();
9930 }
9931
9947 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9948 {
9949 return mImpl->createTimingCache(blob, size);
9950 }
9951
9970 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9971 {
9972 return mImpl->setTimingCache(cache, ignoreMismatch);
9973 }
9974
9981 {
9982 return mImpl->getTimingCache();
9983 }
9984
10012 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
10013 {
10014 mImpl->setMemoryPoolLimit(pool, poolSize);
10015 }
10016
10031 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
10032 {
10033 return mImpl->getMemoryPoolLimit(pool);
10034 }
10035
10049 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
10050 {
10051 mImpl->setPreviewFeature(feature, enable);
10052 }
10053
10063 bool getPreviewFeature(PreviewFeature feature) const noexcept
10064 {
10065 return mImpl->getPreviewFeature(feature);
10066 }
10067
10096 void setBuilderOptimizationLevel(int32_t level) noexcept
10097 {
10098 mImpl->setBuilderOptimizationLevel(level);
10099 }
10100
10109 {
10110 return mImpl->getBuilderOptimizationLevel();
10111 }
10112
10125 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
10126 {
10127 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
10128 }
10129
10139 {
10140 return mImpl->getHardwareCompatibilityLevel();
10141 }
10142
10151 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
10152 {
10153 mImpl->setPluginsToSerialize(paths, nbPaths);
10154 }
10155
10164 char const* getPluginToSerialize(int32_t index) const noexcept
10165 {
10166 return mImpl->getPluginToSerialize(index);
10167 }
10168
10174 int32_t getNbPluginsToSerialize() const noexcept
10175 {
10176 return mImpl->getNbPluginsToSerialize();
10177 }
10178
10203 void setMaxAuxStreams(int32_t nbStreams) noexcept
10204 {
10205 mImpl->setMaxAuxStreams(nbStreams);
10206 }
10207
10213 int32_t getMaxAuxStreams() const noexcept
10214 {
10215 return mImpl->getMaxAuxStreams();
10216 }
10217
10229 void setProgressMonitor(IProgressMonitor* monitor) noexcept
10230 {
10231 return mImpl->setProgressMonitor(monitor);
10232 }
10233
10240 {
10241 return mImpl->getProgressMonitor();
10242 }
10243
10255 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
10256 {
10257 mImpl->setRuntimePlatform(runtimePlatform);
10258 }
10259
10268 {
10269 return mImpl->getRuntimePlatform();
10270 }
10271
10279 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10280 {
10281 mImpl->setMaxNbTactics(maxNbTactics);
10282 }
10283
10291 int32_t getMaxNbTactics() const noexcept
10292 {
10293 return mImpl->getMaxNbTactics();
10294 }
10295
10308 {
10309 return mImpl->setTilingOptimizationLevel(level);
10310 }
10311
10320 {
10321 return mImpl->getTilingOptimizationLevel();
10322 }
10323
10335 bool setL2LimitForTiling(int64_t size) noexcept
10336 {
10337 return mImpl->setL2LimitForTiling(size);
10338 }
10339
10347 int64_t getL2LimitForTiling() const noexcept
10348 {
10349 return mImpl->getL2LimitForTiling();
10350 }
10351
10352protected:
10353 apiv::VBuilderConfig* mImpl;
10354};
10355
10364
10374{
10379
10384 kSTRONGLY_TYPED = 1,
10389
10394};
10395
10401template <>
10402constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10403{
10404 return 4;
10405}
10406
10414class IBuilder : public INoCopy
10415{
10416public:
10417 virtual ~IBuilder() noexcept = default;
10418
10424 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
10425 {
10426 return mImpl->platformHasFastFp16();
10427 }
10428
10435 {
10436 return mImpl->platformHasFastInt8();
10437 }
10438
10446 int32_t getMaxDLABatchSize() const noexcept
10447 {
10448 return mImpl->getMaxDLABatchSize();
10449 }
10450
10454 int32_t getNbDLACores() const noexcept
10455 {
10456 return mImpl->getNbDLACores();
10457 }
10458
10472 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10473 {
10474 mImpl->setGpuAllocator(allocator);
10475 }
10476
10487 {
10488 return mImpl->createBuilderConfig();
10489 }
10490
10513 {
10514 return mImpl->createNetworkV2(flags);
10515 }
10516
10528 {
10529 return mImpl->createOptimizationProfile();
10530 }
10531
10546 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10547 {
10548 mImpl->setErrorRecorder(recorder);
10549 }
10550
10562 {
10563 return mImpl->getErrorRecorder();
10564 }
10565
10569 void reset() noexcept
10570 {
10571 mImpl->reset();
10572 }
10573
10579 TRT_DEPRECATED bool platformHasTf32() const noexcept
10580 {
10581 return mImpl->platformHasTf32();
10582 }
10583
10599 {
10600 return mImpl->buildSerializedNetwork(network, config);
10601 }
10602
10619 {
10620 return mImpl->buildEngineWithConfig(network, config);
10621 }
10622
10640 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10641 {
10642 return mImpl->isNetworkSupported(network, config);
10643 }
10644
10650 ILogger* getLogger() const noexcept
10651 {
10652 return mImpl->getLogger();
10653 }
10654
10666 bool setMaxThreads(int32_t maxThreads) noexcept
10667 {
10668 return mImpl->setMaxThreads(maxThreads);
10669 }
10670
10680 int32_t getMaxThreads() const noexcept
10681 {
10682 return mImpl->getMaxThreads();
10683 }
10684
10691 {
10692 return mImpl->getPluginRegistry();
10693 }
10694
10695protected:
10696 apiv::VBuilder* mImpl;
10697};
10698
10699} // namespace nvinfer1
10700
10705extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10706
10707namespace nvinfer1
10708{
10709namespace
10710{
10711
10719inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10720{
10721 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10722}
10723
10724} // namespace
10725
10739 nvinfer1::EngineCapability capability) noexcept;
10740
10741namespace safe
10742{
10744class IPluginRegistry;
10745} // namespace safe
10746
10754extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
10755 nvinfer1::EngineCapability capability) noexcept;
10756
10757} // namespace nvinfer1
10758
10759#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:69
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:101
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h:214
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:217
An Activation layer in a network definition.
Definition: NvInfer.h:1367
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1415
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1376
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1386
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1424
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1433
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1401
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:8537
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8572
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8564
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:8544
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:8556
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8596
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:8617
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8609
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:8631
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8601
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8440
virtual ~IAlgorithmIOInfo() noexcept=default
int64_t getVectorizedDim() const noexcept
Return the index of the vectorized dimension or -1 for non-vectorized formats.
Definition: NvInfer.h:8468
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8458
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8447
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8479
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8503
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8516
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8508
An assertion layer in a network.
Definition: NvInfer.h:4983
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4993
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5003
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9432
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:10012
TRT_DEPRECATED void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9834
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9947
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:10049
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9775
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:9493
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10063
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:10108
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9912
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:10151
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10307
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:10335
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:9503
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:10031
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9653
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:10174
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9585
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9469
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10213
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9568
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10279
TRT_DEPRECATED void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9862
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:10347
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:10229
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9750
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9738
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9980
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9684
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9970
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:10164
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9481
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:10267
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9674
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:10255
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10291
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9532
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9520
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9927
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9617
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9643
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:10138
TRT_DEPRECATED QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9848
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9544
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9725
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:10239
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:10353
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9815
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9456
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:9664
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9556
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9803
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9595
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9627
TRT_DEPRECATED bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9890
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9708
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:10125
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:10319
TRT_DEPRECATED void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9876
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10203
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9763
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9607
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:10096
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9696
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9785
Builds an engine from a network definition.
Definition: NvInfer.h:10415
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:10446
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10454
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10561
apiv::VBuilder * mImpl
Definition: NvInfer.h:10696
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10650
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:10640
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10680
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10690
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:10434
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10527
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10472
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10512
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10486
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10569
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10666
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10546
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10598
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:10579
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10618
A cast layer in a network.
Definition: NvInfer.h:3844
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3870
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3864
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3853
A concatenation layer in a network definition.
Definition: NvInfer.h:2077
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2090
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2100
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4507
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3883
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3893
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3903
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3915
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3933
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3927
A convolution layer in a network definition.
Definition: NvInfer.h:1047
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1172
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1145
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1213
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1317
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1303
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1273
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1120
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1263
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1327
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1066
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1110
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1199
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1096
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1225
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1086
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1056
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1135
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1248
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1291
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1162
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1189
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1238
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3111
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6574
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6585
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6633
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6651
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6621
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6645
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6609
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6597
A deconvolution layer in a network definition.
Definition: NvInfer.h:2118
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2206
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2167
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2191
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2233
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2348
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2414
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2216
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2181
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2137
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2338
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2270
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2321
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2260
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2311
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2366
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2127
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2378
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2404
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2284
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2157
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2243
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2296
A Dequantize layer in a network definition.
Definition: NvInfer.h:5571
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5608
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5581
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5620
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5592
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5648
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5736
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5759
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5713
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5700
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5688
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5675
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5726
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5749
An Einsum layer in a network.
Definition: NvInfer.h:5806
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:5817
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5827
A elementwise layer in a network definition.
Definition: NvInfer.h:2490
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2519
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2513
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2501
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5094
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5326
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5140
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5130
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5355
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5269
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5303
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5193
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5284
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5318
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5174
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5105
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5159
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5343
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5120
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5208
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2623
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:2634
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2669
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2705
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2679
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2689
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2646
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2699
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:6028
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6035
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6081
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6057
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6099
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6093
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6047
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6069
virtual ~IGridSampleLayer() noexcept=default
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:142
A layer that represents the identity function.
Definition: NvInfer.h:3831
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3833
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4486
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4491
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4569
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4610
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4635
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4580
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4598
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4625
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4537
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4524
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:8165
virtual TRT_DEPRECATED int32_t getBatchSize() const noexcept=0
Get the batch size used for calibration batches.
A layer to do iterations.
Definition: NvInfer.h:4800
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4827
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4837
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4813
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4805
A LRN layer in a network definition.
Definition: NvInfer.h:1732
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1753
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1775
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1743
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1809
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1765
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1787
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1797
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1819
Base class for all layer classes in a network definition.
Definition: NvInfer.h:575
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:717
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:833
void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:693
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:596
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:727
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:614
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:846
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:789
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:705
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:606
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:635
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:803
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:645
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:662
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:815
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:627
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:774
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:582
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1542
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4463
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4468
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4858
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4928
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4887
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4900
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:4913
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4938
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4866
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4700
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4730
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4705
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4722
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3706
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3734
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3728
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3716
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6176
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6213
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6187
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6199
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6249
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6223
A network definition for input to the builder.
Definition: NvInfer.h:6673
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6865
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6928
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8005
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7338
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6744
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6809
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7088
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8027
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7654
IConvolutionLayer * addConvolutionNd(ITensor &input, int64_t nbOutputMaps, Dims const &kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a multi-dimension convolution layer to the network.
Definition: NvInfer.h:7473
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7228
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:7552
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7352
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7451
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7029
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6999
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7822
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7433
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7705
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7583
IDynamicQuantizeLayer * addDynamicQuantize(ITensor &input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:7910
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6790
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7679
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7314
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7863
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8038
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7962
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6971
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7404
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7598
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7779
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8095
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7979
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6983
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7392
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7885
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7055
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6914
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7944
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7243
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8076
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7637
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:7842
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6957
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7382
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8122
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7421
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6945
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6835
IPluginV3Layer * addPluginV3(ITensor *const *inputs, int32_t nbInputs, ITensor *const *shapeInputs, int32_t nbShapeInputs, IPluginV3 &plugin) noexcept
Add a plugin layer implementing the IPluginV3 interface to the network.
Definition: NvInfer.h:7294
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7255
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7213
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7120
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6892
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7199
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7764
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7493
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7139
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7368
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:7104
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8063
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8051
IDeconvolutionLayer * addDeconvolutionNd(ITensor &input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
Add a multi-dimension deconvolution layer to the network.
Definition: NvInfer.h:7515
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7569
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8116
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7160
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6848
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6770
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6760
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7926
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6726
TRT_DEPRECATED 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:7276
IPaddingLayer * addPaddingNd(ITensor &input, Dims const &prePadding, Dims const &postPadding) noexcept
Add a padding layer to the network. Only 2D padding is currently supported.
Definition: NvInfer.h:7721
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7175
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7800
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7013
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7745
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3760
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6338
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6357
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6377
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6347
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6444
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6450
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6408
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6367
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6434
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6398
A OneHot layer in a network definition.
Definition: NvInfer.h:5991
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6012
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5998
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6006
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2618
Layer that represents a padding operation.
Definition: NvInfer.h:2984
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3033
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2995
virtual ~IPaddingLayer() noexcept=default
void setPostPaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3021
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3007
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3039
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3947
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3949
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:139
Layer type for pluginV2.
Definition: NvInfer.h:2721
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2734
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2728
Layer type for V3 plugins.
Definition: NvInfer.h:2748
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2755
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2761
A Pooling layer in a network definition.
Definition: NvInfer.h:1481
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1500
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1633
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1609
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1553
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1581
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1490
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1646
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1622
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1656
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:1542
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1700
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1528
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1671
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1681
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1712
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1599
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1571
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1515
A Quantize layer in a network definition.
Definition: NvInfer.h:5440
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5477
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5461
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5450
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5489
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3781
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3783
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4653
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2904
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2951
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2911
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2921
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2941
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2931
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2967
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2961
A resize layer in a network definition.
Definition: NvInfer.h:4136
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4297
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4321
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:4215
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4156
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4353
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4196
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4363
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4307
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4237
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4272
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4376
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4227
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4166
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4331
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4386
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4282
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6266
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6299
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6286
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6315
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6309
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6276
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1878
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1935
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1955
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1925
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1945
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1895
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1905
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1991
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1915
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1885
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1970
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5919
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5926
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5960
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5946
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5954
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5936
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4961
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3509
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3511
Layer type for shuffling data.
Definition: NvInfer.h:3072
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3230
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3083
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3183
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3136
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3123
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3095
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3195
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3224
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3211
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3324
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3393
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3492
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3364
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3471
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3335
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3350
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3418
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3379
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3428
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3408
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3486
A Softmax layer in a network definition.
Definition: NvInfer.h:2022
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2044
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2054
virtual ~ISoftMaxLayer() noexcept=default
Layer that represents a squeeze operation, removing unit dimensions of the input tensor on a set of a...
Definition: NvInfer.h:6464
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6481
A tensor in a network definition.
Definition: NvInfer.h:183
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:451
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:370
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:231
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:409
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:200
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:516
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:279
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:401
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:212
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:495
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:429
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:319
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:344
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:311
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:358
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:327
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:294
apiv::VTensor * mImpl
Definition: NvInfer.h:563
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:419
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:542
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:557
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:389
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:245
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:464
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:9013
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:9079
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:9050
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:9096
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:9118
apiv::VTimingCache * mImpl
Definition: NvInfer.h:9124
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:9060
Layer that represents a TopK reduction.
Definition: NvInfer.h:3549
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3580
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3604
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3566
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3636
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3556
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3594
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3614
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4774
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4779
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2829
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2838
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2854
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2848
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6493
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6510
An Interface class for version control.
Definition: NvInferRuntimeBase.h:274
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:239
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:8644
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 void reportAlgorithms(IAlgorithmContext const *const *algoContexts, IAlgorithm const *const *algoChoices, int32_t nbAlgorithms) noexcept=0
Called by TensorRT to report choices it made.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8649
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:411
Definition: NvInferRuntime.h:1610
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8284
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8276
Definition: NvInfer.h:8231
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8244
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8236
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:8350
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8363
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8355
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:8311
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8324
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8316
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:9339
virtual bool stepComplete(char const *phaseName, int32_t step) noexcept=0
Signal that a step of an optimizer phase has finished.
virtual ~IProgressMonitor() noexcept=default
virtual void phaseFinish(char const *phaseName) noexcept=0
Signal that a phase of the optimizer has finished.
virtual void phaseStart(char const *phaseName, char const *parentPhase, int32_t nbSteps) noexcept=0
Signal that a phase of the optimizer has started.
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:10719
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:2904
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4041
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
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:9135
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1835
@ kUNIFORM
Identical coefficients across all elements of the tensor.
@ kCHANNEL
Per-channel coefficients.
RuntimePlatform
Describes the intended runtime platform (operating system and CPU architecture) for the execution of ...
Definition: NvInfer.h:8755
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8707
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9254
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6526
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6111
@ 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:8957
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:118
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8146
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2782
@ kISINF
Return true if input value equals +/- infinity for floating-point data type.
@ kCOSH
Hyperbolic cosine.
@ kACOSH
Inverse hyperbolic cosine.
@ kERF
Gauss error function.
@ kISNAN
Return true if input value is a NaN for floating-point data type.
@ 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:2891
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4442
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:137
@ 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))
@ kGELU_TANH
GELU tanh activation: 0.5 * x * (1 + tanh(sqrt(2/pi) * (0.044715F * pow(x, 3) + x)))
@ kGELU_ERF
GELU erf activation: 0.5 * x * (1 + erf(sqrt(0.5) * 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:5022
@ kRANDOM_UNIFORM
Randomly draw values from a uniform distribution.
@ kRANDOM_NORMAL
Randomly draw values from a normal distribution.
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4071
@ 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.
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:1013
@ kSAME_LOWER
Use SAME padding, with prePadding >= postPadding.
@ kEXPLICIT_ROUND_DOWN
Use explicit padding, rounding output size down.
@ kEXPLICIT_ROUND_UP
Use explicit padding, rounding output size up.
@ kSAME_UPPER
Use SAME padding, with prePadding <= postPadding.
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4430
@ kWHILE
Tensor is a scalar of type kBOOL. Loop terminates when value is false.
@ kCOUNT
Tensor is a scalar of type kINT32 or kINT64 that contains the trip count.
uint32_t NetworkDefinitionCreationFlags
Represents one or more NetworkDefinitionCreationFlag flags using binary OR operations....
Definition: NvInfer.h:10363
PreviewFeature
Define preview features.
Definition: NvInfer.h:9210
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9306
@ kFAST
Use a fast algorithm and heuristic based strategy. Slightly increases engine build time.
@ kFULL
Increase search space even wider. Significantly increases engine build time.
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2541
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:143
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8785
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1304
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1847
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:8133
@ kENTROPY_CALIBRATION_2
Entropy calibration.
@ kLEGACY_CALIBRATION
Legacy calibration.
@ kENTROPY_CALIBRATION
Legacy entropy calibration.
@ kMINMAX_CALIBRATION
Minmax calibration.
LayerType
The type values of layer classes.
Definition: NvInfer.h:58
@ 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.
@ kSQUEEZE
Squeeze Layer.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition layer.
@ kCUMULATIVE
Cumulative 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.
@ kUNSQUEEZE
Unsqueeze 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.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kPLUGIN_V3
PluginV3 layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kDYNAMIC_QUANTIZE
Dynamic Quantize 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.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Definition: NvInfer.h:8732
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3240
@ 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:2529
@ 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:129
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2916
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10374
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2439
@ 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:8719
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3256
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3959
@ kNEAREST
ND (0 < N <= 8) nearest neighbor resizing.
@ kCUBIC
Supports bicubic (2D) interpolation.
@ kLINEAR
Supports linear (1D), bilinear (2D), and trilinear (3D) interpolation.
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:8795
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ 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.
@ kFP4
Enable plugins with FP4 input/output.
@ 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.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ kINT4
Enable plugins with INT4 input/output.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ kMONITOR_MEMORY
Enable memory monitor during build time.
@ 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.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3532
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9196
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3521
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2877
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4419
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:10402
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5845
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3647
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3987
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2816
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4402
@ 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:6124
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3675
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1449
@ kAVERAGE
Average over elements. If the tensor is padded, the count includes the padding.
@ kMAX
Maximum over elements.
@ kMAX_AVERAGE_BLEND
Blending between max and average pooling: (1-blendFactor)*maxPool + blendFactor*avgPool.
v_1_0::IProgressMonitor IProgressMonitor
Definition: NvInfer.h:9422
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5053
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:204
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2578
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5856
Represents a permutation of dimensions.
Definition: NvInfer.h:3049
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:128
The key to retrieve timing cache entries.
Definition: NvInfer.h:8977
Definition: NvInfer.h:8989
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8991
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8993

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact