TensorRT 10.12.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
281 TRT_DEPRECATED void setType(DataType type) noexcept
282 {
283 mImpl->setType(type);
284 }
285
296 DataType getType() const noexcept
297 {
298 return mImpl->getType();
299 }
300
313 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
314 {
315 return mImpl->setDynamicRange(min, max);
316 }
317
321 bool isNetworkInput() const noexcept
322 {
323 return mImpl->isNetworkInput();
324 }
325
329 bool isNetworkOutput() const noexcept
330 {
331 return mImpl->isNetworkOutput();
332 }
333
346 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
347 {
348 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
349 }
350
361 {
362 return mImpl->getBroadcastAcrossBatch();
363 }
364
373 {
374 return mImpl->getLocation();
375 }
376
392 {
393 mImpl->setLocation(location);
394 }
395
403 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
404 {
405 return mImpl->dynamicRangeIsSet();
406 }
407
411 void resetDynamicRange() noexcept
412 {
413 mImpl->resetDynamicRange();
414 }
415
421 float getDynamicRangeMin() const noexcept
422 {
423 return mImpl->getDynamicRangeMin();
424 }
425
431 float getDynamicRangeMax() const noexcept
432 {
433 return mImpl->getDynamicRangeMax();
434 }
435
453 void setAllowedFormats(TensorFormats formats) noexcept
454 {
455 mImpl->setAllowedFormats(formats);
456 }
457
467 {
468 return mImpl->getAllowedFormats();
469 }
470
497 bool isShapeTensor() const noexcept
498 {
499 return mImpl->isShapeTensor();
500 }
501
518 bool isExecutionTensor() const noexcept
519 {
520 return mImpl->isExecutionTensor();
521 }
522
544 void setDimensionName(int32_t index, char const* name) noexcept
545 {
546 mImpl->setDimensionName(index, name);
547 }
548
559 char const* getDimensionName(int32_t index) const noexcept
560 {
561 return mImpl->getDimensionName(index);
562 }
563
564protected:
565 apiv::VTensor* mImpl;
566 virtual ~ITensor() noexcept = default;
567};
568
576class ILayer : public INoCopy
577{
578public:
584 LayerType getType() const noexcept
585 {
586 return mLayer->getType();
587 }
588
598 void setName(char const* name) noexcept
599 {
600 mLayer->setName(name);
601 }
602
608 char const* getName() const noexcept
609 {
610 return mLayer->getName();
611 }
612
616 int32_t getNbInputs() const noexcept
617 {
618 return mLayer->getNbInputs();
619 }
620
629 ITensor* getInput(int32_t index) const noexcept
630 {
631 return mLayer->getInput(index);
632 }
633
637 int32_t getNbOutputs() const noexcept
638 {
639 return mLayer->getNbOutputs();
640 }
641
647 ITensor* getOutput(int32_t index) const noexcept
648 {
649 return mLayer->getOutput(index);
650 }
651
664 void setInput(int32_t index, ITensor& tensor) noexcept
665 {
666 return mLayer->setInput(index, tensor);
667 }
668
697 TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
698 {
699 mLayer->setPrecision(dataType);
700 }
701
709 DataType getPrecision() const noexcept
710 {
711 return mLayer->getPrecision();
712 }
713
723 TRT_DEPRECATED bool precisionIsSet() const noexcept
724 {
725 return mLayer->precisionIsSet();
726 }
727
736 {
737 mLayer->resetPrecision();
738 }
739
785 TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
786 {
787 mLayer->setOutputType(index, dataType);
788 }
789
800 DataType getOutputType(int32_t index) const noexcept
801 {
802 return mLayer->getOutputType(index);
803 }
804
816 TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
817 {
818 return mLayer->outputTypeIsSet(index);
819 }
820
830 TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
831 {
832 return mLayer->resetOutputType(index);
833 }
834
848 void setMetadata(char const* metadata) noexcept
849 {
850 mLayer->setMetadata(metadata);
851 }
852
861 char const* getMetadata() const noexcept
862 {
863 return mLayer->getMetadata();
864 }
865
866protected:
867 virtual ~ILayer() noexcept = default;
868 apiv::VLayer* mLayer;
869};
870
1027enum class PaddingMode : int32_t
1028{
1030 kEXPLICIT_ROUND_UP = 1,
1031 kSAME_UPPER = 2,
1032 kSAME_LOWER = 3,
1033};
1034
1035namespace impl
1036{
1042template <>
1044{
1045 static constexpr int32_t kVALUE = 4;
1046};
1047} // namespace impl
1048
1062{
1063public:
1071 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1072 {
1073 mImpl->setNbOutputMaps(nbOutputMaps);
1074 }
1075
1081 int64_t getNbOutputMaps() const noexcept
1082 {
1083 return mImpl->getNbOutputMaps();
1084 }
1085
1101 void setNbGroups(int64_t nbGroups) noexcept
1102 {
1103 mImpl->setNbGroups(nbGroups);
1104 }
1105
1111 int64_t getNbGroups() const noexcept
1112 {
1113 return mImpl->getNbGroups();
1114 }
1115
1125 void setKernelWeights(Weights weights) noexcept
1126 {
1127 mImpl->setKernelWeights(weights);
1128 }
1129
1135 Weights getKernelWeights() const noexcept
1136 {
1137 return mImpl->getKernelWeights();
1138 }
1139
1150 void setBiasWeights(Weights weights) noexcept
1151 {
1152 mImpl->setBiasWeights(weights);
1153 }
1154
1160 Weights getBiasWeights() const noexcept
1161 {
1162 return mImpl->getBiasWeights();
1163 }
1164
1177 void setPrePadding(Dims const& padding) noexcept
1178 {
1179 mImpl->setPrePadding(padding);
1180 }
1181
1187 Dims getPrePadding() const noexcept
1188 {
1189 return mImpl->getPrePadding();
1190 }
1191
1204 void setPostPadding(Dims const& padding) noexcept
1205 {
1206 mImpl->setPostPadding(padding);
1207 }
1208
1214 Dims getPostPadding() const noexcept
1215 {
1216 return mImpl->getPostPadding();
1217 }
1218
1228 void setPaddingMode(PaddingMode paddingMode) noexcept
1229 {
1230 mImpl->setPaddingMode(paddingMode);
1231 }
1232
1241 {
1242 return mImpl->getPaddingMode();
1243 }
1244
1253 void setKernelSizeNd(Dims const& kernelSize) noexcept
1254 {
1255 mImpl->setKernelSizeNd(kernelSize);
1256 }
1257
1263 Dims getKernelSizeNd() const noexcept
1264 {
1265 return mImpl->getKernelSizeNd();
1266 }
1267
1278 void setStrideNd(Dims const& stride) noexcept
1279 {
1280 mImpl->setStrideNd(stride);
1281 }
1282
1288 Dims getStrideNd() const noexcept
1289 {
1290 return mImpl->getStrideNd();
1291 }
1292
1306 void setPaddingNd(Dims const& padding) noexcept
1307 {
1308 mImpl->setPaddingNd(padding);
1309 }
1310
1318 Dims getPaddingNd() const noexcept
1319 {
1320 return mImpl->getPaddingNd();
1321 }
1322
1332 void setDilationNd(Dims const& dilation) noexcept
1333 {
1334 mImpl->setDilationNd(dilation);
1335 }
1336
1342 Dims getDilationNd() const noexcept
1343 {
1344 return mImpl->getDilationNd();
1345 }
1346
1361 using ILayer::setInput;
1362
1363protected:
1364 virtual ~IConvolutionLayer() noexcept = default;
1365 apiv::VConvolutionLayer* mImpl;
1366};
1367
1382{
1383public:
1392 {
1393 mImpl->setActivationType(type);
1394 }
1395
1402 {
1403 return mImpl->getActivationType();
1404 }
1405
1416 void setAlpha(float alpha) noexcept
1417 {
1418 mImpl->setAlpha(alpha);
1419 }
1420
1430 void setBeta(float beta) noexcept
1431 {
1432 mImpl->setBeta(beta);
1433 }
1434
1439 float getAlpha() const noexcept
1440 {
1441 return mImpl->getAlpha();
1442 }
1443
1448 float getBeta() const noexcept
1449 {
1450 return mImpl->getBeta();
1451 }
1452
1453protected:
1454 virtual ~IActivationLayer() noexcept = default;
1455 apiv::VActivationLayer* mImpl;
1456};
1457
1463enum class PoolingType : int32_t
1464{
1465 kMAX = 0,
1466 kAVERAGE = 1,
1468};
1469
1470namespace impl
1471{
1477template <>
1479{
1480 static constexpr int32_t kVALUE = 3;
1481};
1482} // namespace impl
1483
1495class IPoolingLayer : public ILayer
1496{
1497public:
1505 void setPoolingType(PoolingType type) noexcept
1506 {
1507 mImpl->setPoolingType(type);
1508 }
1509
1516 {
1517 return mImpl->getPoolingType();
1518 }
1519
1530 void setBlendFactor(float blendFactor) noexcept
1531 {
1532 mImpl->setBlendFactor(blendFactor);
1533 }
1534
1543 float getBlendFactor() const noexcept
1544 {
1545 return mImpl->getBlendFactor();
1546 }
1547
1557 void setAverageCountExcludesPadding(bool exclusive) noexcept
1558 {
1559 mImpl->setAverageCountExcludesPadding(exclusive);
1560 }
1561
1569 {
1570 return mImpl->getAverageCountExcludesPadding();
1571 }
1572
1586 void setPrePadding(Dims const& padding) noexcept
1587 {
1588 mImpl->setPrePadding(padding);
1589 }
1590
1596 Dims getPrePadding() const noexcept
1597 {
1598 return mImpl->getPrePadding();
1599 }
1600
1614 void setPostPadding(Dims const& padding) noexcept
1615 {
1616 mImpl->setPostPadding(padding);
1617 }
1618
1624 Dims getPostPadding() const noexcept
1625 {
1626 return mImpl->getPostPadding();
1627 }
1628
1637 void setPaddingMode(PaddingMode paddingMode) noexcept
1638 {
1639 mImpl->setPaddingMode(paddingMode);
1640 }
1641
1649 {
1650 return mImpl->getPaddingMode();
1651 }
1652
1661 void setWindowSizeNd(Dims const& windowSize) noexcept
1662 {
1663 mImpl->setWindowSizeNd(windowSize);
1664 }
1665
1671 Dims getWindowSizeNd() const noexcept
1672 {
1673 return mImpl->getWindowSizeNd();
1674 }
1675
1686 void setStrideNd(Dims const& stride) noexcept
1687 {
1688 mImpl->setStrideNd(stride);
1689 }
1690
1696 Dims getStrideNd() const noexcept
1697 {
1698 return mImpl->getStrideNd();
1699 }
1700
1715 void setPaddingNd(Dims const& padding) noexcept
1716 {
1717 mImpl->setPaddingNd(padding);
1718 }
1719
1727 Dims getPaddingNd() const noexcept
1728 {
1729 return mImpl->getPaddingNd();
1730 }
1731
1732protected:
1733 virtual ~IPoolingLayer() noexcept = default;
1734 apiv::VPoolingLayer* mImpl;
1735};
1736
1746class ILRNLayer : public ILayer
1747{
1748public:
1758 void setWindowSize(int64_t windowSize) noexcept
1759 {
1760 mImpl->setWindowSize(windowSize);
1761 }
1762
1768 int64_t getWindowSize() const noexcept
1769 {
1770 return mImpl->getWindowSize();
1771 }
1772
1780 void setAlpha(float alpha) noexcept
1781 {
1782 mImpl->setAlpha(alpha);
1783 }
1784
1790 float getAlpha() const noexcept
1791 {
1792 return mImpl->getAlpha();
1793 }
1794
1802 void setBeta(float beta) noexcept
1803 {
1804 mImpl->setBeta(beta);
1805 }
1806
1812 float getBeta() const noexcept
1813 {
1814 return mImpl->getBeta();
1815 }
1816
1824 void setK(float k) noexcept
1825 {
1826 mImpl->setK(k);
1827 }
1828
1834 float getK() const noexcept
1835 {
1836 return mImpl->getK();
1837 }
1838
1839protected:
1840 virtual ~ILRNLayer() noexcept = default;
1841 apiv::VLRNLayer* mImpl;
1842};
1843
1849enum class ScaleMode : int32_t
1850{
1851 kUNIFORM = 0,
1852 kCHANNEL = 1,
1853 kELEMENTWISE = 2
1854};
1855
1861template <>
1862constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1863{
1864 return 3;
1865}
1866
1892class IScaleLayer : public ILayer
1893{
1894public:
1900 void setMode(ScaleMode mode) noexcept
1901 {
1902 mImpl->setMode(mode);
1903 }
1904
1910 ScaleMode getMode() const noexcept
1911 {
1912 return mImpl->getMode();
1913 }
1914
1920 void setShift(Weights shift) noexcept
1921 {
1922 mImpl->setShift(shift);
1923 }
1924
1930 Weights getShift() const noexcept
1931 {
1932 return mImpl->getShift();
1933 }
1934
1940 void setScale(Weights scale) noexcept
1941 {
1942 mImpl->setScale(scale);
1943 }
1944
1950 Weights getScale() const noexcept
1951 {
1952 return mImpl->getScale();
1953 }
1954
1960 void setPower(Weights power) noexcept
1961 {
1962 mImpl->setPower(power);
1963 }
1964
1970 Weights getPower() const noexcept
1971 {
1972 return mImpl->getPower();
1973 }
1974
1985 int32_t getChannelAxis() const noexcept
1986 {
1987 return mImpl->getChannelAxis();
1988 }
1989
2006 void setChannelAxis(int32_t channelAxis) noexcept
2007 {
2008 mImpl->setChannelAxis(channelAxis);
2009 }
2010
2011protected:
2012 virtual ~IScaleLayer() noexcept = default;
2013 apiv::VScaleLayer* mImpl;
2014};
2015
2036class ISoftMaxLayer : public ILayer
2037{
2038public:
2059 void setAxes(uint32_t axes) noexcept
2060 {
2061 mImpl->setAxes(axes);
2062 }
2063
2069 uint32_t getAxes() const noexcept
2070 {
2071 return mImpl->getAxes();
2072 }
2073
2074protected:
2075 virtual ~ISoftMaxLayer() noexcept = default;
2076 apiv::VSoftMaxLayer* mImpl;
2077};
2078
2092{
2093public:
2105 void setAxis(int32_t axis) noexcept
2106 {
2107 mImpl->setAxis(axis);
2108 }
2109
2115 int32_t getAxis() const noexcept
2116 {
2117 return mImpl->getAxis();
2118 }
2119
2120protected:
2121 virtual ~IConcatenationLayer() noexcept = default;
2122 apiv::VConcatenationLayer* mImpl;
2123};
2124
2133{
2134public:
2142 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2143 {
2144 mImpl->setNbOutputMaps(nbOutputMaps);
2145 }
2146
2152 int64_t getNbOutputMaps() const noexcept
2153 {
2154 return mImpl->getNbOutputMaps();
2155 }
2156
2172 void setNbGroups(int64_t nbGroups) noexcept
2173 {
2174 mImpl->setNbGroups(nbGroups);
2175 }
2176
2182 int64_t getNbGroups() const noexcept
2183 {
2184 return mImpl->getNbGroups();
2185 }
2186
2196 void setKernelWeights(Weights weights) noexcept
2197 {
2198 mImpl->setKernelWeights(weights);
2199 }
2200
2206 Weights getKernelWeights() const noexcept
2207 {
2208 return mImpl->getKernelWeights();
2209 }
2210
2221 void setBiasWeights(Weights weights) noexcept
2222 {
2223 mImpl->setBiasWeights(weights);
2224 }
2225
2231 Weights getBiasWeights() const noexcept
2232 {
2233 return mImpl->getBiasWeights();
2234 }
2235
2248 void setPrePadding(Dims const& padding) noexcept
2249 {
2250 mImpl->setPrePadding(padding);
2251 }
2252
2258 Dims getPrePadding() const noexcept
2259 {
2260 return mImpl->getPrePadding();
2261 }
2262
2275 void setPostPadding(Dims const& padding) noexcept
2276 {
2277 mImpl->setPostPadding(padding);
2278 }
2279
2285 Dims getPostPadding() const noexcept
2286 {
2287 return mImpl->getPostPadding();
2288 }
2289
2299 void setPaddingMode(PaddingMode paddingMode) noexcept
2300 {
2301 mImpl->setPaddingMode(paddingMode);
2302 }
2303
2312 {
2313 return mImpl->getPaddingMode();
2314 }
2315
2326 void setKernelSizeNd(Dims const& kernelSize) noexcept
2327 {
2328 mImpl->setKernelSizeNd(kernelSize);
2329 }
2330
2336 Dims getKernelSizeNd() const noexcept
2337 {
2338 return mImpl->getKernelSizeNd();
2339 }
2340
2353 void setStrideNd(Dims const& stride) noexcept
2354 {
2355 mImpl->setStrideNd(stride);
2356 }
2357
2363 Dims getStrideNd() const noexcept
2364 {
2365 return mImpl->getStrideNd();
2366 }
2367
2381 void setPaddingNd(Dims const& padding) noexcept
2382 {
2383 mImpl->setPaddingNd(padding);
2384 }
2385
2393 Dims getPaddingNd() const noexcept
2394 {
2395 return mImpl->getPaddingNd();
2396 }
2397
2410 using ILayer::setInput;
2411
2419 void setDilationNd(Dims const& dilation) noexcept
2420 {
2421 mImpl->setDilationNd(dilation);
2422 }
2423
2429 Dims getDilationNd() const noexcept
2430 {
2431 return mImpl->getDilationNd();
2432 }
2433
2434protected:
2435 virtual ~IDeconvolutionLayer() noexcept = default;
2436 apiv::VDeconvolutionLayer* mImpl;
2437};
2438
2451enum class ElementWiseOperation : int32_t
2452{
2453 kSUM = 0,
2454 kPROD = 1,
2455 kMAX = 2,
2456 kMIN = 3,
2457 kSUB = 4,
2458 kDIV = 5,
2459 kPOW = 6,
2460 kFLOOR_DIV = 7,
2461 kAND = 8,
2462 kOR = 9,
2463 kXOR = 10,
2464 kEQUAL = 11,
2465 kGREATER = 12,
2466 kLESS = 13
2467};
2468
2469namespace impl
2470{
2476template <>
2478{
2479 static constexpr int32_t kVALUE = 14;
2480};
2481} // namespace impl
2482
2503{
2504public:
2515 {
2516 return mImpl->setOperation(op);
2517 }
2518
2527 {
2528 return mImpl->getOperation();
2529 }
2530
2531protected:
2532 apiv::VElementWiseLayer* mImpl;
2533 virtual ~IElementWiseLayer() noexcept = default;
2534};
2535
2541enum class GatherMode : int32_t
2542{
2543 kDEFAULT = 0,
2544 kELEMENT = 1,
2545 kND = 2
2546};
2547
2553template <>
2554constexpr inline int32_t EnumMax<GatherMode>() noexcept
2555{
2556 return 3;
2557}
2558
2635class IGatherLayer : public ILayer
2636{
2637public:
2647 void setGatherAxis(int32_t axis) noexcept
2648 {
2649 mImpl->setGatherAxis(axis);
2650 }
2651
2659 int32_t getGatherAxis() const noexcept
2660 {
2661 return mImpl->getGatherAxis();
2662 }
2663
2682 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2683 {
2684 mImpl->setNbElementWiseDims(elementWiseDims);
2685 }
2686
2692 int32_t getNbElementWiseDims() const noexcept
2693 {
2694 return mImpl->getNbElementWiseDims();
2695 }
2696
2702 void setMode(GatherMode mode) noexcept
2703 {
2704 mImpl->setMode(mode);
2705 }
2706
2712 GatherMode getMode() const noexcept
2713 {
2714 return mImpl->getMode();
2715 }
2716
2717protected:
2718 apiv::VGatherLayer* mImpl;
2719 virtual ~IGatherLayer() noexcept = default;
2720};
2721
2734{
2735public:
2742 {
2743 return mImpl->getPlugin();
2744 }
2745
2746protected:
2747 apiv::VPluginV2Layer* mImpl;
2748 virtual ~IPluginV2Layer() noexcept = default;
2749};
2750
2761{
2762public:
2769 {
2770 return mImpl->getPlugin();
2771 }
2772
2773protected:
2774 apiv::VPluginV3Layer* mImpl;
2775 virtual ~IPluginV3Layer() noexcept = default;
2776};
2777
2794enum class UnaryOperation : int32_t
2795{
2796 kEXP = 0,
2797 kLOG = 1,
2798 kSQRT = 2,
2799 kRECIP = 3,
2800 kABS = 4,
2801 kNEG = 5,
2802 kSIN = 6,
2803 kCOS = 7,
2804 kTAN = 8,
2805 kSINH = 9,
2806 kCOSH = 10,
2807 kASIN = 11,
2808 kACOS = 12,
2809 kATAN = 13,
2810 kASINH = 14,
2811 kACOSH = 15,
2812 kATANH = 16,
2813 kCEIL = 17,
2814 kFLOOR = 18,
2815 kERF = 19,
2816 kNOT = 20,
2817 kSIGN = 21,
2818 kROUND = 22,
2819 kISINF = 23,
2820 kISNAN = 24,
2821};
2822
2828template <>
2829constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2830{
2831 return 25;
2832}
2833
2841class IUnaryLayer : public ILayer
2842{
2843public:
2852 {
2853 mImpl->setOperation(op);
2854 }
2855
2862 {
2863 return mImpl->getOperation();
2864 }
2865
2866protected:
2867 apiv::VUnaryLayer* mImpl;
2868 virtual ~IUnaryLayer() noexcept = default;
2869};
2870
2889enum class ReduceOperation : int32_t
2890{
2891 kSUM = 0,
2892 kPROD = 1,
2893 kMAX = 2,
2894 kMIN = 3,
2895 kAVG = 4
2896};
2897
2903template <>
2904constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2905{
2906 return 5;
2907}
2908
2916class IReduceLayer : public ILayer
2917{
2918public:
2925 {
2926 mImpl->setOperation(op);
2927 }
2928
2935 {
2936 return mImpl->getOperation();
2937 }
2938
2944 void setReduceAxes(uint32_t reduceAxes) noexcept
2945 {
2946 mImpl->setReduceAxes(reduceAxes);
2947 }
2948
2954 uint32_t getReduceAxes() const noexcept
2955 {
2956 return mImpl->getReduceAxes();
2957 }
2958
2964 void setKeepDimensions(bool keepDimensions) noexcept
2965 {
2966 mImpl->setKeepDimensions(keepDimensions);
2967 }
2968
2974 bool getKeepDimensions() const noexcept
2975 {
2976 return mImpl->getKeepDimensions();
2977 }
2978
2979protected:
2980 apiv::VReduceLayer* mImpl;
2981 virtual ~IReduceLayer() noexcept = default;
2982};
2983
2996class IPaddingLayer : public ILayer
2997{
2998public:
3008 void setPrePaddingNd(Dims const& padding) noexcept
3009 {
3010 mImpl->setPrePaddingNd(padding);
3011 }
3012
3020 Dims getPrePaddingNd() const noexcept
3021 {
3022 return mImpl->getPrePaddingNd();
3023 }
3024
3034 void setPostPaddingNd(Dims const& padding) noexcept
3035 {
3036 mImpl->setPostPaddingNd(padding);
3037 }
3038
3046 Dims getPostPaddingNd() const noexcept
3047 {
3048 return mImpl->getPostPaddingNd();
3049 }
3050
3051protected:
3052 apiv::VPaddingLayer* mImpl;
3053 virtual ~IPaddingLayer() noexcept = default;
3054};
3055
3062{
3069 int32_t order[Dims::MAX_DIMS];
3070};
3071
3084class IShuffleLayer : public ILayer
3085{
3086public:
3096 void setFirstTranspose(Permutation permutation) noexcept
3097 {
3098 mImpl->setFirstTranspose(permutation);
3099 }
3100
3109 {
3110 return mImpl->getFirstTranspose();
3111 }
3112
3136 void setReshapeDimensions(Dims const& dimensions) noexcept
3137 {
3138 mImpl->setReshapeDimensions(dimensions);
3139 }
3140
3150 {
3151 return mImpl->getReshapeDimensions();
3152 }
3153
3159 //
3182 using ILayer::setInput;
3183
3196 void setSecondTranspose(Permutation permutation) noexcept
3197 {
3198 mImpl->setSecondTranspose(permutation);
3199 }
3200
3209 {
3210 return mImpl->getSecondTranspose();
3211 }
3212
3224 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3225 {
3226 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3227 }
3228
3237 bool getZeroIsPlaceholder() const noexcept
3238 {
3239 return mImpl->getZeroIsPlaceholder();
3240 }
3241
3242protected:
3243 apiv::VShuffleLayer* mImpl;
3244 virtual ~IShuffleLayer() noexcept = default;
3245};
3246
3252enum class SampleMode : int32_t
3253{
3254 kSTRICT_BOUNDS = 0,
3255 kWRAP = 1,
3256 kCLAMP = 2,
3257 kFILL = 3,
3258 kREFLECT = 4,
3261};
3262
3268template <>
3269constexpr inline int32_t EnumMax<SampleMode>() noexcept
3270{
3271 return 5;
3272}
3273
3336class ISliceLayer : public ILayer
3337{
3338public:
3348 void setStart(Dims const& start) noexcept
3349 {
3350 mImpl->setStart(start);
3351 }
3352
3363 Dims getStart() const noexcept
3364 {
3365 return mImpl->getStart();
3366 }
3367
3377 void setSize(Dims const& size) noexcept
3378 {
3379 return mImpl->setSize(size);
3380 }
3381
3392 Dims getSize() const noexcept
3393 {
3394 return mImpl->getSize();
3395 }
3396
3406 void setStride(Dims const& stride) noexcept
3407 {
3408 mImpl->setStride(stride);
3409 }
3410
3421 Dims getStride() const noexcept
3422 {
3423 return mImpl->getStride();
3424 }
3425
3431 void setMode(SampleMode mode) noexcept
3432 {
3433 mImpl->setMode(mode);
3434 }
3435
3441 SampleMode getMode() const noexcept
3442 {
3443 return mImpl->getMode();
3444 }
3445
3473 using ILayer::setInput;
3474
3484 void setAxes(Dims const& axes) noexcept
3485 {
3486 mImpl->setAxes(axes);
3487 }
3488
3499 Dims getAxes() const noexcept
3500 {
3501 return mImpl->getAxes();
3502 }
3503
3504protected:
3505 apiv::VSliceLayer* mImpl;
3506 virtual ~ISliceLayer() noexcept = default;
3507};
3508
3521class IShapeLayer : public ILayer
3522{
3523protected:
3524 apiv::VShapeLayer* mImpl;
3525 virtual ~IShapeLayer() noexcept = default;
3526};
3527
3533enum class TopKOperation : int32_t
3534{
3535 kMAX = 0,
3536 kMIN = 1,
3537};
3538
3544template <>
3545constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3546{
3547 return 2;
3548}
3549
3561class ITopKLayer : public ILayer
3562{
3563public:
3569 void setOperation(TopKOperation op) noexcept
3570 {
3571 mImpl->setOperation(op);
3572 }
3573
3580 {
3581 return mImpl->getOperation();
3582 }
3583
3593 void setK(int32_t k) noexcept
3594 {
3595 mImpl->setK(k);
3596 }
3597
3607 int32_t getK() const noexcept
3608 {
3609 return mImpl->getK();
3610 }
3611
3617 void setReduceAxes(uint32_t reduceAxes) noexcept
3618 {
3619 mImpl->setReduceAxes(reduceAxes);
3620 }
3621
3627 uint32_t getReduceAxes() const noexcept
3628 {
3629 return mImpl->getReduceAxes();
3630 }
3631
3646 using ILayer::setInput;
3647
3648protected:
3649 apiv::VTopKLayer* mImpl;
3650 virtual ~ITopKLayer() noexcept = default;
3651};
3652
3659enum class MatrixOperation : int32_t
3660{
3664 kNONE = 0,
3665
3667 kTRANSPOSE = 1,
3668
3679 kVECTOR = 2,
3680};
3681
3687template <>
3688constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3689{
3690 return 3;
3691}
3692
3719{
3720public:
3729 void setOperation(int32_t index, MatrixOperation op) noexcept
3730 {
3731 mImpl->setOperation(index, op);
3732 }
3733
3741 MatrixOperation getOperation(int32_t index) const noexcept
3742 {
3743 return mImpl->getOperation(index);
3744 }
3745
3746protected:
3747 apiv::VMatrixMultiplyLayer* mImpl;
3748 virtual ~IMatrixMultiplyLayer() noexcept = default;
3749};
3750
3772class INonZeroLayer : public ILayer
3773{
3774protected:
3775 virtual ~INonZeroLayer() noexcept = default;
3776 apiv::VNonZeroLayer* mImpl;
3777};
3778
3794{
3795protected:
3796 apiv::VRaggedSoftMaxLayer* mImpl;
3797 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3798};
3799
3844{
3845protected:
3846 apiv::VIdentityLayer* mImpl;
3847 virtual ~IIdentityLayer() noexcept = default;
3848};
3849
3856class ICastLayer : public ILayer
3857{
3858public:
3866 void setToType(DataType toType) noexcept
3867 {
3868 mImpl->setToType(toType);
3869 }
3870
3877 DataType getToType() const noexcept
3878 {
3879 return mImpl->getToType();
3880 }
3881
3882protected:
3883 apiv::VCastLayer* mImpl;
3884 virtual ~ICastLayer() noexcept = default;
3885};
3886
3896{
3897public:
3906 void setWeights(Weights weights) noexcept
3907 {
3908 mImpl->setWeights(weights);
3909 }
3910
3916 Weights getWeights() const noexcept
3917 {
3918 return mImpl->getWeights();
3919 }
3920
3928 void setDimensions(Dims const& dimensions) noexcept
3929 {
3930 mImpl->setDimensions(dimensions);
3931 }
3932
3940 Dims getDimensions() const noexcept
3941 {
3942 return mImpl->getDimensions();
3943 }
3944
3945protected:
3946 apiv::VConstantLayer* mImpl;
3947 virtual ~IConstantLayer() noexcept = default;
3948};
3949
3960{
3961protected:
3962 apiv::VParametricReLULayer* mImpl;
3963 virtual ~IParametricReLULayer() noexcept = default;
3964};
3965
3971enum class InterpolationMode : int32_t
3972{
3973 kNEAREST = 0,
3974 kLINEAR = 1,
3975 kCUBIC = 2
3976};
3977
3978namespace impl
3979{
3985template <>
3987{
3988 static constexpr int32_t kVALUE = 3;
3989};
3990} // namespace impl
3991
4000{
4013 kALIGN_CORNERS = 0,
4014
4021 kASYMMETRIC = 1,
4022
4029 kHALF_PIXEL = 2,
4030};
4031
4032namespace impl
4033{
4039template <>
4041{
4042 static constexpr int32_t kVALUE = 3;
4043};
4044} // namespace impl
4045
4053enum class ResizeSelector : int32_t
4054{
4056 kFORMULA = 0,
4057
4059 kUPPER = 1,
4060};
4061
4062namespace impl
4063{
4069template <>
4071{
4072 static constexpr int32_t kVALUE = 2;
4073};
4074} // namespace impl
4075
4083enum class ResizeRoundMode : int32_t
4084{
4086 kHALF_UP = 0,
4087
4089 kHALF_DOWN = 1,
4090
4092 kFLOOR = 2,
4093
4095 kCEIL = 3,
4096};
4097
4098namespace impl
4099{
4105template <>
4107{
4108 static constexpr int32_t kVALUE = 4;
4109};
4110} // namespace impl
4111
4148class IResizeLayer : public ILayer
4149{
4150public:
4169 void setOutputDimensions(Dims const& dimensions) noexcept
4170 {
4171 return mImpl->setOutputDimensions(dimensions);
4172 }
4173
4179 Dims getOutputDimensions() const noexcept
4180 {
4181 return mImpl->getOutputDimensions();
4182 }
4183
4209 void setScales(float const* scales, int32_t nbScales) noexcept
4210 {
4211 mImpl->setScales(scales, nbScales);
4212 }
4213
4228 int32_t getScales(int32_t size, float* scales) const noexcept
4229 {
4230 return mImpl->getScales(size, scales);
4231 }
4232
4240 void setResizeMode(InterpolationMode interpolationMode) noexcept
4241 {
4242 mImpl->setResizeMode(interpolationMode);
4243 }
4244
4251 {
4252 return mImpl->getResizeMode();
4253 }
4254
4274 using ILayer::setInput;
4275
4286 {
4287 mImpl->setCoordinateTransformation(coordTransform);
4288 }
4289
4296 {
4297 return mImpl->getCoordinateTransformation();
4298 }
4299
4311 {
4312 mImpl->setSelectorForSinglePixel(selector);
4313 }
4314
4321 {
4322 return mImpl->getSelectorForSinglePixel();
4323 }
4324
4335 {
4336 mImpl->setNearestRounding(value);
4337 }
4338
4345 {
4346 return mImpl->getNearestRounding();
4347 }
4348
4366 void setCubicCoeff(float A) noexcept
4367 {
4368 mImpl->setCubicCoeff(A);
4369 }
4370
4376 float getCubicCoeff() const noexcept
4377 {
4378 return mImpl->getCubicCoeff();
4379 }
4380
4389 void setExcludeOutside(bool excludeFlag) noexcept
4390 {
4391 mImpl->setExcludeOutside(excludeFlag);
4392 }
4393
4399 bool getExcludeOutside() const noexcept
4400 {
4401 return mImpl->getExcludeOutside();
4402 }
4403
4404protected:
4405 virtual ~IResizeLayer() noexcept = default;
4406 apiv::VResizeLayer* mImpl;
4407};
4408
4414enum class LoopOutput : int32_t
4415{
4417 kLAST_VALUE = 0,
4418
4420 kCONCATENATE = 1,
4421
4423 kREVERSE = 2
4424};
4425
4431template <>
4432constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4433{
4434 return 3;
4435}
4436
4442enum class TripLimit : int32_t
4443{
4444
4445 kCOUNT = 0,
4446 kWHILE = 1
4447};
4448
4454template <>
4455constexpr inline int32_t EnumMax<TripLimit>() noexcept
4456{
4457 return 2;
4458}
4459
4460class ILoop;
4461
4476{
4477public:
4481 ILoop* getLoop() const noexcept
4482 {
4483 return mBoundary->getLoop();
4484 }
4485
4486protected:
4487 virtual ~ILoopBoundaryLayer() noexcept = default;
4488 apiv::VLoopBoundaryLayer* mBoundary;
4489};
4490
4499{
4500public:
4505 {
4506 return mBoundary->getConditional();
4507 }
4508
4509protected:
4510 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4511 apiv::VConditionalBoundaryLayer* mBoundary;
4512};
4513
4520{
4521public:
4522protected:
4523 virtual ~IConditionLayer() noexcept = default;
4524 apiv::VConditionLayer* mImpl;
4525};
4526
4537{
4538public:
4539protected:
4540 virtual ~IIfConditionalOutputLayer() noexcept = default;
4541 apiv::VConditionalOutputLayer* mImpl;
4542};
4543
4550{
4551public:
4552protected:
4553 virtual ~IIfConditionalInputLayer() noexcept = default;
4554 apiv::VConditionalInputLayer* mImpl;
4555};
4556
4582{
4583public:
4594 {
4595 return mImpl->setCondition(condition);
4596 }
4597
4611 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4612 {
4613 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4614 }
4615
4624 {
4625 return mImpl->addInput(input);
4626 }
4627
4638 void setName(char const* name) noexcept
4639 {
4640 mImpl->setName(name);
4641 }
4642
4648 char const* getName() const noexcept
4649 {
4650 return mImpl->getName();
4651 }
4652
4653protected:
4654 virtual ~IIfConditional() noexcept = default;
4655 apiv::VIfConditional* mImpl;
4656};
4657
4666{
4667public:
4673 //
4686 using ILayer::setInput;
4687
4688protected:
4689 virtual ~IRecurrenceLayer() noexcept = default;
4690 apiv::VRecurrenceLayer* mImpl;
4691};
4692
4713{
4714public:
4718 LoopOutput getLoopOutput() const noexcept
4719 {
4720 return mImpl->getLoopOutput();
4721 }
4722
4735 void setAxis(int32_t axis) noexcept
4736 {
4737 mImpl->setAxis(axis);
4738 }
4739
4743 int32_t getAxis() const noexcept
4744 {
4745 return mImpl->getAxis();
4746 }
4747
4753 //
4768 using ILayer::setInput;
4769
4770protected:
4771 virtual ~ILoopOutputLayer() noexcept = default;
4772 apiv::VLoopOutputLayer* mImpl;
4773};
4774
4787{
4788public:
4792 TripLimit getTripLimit() const noexcept
4793 {
4794 return mImpl->getTripLimit();
4795 }
4796
4797protected:
4798 virtual ~ITripLimitLayer() noexcept = default;
4799 apiv::VTripLimitLayer* mImpl;
4800};
4801
4813{
4814public:
4818 void setAxis(int32_t axis) noexcept
4819 {
4820 mImpl->setAxis(axis);
4821 }
4822
4826 int32_t getAxis() const noexcept
4827 {
4828 return mImpl->getAxis();
4829 }
4830
4840 void setReverse(bool reverse) noexcept
4841 {
4842 mImpl->setReverse(reverse);
4843 }
4844
4850 bool getReverse() const noexcept
4851 {
4852 return mImpl->getReverse();
4853 }
4854
4855protected:
4856 virtual ~IIteratorLayer() noexcept = default;
4857 apiv::VIteratorLayer* mImpl;
4858};
4859
4870class ILoop : public INoCopy
4871{
4872public:
4879 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4880 {
4881 return mImpl->addRecurrence(initialValue);
4882 }
4883
4901 {
4902 return mImpl->addTripLimit(tensor, limit);
4903 }
4904
4913 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4914 {
4915 return mImpl->addIterator(tensor, axis, reverse);
4916 }
4917
4926 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4927 {
4928 return mImpl->addLoopOutput(tensor, outputKind, axis);
4929 }
4930
4941 void setName(char const* name) noexcept
4942 {
4943 mImpl->setName(name);
4944 }
4945
4951 char const* getName() const noexcept
4952 {
4953 return mImpl->getName();
4954 }
4955
4956protected:
4957 virtual ~ILoop() noexcept = default;
4958 apiv::VLoop* mImpl;
4959};
4960
4973class ISelectLayer : public ILayer
4974{
4975protected:
4976 virtual ~ISelectLayer() noexcept = default;
4977 apiv::VSelectLayer* mImpl;
4978};
4979
4996{
4997public:
5006 void setMessage(char const* message) noexcept
5007 {
5008 mImpl->setMessage(message);
5009 }
5010
5016 char const* getMessage() const noexcept
5017 {
5018 return mImpl->getMessage();
5019 }
5020
5021protected:
5022 virtual ~IAssertionLayer() noexcept = default;
5023
5024 apiv::VAssertionLayer* mImpl;
5025};
5026
5034enum class FillOperation : int32_t
5035{
5051 kLINSPACE = 0,
5052
5054 kRANDOM_UNIFORM = 1,
5055
5057 kRANDOM_NORMAL = 2
5058};
5059
5065template <>
5066constexpr inline int32_t EnumMax<FillOperation>() noexcept
5067{
5068 return 3;
5069}
5070
5106class IFillLayer : public ILayer
5107{
5108public:
5117 //
5118 void setDimensions(Dims const& dimensions) noexcept
5119 {
5120 mImpl->setDimensions(dimensions);
5121 }
5122
5133 Dims getDimensions() const noexcept
5134 {
5135 return mImpl->getDimensions();
5136 }
5137
5143 void setOperation(FillOperation op) noexcept
5144 {
5145 mImpl->setOperation(op);
5146 }
5147
5154 {
5155 return mImpl->getOperation();
5156 }
5157
5171 //
5172 void setAlpha(double alpha) noexcept
5173 {
5174 mImpl->setAlpha(alpha);
5175 }
5176
5187 double getAlpha() const noexcept
5188 {
5189 return mImpl->getAlpha();
5190 }
5191
5206 void setBeta(double beta) noexcept
5207 {
5208 mImpl->setBeta(beta);
5209 }
5210
5221 double getBeta() const noexcept
5222 {
5223 return mImpl->getBeta();
5224 }
5225
5266 using ILayer::setInput;
5267
5281 //
5282 void setAlphaInt64(int64_t alpha) noexcept
5283 {
5284 mImpl->setAlphaInt64(alpha);
5285 }
5286
5297 int64_t getAlphaInt64() const noexcept
5298 {
5299 return mImpl->getAlphaInt64();
5300 }
5301
5316 void setBetaInt64(int64_t beta) noexcept
5317 {
5318 mImpl->setBetaInt64(beta);
5319 }
5320
5331 int64_t getBetaInt64() const noexcept
5332 {
5333 return mImpl->getBetaInt64();
5334 }
5335
5339 bool isAlphaBetaInt64() const noexcept
5340 {
5341 return mImpl->isAlphaBetaInt64();
5342 }
5343
5356 void setToType(DataType toType) noexcept
5357 {
5358 mImpl->setToType(toType);
5359 }
5360
5368 DataType getToType() const noexcept
5369 {
5370 return mImpl->getToType();
5371 }
5372
5373protected:
5374 virtual ~IFillLayer() noexcept = default;
5375 apiv::VFillLayer* mImpl;
5376};
5377
5453{
5454public:
5463 int32_t getAxis() const noexcept
5464 {
5465 return mImpl->getAxis();
5466 }
5474 void setAxis(int32_t axis) noexcept
5475 {
5476 mImpl->setAxis(axis);
5477 }
5478
5490 void setToType(DataType toType) noexcept
5491 {
5492 mImpl->setToType(toType);
5493 }
5494
5502 DataType getToType() const noexcept
5503 {
5504 return mImpl->getToType();
5505 }
5506
5507protected:
5508 virtual ~IQuantizeLayer() noexcept = default;
5509 apiv::VQuantizeLayer* mImpl;
5510};
5511
5584{
5585public:
5594 int32_t getAxis() const noexcept
5595 {
5596 return mImpl->getAxis();
5597 }
5605 void setAxis(int32_t axis) noexcept
5606 {
5607 mImpl->setAxis(axis);
5608 }
5609
5621 void setToType(DataType toType) noexcept
5622 {
5623 mImpl->setToType(toType);
5624 }
5625
5633 DataType getToType() const noexcept
5634 {
5635 return mImpl->getToType();
5636 }
5637
5638protected:
5639 virtual ~IDequantizeLayer() noexcept = default;
5640 apiv::VDequantizeLayer* mImpl;
5641};
5642
5661{
5662public:
5674 using ILayer::setInput;
5675
5688 void setToType(DataType toType) noexcept
5689 {
5690 mImpl->setToType(toType);
5691 }
5692
5701 DataType getToType() const noexcept
5702 {
5703 return mImpl->getToType();
5704 }
5705
5714 void setScaleType(DataType scaleType) noexcept
5715 {
5716 mImpl->setScaleType(scaleType);
5717 }
5718
5727 DataType getScaleType() const noexcept
5728 {
5729 return mImpl->getScaleType();
5730 }
5731
5740 void setAxis(int32_t axis) noexcept
5741 {
5742 mImpl->setAxis(axis);
5743 }
5744
5750 int32_t getAxis() const noexcept
5751 {
5752 return mImpl->getAxis();
5753 }
5754
5763 void setBlockSize(int32_t size) noexcept
5764 {
5765 mImpl->setBlockSize(size);
5766 }
5767
5773 int32_t getBlockSize() const noexcept
5774 {
5775 return mImpl->getBlockSize();
5776 }
5777
5778protected:
5779 virtual ~IDynamicQuantizeLayer() noexcept = default;
5780 apiv::VDynamicQuantizeLayer* mImpl;
5781};
5782
5817class IEinsumLayer : public ILayer
5818{
5819public:
5829 bool setEquation(char const* equation) noexcept
5830 {
5831 return mImpl->setEquation(equation);
5832 }
5833
5839 char const* getEquation() const noexcept
5840 {
5841 return mImpl->getEquation();
5842 }
5843
5844protected:
5845 virtual ~IEinsumLayer() noexcept = default;
5846 apiv::VEinsumLayer* mImpl;
5847};
5848
5856enum class ScatterMode : int32_t
5857{
5858 kELEMENT = 0,
5859 kND = 1,
5860};
5861
5867template <>
5868constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5869{
5870 return 2;
5871}
5872
5930class IScatterLayer : public ILayer
5931{
5932public:
5938 void setMode(ScatterMode mode) noexcept
5939 {
5940 mImpl->setMode(mode);
5941 }
5942
5948 ScatterMode getMode() const noexcept
5949 {
5950 return mImpl->getMode();
5951 }
5952
5958 void setAxis(int32_t axis) noexcept
5959 {
5960 mImpl->setAxis(axis);
5961 }
5962
5966 int32_t getAxis() const noexcept
5967 {
5968 return mImpl->getAxis();
5969 }
5970
5971protected:
5972 apiv::VScatterLayer* mImpl;
5973 virtual ~IScatterLayer() noexcept = default;
5974}; // class IScatterLayer
5975
6002class IOneHotLayer : public ILayer
6003{
6004public:
6010 void setAxis(int32_t axis) noexcept
6011 {
6012 mImpl->setAxis(axis);
6013 }
6014
6018 int32_t getAxis() const noexcept
6019 {
6020 return mImpl->getAxis();
6021 }
6022
6023protected:
6024 apiv::VOneHotLayer* mImpl;
6025 virtual ~IOneHotLayer() noexcept = default;
6026};
6027
6040{
6041public:
6048 {
6049 mImpl->setInterpolationMode(mode);
6050 }
6051
6060 {
6061 return mImpl->getInterpolationMode();
6062 }
6063
6069 void setAlignCorners(bool alignCorners) noexcept
6070 {
6071 mImpl->setAlignCorners(alignCorners);
6072 }
6073
6081 bool getAlignCorners() const noexcept
6082 {
6083 return mImpl->getAlignCorners();
6084 }
6085
6093 bool setSampleMode(SampleMode mode) noexcept
6094 {
6095 return mImpl->setSampleMode(mode);
6096 }
6097
6105 SampleMode getSampleMode() const noexcept
6106 {
6107 return mImpl->getSampleMode();
6108 }
6109
6110protected:
6111 apiv::VGridSampleLayer* mImpl;
6112 virtual ~IGridSampleLayer() noexcept = default;
6113}; // class IGridSampleLayer
6114
6122enum class BoundingBoxFormat : int32_t
6123{
6125 kCORNER_PAIRS = 0,
6127 kCENTER_SIZES = 1
6128};
6129
6135template <>
6136constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6137{
6138 return 2;
6139}
6140
6187class INMSLayer : public ILayer
6188{
6189public:
6200 {
6201 mImpl->setBoundingBoxFormat(fmt);
6202 }
6203
6212 {
6213 return mImpl->getBoundingBoxFormat();
6214 }
6215
6225 void setTopKBoxLimit(int32_t limit) noexcept
6226 {
6227 mImpl->setTopKBoxLimit(limit);
6228 }
6229
6235 int32_t getTopKBoxLimit() const noexcept
6236 {
6237 return mImpl->getTopKBoxLimit();
6238 }
6239
6258 using ILayer::setInput;
6259
6260protected:
6261 apiv::VNMSLayer* mImpl;
6262 virtual ~INMSLayer() noexcept = default;
6263}; // class INMSLayer
6264
6278{
6279public:
6288 void setBatchAxis(int32_t batchAxis) noexcept
6289 {
6290 mImpl->setBatchAxis(batchAxis);
6291 }
6292
6298 int32_t getBatchAxis() const noexcept
6299 {
6300 return mImpl->getBatchAxis();
6301 }
6302
6311 void setSequenceAxis(int32_t sequenceAxis) noexcept
6312 {
6313 mImpl->setSequenceAxis(sequenceAxis);
6314 }
6315
6321 int32_t getSequenceAxis() const noexcept
6322 {
6323 return mImpl->getSequenceAxis();
6324 }
6325
6326protected:
6327 apiv::VReverseSequenceLayer* mImpl;
6328 virtual ~IReverseSequenceLayer() noexcept = default;
6329}; // class IReverseSequenceLayer
6330
6350{
6351public:
6359 void setEpsilon(float eps) noexcept
6360 {
6361 return mImpl->setEpsilon(eps);
6362 }
6363
6369 float getEpsilon() const noexcept
6370 {
6371 return mImpl->getEpsilon();
6372 }
6373
6379 void setAxes(uint32_t axesMask) noexcept
6380 {
6381 return mImpl->setAxes(axesMask);
6382 }
6383
6389 uint32_t getAxes() const noexcept
6390 {
6391 return mImpl->getAxes();
6392 }
6393
6410 void setNbGroups(int64_t nbGroups) noexcept
6411 {
6412 return mImpl->setNbGroups(nbGroups);
6413 }
6414
6420 int64_t getNbGroups() const noexcept
6421 {
6422 return mImpl->getNbGroups();
6423 }
6424
6446 void setComputePrecision(DataType type) noexcept
6447 {
6448 return mImpl->setComputePrecision(type);
6449 }
6450
6457 {
6458 return mImpl->getComputePrecision();
6459 }
6460
6461protected:
6462 apiv::VNormalizationLayer* mImpl;
6463 virtual ~INormalizationLayer() noexcept = default;
6464};
6465
6466
6475class ISqueezeLayer : public ILayer
6476{
6477public:
6490 using ILayer::setInput;
6491
6492protected:
6493 apiv::VSqueezeLayer* mImpl;
6494 virtual ~ISqueezeLayer() noexcept = default;
6495};
6496
6505{
6506public:
6519 using ILayer::setInput;
6520
6521protected:
6522 apiv::VUnsqueezeLayer* mImpl;
6523 virtual ~IUnsqueezeLayer() noexcept = default;
6524};
6525
6537enum class CumulativeOperation : int32_t
6538{
6539 kSUM = 0,
6540};
6541
6542namespace impl
6543{
6544
6550template <>
6552{
6553 static constexpr int32_t kVALUE = 1;
6554};
6555
6556} // namespace impl
6557
6586{
6587public:
6598 {
6599 return mImpl->setOperation(op);
6600 }
6601
6610 {
6611 return mImpl->getOperation();
6612 }
6613
6621 void setExclusive(bool exclusive) noexcept
6622 {
6623 mImpl->setExclusive(exclusive);
6624 }
6625
6633 bool getExclusive() const noexcept
6634 {
6635 return mImpl->getExclusive();
6636 }
6637
6645 void setReverse(bool reverse) noexcept
6646 {
6647 mImpl->setReverse(reverse);
6648 }
6649
6657 bool getReverse() const noexcept
6658 {
6659 return mImpl->getReverse();
6660 }
6661
6662protected:
6663 apiv::VCumulativeLayer* mImpl;
6664 virtual ~ICumulativeLayer() noexcept = default;
6665};
6666
6685{
6686public:
6687 virtual ~INetworkDefinition() noexcept = default;
6688
6724 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6725 {
6726 return mImpl->addInput(name, type, dimensions);
6727 }
6728
6738 void markOutput(ITensor& tensor) noexcept
6739 {
6740 mImpl->markOutput(tensor);
6741 }
6742
6756 bool markDebug(ITensor& tensor) noexcept
6757 {
6758 return mImpl->markDebug(tensor);
6759 }
6760
6772 bool unmarkDebug(ITensor& tensor) noexcept
6773 {
6774 return mImpl->unmarkDebug(tensor);
6775 }
6776
6782 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6783 {
6784 return mImpl->isDebugTensor(tensor);
6785 }
6786
6805 {
6806 return mImpl->markUnfusedTensorsAsDebugTensors();
6807 }
6808
6819 {
6820 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
6821 }
6822
6839 {
6840 return mImpl->addActivation(input, type);
6841 }
6842
6857 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6858 {
6859 return mImpl->addLRN(input, window, alpha, beta, k);
6860 }
6861
6883 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6884 {
6885 return mImpl->addScale(input, mode, shift, scale, power);
6886 }
6887
6897 {
6898 return mImpl->addSoftMax(input);
6899 }
6900
6913 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6914 {
6915 return mImpl->addConcatenation(inputs, nbInputs);
6916 }
6917
6941 {
6942 return mImpl->addElementWise(input1, input2, op);
6943 }
6944
6962 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6963 {
6964 return mImpl->addUnary(input, operation);
6965 }
6966
6977 {
6978 return mImpl->addShuffle(input);
6979 }
6980
6993 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6994 {
6995 return mImpl->addOneHot(indices, values, depth, axis);
6996 }
6997
7005 int32_t getNbLayers() const noexcept
7006 {
7007 return mImpl->getNbLayers();
7008 }
7009
7019 ILayer* getLayer(int32_t index) const noexcept
7020 {
7021 return mImpl->getLayer(index);
7022 }
7023
7031 int32_t getNbInputs() const noexcept
7032 {
7033 return mImpl->getNbInputs();
7034 }
7035
7047 ITensor* getInput(int32_t index) const noexcept
7048 {
7049 return mImpl->getInput(index);
7050 }
7051
7061 int32_t getNbOutputs() const noexcept
7062 {
7063 return mImpl->getNbOutputs();
7064 }
7065
7077 ITensor* getOutput(int32_t index) const noexcept
7078 {
7079 return mImpl->getOutput(index);
7080 }
7081
7104 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7105 {
7106 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7107 }
7108
7136 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7137 {
7138 return mImpl->addTopK(input, op, k, reduceAxes);
7139 }
7140
7152 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7153 {
7154 return mImpl->addGather(data, indices, axis);
7155 }
7156
7168 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7169 {
7170 return mImpl->addGatherV2(data, indices, mode);
7171 }
7172
7188 {
7189 return mImpl->addRaggedSoftMax(input, bounds);
7190 }
7191
7209 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7210 {
7211 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7212 }
7213
7224 {
7225 return mImpl->addNonZero(input);
7226 }
7227
7247 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7248 {
7249 return mImpl->addConstant(dimensions, weights);
7250 }
7251
7262 {
7263 return mImpl->addIdentity(input);
7264 }
7265
7276 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7277 {
7278 return mImpl->addCast(input, toType);
7279 }
7280
7291 void removeTensor(ITensor& tensor) noexcept
7292 {
7293 mImpl->removeTensor(tensor);
7294 }
7295
7303 void unmarkOutput(ITensor& tensor) noexcept
7304 {
7305 mImpl->unmarkOutput(tensor);
7306 }
7307
7324 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7325 {
7326 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7327 }
7328
7342 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
7343 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
7344 {
7345 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
7346 }
7347
7362 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7363 {
7364 return mImpl->addSlice(input, start, size, stride);
7365 }
7366
7386 void setName(char const* name) noexcept
7387 {
7388 mImpl->setName(name);
7389 }
7390
7400 char const* getName() const noexcept
7401 {
7402 return mImpl->getName();
7403 }
7404
7416 IShapeLayer* addShape(ITensor& input) noexcept
7417 {
7418 return mImpl->addShape(input);
7419 }
7420
7431 {
7432 return mImpl->hasImplicitBatchDimension();
7433 }
7434
7441 {
7442 return mImpl->getFlags();
7443 }
7444
7452 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7453 {
7454 return mImpl->getFlag(networkDefinitionCreationFlag);
7455 }
7456
7469 bool markOutputForShapes(ITensor& tensor) noexcept
7470 {
7471 return mImpl->markOutputForShapes(tensor);
7472 }
7473
7481 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7482 {
7483 return mImpl->unmarkOutputForShapes(tensor);
7484 }
7485
7500 {
7501 return mImpl->addParametricReLU(input, slope);
7502 }
7503
7522 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7523 {
7524 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7525 }
7526
7541 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7542 {
7543 return mImpl->addPoolingNd(input, type, windowSize);
7544 }
7545
7560 //
7564 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7565 {
7566 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7567 }
7568
7601 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7602 {
7603 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7604 }
7605
7618 {
7619 return mImpl->addResize(input);
7620 }
7621
7631 ILoop* addLoop() noexcept
7632 {
7633 return mImpl->addLoop();
7634 }
7635
7647 {
7648 return mImpl->addIfConditional();
7649 }
7650
7685 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7686 {
7687 return mImpl->addSelect(condition, thenInput, elseInput);
7688 }
7689
7702 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7703 {
7704 return mImpl->addAssertion(condition, message);
7705 }
7706
7727 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7728 {
7729 return mImpl->addFill(dimensions, op);
7730 }
7731
7753 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7754 {
7755 return mImpl->addFillV2(dimensions, op, outputType);
7756 }
7757
7769 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7770 {
7771 return mImpl->addPaddingNd(input, prePadding, postPadding);
7772 }
7773
7793 bool setWeightsName(Weights weights, char const* name) noexcept
7794 {
7795 return mImpl->setWeightsName(weights, name);
7796 }
7797
7809 //
7812 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7813 {
7814 mImpl->setErrorRecorder(recorder);
7815 }
7816
7828 {
7829 return mImpl->getErrorRecorder();
7830 }
7831
7849 {
7850 return mImpl->addDequantize(input, scale);
7851 }
7852
7870 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7871 {
7872 return mImpl->addDequantizeV2(input, scale, outputType);
7873 }
7874
7890 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7891 {
7892 return mImpl->addScatter(data, indices, updates, mode);
7893 }
7894
7912 {
7913 return mImpl->addQuantize(input, scale);
7914 }
7915
7933 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7934 {
7935 return mImpl->addQuantizeV2(input, scale, outputType);
7936 }
7937
7961 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
7962 {
7963 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
7964 }
7965
7976 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7977 {
7978 return mImpl->addEinsum(inputs, nbInputs, equation);
7979 }
7980
7995 {
7996 return mImpl->addGridSample(input, grid);
7997 }
7998
8012 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8013 {
8014 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8015 }
8016
8030 {
8031 return mImpl->addReverseSequence(input, sequenceLens);
8032 }
8033
8055 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8056 {
8057 return mImpl->addNormalization(input, scale, bias, axesMask);
8058 }
8059
8077 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8078 {
8079 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8080 }
8081
8088 virtual IBuilder& getBuilder() const noexcept
8089 {
8090 return mImpl->getBuilder();
8091 }
8092
8101 bool markWeightsRefittable(char const* name) noexcept
8102 {
8103 return mImpl->markWeightsRefittable(name);
8104 }
8105
8113 bool unmarkWeightsRefittable(char const* name) noexcept
8114 {
8115 return mImpl->unmarkWeightsRefittable(name);
8116 }
8117
8126 bool areWeightsMarkedRefittable(char const* name) const noexcept
8127 {
8128 return mImpl->areWeightsMarkedRefittable(name);
8129 }
8130
8145 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8146 {
8147 return mImpl->addSqueeze(input, axes);
8148 }
8149
8167 {
8168 return mImpl->addUnsqueeze(input, axes);
8169 }
8170
8171protected:
8172 apiv::VNetworkDefinition* mImpl;
8173};
8174
8182enum class CalibrationAlgoType : int32_t
8183{
8188};
8189
8195template <>
8196constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8197{
8198 return 4;
8199}
8200
8215{
8216public:
8224 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
8225
8240 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8241
8256 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8257
8266 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8267
8273 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8274
8275 ~IInt8Calibrator() noexcept override = default;
8276};
8277
8278namespace v_1_0
8279{
8281{
8282public:
8286 InterfaceInfo getInterfaceInfo() const noexcept override
8287 {
8288 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
8289 }
8290
8295 {
8297 }
8298
8299 ~IInt8EntropyCalibrator() noexcept override = default;
8300};
8301} // namespace v_1_0
8302
8317
8318namespace v_1_0
8319{
8321{
8322public:
8326 InterfaceInfo getInterfaceInfo() const noexcept override
8327 {
8328 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
8329 }
8330
8335 {
8337 }
8338
8339 ~IInt8EntropyCalibrator2() noexcept override = default;
8340};
8341} // namespace v_1_0
8342
8357
8358namespace v_1_0
8359{
8361{
8362public:
8366 InterfaceInfo getInterfaceInfo() const noexcept override
8367 {
8368 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
8369 }
8370
8375 {
8377 }
8378
8379 ~IInt8MinMaxCalibrator() noexcept override = default;
8380};
8381} // namespace v_1_0
8382
8396
8397namespace v_1_0
8398{
8400{
8401public:
8405 InterfaceInfo getInterfaceInfo() const noexcept override
8406 {
8407 return InterfaceInfo{"IInt8Calibrator", 1, 0};
8408 }
8409
8414 {
8416 }
8417
8424 virtual double getQuantile() const noexcept = 0;
8425
8432 virtual double getRegressionCutoff() const noexcept = 0;
8433
8446 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8447
8456 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8457
8458 ~IInt8LegacyCalibrator() noexcept override = default;
8459};
8460} // namespace v_1_0
8461
8476
8490{
8491public:
8497 DataType getDataType() const noexcept
8498 {
8499 return mImpl->getDataType();
8500 }
8501
8508 Dims getStrides() const noexcept
8509 {
8510 return mImpl->getStrides();
8511 }
8512
8518 int64_t getVectorizedDim() const noexcept
8519 {
8520 return mImpl->getVectorizedDim();
8521 }
8522
8529 int64_t getComponentsPerElement() const noexcept
8530 {
8531 return mImpl->getComponentsPerElement();
8532 }
8533
8534protected:
8535 virtual ~IAlgorithmIOInfo() noexcept = default;
8536 apiv::VAlgorithmIOInfo* mImpl;
8537};
8538
8553{
8554public:
8558 int64_t getImplementation() const noexcept
8559 {
8560 return mImpl->getImplementation();
8561 }
8562
8566 int64_t getTactic() const noexcept
8567 {
8568 return mImpl->getTactic();
8569 }
8570
8571protected:
8572 virtual ~IAlgorithmVariant() noexcept = default;
8573 apiv::VAlgorithmVariant* mImpl;
8574};
8575
8587{
8588public:
8594 char const* getName() const noexcept
8595 {
8596 return mImpl->getName();
8597 }
8598
8606 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8607 {
8608 return mImpl->getDimensions(index, select);
8609 }
8610
8614 int32_t getNbInputs() const noexcept
8615 {
8616 return mImpl->getNbInputs();
8617 }
8618
8622 int32_t getNbOutputs() const noexcept
8623 {
8624 return mImpl->getNbOutputs();
8625 }
8626
8627protected:
8628 virtual ~IAlgorithmContext() noexcept = default;
8629 apiv::VAlgorithmContext* mImpl;
8630};
8631
8646{
8647public:
8652 {
8653 return mImpl->getAlgorithmVariant();
8654 }
8655
8659 float getTimingMSec() const noexcept
8660 {
8661 return mImpl->getTimingMSec();
8662 }
8663
8667 std::size_t getWorkspaceSize() const noexcept
8668 {
8669 return mImpl->getWorkspaceSize();
8670 }
8671
8681 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8682 {
8683 return mImpl->getAlgorithmIOInfoByIndex(index);
8684 }
8685
8686protected:
8687 virtual ~IAlgorithm() noexcept = default;
8688 apiv::VAlgorithm* mImpl;
8689}; // IAlgorithm
8690
8691namespace v_1_0
8692{
8694{
8695public:
8699 InterfaceInfo getInterfaceInfo() const noexcept override
8700 {
8701 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8702 }
8717 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8718 int32_t nbChoices, int32_t* selection) noexcept = 0;
8719
8730 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8731 int32_t nbAlgorithms) noexcept = 0;
8732
8733 virtual ~IAlgorithmSelector() noexcept = default;
8734};
8735} // namespace v_1_0
8736
8750
8757using QuantizationFlags = uint32_t;
8758
8768enum class QuantizationFlag : int32_t
8769{
8774};
8775
8781template <>
8782constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8783{
8784 return 1;
8785}
8786
8804enum class RuntimePlatform : int32_t
8805{
8808 kSAME_AS_BUILD = 0,
8809
8812 kWINDOWS_AMD64 = 1,
8813};
8814
8815namespace impl
8816{
8822template <>
8824{
8825 static constexpr int32_t kVALUE = 2;
8826};
8827} // namespace impl
8828
8835using BuilderFlags = uint32_t;
8836
8844enum class BuilderFlag : int32_t
8845{
8849
8853
8855 kDEBUG = 2,
8856
8858 kGPU_FALLBACK = 3,
8859
8861 kREFIT = 4,
8862
8865
8869 kTF32 = 6,
8870
8872 kSPARSE_WEIGHTS = 7,
8873
8880 kSAFETY_SCOPE = 8,
8881
8885
8890
8896
8900
8907
8913
8921
8925
8930
8936
8938 kSTRIP_PLAN = 19,
8939
8942
8949 kREFIT_IDENTICAL = 20,
8950
8976 kWEIGHT_STREAMING = 21,
8977
8981
8986 kREFIT_INDIVIDUAL = 23,
8987
8996 kSTRICT_NANS = 24,
8997
8999 kMONITOR_MEMORY = 25,
9000
9004
9007
9019};
9020
9026template <>
9027constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
9028{
9029 return 29;
9030}
9031
9032namespace v_1_0
9033{
9047{
9048 uint8_t data[16];
9049};
9050
9059{
9061 uint64_t tacticHash;
9065 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
9066};
9067} // namespace v_1_0
9068
9082class ITimingCache : public INoCopy
9083{
9084public:
9085 virtual ~ITimingCache() noexcept = default;
9086
9096 nvinfer1::IHostMemory* serialize() const noexcept
9097 {
9098 return mImpl->serialize();
9099 }
9100
9120 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
9121 {
9122 return mImpl->combine(inputCache, ignoreMismatch);
9123 }
9124
9130 bool reset() noexcept
9131 {
9132 return mImpl->reset();
9133 }
9134
9149 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
9150 {
9151 return mImpl->queryKeys(keyBuffer, capacity);
9152 }
9153
9166 TimingCacheValue query(TimingCacheKey const& key) const noexcept
9167 {
9168 return mImpl->query(key);
9169 }
9170
9188 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
9189 {
9190 return mImpl->update(key, value);
9191 }
9192
9193protected:
9194 apiv::VTimingCache* mImpl;
9195};
9196
9204enum class MemoryPoolType : int32_t
9205{
9212 kWORKSPACE = 0,
9213
9221
9227 kDLA_LOCAL_DRAM = 2,
9228
9234 kDLA_GLOBAL_DRAM = 3,
9235
9243 kTACTIC_DRAM = 4,
9244
9258};
9259
9265template <>
9266constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9267{
9268 return 6;
9269}
9270
9279enum class PreviewFeature : int32_t
9280{
9287
9292
9299};
9300
9301namespace impl
9302{
9308template <>
9310{
9311 static constexpr int32_t kVALUE = 3;
9312};
9313} // namespace impl
9314
9323enum class HardwareCompatibilityLevel : int32_t
9324{
9327 kNONE = 0,
9328
9340 kAMPERE_PLUS = 1,
9341
9351};
9352
9353namespace impl
9354{
9360template <>
9362{
9363 static constexpr int32_t kVALUE = 3;
9364};
9365} // namespace impl
9366
9367
9376enum class TilingOptimizationLevel : int32_t
9377{
9379 kNONE = 0,
9380
9382 kFAST = 1,
9383
9386 kMODERATE = 2,
9387
9389 kFULL = 3
9390
9391};
9392
9393namespace impl
9394{
9400template <>
9402{
9403 static constexpr int32_t kVALUE = 4;
9404};
9405} // namespace impl
9406
9407namespace v_1_0
9408{
9410{
9411public:
9412 IProgressMonitor() = default;
9413 virtual ~IProgressMonitor() noexcept = default;
9414
9418 InterfaceInfo getInterfaceInfo() const noexcept override
9419 {
9420 return InterfaceInfo{"IProgressMonitor", 1, 0};
9421 }
9422
9442 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9443
9456 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9457
9469 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9470
9471}; // class IProgressMonitor
9472} // namespace v_1_0
9473
9494
9503{
9504public:
9505 virtual ~IBuilderConfig() noexcept = default;
9506
9515 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9516 {
9517 mImpl->setAvgTimingIterations(avgTiming);
9518 }
9519
9527 int32_t getAvgTimingIterations() const noexcept
9528 {
9529 return mImpl->getAvgTimingIterations();
9530 }
9531
9540 void setEngineCapability(EngineCapability capability) noexcept
9541 {
9542 mImpl->setEngineCapability(capability);
9543 }
9544
9553 {
9554 return mImpl->getEngineCapability();
9555 }
9556
9565 {
9566 mImpl->setInt8Calibrator(calibrator);
9567 }
9568
9575 {
9576 return mImpl->getInt8Calibrator();
9577 }
9578
9591 void setFlags(BuilderFlags builderFlags) noexcept
9592 {
9593 mImpl->setFlags(builderFlags);
9594 }
9595
9603 BuilderFlags getFlags() const noexcept
9604 {
9605 return mImpl->getFlags();
9606 }
9607
9615 void clearFlag(BuilderFlag builderFlag) noexcept
9616 {
9617 mImpl->clearFlag(builderFlag);
9618 }
9619
9627 void setFlag(BuilderFlag builderFlag) noexcept
9628 {
9629 mImpl->setFlag(builderFlag);
9630 }
9631
9639 bool getFlag(BuilderFlag builderFlag) const noexcept
9640 {
9641 return mImpl->getFlag(builderFlag);
9642 }
9643
9656 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9657 {
9658 mImpl->setDeviceType(layer, deviceType);
9659 }
9660
9666 DeviceType getDeviceType(ILayer const* layer) const noexcept
9667 {
9668 return mImpl->getDeviceType(layer);
9669 }
9670
9678 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9679 {
9680 return mImpl->isDeviceTypeSet(layer);
9681 }
9682
9688 void resetDeviceType(ILayer const* layer) noexcept
9689 {
9690 mImpl->resetDeviceType(layer);
9691 }
9692
9698 bool canRunOnDLA(ILayer const* layer) const noexcept
9699 {
9700 return mImpl->canRunOnDLA(layer);
9701 }
9702
9714 void setDLACore(int32_t dlaCore) noexcept
9715 {
9716 mImpl->setDLACore(dlaCore);
9717 }
9718
9724 int32_t getDLACore() const noexcept
9725 {
9726 return mImpl->getDLACore();
9727 }
9728
9735 void setDefaultDeviceType(DeviceType deviceType) noexcept
9736 {
9737 mImpl->setDefaultDeviceType(deviceType);
9738 }
9739
9746 {
9747 return mImpl->getDefaultDeviceType();
9748 }
9749
9755 void reset() noexcept
9756 {
9757 mImpl->reset();
9758 }
9759
9767 void setProfileStream(const cudaStream_t stream) noexcept
9768 {
9769 return mImpl->setProfileStream(stream);
9770 }
9771
9779 cudaStream_t getProfileStream() const noexcept
9780 {
9781 return mImpl->getProfileStream();
9782 }
9783
9796 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9797 {
9798 return mImpl->addOptimizationProfile(profile);
9799 }
9800
9809 int32_t getNbOptimizationProfiles() const noexcept
9810 {
9811 return mImpl->getNbOptimizationProfiles();
9812 }
9813
9822 {
9823 mImpl->setProfilingVerbosity(verbosity);
9824 }
9825
9835 {
9836 return mImpl->getProfilingVerbosity();
9837 }
9838
9847 {
9848 mImpl->setAlgorithmSelector(selector);
9849 }
9850
9857 {
9858 return mImpl->getAlgorithmSelector();
9859 }
9860
9875 {
9876 return mImpl->setCalibrationProfile(profile);
9877 }
9878
9887 {
9888 return mImpl->getCalibrationProfile();
9889 }
9890
9906 {
9907 mImpl->setQuantizationFlags(flags);
9908 }
9909
9920 {
9921 return mImpl->getQuantizationFlags();
9922 }
9923
9934 {
9935 mImpl->clearQuantizationFlag(flag);
9936 }
9937
9948 {
9949 mImpl->setQuantizationFlag(flag);
9950 }
9951
9962 {
9963 return mImpl->getQuantizationFlag(flag);
9964 }
9965
9983 bool setTacticSources(TacticSources tacticSources) noexcept
9984 {
9985 return mImpl->setTacticSources(tacticSources);
9986 }
9987
9999 {
10000 return mImpl->getTacticSources();
10001 }
10002
10018 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
10019 {
10020 return mImpl->createTimingCache(blob, size);
10021 }
10022
10041 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
10042 {
10043 return mImpl->setTimingCache(cache, ignoreMismatch);
10044 }
10045
10052 {
10053 return mImpl->getTimingCache();
10054 }
10055
10083 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
10084 {
10085 mImpl->setMemoryPoolLimit(pool, poolSize);
10086 }
10087
10102 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
10103 {
10104 return mImpl->getMemoryPoolLimit(pool);
10105 }
10106
10120 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
10121 {
10122 mImpl->setPreviewFeature(feature, enable);
10123 }
10124
10134 bool getPreviewFeature(PreviewFeature feature) const noexcept
10135 {
10136 return mImpl->getPreviewFeature(feature);
10137 }
10138
10167 void setBuilderOptimizationLevel(int32_t level) noexcept
10168 {
10169 mImpl->setBuilderOptimizationLevel(level);
10170 }
10171
10180 {
10181 return mImpl->getBuilderOptimizationLevel();
10182 }
10183
10196 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
10197 {
10198 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
10199 }
10200
10210 {
10211 return mImpl->getHardwareCompatibilityLevel();
10212 }
10213
10222 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
10223 {
10224 mImpl->setPluginsToSerialize(paths, nbPaths);
10225 }
10226
10235 char const* getPluginToSerialize(int32_t index) const noexcept
10236 {
10237 return mImpl->getPluginToSerialize(index);
10238 }
10239
10245 int32_t getNbPluginsToSerialize() const noexcept
10246 {
10247 return mImpl->getNbPluginsToSerialize();
10248 }
10249
10274 void setMaxAuxStreams(int32_t nbStreams) noexcept
10275 {
10276 mImpl->setMaxAuxStreams(nbStreams);
10277 }
10278
10284 int32_t getMaxAuxStreams() const noexcept
10285 {
10286 return mImpl->getMaxAuxStreams();
10287 }
10288
10300 void setProgressMonitor(IProgressMonitor* monitor) noexcept
10301 {
10302 return mImpl->setProgressMonitor(monitor);
10303 }
10304
10311 {
10312 return mImpl->getProgressMonitor();
10313 }
10314
10326 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
10327 {
10328 mImpl->setRuntimePlatform(runtimePlatform);
10329 }
10330
10339 {
10340 return mImpl->getRuntimePlatform();
10341 }
10342
10350 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10351 {
10352 mImpl->setMaxNbTactics(maxNbTactics);
10353 }
10354
10362 int32_t getMaxNbTactics() const noexcept
10363 {
10364 return mImpl->getMaxNbTactics();
10365 }
10366
10379 {
10380 return mImpl->setTilingOptimizationLevel(level);
10381 }
10382
10391 {
10392 return mImpl->getTilingOptimizationLevel();
10393 }
10394
10406 bool setL2LimitForTiling(int64_t size) noexcept
10407 {
10408 return mImpl->setL2LimitForTiling(size);
10409 }
10410
10418 int64_t getL2LimitForTiling() const noexcept
10419 {
10420 return mImpl->getL2LimitForTiling();
10421 }
10422
10423
10424protected:
10425 apiv::VBuilderConfig* mImpl;
10426};
10427
10436
10446{
10451
10456 kSTRONGLY_TYPED = 1,
10461
10466};
10467
10473template <>
10474constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10475{
10476 return 4;
10477}
10478
10486class IBuilder : public INoCopy
10487{
10488public:
10489 virtual ~IBuilder() noexcept = default;
10490
10496 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
10497 {
10498 return mImpl->platformHasFastFp16();
10499 }
10500
10507 {
10508 return mImpl->platformHasFastInt8();
10509 }
10510
10518 int32_t getMaxDLABatchSize() const noexcept
10519 {
10520 return mImpl->getMaxDLABatchSize();
10521 }
10522
10526 int32_t getNbDLACores() const noexcept
10527 {
10528 return mImpl->getNbDLACores();
10529 }
10530
10544 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10545 {
10546 mImpl->setGpuAllocator(allocator);
10547 }
10548
10559 {
10560 return mImpl->createBuilderConfig();
10561 }
10562
10585 {
10586 return mImpl->createNetworkV2(flags);
10587 }
10588
10600 {
10601 return mImpl->createOptimizationProfile();
10602 }
10603
10618 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10619 {
10620 mImpl->setErrorRecorder(recorder);
10621 }
10622
10634 {
10635 return mImpl->getErrorRecorder();
10636 }
10637
10641 void reset() noexcept
10642 {
10643 mImpl->reset();
10644 }
10645
10651 TRT_DEPRECATED bool platformHasTf32() const noexcept
10652 {
10653 return mImpl->platformHasTf32();
10654 }
10655
10671 {
10672 return mImpl->buildSerializedNetwork(network, config);
10673 }
10674
10691 {
10692 return mImpl->buildEngineWithConfig(network, config);
10693 }
10694
10712 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10713 {
10714 return mImpl->isNetworkSupported(network, config);
10715 }
10716
10722 ILogger* getLogger() const noexcept
10723 {
10724 return mImpl->getLogger();
10725 }
10726
10738 bool setMaxThreads(int32_t maxThreads) noexcept
10739 {
10740 return mImpl->setMaxThreads(maxThreads);
10741 }
10742
10752 int32_t getMaxThreads() const noexcept
10753 {
10754 return mImpl->getMaxThreads();
10755 }
10756
10763 {
10764 return mImpl->getPluginRegistry();
10765 }
10766
10767protected:
10768 apiv::VBuilder* mImpl;
10769};
10770
10771} // namespace nvinfer1
10772
10777extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10778
10779namespace nvinfer1
10780{
10781namespace
10782{
10783
10791inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10792{
10793 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10794}
10795
10796} // namespace
10797
10811 nvinfer1::EngineCapability capability) noexcept;
10812
10813namespace safe
10814{
10816class IPluginRegistry;
10817} // namespace safe
10818
10826extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
10827 nvinfer1::EngineCapability capability) noexcept;
10828
10829} // namespace nvinfer1
10830
10831#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:216
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:219
An Activation layer in a network definition.
Definition: NvInfer.h:1382
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1430
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1391
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1401
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1439
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1448
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1416
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:8587
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8622
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8614
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:8594
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:8606
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8646
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:8667
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8659
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:8681
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8651
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8490
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:8518
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8508
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8497
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8529
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8553
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8566
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8558
An assertion layer in a network.
Definition: NvInfer.h:4996
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:5006
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5016
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9503
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:10083
TRT_DEPRECATED void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9905
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:10018
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:10120
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9846
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:9564
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10134
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:10179
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9983
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:10222
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10378
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:10406
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:9574
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:10102
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9724
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:10245
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9656
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9540
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10284
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9639
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10350
TRT_DEPRECATED void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9933
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:10418
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:10300
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9821
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9809
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:10051
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9755
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:10041
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:10235
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9552
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:10338
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9745
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:10326
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10362
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9603
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9591
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9998
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9688
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9714
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:10209
TRT_DEPRECATED QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9919
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9615
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9796
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:10310
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:10425
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9886
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9527
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:9735
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9627
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9874
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9666
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9698
TRT_DEPRECATED bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9961
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9779
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:10196
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:10390
TRT_DEPRECATED void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9947
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10274
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9834
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9678
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:10167
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9767
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9856
Builds an engine from a network definition.
Definition: NvInfer.h:10487
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:10518
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10526
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10633
apiv::VBuilder * mImpl
Definition: NvInfer.h:10768
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10722
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:10712
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10752
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10762
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:10506
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10599
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10544
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10584
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10558
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10641
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10738
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10618
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10670
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:10651
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10690
A cast layer in a network.
Definition: NvInfer.h:3857
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3883
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3877
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3866
A concatenation layer in a network definition.
Definition: NvInfer.h:2092
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2105
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2115
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4520
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3896
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3906
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3916
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3928
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3946
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3940
A convolution layer in a network definition.
Definition: NvInfer.h:1062
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1187
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1160
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1228
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1332
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1318
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1288
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1135
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1278
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1342
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1081
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1125
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1214
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1111
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1240
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1101
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1071
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1150
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1263
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1306
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1177
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1204
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1253
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3120
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6586
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6597
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6645
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6663
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6633
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6657
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6621
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6609
A deconvolution layer in a network definition.
Definition: NvInfer.h:2133
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2221
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2182
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2206
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2248
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2363
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2429
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2231
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2196
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2152
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2353
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2285
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2336
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2275
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2326
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2381
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2142
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2393
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2419
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2299
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2172
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2258
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2311
A Dequantize layer in a network definition.
Definition: NvInfer.h:5584
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5621
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5594
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5633
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5605
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5661
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5750
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5773
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5727
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5714
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5701
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5688
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5740
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5763
An Einsum layer in a network.
Definition: NvInfer.h:5818
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:5829
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5839
A elementwise layer in a network definition.
Definition: NvInfer.h:2503
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2532
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2526
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2514
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5107
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5339
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5153
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5143
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5368
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5282
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5316
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5206
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5297
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5331
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5187
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5118
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5172
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5356
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5133
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5221
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2636
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:2647
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2682
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2718
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2692
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2702
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2659
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2712
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:6040
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6047
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6093
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6069
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6111
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6105
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6059
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6081
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:3844
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3846
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4499
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4504
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4582
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4623
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4648
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4593
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4611
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4638
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4550
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4537
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:8215
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:4813
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4840
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4850
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4826
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4818
A LRN layer in a network definition.
Definition: NvInfer.h:1747
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1768
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1790
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1758
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1824
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1780
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1802
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1812
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1834
Base class for all layer classes in a network definition.
Definition: NvInfer.h:577
TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:697
TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:785
TRT_DEPRECATED bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:723
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:848
TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:830
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:598
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:616
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:861
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:800
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:709
TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:816
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:608
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:637
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:647
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:664
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:629
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:584
TRT_DEPRECATED void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:735
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:4476
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4481
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4871
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4941
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4900
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4913
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:4926
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4951
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4879
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4713
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4743
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4718
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4735
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3719
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3747
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3741
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3729
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6188
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6225
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6199
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6211
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6261
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6235
A network definition for input to the builder.
Definition: NvInfer.h:6685
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6913
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6976
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8055
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7386
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6756
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6857
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7136
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8077
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7702
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:7521
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7276
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:7600
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7400
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7499
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7077
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7047
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7870
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7481
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7753
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7631
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:7960
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:6804
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6838
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7727
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7362
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7911
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8088
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8012
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7019
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7452
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7646
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7827
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8145
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8029
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7031
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7440
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7933
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7103
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6962
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7994
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7291
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8126
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7685
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:7890
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7005
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7430
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8172
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7469
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6993
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6883
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:7342
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7303
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7261
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7168
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6940
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7247
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7812
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7541
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7187
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7416
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:7152
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8113
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8101
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:7563
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7617
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8166
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7208
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6896
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6782
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6772
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7976
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6738
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:7324
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:7769
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7223
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7848
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7061
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7793
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:6818
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3773
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6350
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6369
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6389
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6359
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6456
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6462
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6420
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6379
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6446
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6410
A OneHot layer in a network definition.
Definition: NvInfer.h:6003
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6024
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:6010
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6018
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2627
Layer that represents a padding operation.
Definition: NvInfer.h:2997
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3046
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3008
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:3034
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3020
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3052
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3960
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3962
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:2734
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2747
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2741
Layer type for V3 plugins.
Definition: NvInfer.h:2761
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2768
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2774
A Pooling layer in a network definition.
Definition: NvInfer.h:1496
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1515
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1648
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1624
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1568
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1596
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1505
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1661
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1637
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1671
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:1557
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1715
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1543
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1686
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1696
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1727
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1614
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1586
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1530
A Quantize layer in a network definition.
Definition: NvInfer.h:5453
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5490
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5474
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5463
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5502
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3794
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3796
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4666
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2917
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2964
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2924
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2934
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2954
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2944
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2980
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2974
A resize layer in a network definition.
Definition: NvInfer.h:4149
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4310
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4334
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:4228
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4169
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4366
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4209
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4376
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4320
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4250
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4285
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4389
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4240
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4179
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4344
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4399
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4295
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6278
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6311
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6298
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6327
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6321
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6288
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1893
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1950
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1970
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1940
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1960
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1910
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1920
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:2006
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1930
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1900
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1985
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5931
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5938
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5972
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5958
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5966
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5948
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4974
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3522
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3524
Layer type for shuffling data.
Definition: NvInfer.h:3085
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3243
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3096
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3196
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3149
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3136
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3108
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3208
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3237
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3224
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3337
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3406
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3505
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3377
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3484
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3348
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3363
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3431
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3392
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3441
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3421
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3499
A Softmax layer in a network definition.
Definition: NvInfer.h:2037
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2059
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2069
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:6476
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6493
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:453
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:372
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:411
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:518
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:403
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:497
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:431
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:321
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:346
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:313
TRT_DEPRECATED void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:281
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:360
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:329
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:296
apiv::VTensor * mImpl
Definition: NvInfer.h:565
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:421
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:544
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:559
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:391
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:466
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:9083
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:9149
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:9120
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:9166
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:9188
apiv::VTimingCache * mImpl
Definition: NvInfer.h:9194
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:9130
Layer that represents a TopK reduction.
Definition: NvInfer.h:3562
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3593
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3617
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3579
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3649
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3569
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3607
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3627
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4787
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4792
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2842
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2851
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2867
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2861
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6505
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6522
An Interface class for version control.
Definition: NvInferRuntimeBase.h:276
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:241
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:8694
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:8699
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:413
Definition: NvInferRuntime.h:1610
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8334
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8326
Definition: NvInfer.h:8281
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8294
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8286
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:8400
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8413
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8405
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:8361
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8374
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8366
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:9410
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:10791
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:2913
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4054
@ 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:9205
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1850
@ 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:8805
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8757
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9324
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6538
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6123
@ 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:9027
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:118
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8196
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2795
@ 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:2904
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4455
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:5035
@ 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:4084
@ 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:1028
@ 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:4443
@ 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:10435
PreviewFeature
Define preview features.
Definition: NvInfer.h:9280
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9377
@ 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:2554
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:8835
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1304
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1862
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:8183
@ 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:8782
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3253
@ 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:2542
@ 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:2925
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10446
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2452
@ 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:8769
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3269
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3972
@ 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:8845
@ 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.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ 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.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3545
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9266
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3534
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2890
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4432
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:10474
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5857
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3660
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:4000
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2829
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4415
@ 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:6136
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3688
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1464
@ 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:9493
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5066
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:2587
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5868
Represents a permutation of dimensions.
Definition: NvInfer.h:3062
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:9047
Definition: NvInfer.h:9059
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:9061
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:9063

  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