TensorRT-RTX 1.0.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h"
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110};
111
117template <>
118constexpr inline int32_t EnumMax<LayerType>() noexcept
119{
120 return 51;
121}
122
129using TensorFormats = uint32_t;
130
136enum class ActivationType : int32_t
137{
138 kRELU = 0,
139 kSIGMOID = 1,
140 kTANH = 2,
141 kLEAKY_RELU = 3,
142 kELU = 4,
143 kSELU = 5,
144 kSOFTSIGN = 6,
145 kSOFTPLUS = 7,
146 kCLIP = 8,
147 kHARD_SIGMOID = 9,
148 kSCALED_TANH = 10,
149 kTHRESHOLDED_RELU = 11,
150 kGELU_ERF = 12,
151 kGELU_TANH = 13
152};
153
154namespace impl
155{
161template <>
163{
164 static constexpr int32_t kVALUE = 14;
165};
166} // namespace impl
167
182class ITensor : public INoCopy
183{
184public:
200 void setName(char const* name) noexcept
201 {
202 mImpl->setName(name);
203 }
204
212 char const* getName() const noexcept
213 {
214 return mImpl->getName();
215 }
216
231 void setDimensions(Dims const& dimensions) noexcept
232 {
233 mImpl->setDimensions(dimensions);
234 }
235
245 Dims getDimensions() const noexcept
246 {
247 return mImpl->getDimensions();
248 }
249
281 TRT_DEPRECATED void setType(DataType type) noexcept
282 {
283 mImpl->setType(type);
284 }
285
296 DataType getType() const noexcept
297 {
298 return mImpl->getType();
299 }
300
304 bool isNetworkInput() const noexcept
305 {
306 return mImpl->isNetworkInput();
307 }
308
312 bool isNetworkOutput() const noexcept
313 {
314 return mImpl->isNetworkOutput();
315 }
316
334 void setAllowedFormats(TensorFormats formats) noexcept
335 {
336 mImpl->setAllowedFormats(formats);
337 }
338
348 {
349 return mImpl->getAllowedFormats();
350 }
351
378 bool isShapeTensor() const noexcept
379 {
380 return mImpl->isShapeTensor();
381 }
382
399 bool isExecutionTensor() const noexcept
400 {
401 return mImpl->isExecutionTensor();
402 }
403
425 void setDimensionName(int32_t index, char const* name) noexcept
426 {
427 mImpl->setDimensionName(index, name);
428 }
429
440 char const* getDimensionName(int32_t index) const noexcept
441 {
442 return mImpl->getDimensionName(index);
443 }
444
445protected:
446 apiv::VTensor* mImpl;
447 virtual ~ITensor() noexcept = default;
448};
449
457class ILayer : public INoCopy
458{
459public:
465 LayerType getType() const noexcept
466 {
467 return mLayer->getType();
468 }
469
479 void setName(char const* name) noexcept
480 {
481 mLayer->setName(name);
482 }
483
489 char const* getName() const noexcept
490 {
491 return mLayer->getName();
492 }
493
497 int32_t getNbInputs() const noexcept
498 {
499 return mLayer->getNbInputs();
500 }
501
510 ITensor* getInput(int32_t index) const noexcept
511 {
512 return mLayer->getInput(index);
513 }
514
518 int32_t getNbOutputs() const noexcept
519 {
520 return mLayer->getNbOutputs();
521 }
522
528 ITensor* getOutput(int32_t index) const noexcept
529 {
530 return mLayer->getOutput(index);
531 }
532
545 void setInput(int32_t index, ITensor& tensor) noexcept
546 {
547 return mLayer->setInput(index, tensor);
548 }
549
578 TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
579 {
580 mLayer->setPrecision(dataType);
581 }
582
590 DataType getPrecision() const noexcept
591 {
592 return mLayer->getPrecision();
593 }
594
604 TRT_DEPRECATED bool precisionIsSet() const noexcept
605 {
606 return mLayer->precisionIsSet();
607 }
608
617 {
618 mLayer->resetPrecision();
619 }
620
666 TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
667 {
668 mLayer->setOutputType(index, dataType);
669 }
670
681 DataType getOutputType(int32_t index) const noexcept
682 {
683 return mLayer->getOutputType(index);
684 }
685
697 TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
698 {
699 return mLayer->outputTypeIsSet(index);
700 }
701
711 TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
712 {
713 return mLayer->resetOutputType(index);
714 }
715
729 void setMetadata(char const* metadata) noexcept
730 {
731 mLayer->setMetadata(metadata);
732 }
733
742 char const* getMetadata() const noexcept
743 {
744 return mLayer->getMetadata();
745 }
746
747protected:
748 virtual ~ILayer() noexcept = default;
749 apiv::VLayer* mLayer;
750};
751
908enum class PaddingMode : int32_t
909{
912 kSAME_UPPER = 2,
913 kSAME_LOWER = 3,
914};
915
916namespace impl
917{
923template <>
925{
926 static constexpr int32_t kVALUE = 4;
927};
928} // namespace impl
929
943{
944public:
952 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
953 {
954 mImpl->setNbOutputMaps(nbOutputMaps);
955 }
956
962 int64_t getNbOutputMaps() const noexcept
963 {
964 return mImpl->getNbOutputMaps();
965 }
966
982 void setNbGroups(int64_t nbGroups) noexcept
983 {
984 mImpl->setNbGroups(nbGroups);
985 }
986
992 int64_t getNbGroups() const noexcept
993 {
994 return mImpl->getNbGroups();
995 }
996
1006 void setKernelWeights(Weights weights) noexcept
1007 {
1008 mImpl->setKernelWeights(weights);
1009 }
1010
1016 Weights getKernelWeights() const noexcept
1017 {
1018 return mImpl->getKernelWeights();
1019 }
1020
1031 void setBiasWeights(Weights weights) noexcept
1032 {
1033 mImpl->setBiasWeights(weights);
1034 }
1035
1041 Weights getBiasWeights() const noexcept
1042 {
1043 return mImpl->getBiasWeights();
1044 }
1045
1058 void setPrePadding(Dims const& padding) noexcept
1059 {
1060 mImpl->setPrePadding(padding);
1061 }
1062
1068 Dims getPrePadding() const noexcept
1069 {
1070 return mImpl->getPrePadding();
1071 }
1072
1085 void setPostPadding(Dims const& padding) noexcept
1086 {
1087 mImpl->setPostPadding(padding);
1088 }
1089
1095 Dims getPostPadding() const noexcept
1096 {
1097 return mImpl->getPostPadding();
1098 }
1099
1109 void setPaddingMode(PaddingMode paddingMode) noexcept
1110 {
1111 mImpl->setPaddingMode(paddingMode);
1112 }
1113
1122 {
1123 return mImpl->getPaddingMode();
1124 }
1125
1134 void setKernelSizeNd(Dims const& kernelSize) noexcept
1135 {
1136 mImpl->setKernelSizeNd(kernelSize);
1137 }
1138
1144 Dims getKernelSizeNd() const noexcept
1145 {
1146 return mImpl->getKernelSizeNd();
1147 }
1148
1159 void setStrideNd(Dims const& stride) noexcept
1160 {
1161 mImpl->setStrideNd(stride);
1162 }
1163
1169 Dims getStrideNd() const noexcept
1170 {
1171 return mImpl->getStrideNd();
1172 }
1173
1187 void setPaddingNd(Dims const& padding) noexcept
1188 {
1189 mImpl->setPaddingNd(padding);
1190 }
1191
1199 Dims getPaddingNd() const noexcept
1200 {
1201 return mImpl->getPaddingNd();
1202 }
1203
1213 void setDilationNd(Dims const& dilation) noexcept
1214 {
1215 mImpl->setDilationNd(dilation);
1216 }
1217
1223 Dims getDilationNd() const noexcept
1224 {
1225 return mImpl->getDilationNd();
1226 }
1227
1242 using ILayer::setInput;
1243
1244protected:
1245 virtual ~IConvolutionLayer() noexcept = default;
1246 apiv::VConvolutionLayer* mImpl;
1247};
1248
1263{
1264public:
1273 {
1274 mImpl->setActivationType(type);
1275 }
1276
1283 {
1284 return mImpl->getActivationType();
1285 }
1286
1297 void setAlpha(float alpha) noexcept
1298 {
1299 mImpl->setAlpha(alpha);
1300 }
1301
1311 void setBeta(float beta) noexcept
1312 {
1313 mImpl->setBeta(beta);
1314 }
1315
1320 float getAlpha() const noexcept
1321 {
1322 return mImpl->getAlpha();
1323 }
1324
1329 float getBeta() const noexcept
1330 {
1331 return mImpl->getBeta();
1332 }
1333
1334protected:
1335 virtual ~IActivationLayer() noexcept = default;
1336 apiv::VActivationLayer* mImpl;
1337};
1338
1344enum class PoolingType : int32_t
1345{
1346 kMAX = 0,
1347 kAVERAGE = 1,
1349};
1350
1351namespace impl
1352{
1358template <>
1360{
1361 static constexpr int32_t kVALUE = 3;
1362};
1363} // namespace impl
1364
1376class IPoolingLayer : public ILayer
1377{
1378public:
1386 void setPoolingType(PoolingType type) noexcept
1387 {
1388 mImpl->setPoolingType(type);
1389 }
1390
1397 {
1398 return mImpl->getPoolingType();
1399 }
1400
1411 void setBlendFactor(float blendFactor) noexcept
1412 {
1413 mImpl->setBlendFactor(blendFactor);
1414 }
1415
1424 float getBlendFactor() const noexcept
1425 {
1426 return mImpl->getBlendFactor();
1427 }
1428
1438 void setAverageCountExcludesPadding(bool exclusive) noexcept
1439 {
1440 mImpl->setAverageCountExcludesPadding(exclusive);
1441 }
1442
1450 {
1451 return mImpl->getAverageCountExcludesPadding();
1452 }
1453
1467 void setPrePadding(Dims const& padding) noexcept
1468 {
1469 mImpl->setPrePadding(padding);
1470 }
1471
1477 Dims getPrePadding() const noexcept
1478 {
1479 return mImpl->getPrePadding();
1480 }
1481
1495 void setPostPadding(Dims const& padding) noexcept
1496 {
1497 mImpl->setPostPadding(padding);
1498 }
1499
1505 Dims getPostPadding() const noexcept
1506 {
1507 return mImpl->getPostPadding();
1508 }
1509
1518 void setPaddingMode(PaddingMode paddingMode) noexcept
1519 {
1520 mImpl->setPaddingMode(paddingMode);
1521 }
1522
1530 {
1531 return mImpl->getPaddingMode();
1532 }
1533
1542 void setWindowSizeNd(Dims const& windowSize) noexcept
1543 {
1544 mImpl->setWindowSizeNd(windowSize);
1545 }
1546
1552 Dims getWindowSizeNd() const noexcept
1553 {
1554 return mImpl->getWindowSizeNd();
1555 }
1556
1567 void setStrideNd(Dims const& stride) noexcept
1568 {
1569 mImpl->setStrideNd(stride);
1570 }
1571
1577 Dims getStrideNd() const noexcept
1578 {
1579 return mImpl->getStrideNd();
1580 }
1581
1596 void setPaddingNd(Dims const& padding) noexcept
1597 {
1598 mImpl->setPaddingNd(padding);
1599 }
1600
1608 Dims getPaddingNd() const noexcept
1609 {
1610 return mImpl->getPaddingNd();
1611 }
1612
1613protected:
1614 virtual ~IPoolingLayer() noexcept = default;
1615 apiv::VPoolingLayer* mImpl;
1616};
1617
1627class ILRNLayer : public ILayer
1628{
1629public:
1639 void setWindowSize(int64_t windowSize) noexcept
1640 {
1641 mImpl->setWindowSize(windowSize);
1642 }
1643
1649 int64_t getWindowSize() const noexcept
1650 {
1651 return mImpl->getWindowSize();
1652 }
1653
1661 void setAlpha(float alpha) noexcept
1662 {
1663 mImpl->setAlpha(alpha);
1664 }
1665
1671 float getAlpha() const noexcept
1672 {
1673 return mImpl->getAlpha();
1674 }
1675
1683 void setBeta(float beta) noexcept
1684 {
1685 mImpl->setBeta(beta);
1686 }
1687
1693 float getBeta() const noexcept
1694 {
1695 return mImpl->getBeta();
1696 }
1697
1705 void setK(float k) noexcept
1706 {
1707 mImpl->setK(k);
1708 }
1709
1715 float getK() const noexcept
1716 {
1717 return mImpl->getK();
1718 }
1719
1720protected:
1721 virtual ~ILRNLayer() noexcept = default;
1722 apiv::VLRNLayer* mImpl;
1723};
1724
1730enum class ScaleMode : int32_t
1731{
1732 kUNIFORM = 0,
1733 kCHANNEL = 1,
1734 kELEMENTWISE = 2
1735};
1736
1742template <>
1743constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1744{
1745 return 3;
1746}
1747
1773class IScaleLayer : public ILayer
1774{
1775public:
1781 void setMode(ScaleMode mode) noexcept
1782 {
1783 mImpl->setMode(mode);
1784 }
1785
1791 ScaleMode getMode() const noexcept
1792 {
1793 return mImpl->getMode();
1794 }
1795
1801 void setShift(Weights shift) noexcept
1802 {
1803 mImpl->setShift(shift);
1804 }
1805
1811 Weights getShift() const noexcept
1812 {
1813 return mImpl->getShift();
1814 }
1815
1821 void setScale(Weights scale) noexcept
1822 {
1823 mImpl->setScale(scale);
1824 }
1825
1831 Weights getScale() const noexcept
1832 {
1833 return mImpl->getScale();
1834 }
1835
1841 void setPower(Weights power) noexcept
1842 {
1843 mImpl->setPower(power);
1844 }
1845
1851 Weights getPower() const noexcept
1852 {
1853 return mImpl->getPower();
1854 }
1855
1866 int32_t getChannelAxis() const noexcept
1867 {
1868 return mImpl->getChannelAxis();
1869 }
1870
1887 void setChannelAxis(int32_t channelAxis) noexcept
1888 {
1889 mImpl->setChannelAxis(channelAxis);
1890 }
1891
1892protected:
1893 virtual ~IScaleLayer() noexcept = default;
1894 apiv::VScaleLayer* mImpl;
1895};
1896
1917class ISoftMaxLayer : public ILayer
1918{
1919public:
1940 void setAxes(uint32_t axes) noexcept
1941 {
1942 mImpl->setAxes(axes);
1943 }
1944
1950 uint32_t getAxes() const noexcept
1951 {
1952 return mImpl->getAxes();
1953 }
1954
1955protected:
1956 virtual ~ISoftMaxLayer() noexcept = default;
1957 apiv::VSoftMaxLayer* mImpl;
1958};
1959
1973{
1974public:
1986 void setAxis(int32_t axis) noexcept
1987 {
1988 mImpl->setAxis(axis);
1989 }
1990
1996 int32_t getAxis() const noexcept
1997 {
1998 return mImpl->getAxis();
1999 }
2000
2001protected:
2002 virtual ~IConcatenationLayer() noexcept = default;
2003 apiv::VConcatenationLayer* mImpl;
2004};
2005
2014{
2015public:
2023 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2024 {
2025 mImpl->setNbOutputMaps(nbOutputMaps);
2026 }
2027
2033 int64_t getNbOutputMaps() const noexcept
2034 {
2035 return mImpl->getNbOutputMaps();
2036 }
2037
2053 void setNbGroups(int64_t nbGroups) noexcept
2054 {
2055 mImpl->setNbGroups(nbGroups);
2056 }
2057
2063 int64_t getNbGroups() const noexcept
2064 {
2065 return mImpl->getNbGroups();
2066 }
2067
2077 void setKernelWeights(Weights weights) noexcept
2078 {
2079 mImpl->setKernelWeights(weights);
2080 }
2081
2087 Weights getKernelWeights() const noexcept
2088 {
2089 return mImpl->getKernelWeights();
2090 }
2091
2102 void setBiasWeights(Weights weights) noexcept
2103 {
2104 mImpl->setBiasWeights(weights);
2105 }
2106
2112 Weights getBiasWeights() const noexcept
2113 {
2114 return mImpl->getBiasWeights();
2115 }
2116
2129 void setPrePadding(Dims const& padding) noexcept
2130 {
2131 mImpl->setPrePadding(padding);
2132 }
2133
2139 Dims getPrePadding() const noexcept
2140 {
2141 return mImpl->getPrePadding();
2142 }
2143
2156 void setPostPadding(Dims const& padding) noexcept
2157 {
2158 mImpl->setPostPadding(padding);
2159 }
2160
2166 Dims getPostPadding() const noexcept
2167 {
2168 return mImpl->getPostPadding();
2169 }
2170
2180 void setPaddingMode(PaddingMode paddingMode) noexcept
2181 {
2182 mImpl->setPaddingMode(paddingMode);
2183 }
2184
2193 {
2194 return mImpl->getPaddingMode();
2195 }
2196
2207 void setKernelSizeNd(Dims const& kernelSize) noexcept
2208 {
2209 mImpl->setKernelSizeNd(kernelSize);
2210 }
2211
2217 Dims getKernelSizeNd() const noexcept
2218 {
2219 return mImpl->getKernelSizeNd();
2220 }
2221
2234 void setStrideNd(Dims const& stride) noexcept
2235 {
2236 mImpl->setStrideNd(stride);
2237 }
2238
2244 Dims getStrideNd() const noexcept
2245 {
2246 return mImpl->getStrideNd();
2247 }
2248
2262 void setPaddingNd(Dims const& padding) noexcept
2263 {
2264 mImpl->setPaddingNd(padding);
2265 }
2266
2274 Dims getPaddingNd() const noexcept
2275 {
2276 return mImpl->getPaddingNd();
2277 }
2278
2291 using ILayer::setInput;
2292
2300 void setDilationNd(Dims const& dilation) noexcept
2301 {
2302 mImpl->setDilationNd(dilation);
2303 }
2304
2310 Dims getDilationNd() const noexcept
2311 {
2312 return mImpl->getDilationNd();
2313 }
2314
2315protected:
2316 virtual ~IDeconvolutionLayer() noexcept = default;
2317 apiv::VDeconvolutionLayer* mImpl;
2318};
2319
2332enum class ElementWiseOperation : int32_t
2333{
2334 kSUM = 0,
2335 kPROD = 1,
2336 kMAX = 2,
2337 kMIN = 3,
2338 kSUB = 4,
2339 kDIV = 5,
2340 kPOW = 6,
2341 kFLOOR_DIV = 7,
2342 kAND = 8,
2343 kOR = 9,
2344 kXOR = 10,
2345 kEQUAL = 11,
2346 kGREATER = 12,
2347 kLESS = 13
2348};
2349
2350namespace impl
2351{
2357template <>
2359{
2360 static constexpr int32_t kVALUE = 14;
2361};
2362} // namespace impl
2363
2384{
2385public:
2396 {
2397 return mImpl->setOperation(op);
2398 }
2399
2408 {
2409 return mImpl->getOperation();
2410 }
2411
2412protected:
2413 apiv::VElementWiseLayer* mImpl;
2414 virtual ~IElementWiseLayer() noexcept = default;
2415};
2416
2422enum class GatherMode : int32_t
2423{
2424 kDEFAULT = 0,
2425 kELEMENT = 1,
2426 kND = 2
2427};
2428
2434template <>
2435constexpr inline int32_t EnumMax<GatherMode>() noexcept
2436{
2437 return 3;
2438}
2439
2516class IGatherLayer : public ILayer
2517{
2518public:
2528 void setGatherAxis(int32_t axis) noexcept
2529 {
2530 mImpl->setGatherAxis(axis);
2531 }
2532
2540 int32_t getGatherAxis() const noexcept
2541 {
2542 return mImpl->getGatherAxis();
2543 }
2544
2563 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2564 {
2565 mImpl->setNbElementWiseDims(elementWiseDims);
2566 }
2567
2573 int32_t getNbElementWiseDims() const noexcept
2574 {
2575 return mImpl->getNbElementWiseDims();
2576 }
2577
2583 void setMode(GatherMode mode) noexcept
2584 {
2585 mImpl->setMode(mode);
2586 }
2587
2593 GatherMode getMode() const noexcept
2594 {
2595 return mImpl->getMode();
2596 }
2597
2598protected:
2599 apiv::VGatherLayer* mImpl;
2600 virtual ~IGatherLayer() noexcept = default;
2601};
2602
2619enum class UnaryOperation : int32_t
2620{
2621 kEXP = 0,
2622 kLOG = 1,
2623 kSQRT = 2,
2624 kRECIP = 3,
2625 kABS = 4,
2626 kNEG = 5,
2627 kSIN = 6,
2628 kCOS = 7,
2629 kTAN = 8,
2630 kSINH = 9,
2631 kCOSH = 10,
2632 kASIN = 11,
2633 kACOS = 12,
2634 kATAN = 13,
2635 kASINH = 14,
2636 kACOSH = 15,
2637 kATANH = 16,
2638 kCEIL = 17,
2639 kFLOOR = 18,
2640 kERF = 19,
2641 kNOT = 20,
2642 kSIGN = 21,
2643 kROUND = 22,
2644 kISINF = 23,
2645 kISNAN = 24,
2646};
2647
2653template <>
2654constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2655{
2656 return 25;
2657}
2658
2666class IUnaryLayer : public ILayer
2667{
2668public:
2677 {
2678 mImpl->setOperation(op);
2679 }
2680
2687 {
2688 return mImpl->getOperation();
2689 }
2690
2691protected:
2692 apiv::VUnaryLayer* mImpl;
2693 virtual ~IUnaryLayer() noexcept = default;
2694};
2695
2714enum class ReduceOperation : int32_t
2715{
2716 kSUM = 0,
2717 kPROD = 1,
2718 kMAX = 2,
2719 kMIN = 3,
2720 kAVG = 4
2721};
2722
2728template <>
2729constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2730{
2731 return 5;
2732}
2733
2741class IReduceLayer : public ILayer
2742{
2743public:
2750 {
2751 mImpl->setOperation(op);
2752 }
2753
2760 {
2761 return mImpl->getOperation();
2762 }
2763
2769 void setReduceAxes(uint32_t reduceAxes) noexcept
2770 {
2771 mImpl->setReduceAxes(reduceAxes);
2772 }
2773
2779 uint32_t getReduceAxes() const noexcept
2780 {
2781 return mImpl->getReduceAxes();
2782 }
2783
2789 void setKeepDimensions(bool keepDimensions) noexcept
2790 {
2791 mImpl->setKeepDimensions(keepDimensions);
2792 }
2793
2799 bool getKeepDimensions() const noexcept
2800 {
2801 return mImpl->getKeepDimensions();
2802 }
2803
2804protected:
2805 apiv::VReduceLayer* mImpl;
2806 virtual ~IReduceLayer() noexcept = default;
2807};
2808
2821class IPaddingLayer : public ILayer
2822{
2823public:
2833 void setPrePaddingNd(Dims const& padding) noexcept
2834 {
2835 mImpl->setPrePaddingNd(padding);
2836 }
2837
2845 Dims getPrePaddingNd() const noexcept
2846 {
2847 return mImpl->getPrePaddingNd();
2848 }
2849
2859 void setPostPaddingNd(Dims const& padding) noexcept
2860 {
2861 mImpl->setPostPaddingNd(padding);
2862 }
2863
2871 Dims getPostPaddingNd() const noexcept
2872 {
2873 return mImpl->getPostPaddingNd();
2874 }
2875
2876protected:
2877 apiv::VPaddingLayer* mImpl;
2878 virtual ~IPaddingLayer() noexcept = default;
2879};
2880
2887{
2894 int32_t order[Dims::MAX_DIMS];
2895};
2896
2909class IShuffleLayer : public ILayer
2910{
2911public:
2921 void setFirstTranspose(Permutation permutation) noexcept
2922 {
2923 mImpl->setFirstTranspose(permutation);
2924 }
2925
2934 {
2935 return mImpl->getFirstTranspose();
2936 }
2937
2961 void setReshapeDimensions(Dims const& dimensions) noexcept
2962 {
2963 mImpl->setReshapeDimensions(dimensions);
2964 }
2965
2975 {
2976 return mImpl->getReshapeDimensions();
2977 }
2978
2984 //
3007 using ILayer::setInput;
3008
3021 void setSecondTranspose(Permutation permutation) noexcept
3022 {
3023 mImpl->setSecondTranspose(permutation);
3024 }
3025
3034 {
3035 return mImpl->getSecondTranspose();
3036 }
3037
3049 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3050 {
3051 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3052 }
3053
3062 bool getZeroIsPlaceholder() const noexcept
3063 {
3064 return mImpl->getZeroIsPlaceholder();
3065 }
3066
3067protected:
3068 apiv::VShuffleLayer* mImpl;
3069 virtual ~IShuffleLayer() noexcept = default;
3070};
3071
3077enum class SampleMode : int32_t
3078{
3079 kSTRICT_BOUNDS = 0,
3080 kWRAP = 1,
3081 kCLAMP = 2,
3082 kFILL = 3,
3083 kREFLECT = 4,
3086};
3087
3093template <>
3094constexpr inline int32_t EnumMax<SampleMode>() noexcept
3095{
3096 return 5;
3097}
3098
3161class ISliceLayer : public ILayer
3162{
3163public:
3173 void setStart(Dims const& start) noexcept
3174 {
3175 mImpl->setStart(start);
3176 }
3177
3188 Dims getStart() const noexcept
3189 {
3190 return mImpl->getStart();
3191 }
3192
3202 void setSize(Dims const& size) noexcept
3203 {
3204 return mImpl->setSize(size);
3205 }
3206
3217 Dims getSize() const noexcept
3218 {
3219 return mImpl->getSize();
3220 }
3221
3231 void setStride(Dims const& stride) noexcept
3232 {
3233 mImpl->setStride(stride);
3234 }
3235
3246 Dims getStride() const noexcept
3247 {
3248 return mImpl->getStride();
3249 }
3250
3256 void setMode(SampleMode mode) noexcept
3257 {
3258 mImpl->setMode(mode);
3259 }
3260
3266 SampleMode getMode() const noexcept
3267 {
3268 return mImpl->getMode();
3269 }
3270
3298 using ILayer::setInput;
3299
3309 void setAxes(Dims const& axes) noexcept
3310 {
3311 mImpl->setAxes(axes);
3312 }
3313
3324 Dims getAxes() const noexcept
3325 {
3326 return mImpl->getAxes();
3327 }
3328
3329protected:
3330 apiv::VSliceLayer* mImpl;
3331 virtual ~ISliceLayer() noexcept = default;
3332};
3333
3346class IShapeLayer : public ILayer
3347{
3348protected:
3349 apiv::VShapeLayer* mImpl;
3350 virtual ~IShapeLayer() noexcept = default;
3351};
3352
3358enum class TopKOperation : int32_t
3359{
3360 kMAX = 0,
3361 kMIN = 1,
3362};
3363
3369template <>
3370constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3371{
3372 return 2;
3373}
3374
3386class ITopKLayer : public ILayer
3387{
3388public:
3394 void setOperation(TopKOperation op) noexcept
3395 {
3396 mImpl->setOperation(op);
3397 }
3398
3405 {
3406 return mImpl->getOperation();
3407 }
3408
3418 void setK(int32_t k) noexcept
3419 {
3420 mImpl->setK(k);
3421 }
3422
3432 int32_t getK() const noexcept
3433 {
3434 return mImpl->getK();
3435 }
3436
3442 void setReduceAxes(uint32_t reduceAxes) noexcept
3443 {
3444 mImpl->setReduceAxes(reduceAxes);
3445 }
3446
3452 uint32_t getReduceAxes() const noexcept
3453 {
3454 return mImpl->getReduceAxes();
3455 }
3456
3471 using ILayer::setInput;
3472
3473protected:
3474 apiv::VTopKLayer* mImpl;
3475 virtual ~ITopKLayer() noexcept = default;
3476};
3477
3484enum class MatrixOperation : int32_t
3485{
3489 kNONE = 0,
3490
3492 kTRANSPOSE = 1,
3493
3504 kVECTOR = 2,
3505};
3506
3512template <>
3513constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3514{
3515 return 3;
3516}
3517
3544{
3545public:
3554 void setOperation(int32_t index, MatrixOperation op) noexcept
3555 {
3556 mImpl->setOperation(index, op);
3557 }
3558
3566 MatrixOperation getOperation(int32_t index) const noexcept
3567 {
3568 return mImpl->getOperation(index);
3569 }
3570
3571protected:
3572 apiv::VMatrixMultiplyLayer* mImpl;
3573 virtual ~IMatrixMultiplyLayer() noexcept = default;
3574};
3575
3597class INonZeroLayer : public ILayer
3598{
3599protected:
3600 virtual ~INonZeroLayer() noexcept = default;
3601 apiv::VNonZeroLayer* mImpl;
3602};
3603
3619{
3620protected:
3621 apiv::VRaggedSoftMaxLayer* mImpl;
3622 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3623};
3624
3669{
3670protected:
3671 apiv::VIdentityLayer* mImpl;
3672 virtual ~IIdentityLayer() noexcept = default;
3673};
3674
3681class ICastLayer : public ILayer
3682{
3683public:
3691 void setToType(DataType toType) noexcept
3692 {
3693 mImpl->setToType(toType);
3694 }
3695
3702 DataType getToType() const noexcept
3703 {
3704 return mImpl->getToType();
3705 }
3706
3707protected:
3708 apiv::VCastLayer* mImpl;
3709 virtual ~ICastLayer() noexcept = default;
3710};
3711
3721{
3722public:
3731 void setWeights(Weights weights) noexcept
3732 {
3733 mImpl->setWeights(weights);
3734 }
3735
3741 Weights getWeights() const noexcept
3742 {
3743 return mImpl->getWeights();
3744 }
3745
3753 void setDimensions(Dims const& dimensions) noexcept
3754 {
3755 mImpl->setDimensions(dimensions);
3756 }
3757
3765 Dims getDimensions() const noexcept
3766 {
3767 return mImpl->getDimensions();
3768 }
3769
3770protected:
3771 apiv::VConstantLayer* mImpl;
3772 virtual ~IConstantLayer() noexcept = default;
3773};
3774
3785{
3786protected:
3787 apiv::VParametricReLULayer* mImpl;
3788 virtual ~IParametricReLULayer() noexcept = default;
3789};
3790
3796enum class InterpolationMode : int32_t
3797{
3798 kNEAREST = 0,
3799 kLINEAR = 1,
3800 kCUBIC = 2
3801};
3802
3803namespace impl
3804{
3810template <>
3812{
3813 static constexpr int32_t kVALUE = 3;
3814};
3815} // namespace impl
3816
3825{
3838 kALIGN_CORNERS = 0,
3839
3846 kASYMMETRIC = 1,
3847
3854 kHALF_PIXEL = 2,
3855};
3856
3857namespace impl
3858{
3864template <>
3866{
3867 static constexpr int32_t kVALUE = 3;
3868};
3869} // namespace impl
3870
3878enum class ResizeSelector : int32_t
3879{
3881 kFORMULA = 0,
3882
3884 kUPPER = 1,
3885};
3886
3887namespace impl
3888{
3894template <>
3896{
3897 static constexpr int32_t kVALUE = 2;
3898};
3899} // namespace impl
3900
3908enum class ResizeRoundMode : int32_t
3909{
3911 kHALF_UP = 0,
3912
3914 kHALF_DOWN = 1,
3915
3917 kFLOOR = 2,
3918
3920 kCEIL = 3,
3921};
3922
3923namespace impl
3924{
3930template <>
3932{
3933 static constexpr int32_t kVALUE = 4;
3934};
3935} // namespace impl
3936
3973class IResizeLayer : public ILayer
3974{
3975public:
3994 void setOutputDimensions(Dims const& dimensions) noexcept
3995 {
3996 return mImpl->setOutputDimensions(dimensions);
3997 }
3998
4004 Dims getOutputDimensions() const noexcept
4005 {
4006 return mImpl->getOutputDimensions();
4007 }
4008
4034 void setScales(float const* scales, int32_t nbScales) noexcept
4035 {
4036 mImpl->setScales(scales, nbScales);
4037 }
4038
4053 int32_t getScales(int32_t size, float* scales) const noexcept
4054 {
4055 return mImpl->getScales(size, scales);
4056 }
4057
4065 void setResizeMode(InterpolationMode interpolationMode) noexcept
4066 {
4067 mImpl->setResizeMode(interpolationMode);
4068 }
4069
4076 {
4077 return mImpl->getResizeMode();
4078 }
4079
4099 using ILayer::setInput;
4100
4111 {
4112 mImpl->setCoordinateTransformation(coordTransform);
4113 }
4114
4121 {
4122 return mImpl->getCoordinateTransformation();
4123 }
4124
4136 {
4137 mImpl->setSelectorForSinglePixel(selector);
4138 }
4139
4146 {
4147 return mImpl->getSelectorForSinglePixel();
4148 }
4149
4160 {
4161 mImpl->setNearestRounding(value);
4162 }
4163
4170 {
4171 return mImpl->getNearestRounding();
4172 }
4173
4191 void setCubicCoeff(float A) noexcept
4192 {
4193 mImpl->setCubicCoeff(A);
4194 }
4195
4201 float getCubicCoeff() const noexcept
4202 {
4203 return mImpl->getCubicCoeff();
4204 }
4205
4214 void setExcludeOutside(bool excludeFlag) noexcept
4215 {
4216 mImpl->setExcludeOutside(excludeFlag);
4217 }
4218
4224 bool getExcludeOutside() const noexcept
4225 {
4226 return mImpl->getExcludeOutside();
4227 }
4228
4229protected:
4230 virtual ~IResizeLayer() noexcept = default;
4231 apiv::VResizeLayer* mImpl;
4232};
4233
4239enum class LoopOutput : int32_t
4240{
4242 kLAST_VALUE = 0,
4243
4245 kCONCATENATE = 1,
4246
4248 kREVERSE = 2
4249};
4250
4256template <>
4257constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4258{
4259 return 3;
4260}
4261
4267enum class TripLimit : int32_t
4268{
4269
4270 kCOUNT = 0,
4271 kWHILE = 1
4272};
4273
4279template <>
4280constexpr inline int32_t EnumMax<TripLimit>() noexcept
4281{
4282 return 2;
4283}
4284
4285class ILoop;
4286
4301{
4302public:
4306 ILoop* getLoop() const noexcept
4307 {
4308 return mBoundary->getLoop();
4309 }
4310
4311protected:
4312 virtual ~ILoopBoundaryLayer() noexcept = default;
4313 apiv::VLoopBoundaryLayer* mBoundary;
4314};
4315
4324{
4325public:
4330 {
4331 return mBoundary->getConditional();
4332 }
4333
4334protected:
4335 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4336 apiv::VConditionalBoundaryLayer* mBoundary;
4337};
4338
4345{
4346public:
4347protected:
4348 virtual ~IConditionLayer() noexcept = default;
4349 apiv::VConditionLayer* mImpl;
4350};
4351
4362{
4363public:
4364protected:
4365 virtual ~IIfConditionalOutputLayer() noexcept = default;
4366 apiv::VConditionalOutputLayer* mImpl;
4367};
4368
4375{
4376public:
4377protected:
4378 virtual ~IIfConditionalInputLayer() noexcept = default;
4379 apiv::VConditionalInputLayer* mImpl;
4380};
4381
4407{
4408public:
4419 {
4420 return mImpl->setCondition(condition);
4421 }
4422
4436 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4437 {
4438 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4439 }
4440
4449 {
4450 return mImpl->addInput(input);
4451 }
4452
4463 void setName(char const* name) noexcept
4464 {
4465 mImpl->setName(name);
4466 }
4467
4473 char const* getName() const noexcept
4474 {
4475 return mImpl->getName();
4476 }
4477
4478protected:
4479 virtual ~IIfConditional() noexcept = default;
4480 apiv::VIfConditional* mImpl;
4481};
4482
4491{
4492public:
4498 //
4511 using ILayer::setInput;
4512
4513protected:
4514 virtual ~IRecurrenceLayer() noexcept = default;
4515 apiv::VRecurrenceLayer* mImpl;
4516};
4517
4538{
4539public:
4543 LoopOutput getLoopOutput() const noexcept
4544 {
4545 return mImpl->getLoopOutput();
4546 }
4547
4560 void setAxis(int32_t axis) noexcept
4561 {
4562 mImpl->setAxis(axis);
4563 }
4564
4568 int32_t getAxis() const noexcept
4569 {
4570 return mImpl->getAxis();
4571 }
4572
4578 //
4593 using ILayer::setInput;
4594
4595protected:
4596 virtual ~ILoopOutputLayer() noexcept = default;
4597 apiv::VLoopOutputLayer* mImpl;
4598};
4599
4612{
4613public:
4617 TripLimit getTripLimit() const noexcept
4618 {
4619 return mImpl->getTripLimit();
4620 }
4621
4622protected:
4623 virtual ~ITripLimitLayer() noexcept = default;
4624 apiv::VTripLimitLayer* mImpl;
4625};
4626
4638{
4639public:
4643 void setAxis(int32_t axis) noexcept
4644 {
4645 mImpl->setAxis(axis);
4646 }
4647
4651 int32_t getAxis() const noexcept
4652 {
4653 return mImpl->getAxis();
4654 }
4655
4665 void setReverse(bool reverse) noexcept
4666 {
4667 mImpl->setReverse(reverse);
4668 }
4669
4675 bool getReverse() const noexcept
4676 {
4677 return mImpl->getReverse();
4678 }
4679
4680protected:
4681 virtual ~IIteratorLayer() noexcept = default;
4682 apiv::VIteratorLayer* mImpl;
4683};
4684
4695class ILoop : public INoCopy
4696{
4697public:
4704 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4705 {
4706 return mImpl->addRecurrence(initialValue);
4707 }
4708
4726 {
4727 return mImpl->addTripLimit(tensor, limit);
4728 }
4729
4738 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4739 {
4740 return mImpl->addIterator(tensor, axis, reverse);
4741 }
4742
4751 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4752 {
4753 return mImpl->addLoopOutput(tensor, outputKind, axis);
4754 }
4755
4766 void setName(char const* name) noexcept
4767 {
4768 mImpl->setName(name);
4769 }
4770
4776 char const* getName() const noexcept
4777 {
4778 return mImpl->getName();
4779 }
4780
4781protected:
4782 virtual ~ILoop() noexcept = default;
4783 apiv::VLoop* mImpl;
4784};
4785
4798class ISelectLayer : public ILayer
4799{
4800protected:
4801 virtual ~ISelectLayer() noexcept = default;
4802 apiv::VSelectLayer* mImpl;
4803};
4804
4821{
4822public:
4831 void setMessage(char const* message) noexcept
4832 {
4833 mImpl->setMessage(message);
4834 }
4835
4841 char const* getMessage() const noexcept
4842 {
4843 return mImpl->getMessage();
4844 }
4845
4846protected:
4847 virtual ~IAssertionLayer() noexcept = default;
4848
4849 apiv::VAssertionLayer* mImpl;
4850};
4851
4859enum class FillOperation : int32_t
4860{
4876 kLINSPACE = 0,
4877
4879 kRANDOM_UNIFORM = 1,
4880
4882 kRANDOM_NORMAL = 2
4883};
4884
4890template <>
4891constexpr inline int32_t EnumMax<FillOperation>() noexcept
4892{
4893 return 3;
4894}
4895
4931class IFillLayer : public ILayer
4932{
4933public:
4942 //
4943 void setDimensions(Dims const& dimensions) noexcept
4944 {
4945 mImpl->setDimensions(dimensions);
4946 }
4947
4958 Dims getDimensions() const noexcept
4959 {
4960 return mImpl->getDimensions();
4961 }
4962
4968 void setOperation(FillOperation op) noexcept
4969 {
4970 mImpl->setOperation(op);
4971 }
4972
4979 {
4980 return mImpl->getOperation();
4981 }
4982
4996 //
4997 void setAlpha(double alpha) noexcept
4998 {
4999 mImpl->setAlpha(alpha);
5000 }
5001
5012 double getAlpha() const noexcept
5013 {
5014 return mImpl->getAlpha();
5015 }
5016
5031 void setBeta(double beta) noexcept
5032 {
5033 mImpl->setBeta(beta);
5034 }
5035
5046 double getBeta() const noexcept
5047 {
5048 return mImpl->getBeta();
5049 }
5050
5091 using ILayer::setInput;
5092
5106 //
5107 void setAlphaInt64(int64_t alpha) noexcept
5108 {
5109 mImpl->setAlphaInt64(alpha);
5110 }
5111
5122 int64_t getAlphaInt64() const noexcept
5123 {
5124 return mImpl->getAlphaInt64();
5125 }
5126
5141 void setBetaInt64(int64_t beta) noexcept
5142 {
5143 mImpl->setBetaInt64(beta);
5144 }
5145
5156 int64_t getBetaInt64() const noexcept
5157 {
5158 return mImpl->getBetaInt64();
5159 }
5160
5164 bool isAlphaBetaInt64() const noexcept
5165 {
5166 return mImpl->isAlphaBetaInt64();
5167 }
5168
5181 void setToType(DataType toType) noexcept
5182 {
5183 mImpl->setToType(toType);
5184 }
5185
5193 DataType getToType() const noexcept
5194 {
5195 return mImpl->getToType();
5196 }
5197
5198protected:
5199 virtual ~IFillLayer() noexcept = default;
5200 apiv::VFillLayer* mImpl;
5201};
5202
5278{
5279public:
5288 int32_t getAxis() const noexcept
5289 {
5290 return mImpl->getAxis();
5291 }
5299 void setAxis(int32_t axis) noexcept
5300 {
5301 mImpl->setAxis(axis);
5302 }
5303
5315 void setToType(DataType toType) noexcept
5316 {
5317 mImpl->setToType(toType);
5318 }
5319
5327 DataType getToType() const noexcept
5328 {
5329 return mImpl->getToType();
5330 }
5331
5332protected:
5333 virtual ~IQuantizeLayer() noexcept = default;
5334 apiv::VQuantizeLayer* mImpl;
5335};
5336
5409{
5410public:
5419 int32_t getAxis() const noexcept
5420 {
5421 return mImpl->getAxis();
5422 }
5430 void setAxis(int32_t axis) noexcept
5431 {
5432 mImpl->setAxis(axis);
5433 }
5434
5446 void setToType(DataType toType) noexcept
5447 {
5448 mImpl->setToType(toType);
5449 }
5450
5458 DataType getToType() const noexcept
5459 {
5460 return mImpl->getToType();
5461 }
5462
5463protected:
5464 virtual ~IDequantizeLayer() noexcept = default;
5465 apiv::VDequantizeLayer* mImpl;
5466};
5467
5486{
5487public:
5499 using ILayer::setInput;
5500
5513 void setToType(DataType toType) noexcept
5514 {
5515 mImpl->setToType(toType);
5516 }
5517
5526 DataType getToType() const noexcept
5527 {
5528 return mImpl->getToType();
5529 }
5530
5539 void setScaleType(DataType scaleType) noexcept
5540 {
5541 mImpl->setScaleType(scaleType);
5542 }
5543
5552 DataType getScaleType() const noexcept
5553 {
5554 return mImpl->getScaleType();
5555 }
5556
5565 void setAxis(int32_t axis) noexcept
5566 {
5567 mImpl->setAxis(axis);
5568 }
5569
5575 int32_t getAxis() const noexcept
5576 {
5577 return mImpl->getAxis();
5578 }
5579
5588 void setBlockSize(int32_t size) noexcept
5589 {
5590 mImpl->setBlockSize(size);
5591 }
5592
5598 int32_t getBlockSize() const noexcept
5599 {
5600 return mImpl->getBlockSize();
5601 }
5602
5603protected:
5604 virtual ~IDynamicQuantizeLayer() noexcept = default;
5605 apiv::VDynamicQuantizeLayer* mImpl;
5606};
5607
5642class IEinsumLayer : public ILayer
5643{
5644public:
5654 bool setEquation(char const* equation) noexcept
5655 {
5656 return mImpl->setEquation(equation);
5657 }
5658
5664 char const* getEquation() const noexcept
5665 {
5666 return mImpl->getEquation();
5667 }
5668
5669protected:
5670 virtual ~IEinsumLayer() noexcept = default;
5671 apiv::VEinsumLayer* mImpl;
5672};
5673
5681enum class ScatterMode : int32_t
5682{
5683 kELEMENT = 0,
5684 kND = 1,
5685};
5686
5692template <>
5693constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5694{
5695 return 2;
5696}
5697
5755class IScatterLayer : public ILayer
5756{
5757public:
5763 void setMode(ScatterMode mode) noexcept
5764 {
5765 mImpl->setMode(mode);
5766 }
5767
5773 ScatterMode getMode() const noexcept
5774 {
5775 return mImpl->getMode();
5776 }
5777
5783 void setAxis(int32_t axis) noexcept
5784 {
5785 mImpl->setAxis(axis);
5786 }
5787
5791 int32_t getAxis() const noexcept
5792 {
5793 return mImpl->getAxis();
5794 }
5795
5796protected:
5797 apiv::VScatterLayer* mImpl;
5798 virtual ~IScatterLayer() noexcept = default;
5799}; // class IScatterLayer
5800
5827class IOneHotLayer : public ILayer
5828{
5829public:
5835 void setAxis(int32_t axis) noexcept
5836 {
5837 mImpl->setAxis(axis);
5838 }
5839
5843 int32_t getAxis() const noexcept
5844 {
5845 return mImpl->getAxis();
5846 }
5847
5848protected:
5849 apiv::VOneHotLayer* mImpl;
5850 virtual ~IOneHotLayer() noexcept = default;
5851};
5852
5865{
5866public:
5873 {
5874 mImpl->setInterpolationMode(mode);
5875 }
5876
5885 {
5886 return mImpl->getInterpolationMode();
5887 }
5888
5894 void setAlignCorners(bool alignCorners) noexcept
5895 {
5896 mImpl->setAlignCorners(alignCorners);
5897 }
5898
5906 bool getAlignCorners() const noexcept
5907 {
5908 return mImpl->getAlignCorners();
5909 }
5910
5918 bool setSampleMode(SampleMode mode) noexcept
5919 {
5920 return mImpl->setSampleMode(mode);
5921 }
5922
5930 SampleMode getSampleMode() const noexcept
5931 {
5932 return mImpl->getSampleMode();
5933 }
5934
5935protected:
5936 apiv::VGridSampleLayer* mImpl;
5937 virtual ~IGridSampleLayer() noexcept = default;
5938}; // class IGridSampleLayer
5939
5947enum class BoundingBoxFormat : int32_t
5948{
5950 kCORNER_PAIRS = 0,
5952 kCENTER_SIZES = 1
5953};
5954
5960template <>
5961constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
5962{
5963 return 2;
5964}
5965
6012class INMSLayer : public ILayer
6013{
6014public:
6025 {
6026 mImpl->setBoundingBoxFormat(fmt);
6027 }
6028
6037 {
6038 return mImpl->getBoundingBoxFormat();
6039 }
6040
6050 void setTopKBoxLimit(int32_t limit) noexcept
6051 {
6052 mImpl->setTopKBoxLimit(limit);
6053 }
6054
6060 int32_t getTopKBoxLimit() const noexcept
6061 {
6062 return mImpl->getTopKBoxLimit();
6063 }
6064
6083 using ILayer::setInput;
6084
6085protected:
6086 apiv::VNMSLayer* mImpl;
6087 virtual ~INMSLayer() noexcept = default;
6088}; // class INMSLayer
6089
6103{
6104public:
6113 void setBatchAxis(int32_t batchAxis) noexcept
6114 {
6115 mImpl->setBatchAxis(batchAxis);
6116 }
6117
6123 int32_t getBatchAxis() const noexcept
6124 {
6125 return mImpl->getBatchAxis();
6126 }
6127
6136 void setSequenceAxis(int32_t sequenceAxis) noexcept
6137 {
6138 mImpl->setSequenceAxis(sequenceAxis);
6139 }
6140
6146 int32_t getSequenceAxis() const noexcept
6147 {
6148 return mImpl->getSequenceAxis();
6149 }
6150
6151protected:
6152 apiv::VReverseSequenceLayer* mImpl;
6153 virtual ~IReverseSequenceLayer() noexcept = default;
6154}; // class IReverseSequenceLayer
6155
6175{
6176public:
6184 void setEpsilon(float eps) noexcept
6185 {
6186 return mImpl->setEpsilon(eps);
6187 }
6188
6194 float getEpsilon() const noexcept
6195 {
6196 return mImpl->getEpsilon();
6197 }
6198
6204 void setAxes(uint32_t axesMask) noexcept
6205 {
6206 return mImpl->setAxes(axesMask);
6207 }
6208
6214 uint32_t getAxes() const noexcept
6215 {
6216 return mImpl->getAxes();
6217 }
6218
6235 void setNbGroups(int64_t nbGroups) noexcept
6236 {
6237 return mImpl->setNbGroups(nbGroups);
6238 }
6239
6245 int64_t getNbGroups() const noexcept
6246 {
6247 return mImpl->getNbGroups();
6248 }
6249
6271 void setComputePrecision(DataType type) noexcept
6272 {
6273 return mImpl->setComputePrecision(type);
6274 }
6275
6282 {
6283 return mImpl->getComputePrecision();
6284 }
6285
6286protected:
6287 apiv::VNormalizationLayer* mImpl;
6288 virtual ~INormalizationLayer() noexcept = default;
6289};
6290
6291
6300class ISqueezeLayer : public ILayer
6301{
6302public:
6315 using ILayer::setInput;
6316
6317protected:
6318 apiv::VSqueezeLayer* mImpl;
6319 virtual ~ISqueezeLayer() noexcept = default;
6320};
6321
6330{
6331public:
6344 using ILayer::setInput;
6345
6346protected:
6347 apiv::VUnsqueezeLayer* mImpl;
6348 virtual ~IUnsqueezeLayer() noexcept = default;
6349};
6350
6362enum class CumulativeOperation : int32_t
6363{
6364 kSUM = 0,
6365};
6366
6367namespace impl
6368{
6369
6375template <>
6377{
6378 static constexpr int32_t kVALUE = 1;
6379};
6380
6381} // namespace impl
6382
6411{
6412public:
6423 {
6424 return mImpl->setOperation(op);
6425 }
6426
6435 {
6436 return mImpl->getOperation();
6437 }
6438
6446 void setExclusive(bool exclusive) noexcept
6447 {
6448 mImpl->setExclusive(exclusive);
6449 }
6450
6458 bool getExclusive() const noexcept
6459 {
6460 return mImpl->getExclusive();
6461 }
6462
6470 void setReverse(bool reverse) noexcept
6471 {
6472 mImpl->setReverse(reverse);
6473 }
6474
6482 bool getReverse() const noexcept
6483 {
6484 return mImpl->getReverse();
6485 }
6486
6487protected:
6488 apiv::VCumulativeLayer* mImpl;
6489 virtual ~ICumulativeLayer() noexcept = default;
6490};
6491
6510{
6511public:
6512 virtual ~INetworkDefinition() noexcept = default;
6513
6549 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6550 {
6551 return mImpl->addInput(name, type, dimensions);
6552 }
6553
6563 void markOutput(ITensor& tensor) noexcept
6564 {
6565 mImpl->markOutput(tensor);
6566 }
6567
6581 bool markDebug(ITensor& tensor) noexcept
6582 {
6583 return mImpl->markDebug(tensor);
6584 }
6585
6597 bool unmarkDebug(ITensor& tensor) noexcept
6598 {
6599 return mImpl->unmarkDebug(tensor);
6600 }
6601
6607 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6608 {
6609 return mImpl->isDebugTensor(tensor);
6610 }
6611
6630 {
6631 return mImpl->markUnfusedTensorsAsDebugTensors();
6632 }
6633
6644 {
6645 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
6646 }
6647
6664 {
6665 return mImpl->addActivation(input, type);
6666 }
6667
6682 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6683 {
6684 return mImpl->addLRN(input, window, alpha, beta, k);
6685 }
6686
6708 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6709 {
6710 return mImpl->addScale(input, mode, shift, scale, power);
6711 }
6712
6722 {
6723 return mImpl->addSoftMax(input);
6724 }
6725
6738 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6739 {
6740 return mImpl->addConcatenation(inputs, nbInputs);
6741 }
6742
6766 {
6767 return mImpl->addElementWise(input1, input2, op);
6768 }
6769
6787 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6788 {
6789 return mImpl->addUnary(input, operation);
6790 }
6791
6802 {
6803 return mImpl->addShuffle(input);
6804 }
6805
6818 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6819 {
6820 return mImpl->addOneHot(indices, values, depth, axis);
6821 }
6822
6830 int32_t getNbLayers() const noexcept
6831 {
6832 return mImpl->getNbLayers();
6833 }
6834
6844 ILayer* getLayer(int32_t index) const noexcept
6845 {
6846 return mImpl->getLayer(index);
6847 }
6848
6856 int32_t getNbInputs() const noexcept
6857 {
6858 return mImpl->getNbInputs();
6859 }
6860
6872 ITensor* getInput(int32_t index) const noexcept
6873 {
6874 return mImpl->getInput(index);
6875 }
6876
6886 int32_t getNbOutputs() const noexcept
6887 {
6888 return mImpl->getNbOutputs();
6889 }
6890
6902 ITensor* getOutput(int32_t index) const noexcept
6903 {
6904 return mImpl->getOutput(index);
6905 }
6906
6929 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
6930 {
6931 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
6932 }
6933
6961 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
6962 {
6963 return mImpl->addTopK(input, op, k, reduceAxes);
6964 }
6965
6977 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
6978 {
6979 return mImpl->addGather(data, indices, axis);
6980 }
6981
6993 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
6994 {
6995 return mImpl->addGatherV2(data, indices, mode);
6996 }
6997
7013 {
7014 return mImpl->addRaggedSoftMax(input, bounds);
7015 }
7016
7034 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7035 {
7036 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7037 }
7038
7049 {
7050 return mImpl->addNonZero(input);
7051 }
7052
7072 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7073 {
7074 return mImpl->addConstant(dimensions, weights);
7075 }
7076
7087 {
7088 return mImpl->addIdentity(input);
7089 }
7090
7101 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7102 {
7103 return mImpl->addCast(input, toType);
7104 }
7105
7116 void removeTensor(ITensor& tensor) noexcept
7117 {
7118 mImpl->removeTensor(tensor);
7119 }
7120
7128 void unmarkOutput(ITensor& tensor) noexcept
7129 {
7130 mImpl->unmarkOutput(tensor);
7131 }
7132
7147 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7148 {
7149 return mImpl->addSlice(input, start, size, stride);
7150 }
7151
7171 void setName(char const* name) noexcept
7172 {
7173 mImpl->setName(name);
7174 }
7175
7185 char const* getName() const noexcept
7186 {
7187 return mImpl->getName();
7188 }
7189
7201 IShapeLayer* addShape(ITensor& input) noexcept
7202 {
7203 return mImpl->addShape(input);
7204 }
7205
7212 {
7213 return mImpl->getFlags();
7214 }
7215
7223 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7224 {
7225 return mImpl->getFlag(networkDefinitionCreationFlag);
7226 }
7227
7240 bool markOutputForShapes(ITensor& tensor) noexcept
7241 {
7242 return mImpl->markOutputForShapes(tensor);
7243 }
7244
7252 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7253 {
7254 return mImpl->unmarkOutputForShapes(tensor);
7255 }
7256
7271 {
7272 return mImpl->addParametricReLU(input, slope);
7273 }
7274
7293 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7294 {
7295 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7296 }
7297
7312 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7313 {
7314 return mImpl->addPoolingNd(input, type, windowSize);
7315 }
7316
7331 //
7335 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7336 {
7337 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7338 }
7339
7372 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7373 {
7374 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7375 }
7376
7389 {
7390 return mImpl->addResize(input);
7391 }
7392
7402 ILoop* addLoop() noexcept
7403 {
7404 return mImpl->addLoop();
7405 }
7406
7418 {
7419 return mImpl->addIfConditional();
7420 }
7421
7456 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7457 {
7458 return mImpl->addSelect(condition, thenInput, elseInput);
7459 }
7460
7473 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7474 {
7475 return mImpl->addAssertion(condition, message);
7476 }
7477
7499 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7500 {
7501 return mImpl->addFillV2(dimensions, op, outputType);
7502 }
7503
7515 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7516 {
7517 return mImpl->addPaddingNd(input, prePadding, postPadding);
7518 }
7519
7539 bool setWeightsName(Weights weights, char const* name) noexcept
7540 {
7541 return mImpl->setWeightsName(weights, name);
7542 }
7543
7555 //
7558 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7559 {
7560 mImpl->setErrorRecorder(recorder);
7561 }
7562
7574 {
7575 return mImpl->getErrorRecorder();
7576 }
7577
7595 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7596 {
7597 return mImpl->addDequantizeV2(input, scale, outputType);
7598 }
7599
7615 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7616 {
7617 return mImpl->addScatter(data, indices, updates, mode);
7618 }
7619
7637 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7638 {
7639 return mImpl->addQuantizeV2(input, scale, outputType);
7640 }
7641
7665 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
7666 {
7667 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
7668 }
7669
7680 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7681 {
7682 return mImpl->addEinsum(inputs, nbInputs, equation);
7683 }
7684
7699 {
7700 return mImpl->addGridSample(input, grid);
7701 }
7702
7716 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7717 {
7718 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7719 }
7720
7734 {
7735 return mImpl->addReverseSequence(input, sequenceLens);
7736 }
7737
7759 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
7760 {
7761 return mImpl->addNormalization(input, scale, bias, axesMask);
7762 }
7763
7781 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
7782 {
7783 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
7784 }
7785
7792 virtual IBuilder& getBuilder() const noexcept
7793 {
7794 return mImpl->getBuilder();
7795 }
7796
7805 bool markWeightsRefittable(char const* name) noexcept
7806 {
7807 return mImpl->markWeightsRefittable(name);
7808 }
7809
7817 bool unmarkWeightsRefittable(char const* name) noexcept
7818 {
7819 return mImpl->unmarkWeightsRefittable(name);
7820 }
7821
7830 bool areWeightsMarkedRefittable(char const* name) const noexcept
7831 {
7832 return mImpl->areWeightsMarkedRefittable(name);
7833 }
7834
7849 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
7850 {
7851 return mImpl->addSqueeze(input, axes);
7852 }
7853
7871 {
7872 return mImpl->addUnsqueeze(input, axes);
7873 }
7874
7875protected:
7876 apiv::VNetworkDefinition* mImpl;
7877};
7878
7896enum class RuntimePlatform : int32_t
7897{
7900 kSAME_AS_BUILD = 0,
7901
7904 kWINDOWS_AMD64 = 1,
7905};
7906
7907namespace impl
7908{
7914template <>
7916{
7917 static constexpr int32_t kVALUE = 2;
7918};
7919} // namespace impl
7920
7927using BuilderFlags = uint32_t;
7928
7936enum class BuilderFlag : int32_t
7937{
7941
7945
7947 kDEBUG = 2,
7948
7950 kGPU_FALLBACK = 3,
7951
7953 kREFIT = 4,
7954
7957
7961 kTF32 = 6,
7962
7964 kSPARSE_WEIGHTS = 7,
7965
7972 kSAFETY_SCOPE = 8,
7973
7977
7982
7988
7992
7999
8005
8013
8017
8022
8028
8030 kSTRIP_PLAN = 19,
8031
8034
8041 kREFIT_IDENTICAL = 20,
8042
8068 kWEIGHT_STREAMING = 21,
8069
8073
8078 kREFIT_INDIVIDUAL = 23,
8079
8088 kSTRICT_NANS = 24,
8089
8091 kMONITOR_MEMORY = 25,
8092
8096
8099
8111};
8112
8118template <>
8119constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8120{
8121 return 29;
8122}
8123
8124namespace v_1_0
8125{
8139{
8140 uint8_t data[16];
8141};
8142
8151{
8153 uint64_t tacticHash;
8157 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8158};
8159} // namespace v_1_0
8160
8174class ITimingCache : public INoCopy
8175{
8176public:
8177 virtual ~ITimingCache() noexcept = default;
8178
8188 nvinfer1::IHostMemory* serialize() const noexcept
8189 {
8190 return mImpl->serialize();
8191 }
8192
8212 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8213 {
8214 return mImpl->combine(inputCache, ignoreMismatch);
8215 }
8216
8222 bool reset() noexcept
8223 {
8224 return mImpl->reset();
8225 }
8226
8241 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
8242 {
8243 return mImpl->queryKeys(keyBuffer, capacity);
8244 }
8245
8258 TimingCacheValue query(TimingCacheKey const& key) const noexcept
8259 {
8260 return mImpl->query(key);
8261 }
8262
8280 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
8281 {
8282 return mImpl->update(key, value);
8283 }
8284
8285protected:
8286 apiv::VTimingCache* mImpl;
8287};
8288
8296enum class MemoryPoolType : int32_t
8297{
8304 kWORKSPACE = 0,
8305
8313
8319 kDLA_LOCAL_DRAM = 2,
8320
8326 kDLA_GLOBAL_DRAM = 3,
8327
8335 kTACTIC_DRAM = 4,
8336
8350};
8351
8357template <>
8358constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
8359{
8360 return 6;
8361}
8362
8371enum class PreviewFeature : int32_t
8372{
8379
8384
8391};
8392
8393namespace impl
8394{
8400template <>
8402{
8403 static constexpr int32_t kVALUE = 3;
8404};
8405} // namespace impl
8406
8415enum class HardwareCompatibilityLevel : int32_t
8416{
8419 kNONE = 0,
8420
8432 kAMPERE_PLUS = 1,
8433
8443};
8444
8445namespace impl
8446{
8452template <>
8454{
8455 static constexpr int32_t kVALUE = 3;
8456};
8457} // namespace impl
8458
8464enum class ComputeCapability : int32_t
8465{
8467 kNONE = 0,
8469 kCURRENT = 1,
8471 kSM75 = 75,
8473 kSM80 = 80,
8475 kSM86 = 86,
8477 kSM89 = 89,
8479 kSM120 = 120,
8480};
8481
8490enum class TilingOptimizationLevel : int32_t
8491{
8493 kNONE = 0,
8494
8496 kFAST = 1,
8497
8500 kMODERATE = 2,
8501
8503 kFULL = 3
8504
8505};
8506
8507namespace impl
8508{
8514template <>
8516{
8517 static constexpr int32_t kVALUE = 4;
8518};
8519} // namespace impl
8520
8521namespace v_1_0
8522{
8524{
8525public:
8526 IProgressMonitor() = default;
8527 virtual ~IProgressMonitor() noexcept = default;
8528
8532 InterfaceInfo getInterfaceInfo() const noexcept override
8533 {
8534 return InterfaceInfo{"IProgressMonitor", 1, 0};
8535 }
8536
8556 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
8557
8570 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
8571
8583 virtual void phaseFinish(char const* phaseName) noexcept = 0;
8584
8585}; // class IProgressMonitor
8586} // namespace v_1_0
8587
8608
8617{
8618public:
8619 virtual ~IBuilderConfig() noexcept = default;
8620
8629 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
8630 {
8631 mImpl->setAvgTimingIterations(avgTiming);
8632 }
8633
8641 int32_t getAvgTimingIterations() const noexcept
8642 {
8643 return mImpl->getAvgTimingIterations();
8644 }
8645
8654 void setEngineCapability(EngineCapability capability) noexcept
8655 {
8656 mImpl->setEngineCapability(capability);
8657 }
8658
8667 {
8668 return mImpl->getEngineCapability();
8669 }
8670
8683 void setFlags(BuilderFlags builderFlags) noexcept
8684 {
8685 mImpl->setFlags(builderFlags);
8686 }
8687
8695 BuilderFlags getFlags() const noexcept
8696 {
8697 return mImpl->getFlags();
8698 }
8699
8707 void clearFlag(BuilderFlag builderFlag) noexcept
8708 {
8709 mImpl->clearFlag(builderFlag);
8710 }
8711
8719 void setFlag(BuilderFlag builderFlag) noexcept
8720 {
8721 mImpl->setFlag(builderFlag);
8722 }
8723
8731 bool getFlag(BuilderFlag builderFlag) const noexcept
8732 {
8733 return mImpl->getFlag(builderFlag);
8734 }
8735
8748 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
8749 {
8750 mImpl->setDeviceType(layer, deviceType);
8751 }
8752
8758 DeviceType getDeviceType(ILayer const* layer) const noexcept
8759 {
8760 return mImpl->getDeviceType(layer);
8761 }
8762
8770 bool isDeviceTypeSet(ILayer const* layer) const noexcept
8771 {
8772 return mImpl->isDeviceTypeSet(layer);
8773 }
8774
8780 void resetDeviceType(ILayer const* layer) noexcept
8781 {
8782 mImpl->resetDeviceType(layer);
8783 }
8784
8790 bool canRunOnDLA(ILayer const* layer) const noexcept
8791 {
8792 return mImpl->canRunOnDLA(layer);
8793 }
8794
8806 void setDLACore(int32_t dlaCore) noexcept
8807 {
8808 mImpl->setDLACore(dlaCore);
8809 }
8810
8816 int32_t getDLACore() const noexcept
8817 {
8818 return mImpl->getDLACore();
8819 }
8820
8827 void setDefaultDeviceType(DeviceType deviceType) noexcept
8828 {
8829 mImpl->setDefaultDeviceType(deviceType);
8830 }
8831
8838 {
8839 return mImpl->getDefaultDeviceType();
8840 }
8841
8847 void reset() noexcept
8848 {
8849 mImpl->reset();
8850 }
8851
8859 void setProfileStream(const cudaStream_t stream) noexcept
8860 {
8861 return mImpl->setProfileStream(stream);
8862 }
8863
8871 cudaStream_t getProfileStream() const noexcept
8872 {
8873 return mImpl->getProfileStream();
8874 }
8875
8888 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
8889 {
8890 return mImpl->addOptimizationProfile(profile);
8891 }
8892
8901 int32_t getNbOptimizationProfiles() const noexcept
8902 {
8903 return mImpl->getNbOptimizationProfiles();
8904 }
8905
8914 {
8915 mImpl->setProfilingVerbosity(verbosity);
8916 }
8917
8927 {
8928 return mImpl->getProfilingVerbosity();
8929 }
8930
8948 bool setTacticSources(TacticSources tacticSources) noexcept
8949 {
8950 return mImpl->setTacticSources(tacticSources);
8951 }
8952
8964 {
8965 return mImpl->getTacticSources();
8966 }
8967
8983 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
8984 {
8985 return mImpl->createTimingCache(blob, size);
8986 }
8987
9006 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9007 {
9008 return mImpl->setTimingCache(cache, ignoreMismatch);
9009 }
9010
9017 {
9018 return mImpl->getTimingCache();
9019 }
9020
9048 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9049 {
9050 mImpl->setMemoryPoolLimit(pool, poolSize);
9051 }
9052
9067 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9068 {
9069 return mImpl->getMemoryPoolLimit(pool);
9070 }
9071
9085 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9086 {
9087 mImpl->setPreviewFeature(feature, enable);
9088 }
9089
9099 bool getPreviewFeature(PreviewFeature feature) const noexcept
9100 {
9101 return mImpl->getPreviewFeature(feature);
9102 }
9103
9132 void setBuilderOptimizationLevel(int32_t level) noexcept
9133 {
9134 mImpl->setBuilderOptimizationLevel(level);
9135 }
9136
9145 {
9146 return mImpl->getBuilderOptimizationLevel();
9147 }
9148
9161 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9162 {
9163 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9164 }
9165
9175 {
9176 return mImpl->getHardwareCompatibilityLevel();
9177 }
9178
9187 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9188 {
9189 mImpl->setPluginsToSerialize(paths, nbPaths);
9190 }
9191
9200 char const* getPluginToSerialize(int32_t index) const noexcept
9201 {
9202 return mImpl->getPluginToSerialize(index);
9203 }
9204
9210 int32_t getNbPluginsToSerialize() const noexcept
9211 {
9212 return mImpl->getNbPluginsToSerialize();
9213 }
9214
9239 void setMaxAuxStreams(int32_t nbStreams) noexcept
9240 {
9241 mImpl->setMaxAuxStreams(nbStreams);
9242 }
9243
9249 int32_t getMaxAuxStreams() const noexcept
9250 {
9251 return mImpl->getMaxAuxStreams();
9252 }
9253
9265 void setProgressMonitor(IProgressMonitor* monitor) noexcept
9266 {
9267 return mImpl->setProgressMonitor(monitor);
9268 }
9269
9276 {
9277 return mImpl->getProgressMonitor();
9278 }
9279
9291 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
9292 {
9293 mImpl->setRuntimePlatform(runtimePlatform);
9294 }
9295
9304 {
9305 return mImpl->getRuntimePlatform();
9306 }
9307
9315 void setMaxNbTactics(int32_t maxNbTactics) noexcept
9316 {
9317 mImpl->setMaxNbTactics(maxNbTactics);
9318 }
9319
9327 int32_t getMaxNbTactics() const noexcept
9328 {
9329 return mImpl->getMaxNbTactics();
9330 }
9331
9344 {
9345 return mImpl->setTilingOptimizationLevel(level);
9346 }
9347
9356 {
9357 return mImpl->getTilingOptimizationLevel();
9358 }
9359
9371 bool setL2LimitForTiling(int64_t size) noexcept
9372 {
9373 return mImpl->setL2LimitForTiling(size);
9374 }
9375
9383 int64_t getL2LimitForTiling() const noexcept
9384 {
9385 return mImpl->getL2LimitForTiling();
9386 }
9387
9402 bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
9403 {
9404 return mImpl->setNbComputeCapabilities(maxNbComputeCapabilities);
9405 }
9406
9414 int32_t getNbComputeCapabilities() const noexcept
9415 {
9416 return mImpl->getNbComputeCapabilities();
9417 }
9418
9432 bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
9433 {
9434 return mImpl->setComputeCapability(computeCapability, index);
9435 }
9436
9446 ComputeCapability getComputeCapability(int32_t index) const noexcept
9447 {
9448 return mImpl->getComputeCapability(index);
9449 }
9450
9451protected:
9452 apiv::VBuilderConfig* mImpl;
9453};
9454
9463
9473{
9478
9483 kSTRONGLY_TYPED = 1,
9484};
9485
9491template <>
9492constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
9493{
9494 return 2;
9495}
9496
9504class IBuilder : public INoCopy
9505{
9506public:
9507 virtual ~IBuilder() noexcept = default;
9508
9516 int32_t getMaxDLABatchSize() const noexcept
9517 {
9518 return mImpl->getMaxDLABatchSize();
9519 }
9520
9524 int32_t getNbDLACores() const noexcept
9525 {
9526 return mImpl->getNbDLACores();
9527 }
9528
9542 void setGpuAllocator(IGpuAllocator* allocator) noexcept
9543 {
9544 mImpl->setGpuAllocator(allocator);
9545 }
9546
9557 {
9558 return mImpl->createBuilderConfig();
9559 }
9560
9583 {
9584 return mImpl->createNetworkV2(flags);
9585 }
9586
9598 {
9599 return mImpl->createOptimizationProfile();
9600 }
9601
9616 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9617 {
9618 mImpl->setErrorRecorder(recorder);
9619 }
9620
9632 {
9633 return mImpl->getErrorRecorder();
9634 }
9635
9639 void reset() noexcept
9640 {
9641 mImpl->reset();
9642 }
9643
9659 {
9660 return mImpl->buildSerializedNetwork(network, config);
9661 }
9662
9680 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
9681 {
9682 return mImpl->isNetworkSupported(network, config);
9683 }
9684
9690 ILogger* getLogger() const noexcept
9691 {
9692 return mImpl->getLogger();
9693 }
9694
9706 bool setMaxThreads(int32_t maxThreads) noexcept
9707 {
9708 return mImpl->setMaxThreads(maxThreads);
9709 }
9710
9720 int32_t getMaxThreads() const noexcept
9721 {
9722 return mImpl->getMaxThreads();
9723 }
9724
9731 {
9732 return mImpl->getPluginRegistry();
9733 }
9734
9735protected:
9736 apiv::VBuilder* mImpl;
9737};
9738
9739} // namespace nvinfer1
9740
9745extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
9746
9747namespace nvinfer1
9748{
9749namespace
9750{
9751
9759inline IBuilder* createInferBuilder(ILogger& logger) noexcept
9760{
9761 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
9762}
9763
9764} // namespace
9765
9779 nvinfer1::EngineCapability capability) noexcept;
9780
9781namespace safe
9782{
9784class IPluginRegistry;
9785} // namespace safe
9786
9794extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
9795 nvinfer1::EngineCapability capability) noexcept;
9796
9797} // namespace nvinfer1
9798
9799#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:69
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:101
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h:216
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:219
An Activation layer in a network definition.
Definition: NvInfer.h:1263
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1311
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1272
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1282
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1320
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1329
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1297
An assertion layer in a network.
Definition: NvInfer.h:4821
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4831
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4841
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:8617
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9048
bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
Set one compute capability for runtime execution.
Definition: NvInfer.h:9432
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:8983
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
Set the number of compute capabilities.
Definition: NvInfer.h:9402
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9085
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9099
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9144
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:8948
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9187
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:9343
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:9371
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9067
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:8816
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9210
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:8748
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:8654
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9249
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:8731
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:9315
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:9383
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:9265
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8913
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:8901
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9016
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:8847
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9006
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9200
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:8666
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:9303
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:8837
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:9291
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:9327
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:8695
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:8683
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:8963
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:8780
ComputeCapability getComputeCapability(int32_t index) const noexcept
Get one compute capability for runtime execution.
Definition: NvInfer.h:9446
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:8806
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9174
int32_t getNbComputeCapabilities() const noexcept
Get the number of compute capabilities.
Definition: NvInfer.h:9414
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:8707
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:8888
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:9275
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:9452
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:8641
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:8827
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:8719
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:8758
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:8790
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:8871
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9161
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:9355
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9239
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8926
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:8770
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9132
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:8859
Builds an engine from a network definition.
Definition: NvInfer.h:9505
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:9524
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9631
apiv::VBuilder * mImpl
Definition: NvInfer.h:9736
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:9690
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:9680
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:9720
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:9730
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:9597
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:9542
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:9582
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:9556
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:9639
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:9706
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9616
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:9658
virtual ~IBuilder() noexcept=default
A cast layer in a network.
Definition: NvInfer.h:3682
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3708
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3702
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3691
A concatenation layer in a network definition.
Definition: NvInfer.h:1973
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:1986
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:1996
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4345
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3721
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3731
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3741
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3753
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3771
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3765
A convolution layer in a network definition.
Definition: NvInfer.h:943
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1068
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1041
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1109
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1213
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1199
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1169
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1016
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1159
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1223
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:962
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1006
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1095
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:992
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1121
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:982
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:952
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1031
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1144
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1187
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1058
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1085
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1134
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6411
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6422
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6470
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6488
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6458
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6482
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6446
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6434
A deconvolution layer in a network definition.
Definition: NvInfer.h:2014
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2102
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2063
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2087
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2129
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2244
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2310
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2112
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2077
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2033
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2234
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2166
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2217
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2156
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2207
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2262
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2023
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2274
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2300
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2180
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2053
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2139
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2192
A Dequantize layer in a network definition.
Definition: NvInfer.h:5409
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5446
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5419
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5458
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5430
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5486
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5575
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5598
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5552
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5539
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5526
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5513
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5565
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5588
An Einsum layer in a network.
Definition: NvInfer.h:5643
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:5654
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5664
A elementwise layer in a network definition.
Definition: NvInfer.h:2384
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2413
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2407
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2395
Generate a tensor according to a specified mode.
Definition: NvInfer.h:4932
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5164
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:4978
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:4968
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5193
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5107
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5141
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5031
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5122
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5156
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5012
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:4943
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:4997
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5181
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:4958
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5046
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2517
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:2528
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2563
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2599
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2573
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2583
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2540
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2593
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:5865
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5872
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:5918
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:5894
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:5936
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:5930
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:5884
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:5906
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:3669
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3671
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4324
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4329
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4407
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4448
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4473
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4418
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4436
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4463
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4375
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4362
virtual ~IIfConditionalOutputLayer() noexcept=default
A layer to do iterations.
Definition: NvInfer.h:4638
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4665
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4675
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4651
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4643
A LRN layer in a network definition.
Definition: NvInfer.h:1628
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1649
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1671
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1639
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1705
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1661
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1683
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1693
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1715
Base class for all layer classes in a network definition.
Definition: NvInfer.h:458
TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:578
TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:666
TRT_DEPRECATED bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:604
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:729
TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:711
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:479
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:497
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:742
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:681
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:590
TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:697
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:489
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:518
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:528
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:545
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:510
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:465
TRT_DEPRECATED void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:616
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1052
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4301
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4306
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4696
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4766
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4725
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4738
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:4751
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4776
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4704
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4538
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4568
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4543
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4560
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3544
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3572
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3566
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3554
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6013
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6050
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6024
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6036
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6086
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6060
A network definition for input to the builder.
Definition: NvInfer.h:6510
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6738
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6801
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:7759
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7171
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6581
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6682
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:6961
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:7781
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7473
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:7292
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7101
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:7371
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7185
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7270
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6902
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6872
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7595
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7252
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7499
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7402
IDynamicQuantizeLayer * addDynamicQuantize(ITensor &input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:7664
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:6629
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6663
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7147
virtual ~INetworkDefinition() noexcept=default
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:7792
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7716
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6844
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7223
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7417
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7573
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:7849
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7733
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6856
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7211
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7637
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:6928
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6787
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7698
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7116
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:7830
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7456
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:7615
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6830
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:7876
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7240
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6818
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6708
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7128
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7086
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:6993
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6765
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7072
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7558
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7312
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7012
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7201
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:6977
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:7817
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:7805
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:7334
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7388
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:7870
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7033
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6721
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6607
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6597
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7680
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6563
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:7515
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7048
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6886
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7539
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:6643
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3598
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6175
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6194
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6214
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6184
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6281
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6287
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6245
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6204
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6271
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6235
A OneHot layer in a network definition.
Definition: NvInfer.h:5828
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5849
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5835
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5843
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2041
Layer that represents a padding operation.
Definition: NvInfer.h:2822
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2871
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2833
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:2859
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2845
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2877
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3785
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3787
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
A Pooling layer in a network definition.
Definition: NvInfer.h:1377
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1396
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1529
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1505
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1449
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1477
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1386
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1542
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1518
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1552
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:1438
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1596
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1424
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1567
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1577
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1608
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1495
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1467
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1411
A Quantize layer in a network definition.
Definition: NvInfer.h:5278
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5315
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5299
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5288
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5327
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3619
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3621
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4491
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2742
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2789
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2749
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2759
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2779
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2769
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2805
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2799
A resize layer in a network definition.
Definition: NvInfer.h:3974
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4135
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4159
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:4053
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:3994
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4191
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4034
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4201
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4145
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4075
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4110
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4214
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4065
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4004
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4169
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4224
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4120
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6103
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6136
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6123
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6152
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6146
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6113
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1774
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1831
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1851
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1821
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1841
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1791
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1801
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1887
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1811
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1781
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1866
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5756
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5763
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5797
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5783
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5791
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5773
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4799
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3347
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3349
Layer type for shuffling data.
Definition: NvInfer.h:2910
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3068
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2921
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3021
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:2974
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:2961
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2933
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3033
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3062
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3049
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3162
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3231
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3330
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3202
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3309
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3173
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3188
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3256
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3217
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3266
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3246
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3324
A Softmax layer in a network definition.
Definition: NvInfer.h:1918
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:1940
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:1950
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:6301
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6318
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:334
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:231
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:399
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:378
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:304
TRT_DEPRECATED void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:281
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:312
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:296
apiv::VTensor * mImpl
Definition: NvInfer.h:446
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:425
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:440
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:347
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8175
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:8241
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8212
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:8258
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:8280
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8286
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8222
Layer that represents a TopK reduction.
Definition: NvInfer.h:3387
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3418
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3442
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3404
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3474
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3394
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3432
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3452
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4612
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4617
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2667
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2676
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2692
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2686
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6330
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6347
An Interface class for version control.
Definition: NvInferRuntimeBase.h:276
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:241
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInferRuntimeBase.h:413
Definition: NvInferRuntime.h:1120
Definition: NvInfer.h:8524
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:9759
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:2327
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3879
@ 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:8297
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1731
@ 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:7897
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:8416
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6363
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:5948
@ 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:8119
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:118
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:8465
@ kSM120
Target NVIDIA Blackwell GPU architecture (SM 12.0).
@ kSM75
Target NVIDIA Turing GPU architecture (SM 7.5).
@ kSM80
Target NVIDIA Ampere GPU architecture (SM 8.0).
@ kCURRENT
Use the compute capability of the current GPU in the environment.
@ kSM89
Target NVIDIA Ada Lovelace GPU architecture (SM 8.9).
@ kSM86
Target NVIDIA Ampere GPU architecture (SM 8.6).
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2620
@ 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:2729
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4280
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:137
@ kSELU
Selu activation: x>0 ? beta * x : beta * (alpha*exp(x) - alpha)
@ kTANH
TanH activation.
@ kSCALED_TANH
Scaled tanh activation: alpha*tanh(beta*x)
@ kRELU
Rectified linear activation.
@ kELU
Elu activation: x>=0 ? x : alpha * (exp(x) - 1).
@ kLEAKY_RELU
LeakyRelu activation: x>=0 ? x : alpha * x.
@ kSOFTSIGN
Softsign activation: x / (1+|x|)
@ kHARD_SIGMOID
Hard sigmoid activation: max(0, min(1, alpha*x+beta))
@ kTHRESHOLDED_RELU
Thresholded ReLU activation: x>alpha ? x : 0.
@ kSIGMOID
Sigmoid activation.
@ kCLIP
Clip activation: max(alpha, min(beta, x))
@ kGELU_TANH
GELU tanh activation: 0.5 * x * (1 + tanh(sqrt(2/pi) * (0.044715F * pow(x, 3) + x)))
@ kGELU_ERF
GELU erf activation: 0.5 * x * (1 + erf(sqrt(0.5) * x))
@ kSOFTPLUS
Parametric softplus activation: alpha*log(exp(beta*x)+1)
FillOperation
Enumerates the tensor fill operations that may performed by a fill layer.
Definition: NvInfer.h:4860
@ 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:3909
@ 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:909
@ kSAME_LOWER
Use SAME padding, with prePadding >= postPadding.
@ kEXPLICIT_ROUND_DOWN
Use explicit padding, rounding output size down.
@ kEXPLICIT_ROUND_UP
Use explicit padding, rounding output size up.
@ kSAME_UPPER
Use SAME padding, with prePadding <= postPadding.
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4268
@ 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:9462
PreviewFeature
Define preview features.
Definition: NvInfer.h:8372
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:8491
@ kFAST
Use a fast algorithm and heuristic based strategy. Slightly increases engine build time.
@ kFULL
Increase search space even wider. Significantly increases engine build time.
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2435
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:143
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:7927
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:814
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1743
LayerType
The type values of layer classes.
Definition: NvInfer.h:58
@ kGRID_SAMPLE
Grid sample layer.
@ kRAGGED_SOFTMAX
Ragged softmax layer.
@ kDECONVOLUTION
Deconvolution layer.
@ kREDUCE
Reduce layer.
@ kASSERTION
Assertion layer.
@ kTOPK
TopK layer.
@ kRESIZE
Resize Layer.
@ kCAST
Cast layer.
@ kPADDING
Padding layer.
@ kSQUEEZE
Squeeze Layer.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition layer.
@ kCUMULATIVE
Cumulative layer.
@ kCONDITIONAL_INPUT
Conditional Input layer.
@ kIDENTITY
Identity layer.
@ kNORMALIZATION
Normalization layer.
@ kQUANTIZE
Quantize layer.
@ kSCATTER
Scatter layer.
@ kCONVOLUTION
Convolution layer.
@ kPARAMETRIC_RELU
Parametric ReLU layer.
@ kUNSQUEEZE
Unsqueeze Layer.
@ kCONCATENATION
Concatenation layer.
@ kONE_HOT
OneHot layer.
@ kREVERSE_SEQUENCE
Reverse sequence layer.
@ kSLICE
Slice layer.
@ kEINSUM
Einsum layer.
@ kSOFTMAX
SoftMax layer.
@ kSHAPE
Shape layer.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kPLUGIN_V3
PluginV3 layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kDYNAMIC_QUANTIZE
Dynamic Quantize layer.
@ kGATHER
Gather layer.
@ kUNARY
UnaryOp operation Layer.
@ kACTIVATION
Activation layer.
@ kELEMENTWISE
Elementwise layer.
@ kSELECT
Select layer.
@ kPLUGIN_V2
PluginV2 layer.
@ kLOOP_OUTPUT
Loop output layer.
@ kCONDITIONAL_OUTPUT
Conditional Output layer.
@ kCONSTANT
Constant layer.
@ kNON_ZERO
NonZero layer.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3078
@ 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:2423
@ kDEFAULT
Similar to ONNX Gather.
@ kELEMENT
Similar to ONNX GatherElements.
@ kND
Similar to ONNX GatherND.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:129
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2339
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:9473
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2333
@ 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.
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3094
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3797
@ 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:7937
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ kMONITOR_MEMORY
Enable memory monitor during build time.
@ kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
@ kREFIT
Enable building a refittable engine.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3370
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:8358
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3359
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2715
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4257
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:9492
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5682
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3485
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3825
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2654
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4240
@ 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:5961
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3513
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1345
@ 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:8607
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:4891
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5693
Represents a permutation of dimensions.
Definition: NvInfer.h:2887
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:128
The key to retrieve timing cache entries.
Definition: NvInfer.h:8139
Definition: NvInfer.h:8151
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8153
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8155

  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