TensorRT 10.7.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2024 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
32//
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};
109
115template <>
116constexpr inline int32_t EnumMax<LayerType>() noexcept
117{
118 return 49;
119}
120
127using TensorFormats = uint32_t;
128
134enum class ActivationType : int32_t
135{
136 kRELU = 0,
137 kSIGMOID = 1,
138 kTANH = 2,
139 kLEAKY_RELU = 3,
140 kELU = 4,
141 kSELU = 5,
142 kSOFTSIGN = 6,
143 kSOFTPLUS = 7,
144 kCLIP = 8,
145 kHARD_SIGMOID = 9,
146 kSCALED_TANH = 10,
147 kTHRESHOLDED_RELU = 11,
148 kGELU_ERF = 12,
149 kGELU_TANH = 13
150};
151
152namespace impl
153{
159template <>
161{
162 static constexpr int32_t kVALUE = 14;
163};
164} // namespace impl
165
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
260 void setType(DataType type) noexcept
261 {
262 mImpl->setType(type);
263 }
264
272 DataType getType() const noexcept
273 {
274 return mImpl->getType();
275 }
276
289 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
290 {
291 return mImpl->setDynamicRange(min, max);
292 }
293
297 bool isNetworkInput() const noexcept
298 {
299 return mImpl->isNetworkInput();
300 }
301
305 bool isNetworkOutput() const noexcept
306 {
307 return mImpl->isNetworkOutput();
308 }
309
322 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
323 {
324 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
325 }
326
337 {
338 return mImpl->getBroadcastAcrossBatch();
339 }
340
349 {
350 return mImpl->getLocation();
351 }
352
368 {
369 mImpl->setLocation(location);
370 }
371
379 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
380 {
381 return mImpl->dynamicRangeIsSet();
382 }
383
387 void resetDynamicRange() noexcept
388 {
389 mImpl->resetDynamicRange();
390 }
391
397 float getDynamicRangeMin() const noexcept
398 {
399 return mImpl->getDynamicRangeMin();
400 }
401
407 float getDynamicRangeMax() const noexcept
408 {
409 return mImpl->getDynamicRangeMax();
410 }
411
429 void setAllowedFormats(TensorFormats formats) noexcept
430 {
431 mImpl->setAllowedFormats(formats);
432 }
433
443 {
444 return mImpl->getAllowedFormats();
445 }
446
473 bool isShapeTensor() const noexcept
474 {
475 return mImpl->isShapeTensor();
476 }
477
494 bool isExecutionTensor() const noexcept
495 {
496 return mImpl->isExecutionTensor();
497 }
498
520 void setDimensionName(int32_t index, char const* name) noexcept
521 {
522 mImpl->setDimensionName(index, name);
523 }
524
535 char const* getDimensionName(int32_t index) const noexcept
536 {
537 return mImpl->getDimensionName(index);
538 }
539
540protected:
541 apiv::VTensor* mImpl;
542 virtual ~ITensor() noexcept = default;
543};
544
552class ILayer : public INoCopy
553{
554public:
560 LayerType getType() const noexcept
561 {
562 return mLayer->getType();
563 }
564
574 void setName(char const* name) noexcept
575 {
576 mLayer->setName(name);
577 }
578
584 char const* getName() const noexcept
585 {
586 return mLayer->getName();
587 }
588
592 int32_t getNbInputs() const noexcept
593 {
594 return mLayer->getNbInputs();
595 }
596
605 ITensor* getInput(int32_t index) const noexcept
606 {
607 return mLayer->getInput(index);
608 }
609
613 int32_t getNbOutputs() const noexcept
614 {
615 return mLayer->getNbOutputs();
616 }
617
623 ITensor* getOutput(int32_t index) const noexcept
624 {
625 return mLayer->getOutput(index);
626 }
627
640 void setInput(int32_t index, ITensor& tensor) noexcept
641 {
642 return mLayer->setInput(index, tensor);
643 }
644
671 void setPrecision(DataType dataType) noexcept
672 {
673 mLayer->setPrecision(dataType);
674 }
675
683 DataType getPrecision() const noexcept
684 {
685 return mLayer->getPrecision();
686 }
687
695 bool precisionIsSet() const noexcept
696 {
697 return mLayer->precisionIsSet();
698 }
699
705 void resetPrecision() noexcept
706 {
707 mLayer->resetPrecision();
708 }
709
752 void setOutputType(int32_t index, DataType dataType) noexcept
753 {
754 mLayer->setOutputType(index, dataType);
755 }
756
767 DataType getOutputType(int32_t index) const noexcept
768 {
769 return mLayer->getOutputType(index);
770 }
771
781 bool outputTypeIsSet(int32_t index) const noexcept
782 {
783 return mLayer->outputTypeIsSet(index);
784 }
785
793 void resetOutputType(int32_t index) noexcept
794 {
795 return mLayer->resetOutputType(index);
796 }
797
811 void setMetadata(char const* metadata) noexcept
812 {
813 mLayer->setMetadata(metadata);
814 }
815
824 char const* getMetadata() const noexcept
825 {
826 return mLayer->getMetadata();
827 }
828
829protected:
830 virtual ~ILayer() noexcept = default;
831 apiv::VLayer* mLayer;
832};
833
990enum class PaddingMode : int32_t
991{
994 kSAME_UPPER = 2,
995 kSAME_LOWER = 3,
996};
997
998namespace impl
999{
1005template <>
1007{
1008 static constexpr int32_t kVALUE = 4;
1009};
1010} // namespace impl
1011
1025{
1026public:
1034 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1035 {
1036 mImpl->setNbOutputMaps(nbOutputMaps);
1037 }
1038
1044 int64_t getNbOutputMaps() const noexcept
1045 {
1046 return mImpl->getNbOutputMaps();
1047 }
1048
1064 void setNbGroups(int64_t nbGroups) noexcept
1065 {
1066 mImpl->setNbGroups(nbGroups);
1067 }
1068
1074 int64_t getNbGroups() const noexcept
1075 {
1076 return mImpl->getNbGroups();
1077 }
1078
1088 void setKernelWeights(Weights weights) noexcept
1089 {
1090 mImpl->setKernelWeights(weights);
1091 }
1092
1098 Weights getKernelWeights() const noexcept
1099 {
1100 return mImpl->getKernelWeights();
1101 }
1102
1113 void setBiasWeights(Weights weights) noexcept
1114 {
1115 mImpl->setBiasWeights(weights);
1116 }
1117
1123 Weights getBiasWeights() const noexcept
1124 {
1125 return mImpl->getBiasWeights();
1126 }
1127
1140 void setPrePadding(Dims const& padding) noexcept
1141 {
1142 mImpl->setPrePadding(padding);
1143 }
1144
1150 Dims getPrePadding() const noexcept
1151 {
1152 return mImpl->getPrePadding();
1153 }
1154
1167 void setPostPadding(Dims const& padding) noexcept
1168 {
1169 mImpl->setPostPadding(padding);
1170 }
1171
1177 Dims getPostPadding() const noexcept
1178 {
1179 return mImpl->getPostPadding();
1180 }
1181
1191 void setPaddingMode(PaddingMode paddingMode) noexcept
1192 {
1193 mImpl->setPaddingMode(paddingMode);
1194 }
1195
1204 {
1205 return mImpl->getPaddingMode();
1206 }
1207
1216 void setKernelSizeNd(Dims const& kernelSize) noexcept
1217 {
1218 mImpl->setKernelSizeNd(kernelSize);
1219 }
1220
1226 Dims getKernelSizeNd() const noexcept
1227 {
1228 return mImpl->getKernelSizeNd();
1229 }
1230
1241 void setStrideNd(Dims const& stride) noexcept
1242 {
1243 mImpl->setStrideNd(stride);
1244 }
1245
1251 Dims getStrideNd() const noexcept
1252 {
1253 return mImpl->getStrideNd();
1254 }
1255
1269 void setPaddingNd(Dims const& padding) noexcept
1270 {
1271 mImpl->setPaddingNd(padding);
1272 }
1273
1281 Dims getPaddingNd() const noexcept
1282 {
1283 return mImpl->getPaddingNd();
1284 }
1285
1295 void setDilationNd(Dims const& dilation) noexcept
1296 {
1297 mImpl->setDilationNd(dilation);
1298 }
1299
1305 Dims getDilationNd() const noexcept
1306 {
1307 return mImpl->getDilationNd();
1308 }
1309
1324 using ILayer::setInput;
1325
1326protected:
1327 virtual ~IConvolutionLayer() noexcept = default;
1328 apiv::VConvolutionLayer* mImpl;
1329};
1330
1345{
1346public:
1355 {
1356 mImpl->setActivationType(type);
1357 }
1358
1365 {
1366 return mImpl->getActivationType();
1367 }
1368
1379 void setAlpha(float alpha) noexcept
1380 {
1381 mImpl->setAlpha(alpha);
1382 }
1383
1393 void setBeta(float beta) noexcept
1394 {
1395 mImpl->setBeta(beta);
1396 }
1397
1402 float getAlpha() const noexcept
1403 {
1404 return mImpl->getAlpha();
1405 }
1406
1411 float getBeta() const noexcept
1412 {
1413 return mImpl->getBeta();
1414 }
1415
1416protected:
1417 virtual ~IActivationLayer() noexcept = default;
1418 apiv::VActivationLayer* mImpl;
1419};
1420
1426enum class PoolingType : int32_t
1427{
1428 kMAX = 0,
1429 kAVERAGE = 1,
1431};
1432
1433namespace impl
1434{
1440template <>
1442{
1443 static constexpr int32_t kVALUE = 3;
1444};
1445} // namespace impl
1446
1458class IPoolingLayer : public ILayer
1459{
1460public:
1468 void setPoolingType(PoolingType type) noexcept
1469 {
1470 mImpl->setPoolingType(type);
1471 }
1472
1479 {
1480 return mImpl->getPoolingType();
1481 }
1482
1493 void setBlendFactor(float blendFactor) noexcept
1494 {
1495 mImpl->setBlendFactor(blendFactor);
1496 }
1497
1506 float getBlendFactor() const noexcept
1507 {
1508 return mImpl->getBlendFactor();
1509 }
1510
1520 void setAverageCountExcludesPadding(bool exclusive) noexcept
1521 {
1522 mImpl->setAverageCountExcludesPadding(exclusive);
1523 }
1524
1532 {
1533 return mImpl->getAverageCountExcludesPadding();
1534 }
1535
1549 void setPrePadding(Dims const& padding) noexcept
1550 {
1551 mImpl->setPrePadding(padding);
1552 }
1553
1559 Dims getPrePadding() const noexcept
1560 {
1561 return mImpl->getPrePadding();
1562 }
1563
1577 void setPostPadding(Dims const& padding) noexcept
1578 {
1579 mImpl->setPostPadding(padding);
1580 }
1581
1587 Dims getPostPadding() const noexcept
1588 {
1589 return mImpl->getPostPadding();
1590 }
1591
1600 void setPaddingMode(PaddingMode paddingMode) noexcept
1601 {
1602 mImpl->setPaddingMode(paddingMode);
1603 }
1604
1612 {
1613 return mImpl->getPaddingMode();
1614 }
1615
1624 void setWindowSizeNd(Dims const& windowSize) noexcept
1625 {
1626 mImpl->setWindowSizeNd(windowSize);
1627 }
1628
1634 Dims getWindowSizeNd() const noexcept
1635 {
1636 return mImpl->getWindowSizeNd();
1637 }
1638
1649 void setStrideNd(Dims const& stride) noexcept
1650 {
1651 mImpl->setStrideNd(stride);
1652 }
1653
1659 Dims getStrideNd() const noexcept
1660 {
1661 return mImpl->getStrideNd();
1662 }
1663
1678 void setPaddingNd(Dims const& padding) noexcept
1679 {
1680 mImpl->setPaddingNd(padding);
1681 }
1682
1690 Dims getPaddingNd() const noexcept
1691 {
1692 return mImpl->getPaddingNd();
1693 }
1694
1695protected:
1696 virtual ~IPoolingLayer() noexcept = default;
1697 apiv::VPoolingLayer* mImpl;
1698};
1699
1709class ILRNLayer : public ILayer
1710{
1711public:
1721 void setWindowSize(int64_t windowSize) noexcept
1722 {
1723 mImpl->setWindowSize(windowSize);
1724 }
1725
1731 int64_t getWindowSize() const noexcept
1732 {
1733 return mImpl->getWindowSize();
1734 }
1735
1743 void setAlpha(float alpha) noexcept
1744 {
1745 mImpl->setAlpha(alpha);
1746 }
1747
1753 float getAlpha() const noexcept
1754 {
1755 return mImpl->getAlpha();
1756 }
1757
1765 void setBeta(float beta) noexcept
1766 {
1767 mImpl->setBeta(beta);
1768 }
1769
1775 float getBeta() const noexcept
1776 {
1777 return mImpl->getBeta();
1778 }
1779
1787 void setK(float k) noexcept
1788 {
1789 mImpl->setK(k);
1790 }
1791
1797 float getK() const noexcept
1798 {
1799 return mImpl->getK();
1800 }
1801
1802protected:
1803 virtual ~ILRNLayer() noexcept = default;
1804 apiv::VLRNLayer* mImpl;
1805};
1806
1812enum class ScaleMode : int32_t
1813{
1814 kUNIFORM = 0,
1815 kCHANNEL = 1,
1816 kELEMENTWISE = 2
1817};
1818
1824template <>
1825constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1826{
1827 return 3;
1828}
1829
1855class IScaleLayer : public ILayer
1856{
1857public:
1863 void setMode(ScaleMode mode) noexcept
1864 {
1865 mImpl->setMode(mode);
1866 }
1867
1873 ScaleMode getMode() const noexcept
1874 {
1875 return mImpl->getMode();
1876 }
1877
1883 void setShift(Weights shift) noexcept
1884 {
1885 mImpl->setShift(shift);
1886 }
1887
1893 Weights getShift() const noexcept
1894 {
1895 return mImpl->getShift();
1896 }
1897
1903 void setScale(Weights scale) noexcept
1904 {
1905 mImpl->setScale(scale);
1906 }
1907
1913 Weights getScale() const noexcept
1914 {
1915 return mImpl->getScale();
1916 }
1917
1923 void setPower(Weights power) noexcept
1924 {
1925 mImpl->setPower(power);
1926 }
1927
1933 Weights getPower() const noexcept
1934 {
1935 return mImpl->getPower();
1936 }
1937
1948 int32_t getChannelAxis() const noexcept
1949 {
1950 return mImpl->getChannelAxis();
1951 }
1952
1969 void setChannelAxis(int32_t channelAxis) noexcept
1970 {
1971 mImpl->setChannelAxis(channelAxis);
1972 }
1973
1974protected:
1975 virtual ~IScaleLayer() noexcept = default;
1976 apiv::VScaleLayer* mImpl;
1977};
1978
1999class ISoftMaxLayer : public ILayer
2000{
2001public:
2022 void setAxes(uint32_t axes) noexcept
2023 {
2024 mImpl->setAxes(axes);
2025 }
2026
2032 uint32_t getAxes() const noexcept
2033 {
2034 return mImpl->getAxes();
2035 }
2036
2037protected:
2038 virtual ~ISoftMaxLayer() noexcept = default;
2039 apiv::VSoftMaxLayer* mImpl;
2040};
2041
2055{
2056public:
2068 void setAxis(int32_t axis) noexcept
2069 {
2070 mImpl->setAxis(axis);
2071 }
2072
2078 int32_t getAxis() const noexcept
2079 {
2080 return mImpl->getAxis();
2081 }
2082
2083protected:
2084 virtual ~IConcatenationLayer() noexcept = default;
2085 apiv::VConcatenationLayer* mImpl;
2086};
2087
2096{
2097public:
2105 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2106 {
2107 mImpl->setNbOutputMaps(nbOutputMaps);
2108 }
2109
2115 int64_t getNbOutputMaps() const noexcept
2116 {
2117 return mImpl->getNbOutputMaps();
2118 }
2119
2135 void setNbGroups(int64_t nbGroups) noexcept
2136 {
2137 mImpl->setNbGroups(nbGroups);
2138 }
2139
2145 int64_t getNbGroups() const noexcept
2146 {
2147 return mImpl->getNbGroups();
2148 }
2149
2159 void setKernelWeights(Weights weights) noexcept
2160 {
2161 mImpl->setKernelWeights(weights);
2162 }
2163
2169 Weights getKernelWeights() const noexcept
2170 {
2171 return mImpl->getKernelWeights();
2172 }
2173
2184 void setBiasWeights(Weights weights) noexcept
2185 {
2186 mImpl->setBiasWeights(weights);
2187 }
2188
2194 Weights getBiasWeights() const noexcept
2195 {
2196 return mImpl->getBiasWeights();
2197 }
2198
2211 void setPrePadding(Dims const& padding) noexcept
2212 {
2213 mImpl->setPrePadding(padding);
2214 }
2215
2221 Dims getPrePadding() const noexcept
2222 {
2223 return mImpl->getPrePadding();
2224 }
2225
2238 void setPostPadding(Dims const& padding) noexcept
2239 {
2240 mImpl->setPostPadding(padding);
2241 }
2242
2248 Dims getPostPadding() const noexcept
2249 {
2250 return mImpl->getPostPadding();
2251 }
2252
2262 void setPaddingMode(PaddingMode paddingMode) noexcept
2263 {
2264 mImpl->setPaddingMode(paddingMode);
2265 }
2266
2275 {
2276 return mImpl->getPaddingMode();
2277 }
2278
2289 void setKernelSizeNd(Dims const& kernelSize) noexcept
2290 {
2291 mImpl->setKernelSizeNd(kernelSize);
2292 }
2293
2299 Dims getKernelSizeNd() const noexcept
2300 {
2301 return mImpl->getKernelSizeNd();
2302 }
2303
2316 void setStrideNd(Dims const& stride) noexcept
2317 {
2318 mImpl->setStrideNd(stride);
2319 }
2320
2326 Dims getStrideNd() const noexcept
2327 {
2328 return mImpl->getStrideNd();
2329 }
2330
2344 void setPaddingNd(Dims const& padding) noexcept
2345 {
2346 mImpl->setPaddingNd(padding);
2347 }
2348
2356 Dims getPaddingNd() const noexcept
2357 {
2358 return mImpl->getPaddingNd();
2359 }
2360
2373 using ILayer::setInput;
2374
2382 void setDilationNd(Dims const& dilation) noexcept
2383 {
2384 mImpl->setDilationNd(dilation);
2385 }
2386
2392 Dims getDilationNd() const noexcept
2393 {
2394 return mImpl->getDilationNd();
2395 }
2396
2397protected:
2398 virtual ~IDeconvolutionLayer() noexcept = default;
2399 apiv::VDeconvolutionLayer* mImpl;
2400};
2401
2416enum class ElementWiseOperation : int32_t
2417{
2418 kSUM = 0,
2419 kPROD = 1,
2420 kMAX = 2,
2421 kMIN = 3,
2422 kSUB = 4,
2423 kDIV = 5,
2424 kPOW = 6,
2425 kFLOOR_DIV = 7,
2426 kAND = 8,
2427 kOR = 9,
2428 kXOR = 10,
2429 kEQUAL = 11,
2430 kGREATER = 12,
2431 kLESS = 13
2432};
2433
2434namespace impl
2435{
2441template <>
2443{
2444 static constexpr int32_t kVALUE = 14;
2445};
2446} // namespace impl
2447
2468{
2469public:
2480 {
2481 return mImpl->setOperation(op);
2482 }
2483
2492 {
2493 return mImpl->getOperation();
2494 }
2495
2496protected:
2497 apiv::VElementWiseLayer* mImpl;
2498 virtual ~IElementWiseLayer() noexcept = default;
2499};
2500
2506enum class GatherMode : int32_t
2507{
2508 kDEFAULT = 0,
2509 kELEMENT = 1,
2510 kND = 2
2511};
2512
2518template <>
2519constexpr inline int32_t EnumMax<GatherMode>() noexcept
2520{
2521 return 3;
2522}
2523
2600class IGatherLayer : public ILayer
2601{
2602public:
2612 void setGatherAxis(int32_t axis) noexcept
2613 {
2614 mImpl->setGatherAxis(axis);
2615 }
2616
2624 int32_t getGatherAxis() const noexcept
2625 {
2626 return mImpl->getGatherAxis();
2627 }
2628
2647 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2648 {
2649 mImpl->setNbElementWiseDims(elementWiseDims);
2650 }
2651
2657 int32_t getNbElementWiseDims() const noexcept
2658 {
2659 return mImpl->getNbElementWiseDims();
2660 }
2661
2667 void setMode(GatherMode mode) noexcept
2668 {
2669 mImpl->setMode(mode);
2670 }
2671
2677 GatherMode getMode() const noexcept
2678 {
2679 return mImpl->getMode();
2680 }
2681
2682protected:
2683 apiv::VGatherLayer* mImpl;
2684 virtual ~IGatherLayer() noexcept = default;
2685};
2686
2697{
2698public:
2705 {
2706 return mImpl->getPlugin();
2707 }
2708
2709protected:
2710 apiv::VPluginV2Layer* mImpl;
2711 virtual ~IPluginV2Layer() noexcept = default;
2712};
2713
2724{
2725public:
2732 {
2733 return mImpl->getPlugin();
2734 }
2735
2736protected:
2737 apiv::VPluginV3Layer* mImpl;
2738 virtual ~IPluginV3Layer() noexcept = default;
2739};
2740
2757enum class UnaryOperation : int32_t
2758{
2759 kEXP = 0,
2760 kLOG = 1,
2761 kSQRT = 2,
2762 kRECIP = 3,
2763 kABS = 4,
2764 kNEG = 5,
2765 kSIN = 6,
2766 kCOS = 7,
2767 kTAN = 8,
2768 kSINH = 9,
2769 kCOSH = 10,
2770 kASIN = 11,
2771 kACOS = 12,
2772 kATAN = 13,
2773 kASINH = 14,
2774 kACOSH = 15,
2775 kATANH = 16,
2776 kCEIL = 17,
2777 kFLOOR = 18,
2778 kERF = 19,
2779 kNOT = 20,
2780 kSIGN = 21,
2781 kROUND = 22,
2782 kISINF = 23,
2783 kISNAN = 24,
2784};
2785
2791template <>
2792constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2793{
2794 return 25;
2795}
2796
2804class IUnaryLayer : public ILayer
2805{
2806public:
2815 {
2816 mImpl->setOperation(op);
2817 }
2818
2825 {
2826 return mImpl->getOperation();
2827 }
2828
2829protected:
2830 apiv::VUnaryLayer* mImpl;
2831 virtual ~IUnaryLayer() noexcept = default;
2832};
2833
2852enum class ReduceOperation : int32_t
2853{
2854 kSUM = 0,
2855 kPROD = 1,
2856 kMAX = 2,
2857 kMIN = 3,
2858 kAVG = 4
2859};
2860
2866template <>
2867constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2868{
2869 return 5;
2870}
2871
2879class IReduceLayer : public ILayer
2880{
2881public:
2888 {
2889 mImpl->setOperation(op);
2890 }
2891
2898 {
2899 return mImpl->getOperation();
2900 }
2901
2907 void setReduceAxes(uint32_t reduceAxes) noexcept
2908 {
2909 mImpl->setReduceAxes(reduceAxes);
2910 }
2911
2917 uint32_t getReduceAxes() const noexcept
2918 {
2919 return mImpl->getReduceAxes();
2920 }
2921
2927 void setKeepDimensions(bool keepDimensions) noexcept
2928 {
2929 mImpl->setKeepDimensions(keepDimensions);
2930 }
2931
2937 bool getKeepDimensions() const noexcept
2938 {
2939 return mImpl->getKeepDimensions();
2940 }
2941
2942protected:
2943 apiv::VReduceLayer* mImpl;
2944 virtual ~IReduceLayer() noexcept = default;
2945};
2946
2959class IPaddingLayer : public ILayer
2960{
2961public:
2971 void setPrePaddingNd(Dims const& padding) noexcept
2972 {
2973 mImpl->setPrePaddingNd(padding);
2974 }
2975
2983 Dims getPrePaddingNd() const noexcept
2984 {
2985 return mImpl->getPrePaddingNd();
2986 }
2987
2997 void setPostPaddingNd(Dims const& padding) noexcept
2998 {
2999 mImpl->setPostPaddingNd(padding);
3000 }
3001
3009 Dims getPostPaddingNd() const noexcept
3010 {
3011 return mImpl->getPostPaddingNd();
3012 }
3013
3014protected:
3015 apiv::VPaddingLayer* mImpl;
3016 virtual ~IPaddingLayer() noexcept = default;
3017};
3018
3025{
3032 int32_t order[Dims::MAX_DIMS];
3033};
3034
3047class IShuffleLayer : public ILayer
3048{
3049public:
3059 void setFirstTranspose(Permutation permutation) noexcept
3060 {
3061 mImpl->setFirstTranspose(permutation);
3062 }
3063
3072 {
3073 return mImpl->getFirstTranspose();
3074 }
3075
3099 void setReshapeDimensions(Dims const& dimensions) noexcept
3100 {
3101 mImpl->setReshapeDimensions(dimensions);
3102 }
3103
3113 {
3114 return mImpl->getReshapeDimensions();
3115 }
3116
3122 //
3145 using ILayer::setInput;
3146
3159 void setSecondTranspose(Permutation permutation) noexcept
3160 {
3161 mImpl->setSecondTranspose(permutation);
3162 }
3163
3172 {
3173 return mImpl->getSecondTranspose();
3174 }
3175
3187 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3188 {
3189 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3190 }
3191
3200 bool getZeroIsPlaceholder() const noexcept
3201 {
3202 return mImpl->getZeroIsPlaceholder();
3203 }
3204
3205protected:
3206 apiv::VShuffleLayer* mImpl;
3207 virtual ~IShuffleLayer() noexcept = default;
3208};
3209
3215enum class SampleMode : int32_t
3216{
3217 kSTRICT_BOUNDS = 0,
3218 kWRAP = 1,
3219 kCLAMP = 2,
3220 kFILL = 3,
3221 kREFLECT = 4,
3224};
3225
3231template <>
3232constexpr inline int32_t EnumMax<SampleMode>() noexcept
3233{
3234 return 5;
3235}
3236
3299class ISliceLayer : public ILayer
3300{
3301public:
3311 void setStart(Dims const& start) noexcept
3312 {
3313 mImpl->setStart(start);
3314 }
3315
3326 Dims getStart() const noexcept
3327 {
3328 return mImpl->getStart();
3329 }
3330
3340 void setSize(Dims const& size) noexcept
3341 {
3342 return mImpl->setSize(size);
3343 }
3344
3355 Dims getSize() const noexcept
3356 {
3357 return mImpl->getSize();
3358 }
3359
3369 void setStride(Dims const& stride) noexcept
3370 {
3371 mImpl->setStride(stride);
3372 }
3373
3384 Dims getStride() const noexcept
3385 {
3386 return mImpl->getStride();
3387 }
3388
3394 void setMode(SampleMode mode) noexcept
3395 {
3396 mImpl->setMode(mode);
3397 }
3398
3404 SampleMode getMode() const noexcept
3405 {
3406 return mImpl->getMode();
3407 }
3408
3436 using ILayer::setInput;
3437
3447 void setAxes(Dims const& axes) noexcept
3448 {
3449 mImpl->setAxes(axes);
3450 }
3451
3462 Dims getAxes() const noexcept
3463 {
3464 return mImpl->getAxes();
3465 }
3466
3467protected:
3468 apiv::VSliceLayer* mImpl;
3469 virtual ~ISliceLayer() noexcept = default;
3470};
3471
3484class IShapeLayer : public ILayer
3485{
3486protected:
3487 apiv::VShapeLayer* mImpl;
3488 virtual ~IShapeLayer() noexcept = default;
3489};
3490
3496enum class TopKOperation : int32_t
3497{
3498 kMAX = 0,
3499 kMIN = 1,
3500};
3501
3507template <>
3508constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3509{
3510 return 2;
3511}
3512
3524class ITopKLayer : public ILayer
3525{
3526public:
3532 void setOperation(TopKOperation op) noexcept
3533 {
3534 mImpl->setOperation(op);
3535 }
3536
3543 {
3544 return mImpl->getOperation();
3545 }
3546
3556 void setK(int32_t k) noexcept
3557 {
3558 mImpl->setK(k);
3559 }
3560
3570 int32_t getK() const noexcept
3571 {
3572 return mImpl->getK();
3573 }
3574
3580 void setReduceAxes(uint32_t reduceAxes) noexcept
3581 {
3582 mImpl->setReduceAxes(reduceAxes);
3583 }
3584
3590 uint32_t getReduceAxes() const noexcept
3591 {
3592 return mImpl->getReduceAxes();
3593 }
3594
3609 using ILayer::setInput;
3610
3611protected:
3612 apiv::VTopKLayer* mImpl;
3613 virtual ~ITopKLayer() noexcept = default;
3614};
3615
3622enum class MatrixOperation : int32_t
3623{
3627 kNONE = 0,
3628
3630 kTRANSPOSE = 1,
3631
3642 kVECTOR = 2,
3643};
3644
3650template <>
3651constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3652{
3653 return 3;
3654}
3655
3682{
3683public:
3692 void setOperation(int32_t index, MatrixOperation op) noexcept
3693 {
3694 mImpl->setOperation(index, op);
3695 }
3696
3704 MatrixOperation getOperation(int32_t index) const noexcept
3705 {
3706 return mImpl->getOperation(index);
3707 }
3708
3709protected:
3710 apiv::VMatrixMultiplyLayer* mImpl;
3711 virtual ~IMatrixMultiplyLayer() noexcept = default;
3712};
3713
3735class INonZeroLayer : public ILayer
3736{
3737protected:
3738 virtual ~INonZeroLayer() noexcept = default;
3739 apiv::VNonZeroLayer* mImpl;
3740};
3741
3757{
3758protected:
3759 apiv::VRaggedSoftMaxLayer* mImpl;
3760 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3761};
3762
3790{
3791protected:
3792 apiv::VIdentityLayer* mImpl;
3793 virtual ~IIdentityLayer() noexcept = default;
3794};
3795
3802class ICastLayer : public ILayer
3803{
3804public:
3812 void setToType(DataType toType) noexcept
3813 {
3814 mImpl->setToType(toType);
3815 }
3816
3823 DataType getToType() const noexcept
3824 {
3825 return mImpl->getToType();
3826 }
3827
3828protected:
3829 apiv::VCastLayer* mImpl;
3830 virtual ~ICastLayer() noexcept = default;
3831};
3832
3842{
3843public:
3852 void setWeights(Weights weights) noexcept
3853 {
3854 mImpl->setWeights(weights);
3855 }
3856
3862 Weights getWeights() const noexcept
3863 {
3864 return mImpl->getWeights();
3865 }
3866
3874 void setDimensions(Dims const& dimensions) noexcept
3875 {
3876 mImpl->setDimensions(dimensions);
3877 }
3878
3886 Dims getDimensions() const noexcept
3887 {
3888 return mImpl->getDimensions();
3889 }
3890
3891protected:
3892 apiv::VConstantLayer* mImpl;
3893 virtual ~IConstantLayer() noexcept = default;
3894};
3895
3906{
3907protected:
3908 apiv::VParametricReLULayer* mImpl;
3909 virtual ~IParametricReLULayer() noexcept = default;
3910};
3911
3917enum class InterpolationMode : int32_t
3918{
3919 kNEAREST = 0,
3920 kLINEAR = 1,
3921 kCUBIC = 2
3922};
3923
3924namespace impl
3925{
3931template <>
3933{
3934 static constexpr int32_t kVALUE = 3;
3935};
3936} // namespace impl
3937
3946{
3959 kALIGN_CORNERS = 0,
3960
3967 kASYMMETRIC = 1,
3968
3975 kHALF_PIXEL = 2,
3976};
3977
3978namespace impl
3979{
3985template <>
3987{
3988 static constexpr int32_t kVALUE = 3;
3989};
3990} // namespace impl
3991
3999enum class ResizeSelector : int32_t
4000{
4002 kFORMULA = 0,
4003
4005 kUPPER = 1,
4006};
4007
4008namespace impl
4009{
4015template <>
4017{
4018 static constexpr int32_t kVALUE = 2;
4019};
4020} // namespace impl
4021
4029enum class ResizeRoundMode : int32_t
4030{
4032 kHALF_UP = 0,
4033
4035 kHALF_DOWN = 1,
4036
4038 kFLOOR = 2,
4039
4041 kCEIL = 3,
4042};
4043
4044namespace impl
4045{
4051template <>
4053{
4054 static constexpr int32_t kVALUE = 4;
4055};
4056} // namespace impl
4057
4094class IResizeLayer : public ILayer
4095{
4096public:
4115 void setOutputDimensions(Dims const& dimensions) noexcept
4116 {
4117 return mImpl->setOutputDimensions(dimensions);
4118 }
4119
4125 Dims getOutputDimensions() const noexcept
4126 {
4127 return mImpl->getOutputDimensions();
4128 }
4129
4155 void setScales(float const* scales, int32_t nbScales) noexcept
4156 {
4157 mImpl->setScales(scales, nbScales);
4158 }
4159
4174 int32_t getScales(int32_t size, float* scales) const noexcept
4175 {
4176 return mImpl->getScales(size, scales);
4177 }
4178
4186 void setResizeMode(InterpolationMode interpolationMode) noexcept
4187 {
4188 mImpl->setResizeMode(interpolationMode);
4189 }
4190
4197 {
4198 return mImpl->getResizeMode();
4199 }
4200
4220 using ILayer::setInput;
4221
4232 {
4233 mImpl->setCoordinateTransformation(coordTransform);
4234 }
4235
4242 {
4243 return mImpl->getCoordinateTransformation();
4244 }
4245
4257 {
4258 mImpl->setSelectorForSinglePixel(selector);
4259 }
4260
4267 {
4268 return mImpl->getSelectorForSinglePixel();
4269 }
4270
4281 {
4282 mImpl->setNearestRounding(value);
4283 }
4284
4291 {
4292 return mImpl->getNearestRounding();
4293 }
4294
4312 void setCubicCoeff(float A) noexcept
4313 {
4314 mImpl->setCubicCoeff(A);
4315 }
4316
4322 float getCubicCoeff() const noexcept
4323 {
4324 return mImpl->getCubicCoeff();
4325 }
4326
4335 void setExcludeOutside(bool excludeFlag) noexcept
4336 {
4337 mImpl->setExcludeOutside(excludeFlag);
4338 }
4339
4345 bool getExcludeOutside() const noexcept
4346 {
4347 return mImpl->getExcludeOutside();
4348 }
4349
4350protected:
4351 virtual ~IResizeLayer() noexcept = default;
4352 apiv::VResizeLayer* mImpl;
4353};
4354
4358enum class LoopOutput : int32_t
4359{
4361 kLAST_VALUE = 0,
4362
4364 kCONCATENATE = 1,
4365
4367 kREVERSE = 2
4368};
4369
4375template <>
4376constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4377{
4378 return 3;
4379}
4380
4384enum class TripLimit : int32_t
4385{
4386
4387 kCOUNT = 0,
4388 kWHILE = 1
4389};
4390
4396template <>
4397constexpr inline int32_t EnumMax<TripLimit>() noexcept
4398{
4399 return 2;
4400}
4401
4402class ILoop;
4403
4418{
4419public:
4423 ILoop* getLoop() const noexcept
4424 {
4425 return mBoundary->getLoop();
4426 }
4427
4428protected:
4429 virtual ~ILoopBoundaryLayer() noexcept = default;
4430 apiv::VLoopBoundaryLayer* mBoundary;
4431};
4432
4441{
4442public:
4447 {
4448 return mBoundary->getConditional();
4449 }
4450
4451protected:
4452 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4453 apiv::VConditionalBoundaryLayer* mBoundary;
4454};
4455
4462{
4463public:
4464protected:
4465 virtual ~IConditionLayer() noexcept = default;
4466 apiv::VConditionLayer* mImpl;
4467};
4468
4479{
4480public:
4481protected:
4482 virtual ~IIfConditionalOutputLayer() noexcept = default;
4483 apiv::VConditionalOutputLayer* mImpl;
4484};
4485
4492{
4493public:
4494protected:
4495 virtual ~IIfConditionalInputLayer() noexcept = default;
4496 apiv::VConditionalInputLayer* mImpl;
4497};
4498
4523{
4524public:
4535 {
4536 return mImpl->setCondition(condition);
4537 }
4538
4552 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4553 {
4554 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4555 }
4556
4565 {
4566 return mImpl->addInput(input);
4567 }
4568
4579 void setName(char const* name) noexcept
4580 {
4581 mImpl->setName(name);
4582 }
4583
4589 char const* getName() const noexcept
4590 {
4591 return mImpl->getName();
4592 }
4593
4594protected:
4595 virtual ~IIfConditional() noexcept = default;
4596 apiv::VIfConditional* mImpl;
4597};
4598
4607{
4608public:
4614 //
4627 using ILayer::setInput;
4628
4629protected:
4630 virtual ~IRecurrenceLayer() noexcept = default;
4631 apiv::VRecurrenceLayer* mImpl;
4632};
4633
4654{
4655public:
4659 LoopOutput getLoopOutput() const noexcept
4660 {
4661 return mImpl->getLoopOutput();
4662 }
4663
4676 void setAxis(int32_t axis) noexcept
4677 {
4678 mImpl->setAxis(axis);
4679 }
4680
4684 int32_t getAxis() const noexcept
4685 {
4686 return mImpl->getAxis();
4687 }
4688
4694 //
4709 using ILayer::setInput;
4710
4711protected:
4712 virtual ~ILoopOutputLayer() noexcept = default;
4713 apiv::VLoopOutputLayer* mImpl;
4714};
4715
4728{
4729public:
4733 TripLimit getTripLimit() const noexcept
4734 {
4735 return mImpl->getTripLimit();
4736 }
4737
4738protected:
4739 virtual ~ITripLimitLayer() noexcept = default;
4740 apiv::VTripLimitLayer* mImpl;
4741};
4742
4754{
4755public:
4759 void setAxis(int32_t axis) noexcept
4760 {
4761 mImpl->setAxis(axis);
4762 }
4763
4767 int32_t getAxis() const noexcept
4768 {
4769 return mImpl->getAxis();
4770 }
4771
4781 void setReverse(bool reverse) noexcept
4782 {
4783 mImpl->setReverse(reverse);
4784 }
4785
4791 bool getReverse() const noexcept
4792 {
4793 return mImpl->getReverse();
4794 }
4795
4796protected:
4797 virtual ~IIteratorLayer() noexcept = default;
4798 apiv::VIteratorLayer* mImpl;
4799};
4800
4810class ILoop : public INoCopy
4811{
4812public:
4819 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4820 {
4821 return mImpl->addRecurrence(initialValue);
4822 }
4823
4841 {
4842 return mImpl->addTripLimit(tensor, limit);
4843 }
4844
4853 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4854 {
4855 return mImpl->addIterator(tensor, axis, reverse);
4856 }
4857
4866 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4867 {
4868 return mImpl->addLoopOutput(tensor, outputKind, axis);
4869 }
4870
4881 void setName(char const* name) noexcept
4882 {
4883 mImpl->setName(name);
4884 }
4885
4891 char const* getName() const noexcept
4892 {
4893 return mImpl->getName();
4894 }
4895
4896protected:
4897 virtual ~ILoop() noexcept = default;
4898 apiv::VLoop* mImpl;
4899};
4900
4913class ISelectLayer : public ILayer
4914{
4915protected:
4916 virtual ~ISelectLayer() noexcept = default;
4917 apiv::VSelectLayer* mImpl;
4918};
4919
4936{
4937public:
4946 void setMessage(char const* message) noexcept
4947 {
4948 mImpl->setMessage(message);
4949 }
4950
4956 char const* getMessage() const noexcept
4957 {
4958 return mImpl->getMessage();
4959 }
4960
4961protected:
4962 virtual ~IAssertionLayer() noexcept = default;
4963
4964 apiv::VAssertionLayer* mImpl;
4965};
4966
4974enum class FillOperation : int32_t
4975{
4991 kLINSPACE = 0,
4992
4994 kRANDOM_UNIFORM = 1,
4995
4997 kRANDOM_NORMAL = 2
4998};
4999
5005template <>
5006constexpr inline int32_t EnumMax<FillOperation>() noexcept
5007{
5008 return 3;
5009}
5010
5046class IFillLayer : public ILayer
5047{
5048public:
5057 //
5058 void setDimensions(Dims const& dimensions) noexcept
5059 {
5060 mImpl->setDimensions(dimensions);
5061 }
5062
5073 Dims getDimensions() const noexcept
5074 {
5075 return mImpl->getDimensions();
5076 }
5077
5083 void setOperation(FillOperation op) noexcept
5084 {
5085 mImpl->setOperation(op);
5086 }
5087
5094 {
5095 return mImpl->getOperation();
5096 }
5097
5111 //
5112 void setAlpha(double alpha) noexcept
5113 {
5114 mImpl->setAlpha(alpha);
5115 }
5116
5127 double getAlpha() const noexcept
5128 {
5129 return mImpl->getAlpha();
5130 }
5131
5146 void setBeta(double beta) noexcept
5147 {
5148 mImpl->setBeta(beta);
5149 }
5150
5161 double getBeta() const noexcept
5162 {
5163 return mImpl->getBeta();
5164 }
5165
5206 using ILayer::setInput;
5207
5221 //
5222 void setAlphaInt64(int64_t alpha) noexcept
5223 {
5224 mImpl->setAlphaInt64(alpha);
5225 }
5226
5237 int64_t getAlphaInt64() const noexcept
5238 {
5239 return mImpl->getAlphaInt64();
5240 }
5241
5256 void setBetaInt64(int64_t beta) noexcept
5257 {
5258 mImpl->setBetaInt64(beta);
5259 }
5260
5271 int64_t getBetaInt64() const noexcept
5272 {
5273 return mImpl->getBetaInt64();
5274 }
5275
5279 bool isAlphaBetaInt64() const noexcept
5280 {
5281 return mImpl->isAlphaBetaInt64();
5282 }
5283
5296 void setToType(DataType toType) noexcept
5297 {
5298 mImpl->setToType(toType);
5299 }
5300
5308 DataType getToType() const noexcept
5309 {
5310 return mImpl->getToType();
5311 }
5312
5313protected:
5314 virtual ~IFillLayer() noexcept = default;
5315 apiv::VFillLayer* mImpl;
5316};
5317
5393{
5394public:
5403 int32_t getAxis() const noexcept
5404 {
5405 return mImpl->getAxis();
5406 }
5414 void setAxis(int32_t axis) noexcept
5415 {
5416 mImpl->setAxis(axis);
5417 }
5418
5430 void setToType(DataType toType) noexcept
5431 {
5432 mImpl->setToType(toType);
5433 }
5434
5442 DataType getToType() const noexcept
5443 {
5444 return mImpl->getToType();
5445 }
5446
5447protected:
5448 virtual ~IQuantizeLayer() noexcept = default;
5449 apiv::VQuantizeLayer* mImpl;
5450};
5451
5524{
5525public:
5534 int32_t getAxis() const noexcept
5535 {
5536 return mImpl->getAxis();
5537 }
5545 void setAxis(int32_t axis) noexcept
5546 {
5547 mImpl->setAxis(axis);
5548 }
5549
5561 void setToType(DataType toType) noexcept
5562 {
5563 mImpl->setToType(toType);
5564 }
5565
5573 DataType getToType() const noexcept
5574 {
5575 return mImpl->getToType();
5576 }
5577
5578protected:
5579 virtual ~IDequantizeLayer() noexcept = default;
5580 apiv::VDequantizeLayer* mImpl;
5581};
5582
5583
5620class IEinsumLayer : public ILayer
5621{
5622public:
5632 bool setEquation(char const* equation) noexcept
5633 {
5634 return mImpl->setEquation(equation);
5635 }
5636
5642 char const* getEquation() const noexcept
5643 {
5644 return mImpl->getEquation();
5645 }
5646
5647protected:
5648 virtual ~IEinsumLayer() noexcept = default;
5649 apiv::VEinsumLayer* mImpl;
5650};
5651
5659enum class ScatterMode : int32_t
5660{
5661 kELEMENT = 0,
5662 kND = 1,
5663};
5664
5670template <>
5671constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5672{
5673 return 2;
5674}
5675
5733class IScatterLayer : public ILayer
5734{
5735public:
5741 void setMode(ScatterMode mode) noexcept
5742 {
5743 mImpl->setMode(mode);
5744 }
5745
5751 ScatterMode getMode() const noexcept
5752 {
5753 return mImpl->getMode();
5754 }
5755
5761 void setAxis(int32_t axis) noexcept
5762 {
5763 mImpl->setAxis(axis);
5764 }
5765
5769 int32_t getAxis() const noexcept
5770 {
5771 return mImpl->getAxis();
5772 }
5773
5774protected:
5775 apiv::VScatterLayer* mImpl;
5776 virtual ~IScatterLayer() noexcept = default;
5777}; // class IScatterLayer
5778
5805class IOneHotLayer : public ILayer
5806{
5807public:
5813 void setAxis(int32_t axis) noexcept
5814 {
5815 mImpl->setAxis(axis);
5816 }
5817
5821 int32_t getAxis() const noexcept
5822 {
5823 return mImpl->getAxis();
5824 }
5825
5826protected:
5827 apiv::VOneHotLayer* mImpl;
5828};
5829
5842{
5843public:
5850 {
5851 mImpl->setInterpolationMode(mode);
5852 }
5853
5862 {
5863 return mImpl->getInterpolationMode();
5864 }
5865
5871 void setAlignCorners(bool alignCorners) noexcept
5872 {
5873 mImpl->setAlignCorners(alignCorners);
5874 }
5875
5883 bool getAlignCorners() const noexcept
5884 {
5885 return mImpl->getAlignCorners();
5886 }
5887
5895 bool setSampleMode(SampleMode mode) noexcept
5896 {
5897 return mImpl->setSampleMode(mode);
5898 }
5899
5907 SampleMode getSampleMode() const noexcept
5908 {
5909 return mImpl->getSampleMode();
5910 }
5911
5912protected:
5913 apiv::VGridSampleLayer* mImpl;
5914 virtual ~IGridSampleLayer() noexcept = default;
5915}; // class IGridSampleLayer
5916
5924enum class BoundingBoxFormat : int32_t
5925{
5927 kCORNER_PAIRS = 0,
5929 kCENTER_SIZES = 1
5930};
5931
5937template <>
5938constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
5939{
5940 return 2;
5941}
5942
5989class INMSLayer : public ILayer
5990{
5991public:
6002 {
6003 mImpl->setBoundingBoxFormat(fmt);
6004 }
6005
6014 {
6015 return mImpl->getBoundingBoxFormat();
6016 }
6017
6027 void setTopKBoxLimit(int32_t limit) noexcept
6028 {
6029 mImpl->setTopKBoxLimit(limit);
6030 }
6031
6037 int32_t getTopKBoxLimit() const noexcept
6038 {
6039 return mImpl->getTopKBoxLimit();
6040 }
6041
6060 using ILayer::setInput;
6061
6062protected:
6063 apiv::VNMSLayer* mImpl;
6064 virtual ~INMSLayer() noexcept = default;
6065}; // class INMSLayer
6066
6080{
6081public:
6090 void setBatchAxis(int32_t batchAxis) noexcept
6091 {
6092 mImpl->setBatchAxis(batchAxis);
6093 }
6094
6100 int32_t getBatchAxis() const noexcept
6101 {
6102 return mImpl->getBatchAxis();
6103 }
6104
6113 void setSequenceAxis(int32_t sequenceAxis) noexcept
6114 {
6115 mImpl->setSequenceAxis(sequenceAxis);
6116 }
6117
6123 int32_t getSequenceAxis() const noexcept
6124 {
6125 return mImpl->getSequenceAxis();
6126 }
6127
6128protected:
6129 apiv::VReverseSequenceLayer* mImpl;
6130 virtual ~IReverseSequenceLayer() noexcept = default;
6131}; // class IReverseSequenceLayer
6132
6152{
6153public:
6161 void setEpsilon(float eps) noexcept
6162 {
6163 return mImpl->setEpsilon(eps);
6164 }
6165
6171 float getEpsilon() const noexcept
6172 {
6173 return mImpl->getEpsilon();
6174 }
6175
6181 void setAxes(uint32_t axesMask) noexcept
6182 {
6183 return mImpl->setAxes(axesMask);
6184 }
6185
6191 uint32_t getAxes() const noexcept
6192 {
6193 return mImpl->getAxes();
6194 }
6195
6212 void setNbGroups(int64_t nbGroups) noexcept
6213 {
6214 return mImpl->setNbGroups(nbGroups);
6215 }
6216
6222 int64_t getNbGroups() const noexcept
6223 {
6224 return mImpl->getNbGroups();
6225 }
6226
6248 void setComputePrecision(DataType type) noexcept
6249 {
6250 return mImpl->setComputePrecision(type);
6251 }
6252
6259 {
6260 return mImpl->getComputePrecision();
6261 }
6262
6263protected:
6264 apiv::VNormalizationLayer* mImpl;
6265 virtual ~INormalizationLayer() noexcept = default;
6266};
6267
6276class ISqueezeLayer : public ILayer
6277{
6278public:
6291 using ILayer::setInput;
6292
6293protected:
6294 apiv::VSqueezeLayer* mImpl;
6295 virtual ~ISqueezeLayer() noexcept = default;
6296};
6297
6306{
6307public:
6320 using ILayer::setInput;
6321
6322protected:
6323 apiv::VUnsqueezeLayer* mImpl;
6324 virtual ~IUnsqueezeLayer() noexcept = default;
6325};
6326
6345{
6346public:
6347 virtual ~INetworkDefinition() noexcept = default;
6348
6385 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6386 {
6387 return mImpl->addInput(name, type, dimensions);
6388 }
6389
6399 void markOutput(ITensor& tensor) noexcept
6400 {
6401 mImpl->markOutput(tensor);
6402 }
6403
6417 bool markDebug(ITensor& tensor) noexcept
6418 {
6419 return mImpl->markDebug(tensor);
6420 }
6421
6433 bool unmarkDebug(ITensor& tensor) noexcept
6434 {
6435 return mImpl->unmarkDebug(tensor);
6436 }
6437
6443 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6444 {
6445 return mImpl->isDebugTensor(tensor);
6446 }
6447
6464 {
6465 return mImpl->addActivation(input, type);
6466 }
6467
6482 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6483 {
6484 return mImpl->addLRN(input, window, alpha, beta, k);
6485 }
6486
6508 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6509 {
6510 return mImpl->addScale(input, mode, shift, scale, power);
6511 }
6512
6522 {
6523 return mImpl->addSoftMax(input);
6524 }
6525
6538 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6539 {
6540 return mImpl->addConcatenation(inputs, nbInputs);
6541 }
6542
6566 {
6567 return mImpl->addElementWise(input1, input2, op);
6568 }
6569
6587 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6588 {
6589 return mImpl->addUnary(input, operation);
6590 }
6591
6602 {
6603 return mImpl->addShuffle(input);
6604 }
6605
6618 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6619 {
6620 return mImpl->addOneHot(indices, values, depth, axis);
6621 }
6622
6630 int32_t getNbLayers() const noexcept
6631 {
6632 return mImpl->getNbLayers();
6633 }
6634
6644 ILayer* getLayer(int32_t index) const noexcept
6645 {
6646 return mImpl->getLayer(index);
6647 }
6648
6656 int32_t getNbInputs() const noexcept
6657 {
6658 return mImpl->getNbInputs();
6659 }
6660
6672 ITensor* getInput(int32_t index) const noexcept
6673 {
6674 return mImpl->getInput(index);
6675 }
6676
6686 int32_t getNbOutputs() const noexcept
6687 {
6688 return mImpl->getNbOutputs();
6689 }
6690
6702 ITensor* getOutput(int32_t index) const noexcept
6703 {
6704 return mImpl->getOutput(index);
6705 }
6706
6729 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
6730 {
6731 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
6732 }
6733
6761 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
6762 {
6763 return mImpl->addTopK(input, op, k, reduceAxes);
6764 }
6765
6777 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
6778 {
6779 return mImpl->addGather(data, indices, axis);
6780 }
6781
6793 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
6794 {
6795 return mImpl->addGatherV2(data, indices, mode);
6796 }
6797
6813 {
6814 return mImpl->addRaggedSoftMax(input, bounds);
6815 }
6816
6834 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
6835 {
6836 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
6837 }
6838
6849 {
6850 return mImpl->addNonZero(input);
6851 }
6852
6872 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
6873 {
6874 return mImpl->addConstant(dimensions, weights);
6875 }
6876
6887 {
6888 return mImpl->addIdentity(input);
6889 }
6890
6901 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
6902 {
6903 return mImpl->addCast(input, toType);
6904 }
6905
6916 void removeTensor(ITensor& tensor) noexcept
6917 {
6918 mImpl->removeTensor(tensor);
6919 }
6920
6928 void unmarkOutput(ITensor& tensor) noexcept
6929 {
6930 mImpl->unmarkOutput(tensor);
6931 }
6932
6947 IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
6948 {
6949 return mImpl->addPluginV2(inputs, nbInputs, plugin);
6950 }
6951
6965 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
6966 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
6967 {
6968 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
6969 }
6970
6985 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
6986 {
6987 return mImpl->addSlice(input, start, size, stride);
6988 }
6989
7009 void setName(char const* name) noexcept
7010 {
7011 mImpl->setName(name);
7012 }
7013
7023 char const* getName() const noexcept
7024 {
7025 return mImpl->getName();
7026 }
7027
7039 IShapeLayer* addShape(ITensor& input) noexcept
7040 {
7041 return mImpl->addShape(input);
7042 }
7043
7054 {
7055 return mImpl->hasImplicitBatchDimension();
7056 }
7057
7064 {
7065 return mImpl->getFlags();
7066 }
7067
7075 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7076 {
7077 return mImpl->getFlag(networkDefinitionCreationFlag);
7078 }
7079
7092 bool markOutputForShapes(ITensor& tensor) noexcept
7093 {
7094 return mImpl->markOutputForShapes(tensor);
7095 }
7096
7104 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7105 {
7106 return mImpl->unmarkOutputForShapes(tensor);
7107 }
7108
7123 {
7124 return mImpl->addParametricReLU(input, slope);
7125 }
7126
7145 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7146 {
7147 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7148 }
7149
7164 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7165 {
7166 return mImpl->addPoolingNd(input, type, windowSize);
7167 }
7168
7183 //
7187 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7188 {
7189 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7190 }
7191
7224 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7225 {
7226 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7227 }
7228
7241 {
7242 return mImpl->addResize(input);
7243 }
7244
7254 ILoop* addLoop() noexcept
7255 {
7256 return mImpl->addLoop();
7257 }
7258
7270 {
7271 return mImpl->addIfConditional();
7272 }
7273
7308 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7309 {
7310 return mImpl->addSelect(condition, thenInput, elseInput);
7311 }
7312
7325 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7326 {
7327 return mImpl->addAssertion(condition, message);
7328 }
7329
7350 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7351 {
7352 return mImpl->addFill(dimensions, op);
7353 }
7354
7376 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7377 {
7378 return mImpl->addFillV2(dimensions, op, outputType);
7379 }
7380
7392 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7393 {
7394 return mImpl->addPaddingNd(input, prePadding, postPadding);
7395 }
7396
7416 bool setWeightsName(Weights weights, char const* name) noexcept
7417 {
7418 return mImpl->setWeightsName(weights, name);
7419 }
7420
7432 //
7435 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7436 {
7437 mImpl->setErrorRecorder(recorder);
7438 }
7439
7451 {
7452 return mImpl->getErrorRecorder();
7453 }
7454
7472 {
7473 return mImpl->addDequantize(input, scale);
7474 }
7475
7492 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7493 {
7494 return mImpl->addDequantizeV2(input, scale, outputType);
7495 }
7496
7512 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7513 {
7514 return mImpl->addScatter(data, indices, updates, mode);
7515 }
7516
7534 {
7535 return mImpl->addQuantize(input, scale);
7536 }
7537
7554 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7555 {
7556 return mImpl->addQuantizeV2(input, scale, outputType);
7557 }
7558
7559
7570 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7571 {
7572 return mImpl->addEinsum(inputs, nbInputs, equation);
7573 }
7574
7589 {
7590 return mImpl->addGridSample(input, grid);
7591 }
7592
7606 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7607 {
7608 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7609 }
7610
7624 {
7625 return mImpl->addReverseSequence(input, sequenceLens);
7626 }
7627
7649 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
7650 {
7651 return mImpl->addNormalization(input, scale, bias, axesMask);
7652 }
7653
7660 virtual IBuilder& getBuilder() const noexcept
7661 {
7662 return mImpl->getBuilder();
7663 }
7664
7673 bool markWeightsRefittable(char const* name) noexcept
7674 {
7675 return mImpl->markWeightsRefittable(name);
7676 }
7677
7685 bool unmarkWeightsRefittable(char const* name) noexcept
7686 {
7687 return mImpl->unmarkWeightsRefittable(name);
7688 }
7689
7698 bool areWeightsMarkedRefittable(char const* name) const noexcept
7699 {
7700 return mImpl->areWeightsMarkedRefittable(name);
7701 }
7702
7717 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
7718 {
7719 return mImpl->addSqueeze(input, axes);
7720 }
7721
7739 {
7740 return mImpl->addUnsqueeze(input, axes);
7741 }
7742
7743protected:
7744 apiv::VNetworkDefinition* mImpl;
7745};
7746
7754enum class CalibrationAlgoType : int32_t
7755{
7760};
7761
7767template <>
7768constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
7769{
7770 return 4;
7771}
7772
7787{
7788public:
7796 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
7797
7812 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
7813
7828 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
7829
7838 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
7839
7845 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
7846
7847 ~IInt8Calibrator() noexcept override = default;
7848};
7849
7850namespace v_1_0
7851{
7853{
7854public:
7858 InterfaceInfo getInterfaceInfo() const noexcept override
7859 {
7860 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
7861 }
7862
7867 {
7869 }
7870
7871 ~IInt8EntropyCalibrator() noexcept override = default;
7872};
7873} // namespace v_1_0
7874
7889
7890namespace v_1_0
7891{
7893{
7894public:
7898 InterfaceInfo getInterfaceInfo() const noexcept override
7899 {
7900 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
7901 }
7902
7907 {
7909 }
7910
7911 ~IInt8EntropyCalibrator2() noexcept override = default;
7912};
7913} // namespace v_1_0
7914
7929
7930namespace v_1_0
7931{
7933{
7934public:
7938 InterfaceInfo getInterfaceInfo() const noexcept override
7939 {
7940 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
7941 }
7942
7947 {
7949 }
7950
7951 ~IInt8MinMaxCalibrator() noexcept override = default;
7952};
7953} // namespace v_1_0
7954
7968
7969namespace v_1_0
7970{
7972{
7973public:
7977 InterfaceInfo getInterfaceInfo() const noexcept override
7978 {
7979 return InterfaceInfo{"IInt8Calibrator", 1, 0};
7980 }
7981
7986 {
7988 }
7989
7996 virtual double getQuantile() const noexcept = 0;
7997
8004 virtual double getRegressionCutoff() const noexcept = 0;
8005
8018 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8019
8028 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8029
8030 ~IInt8LegacyCalibrator() noexcept override = default;
8031};
8032} // namespace v_1_0
8033
8048
8060{
8061public:
8067 DataType getDataType() const noexcept
8068 {
8069 return mImpl->getDataType();
8070 }
8071
8078 Dims getStrides() const noexcept
8079 {
8080 return mImpl->getStrides();
8081 }
8082
8088 int64_t getVectorizedDim() const noexcept
8089 {
8090 return mImpl->getVectorizedDim();
8091 }
8092
8099 int64_t getComponentsPerElement() const noexcept
8100 {
8101 return mImpl->getComponentsPerElement();
8102 }
8103
8104protected:
8105 virtual ~IAlgorithmIOInfo() noexcept = default;
8106 apiv::VAlgorithmIOInfo* mImpl;
8107};
8108
8121{
8122public:
8126 int64_t getImplementation() const noexcept
8127 {
8128 return mImpl->getImplementation();
8129 }
8130
8134 int64_t getTactic() const noexcept
8135 {
8136 return mImpl->getTactic();
8137 }
8138
8139protected:
8140 virtual ~IAlgorithmVariant() noexcept = default;
8141 apiv::VAlgorithmVariant* mImpl;
8142};
8143
8153{
8154public:
8160 char const* getName() const noexcept
8161 {
8162 return mImpl->getName();
8163 }
8164
8172 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8173 {
8174 return mImpl->getDimensions(index, select);
8175 }
8176
8180 int32_t getNbInputs() const noexcept
8181 {
8182 return mImpl->getNbInputs();
8183 }
8184
8188 int32_t getNbOutputs() const noexcept
8189 {
8190 return mImpl->getNbOutputs();
8191 }
8192
8193protected:
8194 virtual ~IAlgorithmContext() noexcept = default;
8195 apiv::VAlgorithmContext* mImpl;
8196};
8197
8209class IAlgorithm : public INoCopy
8210{
8211public:
8216 {
8217 return mImpl->getAlgorithmVariant();
8218 }
8219
8223 float getTimingMSec() const noexcept
8224 {
8225 return mImpl->getTimingMSec();
8226 }
8227
8231 std::size_t getWorkspaceSize() const noexcept
8232 {
8233 return mImpl->getWorkspaceSize();
8234 }
8235
8245 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8246 {
8247 return mImpl->getAlgorithmIOInfoByIndex(index);
8248 }
8249
8250protected:
8251 virtual ~IAlgorithm() noexcept = default;
8252 apiv::VAlgorithm* mImpl;
8253}; // IAlgorithm
8254
8255namespace v_1_0
8256{
8258{
8259public:
8263 InterfaceInfo getInterfaceInfo() const noexcept override
8264 {
8265 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8266 }
8281 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8282 int32_t nbChoices, int32_t* selection) noexcept = 0;
8283
8294 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8295 int32_t nbAlgorithms) noexcept = 0;
8296
8297 virtual ~IAlgorithmSelector() noexcept = default;
8298};
8299} // namespace v_1_0
8300
8312
8319using QuantizationFlags = uint32_t;
8320
8330enum class QuantizationFlag : int32_t
8331{
8336};
8337
8343template <>
8344constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8345{
8346 return 1;
8347}
8348
8366enum class RuntimePlatform : int32_t
8367{
8370 kSAME_AS_BUILD = 0,
8371
8374 kWINDOWS_AMD64 = 1,
8375};
8376
8377namespace impl
8378{
8384template <>
8386{
8387 static constexpr int32_t kVALUE = 2;
8388};
8389} // namespace impl
8390
8397using BuilderFlags = uint32_t;
8398
8406enum class BuilderFlag : int32_t
8407{
8409 kFP16 = 0,
8410
8412 kINT8 = 1,
8413
8415 kDEBUG = 2,
8416
8418 kGPU_FALLBACK = 3,
8419
8421 kREFIT = 4,
8422
8425
8429 kTF32 = 6,
8430
8432 kSPARSE_WEIGHTS = 7,
8433
8440 kSAFETY_SCOPE = 8,
8441
8444
8448
8454
8457
8464
8470
8476 kFP8 = 15,
8477
8481
8484 kBF16 = 17,
8485
8491
8493 kSTRIP_PLAN = 19,
8494
8497
8504 kREFIT_IDENTICAL = 20,
8505
8531 kWEIGHT_STREAMING = 21,
8532
8534 kINT4 = 22,
8535
8540 kREFIT_INDIVIDUAL = 23,
8541
8550 kSTRICT_NANS = 24,
8551
8553 kMONITOR_MEMORY = 25,
8554
8555};
8556
8562template <>
8563constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8564{
8565 return 26;
8566}
8567
8581class ITimingCache : public INoCopy
8582{
8583public:
8584 virtual ~ITimingCache() noexcept = default;
8585
8595 nvinfer1::IHostMemory* serialize() const noexcept
8596 {
8597 return mImpl->serialize();
8598 }
8599
8619 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8620 {
8621 return mImpl->combine(inputCache, ignoreMismatch);
8622 }
8623
8629 bool reset() noexcept
8630 {
8631 return mImpl->reset();
8632 }
8633
8634protected:
8635 apiv::VTimingCache* mImpl;
8636};
8637
8645enum class MemoryPoolType : int32_t
8646{
8653 kWORKSPACE = 0,
8654
8662
8668 kDLA_LOCAL_DRAM = 2,
8669
8675 kDLA_GLOBAL_DRAM = 3,
8676
8684 kTACTIC_DRAM = 4,
8685
8699};
8700
8706template <>
8707constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
8708{
8709 return 6;
8710}
8711
8720enum class PreviewFeature : int32_t
8721{
8728
8733};
8734
8735namespace impl
8736{
8742template <>
8744{
8745 static constexpr int32_t kVALUE = 2;
8746};
8747} // namespace impl
8748
8759enum class HardwareCompatibilityLevel : int32_t
8760{
8763 kNONE = 0,
8764
8774 kAMPERE_PLUS = 1,
8775};
8776
8777namespace impl
8778{
8784template <>
8786{
8787 static constexpr int32_t kVALUE = 2;
8788};
8789} // namespace impl
8790
8791namespace v_1_0
8792{
8794{
8795public:
8796 IProgressMonitor() = default;
8797 virtual ~IProgressMonitor() noexcept = default;
8798
8802 InterfaceInfo getInterfaceInfo() const noexcept override
8803 {
8804 return InterfaceInfo{"IProgressMonitor", 1, 0};
8805 }
8806
8826 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
8827
8840 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
8841
8853 virtual void phaseFinish(char const* phaseName) noexcept = 0;
8854
8855}; // class IProgressMonitor
8856} // namespace v_1_0
8857
8878
8887{
8888public:
8889 virtual ~IBuilderConfig() noexcept = default;
8890
8899 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
8900 {
8901 mImpl->setAvgTimingIterations(avgTiming);
8902 }
8903
8911 int32_t getAvgTimingIterations() const noexcept
8912 {
8913 return mImpl->getAvgTimingIterations();
8914 }
8915
8924 void setEngineCapability(EngineCapability capability) noexcept
8925 {
8926 mImpl->setEngineCapability(capability);
8927 }
8928
8937 {
8938 return mImpl->getEngineCapability();
8939 }
8940
8949 {
8950 mImpl->setInt8Calibrator(calibrator);
8951 }
8952
8959 {
8960 return mImpl->getInt8Calibrator();
8961 }
8962
8975 void setFlags(BuilderFlags builderFlags) noexcept
8976 {
8977 mImpl->setFlags(builderFlags);
8978 }
8979
8987 BuilderFlags getFlags() const noexcept
8988 {
8989 return mImpl->getFlags();
8990 }
8991
8999 void clearFlag(BuilderFlag builderFlag) noexcept
9000 {
9001 mImpl->clearFlag(builderFlag);
9002 }
9003
9011 void setFlag(BuilderFlag builderFlag) noexcept
9012 {
9013 mImpl->setFlag(builderFlag);
9014 }
9015
9023 bool getFlag(BuilderFlag builderFlag) const noexcept
9024 {
9025 return mImpl->getFlag(builderFlag);
9026 }
9027
9040 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9041 {
9042 mImpl->setDeviceType(layer, deviceType);
9043 }
9044
9050 DeviceType getDeviceType(ILayer const* layer) const noexcept
9051 {
9052 return mImpl->getDeviceType(layer);
9053 }
9054
9062 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9063 {
9064 return mImpl->isDeviceTypeSet(layer);
9065 }
9066
9072 void resetDeviceType(ILayer const* layer) noexcept
9073 {
9074 mImpl->resetDeviceType(layer);
9075 }
9076
9082 bool canRunOnDLA(ILayer const* layer) const noexcept
9083 {
9084 return mImpl->canRunOnDLA(layer);
9085 }
9086
9098 void setDLACore(int32_t dlaCore) noexcept
9099 {
9100 mImpl->setDLACore(dlaCore);
9101 }
9102
9108 int32_t getDLACore() const noexcept
9109 {
9110 return mImpl->getDLACore();
9111 }
9112
9119 void setDefaultDeviceType(DeviceType deviceType) noexcept
9120 {
9121 mImpl->setDefaultDeviceType(deviceType);
9122 }
9123
9130 {
9131 return mImpl->getDefaultDeviceType();
9132 }
9133
9139 void reset() noexcept
9140 {
9141 mImpl->reset();
9142 }
9143
9151 void setProfileStream(const cudaStream_t stream) noexcept
9152 {
9153 return mImpl->setProfileStream(stream);
9154 }
9155
9163 cudaStream_t getProfileStream() const noexcept
9164 {
9165 return mImpl->getProfileStream();
9166 }
9167
9180 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9181 {
9182 return mImpl->addOptimizationProfile(profile);
9183 }
9184
9193 int32_t getNbOptimizationProfiles() const noexcept
9194 {
9195 return mImpl->getNbOptimizationProfiles();
9196 }
9197
9206 {
9207 mImpl->setProfilingVerbosity(verbosity);
9208 }
9209
9219 {
9220 return mImpl->getProfilingVerbosity();
9221 }
9222
9228 {
9229 mImpl->setAlgorithmSelector(selector);
9230 }
9231
9236 {
9237 return mImpl->getAlgorithmSelector();
9238 }
9239
9254 {
9255 return mImpl->setCalibrationProfile(profile);
9256 }
9257
9266 {
9267 return mImpl->getCalibrationProfile();
9268 }
9269
9283 {
9284 mImpl->setQuantizationFlags(flags);
9285 }
9286
9295 {
9296 return mImpl->getQuantizationFlags();
9297 }
9298
9307 {
9308 mImpl->clearQuantizationFlag(flag);
9309 }
9310
9319 {
9320 mImpl->setQuantizationFlag(flag);
9321 }
9322
9330 bool getQuantizationFlag(QuantizationFlag flag) const noexcept
9331 {
9332 return mImpl->getQuantizationFlag(flag);
9333 }
9334
9352 bool setTacticSources(TacticSources tacticSources) noexcept
9353 {
9354 return mImpl->setTacticSources(tacticSources);
9355 }
9356
9368 {
9369 return mImpl->getTacticSources();
9370 }
9371
9386 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9387 {
9388 return mImpl->createTimingCache(blob, size);
9389 }
9390
9409 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9410 {
9411 return mImpl->setTimingCache(cache, ignoreMismatch);
9412 }
9413
9420 {
9421 return mImpl->getTimingCache();
9422 }
9423
9451 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9452 {
9453 mImpl->setMemoryPoolLimit(pool, poolSize);
9454 }
9455
9470 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9471 {
9472 return mImpl->getMemoryPoolLimit(pool);
9473 }
9474
9488 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9489 {
9490 mImpl->setPreviewFeature(feature, enable);
9491 }
9492
9502 bool getPreviewFeature(PreviewFeature feature) const noexcept
9503 {
9504 return mImpl->getPreviewFeature(feature);
9505 }
9506
9535 void setBuilderOptimizationLevel(int32_t level) noexcept
9536 {
9537 mImpl->setBuilderOptimizationLevel(level);
9538 }
9539
9548 {
9549 return mImpl->getBuilderOptimizationLevel();
9550 }
9551
9564 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9565 {
9566 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9567 }
9568
9578 {
9579 return mImpl->getHardwareCompatibilityLevel();
9580 }
9581
9590 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9591 {
9592 mImpl->setPluginsToSerialize(paths, nbPaths);
9593 }
9594
9603 char const* getPluginToSerialize(int32_t index) const noexcept
9604 {
9605 return mImpl->getPluginToSerialize(index);
9606 }
9607
9613 int32_t getNbPluginsToSerialize() const noexcept
9614 {
9615 return mImpl->getNbPluginsToSerialize();
9616 }
9617
9642 void setMaxAuxStreams(int32_t nbStreams) noexcept
9643 {
9644 mImpl->setMaxAuxStreams(nbStreams);
9645 }
9646
9652 int32_t getMaxAuxStreams() const noexcept
9653 {
9654 return mImpl->getMaxAuxStreams();
9655 }
9656
9668 void setProgressMonitor(IProgressMonitor* monitor) noexcept
9669 {
9670 return mImpl->setProgressMonitor(monitor);
9671 }
9672
9679 {
9680 return mImpl->getProgressMonitor();
9681 }
9682
9694 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
9695 {
9696 mImpl->setRuntimePlatform(runtimePlatform);
9697 }
9698
9707 {
9708 return mImpl->getRuntimePlatform();
9709 }
9710
9718 void setMaxNbTactics(int32_t maxNbTactics) noexcept
9719 {
9720 mImpl->setMaxNbTactics(maxNbTactics);
9721 }
9722
9730 int32_t getMaxNbTactics() const noexcept
9731 {
9732 return mImpl->getMaxNbTactics();
9733 }
9734
9735protected:
9736 apiv::VBuilderConfig* mImpl;
9737};
9738
9747
9757{
9762
9767 kSTRONGLY_TYPED = 1,
9768};
9769
9775template <>
9776constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
9777{
9778 return 2;
9779}
9780
9788class IBuilder : public INoCopy
9789{
9790public:
9791 virtual ~IBuilder() noexcept = default;
9792
9798 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
9799 {
9800 return mImpl->platformHasFastFp16();
9801 }
9802
9809 {
9810 return mImpl->platformHasFastInt8();
9811 }
9812
9820 int32_t getMaxDLABatchSize() const noexcept
9821 {
9822 return mImpl->getMaxDLABatchSize();
9823 }
9824
9828 int32_t getNbDLACores() const noexcept
9829 {
9830 return mImpl->getNbDLACores();
9831 }
9832
9845 void setGpuAllocator(IGpuAllocator* allocator) noexcept
9846 {
9847 mImpl->setGpuAllocator(allocator);
9848 }
9849
9856 {
9857 return mImpl->createBuilderConfig();
9858 }
9859
9878 {
9879 return mImpl->createNetworkV2(flags);
9880 }
9881
9893 {
9894 return mImpl->createOptimizationProfile();
9895 }
9896
9911 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9912 {
9913 mImpl->setErrorRecorder(recorder);
9914 }
9915
9927 {
9928 return mImpl->getErrorRecorder();
9929 }
9930
9934 void reset() noexcept
9935 {
9936 mImpl->reset();
9937 }
9938
9944 TRT_DEPRECATED bool platformHasTf32() const noexcept
9945 {
9946 return mImpl->platformHasTf32();
9947 }
9948
9964 {
9965 return mImpl->buildSerializedNetwork(network, config);
9966 }
9967
9984 {
9985 return mImpl->buildEngineWithConfig(network, config);
9986 }
9987
10005 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10006 {
10007 return mImpl->isNetworkSupported(network, config);
10008 }
10009
10015 ILogger* getLogger() const noexcept
10016 {
10017 return mImpl->getLogger();
10018 }
10019
10031 bool setMaxThreads(int32_t maxThreads) noexcept
10032 {
10033 return mImpl->setMaxThreads(maxThreads);
10034 }
10035
10045 int32_t getMaxThreads() const noexcept
10046 {
10047 return mImpl->getMaxThreads();
10048 }
10049
10056 {
10057 return mImpl->getPluginRegistry();
10058 }
10059
10060protected:
10061 apiv::VBuilder* mImpl;
10062};
10063
10064} // namespace nvinfer1
10065
10070extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10071
10072namespace nvinfer1
10073{
10074namespace
10075{
10076
10084inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10085{
10086 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10087}
10088
10089} // namespace
10090
10104 nvinfer1::EngineCapability capability) noexcept;
10105
10106namespace safe
10107{
10109class IPluginRegistry;
10110} // namespace safe
10111
10119extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
10120 nvinfer1::EngineCapability capability) noexcept;
10121
10122} // namespace nvinfer1
10123
10124#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:91
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:45
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:46
Definition: NvInferRuntimeBase.h:200
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:203
An Activation layer in a network definition.
Definition: NvInfer.h:1345
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1393
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1354
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1364
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1402
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1411
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1379
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:8153
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8188
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8180
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:8160
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:8172
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8210
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:8231
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8223
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:8245
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8215
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8060
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:8088
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8078
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8067
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8099
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8121
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8134
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8126
An assertion layer in a network.
Definition: NvInfer.h:4936
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4946
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4956
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:8887
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9451
void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9318
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9386
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9488
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:8948
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9502
void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9306
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9547
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9352
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9590
bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9330
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:8958
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9470
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9108
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9613
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9040
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:8924
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9652
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9023
void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9282
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:9718
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:9668
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9205
IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9235
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9193
QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9294
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9419
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9139
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9409
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9603
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:8936
void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9227
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:9706
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9129
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:9694
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:9730
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:8987
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:8975
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9367
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9072
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9098
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9577
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:8999
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9180
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:9678
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:9736
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9265
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:8911
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:9119
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9011
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9253
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9050
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9082
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9163
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9564
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9642
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9218
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9062
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9535
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9151
Builds an engine from a network definition.
Definition: NvInfer.h:9789
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:9820
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:9828
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9926
apiv::VBuilder * mImpl
Definition: NvInfer.h:10061
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10015
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:10005
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10045
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10055
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:9808
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:9892
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:9845
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:9877
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:9855
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:9934
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10031
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9911
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:9963
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:9944
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:9983
A cast layer in a network.
Definition: NvInfer.h:3803
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3829
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3823
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3812
A concatenation layer in a network definition.
Definition: NvInfer.h:2055
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2068
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2078
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4462
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3842
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3852
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3862
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3874
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3892
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3886
A convolution layer in a network definition.
Definition: NvInfer.h:1025
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1150
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1123
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1191
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1295
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1281
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1251
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1098
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1241
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1305
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1044
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1088
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1177
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1074
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1203
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1064
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1034
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1113
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1226
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1269
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1140
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1167
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1216
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3002
A deconvolution layer in a network definition.
Definition: NvInfer.h:2096
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2184
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2145
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2169
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2211
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2326
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2392
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2194
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2159
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2115
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2316
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2248
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2299
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2238
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2289
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2344
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2105
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2356
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2382
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2262
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2135
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2221
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2274
A Dequantize layer in a network definition.
Definition: NvInfer.h:5524
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5561
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5534
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5573
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5545
An Einsum layer in a network.
Definition: NvInfer.h:5621
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:5632
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5642
A elementwise layer in a network definition.
Definition: NvInfer.h:2468
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2497
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2491
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2479
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5047
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5279
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5093
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5083
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5308
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5222
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5256
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5146
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5237
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5271
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5127
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5058
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5112
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5296
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5073
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5161
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2601
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:2612
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2647
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2683
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2657
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2667
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2624
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2677
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:5842
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5849
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:5895
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:5871
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:5913
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:5907
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:5861
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:5883
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:3790
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3792
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4441
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4446
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4523
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4564
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4589
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4534
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4552
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4579
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4492
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4479
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:7787
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:4754
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4781
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4791
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4767
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4759
A LRN layer in a network definition.
Definition: NvInfer.h:1710
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1731
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1753
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1721
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1787
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1743
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1765
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1775
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1797
Base class for all layer classes in a network definition.
Definition: NvInfer.h:553
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:695
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:811
void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:671
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:574
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:705
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:592
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:824
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:767
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:683
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:584
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:613
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:781
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:623
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:640
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:793
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:605
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:752
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:560
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1540
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4418
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4423
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4811
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4881
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4840
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4853
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:4866
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4891
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4819
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4654
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4684
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4659
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4676
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3682
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3710
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3704
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3692
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:5990
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6027
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6001
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6013
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6063
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6037
A network definition for input to the builder.
Definition: NvInfer.h:6345
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:6947
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6538
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6601
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:7649
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7009
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6417
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6482
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:6761
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7325
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:7144
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:6901
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:7223
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7023
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7122
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6702
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6672
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7492
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7104
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7376
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7254
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6463
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7350
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:6985
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7533
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:7660
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7606
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6644
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7075
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7269
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7450
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:7717
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7623
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6656
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7063
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7554
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:6728
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6587
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7588
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:6916
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:7698
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7308
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:7512
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6630
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7053
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:7744
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7092
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6618
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6508
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:6965
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:6928
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:6886
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:6793
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6565
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:6872
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7435
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7164
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:6812
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7039
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:6777
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:7685
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:7673
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:7186
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7240
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:7738
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:6833
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6521
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6443
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6433
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7570
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6399
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:7392
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:6848
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7471
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6686
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7416
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3736
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6152
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6171
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6191
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6161
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6258
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6264
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6222
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6181
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6248
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6212
A OneHot layer in a network definition.
Definition: NvInfer.h:5806
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5827
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5813
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5821
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2616
Layer that represents a padding operation.
Definition: NvInfer.h:2960
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3009
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2971
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:2997
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2983
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3015
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3906
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3908
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:133
Layer type for pluginV2.
Definition: NvInfer.h:2697
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2710
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2704
Layer type for V3 plugins.
Definition: NvInfer.h:2724
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2731
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2737
A Pooling layer in a network definition.
Definition: NvInfer.h:1459
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1478
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1611
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1587
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1531
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1559
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1468
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1624
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1600
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1634
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:1520
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1678
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1506
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1649
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1659
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1690
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1577
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1549
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1493
A Quantize layer in a network definition.
Definition: NvInfer.h:5393
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5430
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5414
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5403
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5442
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3757
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3759
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4607
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2880
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2927
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2887
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2897
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2917
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2907
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2943
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2937
A resize layer in a network definition.
Definition: NvInfer.h:4095
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4256
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4280
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:4174
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4115
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4312
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4155
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4322
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4266
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4196
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4231
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4335
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4186
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4125
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4290
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4345
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4241
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6080
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6113
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6100
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6129
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6123
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6090
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1856
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1913
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1933
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1903
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1923
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1873
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1883
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1969
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1893
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1863
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1948
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5734
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5741
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5775
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5761
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5769
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5751
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4914
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3485
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3487
Layer type for shuffling data.
Definition: NvInfer.h:3048
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3206
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3059
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3159
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3112
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3099
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3071
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3171
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3200
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3187
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3300
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3369
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3468
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3340
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3447
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3311
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3326
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3394
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3355
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3404
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3384
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3462
A Softmax layer in a network definition.
Definition: NvInfer.h:2000
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2022
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2032
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:6277
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6294
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:429
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:348
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:387
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:494
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:260
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:379
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:473
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:407
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:297
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:322
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:289
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:336
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:305
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:272
apiv::VTensor * mImpl
Definition: NvInfer.h:541
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:397
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:520
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:535
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:367
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:442
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8582
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8619
virtual ~ITimingCache() noexcept=default
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8635
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8629
Layer that represents a TopK reduction.
Definition: NvInfer.h:3525
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3556
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3580
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3542
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3612
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3532
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3570
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3590
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4728
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4733
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2805
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2814
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2830
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2824
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6306
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6323
An Interface class for version control.
Definition: NvInferRuntimeBase.h:260
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:225
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:8258
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:8263
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:397
Definition: NvInferRuntime.h:1608
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7906
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7898
Definition: NvInfer.h:7853
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7866
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7858
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:7972
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7985
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7977
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:7933
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7946
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7938
Definition: NvInferPluginBase.h:204
Definition: NvInfer.h:8794
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:10084
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:2832
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4000
@ 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:8646
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1813
@ 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:8367
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8319
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:8760
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:5925
@ 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:8563
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:116
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:7768
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2758
@ 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:2867
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4397
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:135
@ 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:4975
@ 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:4030
@ 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:991
@ 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
Definition: NvInfer.h:4385
@ 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:9746
PreviewFeature
Define preview features.
Definition: NvInfer.h:8721
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2519
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:133
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8397
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1303
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1825
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:7755
@ 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.
@ 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.
@ 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:8344
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3216
@ 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:2507
@ 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:127
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2844
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:9757
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2417
@ 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:8331
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3232
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3918
@ 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:8407
@ 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.
@ kFP16
Enable FP16 layer selection, with FP32 fallback.
@ kINT8
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
@ kINT4
Enable plugins with INT4 input/output.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ kMONITOR_MEMORY
Enable memory monitor during build time.
@ kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
@ kREFIT
Enable building a refittable engine.
@ kOBEY_PRECISION_CONSTRAINTS
Require that layers execute in specified precisions. Build fails otherwise.
@ kREJECT_EMPTY_ALGORITHMS
Fail if IAlgorithmSelector::selectAlgorithms returns an empty set of algorithms.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3508
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:8707
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3497
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2853
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4376
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:9776
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5660
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3623
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3946
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2792
LoopOutput
Definition: NvInfer.h:4359
@ 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:5938
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3651
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1427
@ 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:8877
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5006
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:2576
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5671
Represents a permutation of dimensions.
Definition: NvInfer.h:3025
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:118

  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