TensorRT for RTX 1.2.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" // IWYU pragma: export
23
35
41
46namespace nvinfer1
47{
48
56enum class LayerType : int32_t
57{
58 kCONVOLUTION = 0,
59 kCAST = 1,
60 kACTIVATION = 2,
61 kPOOLING = 3,
62 kLRN = 4,
63 kSCALE = 5,
64 kSOFTMAX = 6,
65 kDECONVOLUTION = 7,
66 kCONCATENATION = 8,
67 kELEMENTWISE = 9,
68 kPLUGIN = 10,
69 kUNARY = 11,
70 kPADDING = 12,
71 kSHUFFLE = 13,
72 kREDUCE = 14,
73 kTOPK = 15,
74 kGATHER = 16,
75 kMATRIX_MULTIPLY = 17,
76 kRAGGED_SOFTMAX = 18,
77 kCONSTANT = 19,
78 kIDENTITY = 20,
79 kPLUGIN_V2 = 21,
80 kSLICE = 22,
81 kSHAPE = 23,
82 kPARAMETRIC_RELU = 24,
83 kRESIZE = 25,
84 kTRIP_LIMIT = 26,
85 kRECURRENCE = 27,
86 kITERATOR = 28,
87 kLOOP_OUTPUT = 29,
88 kSELECT = 30,
89 kFILL = 31,
90 kQUANTIZE = 32,
91 kDEQUANTIZE = 33,
92 kCONDITION = 34,
95 kSCATTER = 37,
96 kEINSUM = 38,
97 kASSERTION = 39,
98 kONE_HOT = 40,
99 kNON_ZERO = 41,
100 kGRID_SAMPLE = 42,
101 kNMS = 43,
102 kREVERSE_SEQUENCE = 44,
103 kNORMALIZATION = 45,
104 kPLUGIN_V3 = 46,
105 kSQUEEZE = 47,
106 kUNSQUEEZE = 48,
107 kCUMULATIVE = 49,
108 kDYNAMIC_QUANTIZE = 50,
109 kATTENTION_INPUT = 51,
110 kATTENTION_OUTPUT = 52,
111};
112
118template <>
119constexpr inline int32_t EnumMax<LayerType>() noexcept
120{
121 return 53;
122}
123
130using TensorFormats = uint32_t;
131
137enum class ActivationType : int32_t
138{
139 kRELU = 0,
140 kSIGMOID = 1,
141 kTANH = 2,
142 kLEAKY_RELU = 3,
143 kELU = 4,
144 kSELU = 5,
145 kSOFTSIGN = 6,
146 kSOFTPLUS = 7,
147 kCLIP = 8,
148 kHARD_SIGMOID = 9,
149 kSCALED_TANH = 10,
150 kTHRESHOLDED_RELU = 11,
151 kGELU_ERF = 12,
152 kGELU_TANH = 13
153};
154
155
156namespace impl
157{
163template <>
165{
166 static constexpr int32_t kVALUE = 14;
167};
168} // namespace impl
169
184class ITensor : public INoCopy
185{
186public:
202 void setName(char const* name) noexcept
203 {
204 mImpl->setName(name);
205 }
206
214 char const* getName() const noexcept
215 {
216 return mImpl->getName();
217 }
218
233 void setDimensions(Dims const& dimensions) noexcept
234 {
235 mImpl->setDimensions(dimensions);
236 }
237
247 Dims getDimensions() const noexcept
248 {
249 return mImpl->getDimensions();
250 }
251
283 TRT_DEPRECATED void setType(DataType type) noexcept
284 {
285 mImpl->setType(type);
286 }
287
298 DataType getType() const noexcept
299 {
300 return mImpl->getType();
301 }
302
306 bool isNetworkInput() const noexcept
307 {
308 return mImpl->isNetworkInput();
309 }
310
314 bool isNetworkOutput() const noexcept
315 {
316 return mImpl->isNetworkOutput();
317 }
318
336 void setAllowedFormats(TensorFormats formats) noexcept
337 {
338 mImpl->setAllowedFormats(formats);
339 }
340
350 {
351 return mImpl->getAllowedFormats();
352 }
353
380 bool isShapeTensor() const noexcept
381 {
382 return mImpl->isShapeTensor();
383 }
384
401 bool isExecutionTensor() const noexcept
402 {
403 return mImpl->isExecutionTensor();
404 }
405
427 void setDimensionName(int32_t index, char const* name) noexcept
428 {
429 mImpl->setDimensionName(index, name);
430 }
431
442 char const* getDimensionName(int32_t index) const noexcept
443 {
444 return mImpl->getDimensionName(index);
445 }
446
447protected:
448 apiv::VTensor* mImpl;
449 virtual ~ITensor() noexcept = default;
450};
451
459class ILayer : public INoCopy
460{
461public:
467 LayerType getType() const noexcept
468 {
469 return mLayer->getType();
470 }
471
481 void setName(char const* name) noexcept
482 {
483 mLayer->setName(name);
484 }
485
491 char const* getName() const noexcept
492 {
493 return mLayer->getName();
494 }
495
499 int32_t getNbInputs() const noexcept
500 {
501 return mLayer->getNbInputs();
502 }
503
512 ITensor* getInput(int32_t index) const noexcept
513 {
514 return mLayer->getInput(index);
515 }
516
520 int32_t getNbOutputs() const noexcept
521 {
522 return mLayer->getNbOutputs();
523 }
524
530 ITensor* getOutput(int32_t index) const noexcept
531 {
532 return mLayer->getOutput(index);
533 }
534
547 void setInput(int32_t index, ITensor& tensor) noexcept
548 {
549 return mLayer->setInput(index, tensor);
550 }
551
580 TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
581 {
582 mLayer->setPrecision(dataType);
583 }
584
592 DataType getPrecision() const noexcept
593 {
594 return mLayer->getPrecision();
595 }
596
606 TRT_DEPRECATED bool precisionIsSet() const noexcept
607 {
608 return mLayer->precisionIsSet();
609 }
610
619 {
620 mLayer->resetPrecision();
621 }
622
668 TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
669 {
670 mLayer->setOutputType(index, dataType);
671 }
672
683 DataType getOutputType(int32_t index) const noexcept
684 {
685 return mLayer->getOutputType(index);
686 }
687
699 TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
700 {
701 return mLayer->outputTypeIsSet(index);
702 }
703
713 TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
714 {
715 return mLayer->resetOutputType(index);
716 }
717
731 void setMetadata(char const* metadata) noexcept
732 {
733 mLayer->setMetadata(metadata);
734 }
735
744 char const* getMetadata() const noexcept
745 {
746 return mLayer->getMetadata();
747 }
748
749protected:
750 virtual ~ILayer() noexcept = default;
751 apiv::VLayer* mLayer;
752};
753
910enum class PaddingMode : int32_t
911{
914 kSAME_UPPER = 2,
915 kSAME_LOWER = 3,
916};
917
918namespace impl
919{
925template <>
927{
928 static constexpr int32_t kVALUE = 4;
929};
930} // namespace impl
931
945{
946public:
954 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
955 {
956 mImpl->setNbOutputMaps(nbOutputMaps);
957 }
958
964 int64_t getNbOutputMaps() const noexcept
965 {
966 return mImpl->getNbOutputMaps();
967 }
968
984 void setNbGroups(int64_t nbGroups) noexcept
985 {
986 mImpl->setNbGroups(nbGroups);
987 }
988
994 int64_t getNbGroups() const noexcept
995 {
996 return mImpl->getNbGroups();
997 }
998
1008 void setKernelWeights(Weights weights) noexcept
1009 {
1010 mImpl->setKernelWeights(weights);
1011 }
1012
1018 Weights getKernelWeights() const noexcept
1019 {
1020 return mImpl->getKernelWeights();
1021 }
1022
1033 void setBiasWeights(Weights weights) noexcept
1034 {
1035 mImpl->setBiasWeights(weights);
1036 }
1037
1043 Weights getBiasWeights() const noexcept
1044 {
1045 return mImpl->getBiasWeights();
1046 }
1047
1060 void setPrePadding(Dims const& padding) noexcept
1061 {
1062 mImpl->setPrePadding(padding);
1063 }
1064
1070 Dims getPrePadding() const noexcept
1071 {
1072 return mImpl->getPrePadding();
1073 }
1074
1087 void setPostPadding(Dims const& padding) noexcept
1088 {
1089 mImpl->setPostPadding(padding);
1090 }
1091
1097 Dims getPostPadding() const noexcept
1098 {
1099 return mImpl->getPostPadding();
1100 }
1101
1111 void setPaddingMode(PaddingMode paddingMode) noexcept
1112 {
1113 mImpl->setPaddingMode(paddingMode);
1114 }
1115
1124 {
1125 return mImpl->getPaddingMode();
1126 }
1127
1136 void setKernelSizeNd(Dims const& kernelSize) noexcept
1137 {
1138 mImpl->setKernelSizeNd(kernelSize);
1139 }
1140
1146 Dims getKernelSizeNd() const noexcept
1147 {
1148 return mImpl->getKernelSizeNd();
1149 }
1150
1161 void setStrideNd(Dims const& stride) noexcept
1162 {
1163 mImpl->setStrideNd(stride);
1164 }
1165
1171 Dims getStrideNd() const noexcept
1172 {
1173 return mImpl->getStrideNd();
1174 }
1175
1189 void setPaddingNd(Dims const& padding) noexcept
1190 {
1191 mImpl->setPaddingNd(padding);
1192 }
1193
1201 Dims getPaddingNd() const noexcept
1202 {
1203 return mImpl->getPaddingNd();
1204 }
1205
1215 void setDilationNd(Dims const& dilation) noexcept
1216 {
1217 mImpl->setDilationNd(dilation);
1218 }
1219
1225 Dims getDilationNd() const noexcept
1226 {
1227 return mImpl->getDilationNd();
1228 }
1229
1244 using ILayer::setInput;
1245
1246protected:
1247 virtual ~IConvolutionLayer() noexcept = default;
1248 apiv::VConvolutionLayer* mImpl;
1249};
1250
1265{
1266public:
1275 {
1276 mImpl->setActivationType(type);
1277 }
1278
1285 {
1286 return mImpl->getActivationType();
1287 }
1288
1299 void setAlpha(float alpha) noexcept
1300 {
1301 mImpl->setAlpha(alpha);
1302 }
1303
1313 void setBeta(float beta) noexcept
1314 {
1315 mImpl->setBeta(beta);
1316 }
1317
1322 float getAlpha() const noexcept
1323 {
1324 return mImpl->getAlpha();
1325 }
1326
1331 float getBeta() const noexcept
1332 {
1333 return mImpl->getBeta();
1334 }
1335
1336protected:
1337 virtual ~IActivationLayer() noexcept = default;
1338 apiv::VActivationLayer* mImpl;
1339};
1340
1346enum class PoolingType : int32_t
1347{
1348 kMAX = 0,
1349 kAVERAGE = 1,
1351};
1352
1353namespace impl
1354{
1360template <>
1362{
1363 static constexpr int32_t kVALUE = 3;
1364};
1365} // namespace impl
1366
1378class IPoolingLayer : public ILayer
1379{
1380public:
1388 void setPoolingType(PoolingType type) noexcept
1389 {
1390 mImpl->setPoolingType(type);
1391 }
1392
1399 {
1400 return mImpl->getPoolingType();
1401 }
1402
1413 void setBlendFactor(float blendFactor) noexcept
1414 {
1415 mImpl->setBlendFactor(blendFactor);
1416 }
1417
1426 float getBlendFactor() const noexcept
1427 {
1428 return mImpl->getBlendFactor();
1429 }
1430
1440 void setAverageCountExcludesPadding(bool exclusive) noexcept
1441 {
1442 mImpl->setAverageCountExcludesPadding(exclusive);
1443 }
1444
1452 {
1453 return mImpl->getAverageCountExcludesPadding();
1454 }
1455
1469 void setPrePadding(Dims const& padding) noexcept
1470 {
1471 mImpl->setPrePadding(padding);
1472 }
1473
1479 Dims getPrePadding() const noexcept
1480 {
1481 return mImpl->getPrePadding();
1482 }
1483
1497 void setPostPadding(Dims const& padding) noexcept
1498 {
1499 mImpl->setPostPadding(padding);
1500 }
1501
1507 Dims getPostPadding() const noexcept
1508 {
1509 return mImpl->getPostPadding();
1510 }
1511
1520 void setPaddingMode(PaddingMode paddingMode) noexcept
1521 {
1522 mImpl->setPaddingMode(paddingMode);
1523 }
1524
1532 {
1533 return mImpl->getPaddingMode();
1534 }
1535
1544 void setWindowSizeNd(Dims const& windowSize) noexcept
1545 {
1546 mImpl->setWindowSizeNd(windowSize);
1547 }
1548
1554 Dims getWindowSizeNd() const noexcept
1555 {
1556 return mImpl->getWindowSizeNd();
1557 }
1558
1569 void setStrideNd(Dims const& stride) noexcept
1570 {
1571 mImpl->setStrideNd(stride);
1572 }
1573
1579 Dims getStrideNd() const noexcept
1580 {
1581 return mImpl->getStrideNd();
1582 }
1583
1598 void setPaddingNd(Dims const& padding) noexcept
1599 {
1600 mImpl->setPaddingNd(padding);
1601 }
1602
1610 Dims getPaddingNd() const noexcept
1611 {
1612 return mImpl->getPaddingNd();
1613 }
1614
1615protected:
1616 virtual ~IPoolingLayer() noexcept = default;
1617 apiv::VPoolingLayer* mImpl;
1618};
1619
1629class ILRNLayer : public ILayer
1630{
1631public:
1641 void setWindowSize(int64_t windowSize) noexcept
1642 {
1643 mImpl->setWindowSize(windowSize);
1644 }
1645
1651 int64_t getWindowSize() const noexcept
1652 {
1653 return mImpl->getWindowSize();
1654 }
1655
1663 void setAlpha(float alpha) noexcept
1664 {
1665 mImpl->setAlpha(alpha);
1666 }
1667
1673 float getAlpha() const noexcept
1674 {
1675 return mImpl->getAlpha();
1676 }
1677
1685 void setBeta(float beta) noexcept
1686 {
1687 mImpl->setBeta(beta);
1688 }
1689
1695 float getBeta() const noexcept
1696 {
1697 return mImpl->getBeta();
1698 }
1699
1707 void setK(float k) noexcept
1708 {
1709 mImpl->setK(k);
1710 }
1711
1717 float getK() const noexcept
1718 {
1719 return mImpl->getK();
1720 }
1721
1722protected:
1723 virtual ~ILRNLayer() noexcept = default;
1724 apiv::VLRNLayer* mImpl;
1725};
1726
1732enum class ScaleMode : int32_t
1733{
1734 kUNIFORM = 0,
1735 kCHANNEL = 1,
1736 kELEMENTWISE = 2
1737};
1738
1744template <>
1745constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1746{
1747 return 3;
1748}
1749
1775class IScaleLayer : public ILayer
1776{
1777public:
1783 void setMode(ScaleMode mode) noexcept
1784 {
1785 mImpl->setMode(mode);
1786 }
1787
1793 ScaleMode getMode() const noexcept
1794 {
1795 return mImpl->getMode();
1796 }
1797
1803 void setShift(Weights shift) noexcept
1804 {
1805 mImpl->setShift(shift);
1806 }
1807
1813 Weights getShift() const noexcept
1814 {
1815 return mImpl->getShift();
1816 }
1817
1823 void setScale(Weights scale) noexcept
1824 {
1825 mImpl->setScale(scale);
1826 }
1827
1833 Weights getScale() const noexcept
1834 {
1835 return mImpl->getScale();
1836 }
1837
1843 void setPower(Weights power) noexcept
1844 {
1845 mImpl->setPower(power);
1846 }
1847
1853 Weights getPower() const noexcept
1854 {
1855 return mImpl->getPower();
1856 }
1857
1868 int32_t getChannelAxis() const noexcept
1869 {
1870 return mImpl->getChannelAxis();
1871 }
1872
1889 void setChannelAxis(int32_t channelAxis) noexcept
1890 {
1891 mImpl->setChannelAxis(channelAxis);
1892 }
1893
1894protected:
1895 virtual ~IScaleLayer() noexcept = default;
1896 apiv::VScaleLayer* mImpl;
1897};
1898
1919class ISoftMaxLayer : public ILayer
1920{
1921public:
1942 void setAxes(uint32_t axes) noexcept
1943 {
1944 mImpl->setAxes(axes);
1945 }
1946
1952 uint32_t getAxes() const noexcept
1953 {
1954 return mImpl->getAxes();
1955 }
1956
1957protected:
1958 virtual ~ISoftMaxLayer() noexcept = default;
1959 apiv::VSoftMaxLayer* mImpl;
1960};
1961
1975{
1976public:
1988 void setAxis(int32_t axis) noexcept
1989 {
1990 mImpl->setAxis(axis);
1991 }
1992
1998 int32_t getAxis() const noexcept
1999 {
2000 return mImpl->getAxis();
2001 }
2002
2003protected:
2004 virtual ~IConcatenationLayer() noexcept = default;
2005 apiv::VConcatenationLayer* mImpl;
2006};
2007
2016{
2017public:
2025 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2026 {
2027 mImpl->setNbOutputMaps(nbOutputMaps);
2028 }
2029
2035 int64_t getNbOutputMaps() const noexcept
2036 {
2037 return mImpl->getNbOutputMaps();
2038 }
2039
2055 void setNbGroups(int64_t nbGroups) noexcept
2056 {
2057 mImpl->setNbGroups(nbGroups);
2058 }
2059
2065 int64_t getNbGroups() const noexcept
2066 {
2067 return mImpl->getNbGroups();
2068 }
2069
2079 void setKernelWeights(Weights weights) noexcept
2080 {
2081 mImpl->setKernelWeights(weights);
2082 }
2083
2089 Weights getKernelWeights() const noexcept
2090 {
2091 return mImpl->getKernelWeights();
2092 }
2093
2104 void setBiasWeights(Weights weights) noexcept
2105 {
2106 mImpl->setBiasWeights(weights);
2107 }
2108
2114 Weights getBiasWeights() const noexcept
2115 {
2116 return mImpl->getBiasWeights();
2117 }
2118
2131 void setPrePadding(Dims const& padding) noexcept
2132 {
2133 mImpl->setPrePadding(padding);
2134 }
2135
2141 Dims getPrePadding() const noexcept
2142 {
2143 return mImpl->getPrePadding();
2144 }
2145
2158 void setPostPadding(Dims const& padding) noexcept
2159 {
2160 mImpl->setPostPadding(padding);
2161 }
2162
2168 Dims getPostPadding() const noexcept
2169 {
2170 return mImpl->getPostPadding();
2171 }
2172
2182 void setPaddingMode(PaddingMode paddingMode) noexcept
2183 {
2184 mImpl->setPaddingMode(paddingMode);
2185 }
2186
2195 {
2196 return mImpl->getPaddingMode();
2197 }
2198
2209 void setKernelSizeNd(Dims const& kernelSize) noexcept
2210 {
2211 mImpl->setKernelSizeNd(kernelSize);
2212 }
2213
2219 Dims getKernelSizeNd() const noexcept
2220 {
2221 return mImpl->getKernelSizeNd();
2222 }
2223
2236 void setStrideNd(Dims const& stride) noexcept
2237 {
2238 mImpl->setStrideNd(stride);
2239 }
2240
2246 Dims getStrideNd() const noexcept
2247 {
2248 return mImpl->getStrideNd();
2249 }
2250
2264 void setPaddingNd(Dims const& padding) noexcept
2265 {
2266 mImpl->setPaddingNd(padding);
2267 }
2268
2276 Dims getPaddingNd() const noexcept
2277 {
2278 return mImpl->getPaddingNd();
2279 }
2280
2293 using ILayer::setInput;
2294
2302 void setDilationNd(Dims const& dilation) noexcept
2303 {
2304 mImpl->setDilationNd(dilation);
2305 }
2306
2312 Dims getDilationNd() const noexcept
2313 {
2314 return mImpl->getDilationNd();
2315 }
2316
2317protected:
2318 virtual ~IDeconvolutionLayer() noexcept = default;
2319 apiv::VDeconvolutionLayer* mImpl;
2320};
2321
2334enum class ElementWiseOperation : int32_t
2335{
2336 kSUM = 0,
2337 kPROD = 1,
2338 kMAX = 2,
2339 kMIN = 3,
2340 kSUB = 4,
2341 kDIV = 5,
2342 kPOW = 6,
2343 kFLOOR_DIV = 7,
2344 kAND = 8,
2345 kOR = 9,
2346 kXOR = 10,
2347 kEQUAL = 11,
2348 kGREATER = 12,
2349 kLESS = 13
2350};
2351
2352namespace impl
2353{
2359template <>
2361{
2362 static constexpr int32_t kVALUE = 14;
2363};
2364} // namespace impl
2365
2386{
2387public:
2398 {
2399 return mImpl->setOperation(op);
2400 }
2401
2410 {
2411 return mImpl->getOperation();
2412 }
2413
2414protected:
2415 apiv::VElementWiseLayer* mImpl;
2416 virtual ~IElementWiseLayer() noexcept = default;
2417};
2418
2424enum class GatherMode : int32_t
2425{
2426 kDEFAULT = 0,
2427 kELEMENT = 1,
2428 kND = 2
2429};
2430
2436template <>
2437constexpr inline int32_t EnumMax<GatherMode>() noexcept
2438{
2439 return 3;
2440}
2441
2518class IGatherLayer : public ILayer
2519{
2520public:
2530 void setGatherAxis(int32_t axis) noexcept
2531 {
2532 mImpl->setGatherAxis(axis);
2533 }
2534
2542 int32_t getGatherAxis() const noexcept
2543 {
2544 return mImpl->getGatherAxis();
2545 }
2546
2565 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2566 {
2567 mImpl->setNbElementWiseDims(elementWiseDims);
2568 }
2569
2575 int32_t getNbElementWiseDims() const noexcept
2576 {
2577 return mImpl->getNbElementWiseDims();
2578 }
2579
2585 void setMode(GatherMode mode) noexcept
2586 {
2587 mImpl->setMode(mode);
2588 }
2589
2595 GatherMode getMode() const noexcept
2596 {
2597 return mImpl->getMode();
2598 }
2599
2600protected:
2601 apiv::VGatherLayer* mImpl;
2602 virtual ~IGatherLayer() noexcept = default;
2603};
2604
2617{
2618public:
2625 {
2626 return mImpl->getPlugin();
2627 }
2628
2629protected:
2630 apiv::VPluginV2Layer* mImpl;
2631 virtual ~IPluginV2Layer() noexcept = default;
2632};
2633
2644{
2645public:
2652 {
2653 return mImpl->getPlugin();
2654 }
2655
2656protected:
2657 apiv::VPluginV3Layer* mImpl;
2658 virtual ~IPluginV3Layer() noexcept = default;
2659};
2660
2677enum class UnaryOperation : int32_t
2678{
2679 kEXP = 0,
2680 kLOG = 1,
2681 kSQRT = 2,
2682 kRECIP = 3,
2683 kABS = 4,
2684 kNEG = 5,
2685 kSIN = 6,
2686 kCOS = 7,
2687 kTAN = 8,
2688 kSINH = 9,
2689 kCOSH = 10,
2690 kASIN = 11,
2691 kACOS = 12,
2692 kATAN = 13,
2693 kASINH = 14,
2694 kACOSH = 15,
2695 kATANH = 16,
2696 kCEIL = 17,
2697 kFLOOR = 18,
2698 kERF = 19,
2699 kNOT = 20,
2700 kSIGN = 21,
2701 kROUND = 22,
2702 kISINF = 23,
2703 kISNAN = 24,
2704};
2705
2711template <>
2712constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2713{
2714 return 25;
2715}
2716
2724class IUnaryLayer : public ILayer
2725{
2726public:
2735 {
2736 mImpl->setOperation(op);
2737 }
2738
2745 {
2746 return mImpl->getOperation();
2747 }
2748
2749protected:
2750 apiv::VUnaryLayer* mImpl;
2751 virtual ~IUnaryLayer() noexcept = default;
2752};
2753
2772enum class ReduceOperation : int32_t
2773{
2774 kSUM = 0,
2775 kPROD = 1,
2776 kMAX = 2,
2777 kMIN = 3,
2778 kAVG = 4
2779};
2780
2786template <>
2787constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2788{
2789 return 5;
2790}
2791
2799class IReduceLayer : public ILayer
2800{
2801public:
2808 {
2809 mImpl->setOperation(op);
2810 }
2811
2818 {
2819 return mImpl->getOperation();
2820 }
2821
2827 void setReduceAxes(uint32_t reduceAxes) noexcept
2828 {
2829 mImpl->setReduceAxes(reduceAxes);
2830 }
2831
2837 uint32_t getReduceAxes() const noexcept
2838 {
2839 return mImpl->getReduceAxes();
2840 }
2841
2847 void setKeepDimensions(bool keepDimensions) noexcept
2848 {
2849 mImpl->setKeepDimensions(keepDimensions);
2850 }
2851
2857 bool getKeepDimensions() const noexcept
2858 {
2859 return mImpl->getKeepDimensions();
2860 }
2861
2862protected:
2863 apiv::VReduceLayer* mImpl;
2864 virtual ~IReduceLayer() noexcept = default;
2865};
2866
2879class IPaddingLayer : public ILayer
2880{
2881public:
2891 void setPrePaddingNd(Dims const& padding) noexcept
2892 {
2893 mImpl->setPrePaddingNd(padding);
2894 }
2895
2903 Dims getPrePaddingNd() const noexcept
2904 {
2905 return mImpl->getPrePaddingNd();
2906 }
2907
2917 void setPostPaddingNd(Dims const& padding) noexcept
2918 {
2919 mImpl->setPostPaddingNd(padding);
2920 }
2921
2929 Dims getPostPaddingNd() const noexcept
2930 {
2931 return mImpl->getPostPaddingNd();
2932 }
2933
2934protected:
2935 apiv::VPaddingLayer* mImpl;
2936 virtual ~IPaddingLayer() noexcept = default;
2937};
2938
2945{
2952 int32_t order[Dims::MAX_DIMS];
2953};
2954
2967class IShuffleLayer : public ILayer
2968{
2969public:
2979 void setFirstTranspose(Permutation permutation) noexcept
2980 {
2981 mImpl->setFirstTranspose(permutation);
2982 }
2983
2992 {
2993 return mImpl->getFirstTranspose();
2994 }
2995
3019 void setReshapeDimensions(Dims const& dimensions) noexcept
3020 {
3021 mImpl->setReshapeDimensions(dimensions);
3022 }
3023
3033 {
3034 return mImpl->getReshapeDimensions();
3035 }
3036
3042 //
3065 using ILayer::setInput;
3066
3079 void setSecondTranspose(Permutation permutation) noexcept
3080 {
3081 mImpl->setSecondTranspose(permutation);
3082 }
3083
3092 {
3093 return mImpl->getSecondTranspose();
3094 }
3095
3107 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3108 {
3109 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3110 }
3111
3120 bool getZeroIsPlaceholder() const noexcept
3121 {
3122 return mImpl->getZeroIsPlaceholder();
3123 }
3124
3125protected:
3126 apiv::VShuffleLayer* mImpl;
3127 virtual ~IShuffleLayer() noexcept = default;
3128};
3129
3135enum class SampleMode : int32_t
3136{
3137 kSTRICT_BOUNDS = 0,
3138 kWRAP = 1,
3139 kCLAMP = 2,
3140 kFILL = 3,
3141 kREFLECT = 4,
3144};
3145
3151template <>
3152constexpr inline int32_t EnumMax<SampleMode>() noexcept
3153{
3154 return 5;
3155}
3156
3219class ISliceLayer : public ILayer
3220{
3221public:
3231 void setStart(Dims const& start) noexcept
3232 {
3233 mImpl->setStart(start);
3234 }
3235
3246 Dims getStart() const noexcept
3247 {
3248 return mImpl->getStart();
3249 }
3250
3260 void setSize(Dims const& size) noexcept
3261 {
3262 return mImpl->setSize(size);
3263 }
3264
3275 Dims getSize() const noexcept
3276 {
3277 return mImpl->getSize();
3278 }
3279
3289 void setStride(Dims const& stride) noexcept
3290 {
3291 mImpl->setStride(stride);
3292 }
3293
3304 Dims getStride() const noexcept
3305 {
3306 return mImpl->getStride();
3307 }
3308
3314 void setMode(SampleMode mode) noexcept
3315 {
3316 mImpl->setMode(mode);
3317 }
3318
3324 SampleMode getMode() const noexcept
3325 {
3326 return mImpl->getMode();
3327 }
3328
3356 using ILayer::setInput;
3357
3367 void setAxes(Dims const& axes) noexcept
3368 {
3369 mImpl->setAxes(axes);
3370 }
3371
3382 Dims getAxes() const noexcept
3383 {
3384 return mImpl->getAxes();
3385 }
3386
3387protected:
3388 apiv::VSliceLayer* mImpl;
3389 virtual ~ISliceLayer() noexcept = default;
3390};
3391
3404class IShapeLayer : public ILayer
3405{
3406protected:
3407 apiv::VShapeLayer* mImpl;
3408 virtual ~IShapeLayer() noexcept = default;
3409};
3410
3416enum class TopKOperation : int32_t
3417{
3418 kMAX = 0,
3419 kMIN = 1,
3420};
3421
3427template <>
3428constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3429{
3430 return 2;
3431}
3432
3444class ITopKLayer : public ILayer
3445{
3446public:
3452 void setOperation(TopKOperation op) noexcept
3453 {
3454 mImpl->setOperation(op);
3455 }
3456
3463 {
3464 return mImpl->getOperation();
3465 }
3466
3476 void setK(int32_t k) noexcept
3477 {
3478 mImpl->setK(k);
3479 }
3480
3490 int32_t getK() const noexcept
3491 {
3492 return mImpl->getK();
3493 }
3494
3500 void setReduceAxes(uint32_t reduceAxes) noexcept
3501 {
3502 mImpl->setReduceAxes(reduceAxes);
3503 }
3504
3510 uint32_t getReduceAxes() const noexcept
3511 {
3512 return mImpl->getReduceAxes();
3513 }
3514
3529 using ILayer::setInput;
3530
3541 bool setIndicesType(DataType type) noexcept
3542 {
3543 return mImpl->setIndicesType(type);
3544 }
3545
3553 DataType getIndicesType() const noexcept
3554 {
3555 return mImpl->getIndicesType();
3556 }
3557
3558protected:
3559 apiv::VTopKLayer* mImpl;
3560 virtual ~ITopKLayer() noexcept = default;
3561};
3562
3569enum class MatrixOperation : int32_t
3570{
3574 kNONE = 0,
3575
3577 kTRANSPOSE = 1,
3578
3589 kVECTOR = 2,
3590};
3591
3597template <>
3598constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3599{
3600 return 3;
3601}
3602
3629{
3630public:
3639 void setOperation(int32_t index, MatrixOperation op) noexcept
3640 {
3641 mImpl->setOperation(index, op);
3642 }
3643
3651 MatrixOperation getOperation(int32_t index) const noexcept
3652 {
3653 return mImpl->getOperation(index);
3654 }
3655
3656protected:
3657 apiv::VMatrixMultiplyLayer* mImpl;
3658 virtual ~IMatrixMultiplyLayer() noexcept = default;
3659};
3660
3682class INonZeroLayer : public ILayer
3683{
3684public:
3695 bool setIndicesType(DataType type) noexcept
3696 {
3697 return mImpl->setIndicesType(type);
3698 }
3699
3707 DataType getIndicesType() const noexcept
3708 {
3709 return mImpl->getIndicesType();
3710 }
3711
3712protected:
3713 virtual ~INonZeroLayer() noexcept = default;
3714 apiv::VNonZeroLayer* mImpl;
3715};
3716
3732{
3733protected:
3734 apiv::VRaggedSoftMaxLayer* mImpl;
3735 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3736};
3737
3782{
3783protected:
3784 apiv::VIdentityLayer* mImpl;
3785 virtual ~IIdentityLayer() noexcept = default;
3786};
3787
3794class ICastLayer : public ILayer
3795{
3796public:
3804 void setToType(DataType toType) noexcept
3805 {
3806 mImpl->setToType(toType);
3807 }
3808
3815 DataType getToType() const noexcept
3816 {
3817 return mImpl->getToType();
3818 }
3819
3820protected:
3821 apiv::VCastLayer* mImpl;
3822 virtual ~ICastLayer() noexcept = default;
3823};
3824
3834{
3835public:
3844 void setWeights(Weights weights) noexcept
3845 {
3846 mImpl->setWeights(weights);
3847 }
3848
3854 Weights getWeights() const noexcept
3855 {
3856 return mImpl->getWeights();
3857 }
3858
3866 void setDimensions(Dims const& dimensions) noexcept
3867 {
3868 mImpl->setDimensions(dimensions);
3869 }
3870
3878 Dims getDimensions() const noexcept
3879 {
3880 return mImpl->getDimensions();
3881 }
3882
3883protected:
3884 apiv::VConstantLayer* mImpl;
3885 virtual ~IConstantLayer() noexcept = default;
3886};
3887
3898{
3899protected:
3900 apiv::VParametricReLULayer* mImpl;
3901 virtual ~IParametricReLULayer() noexcept = default;
3902};
3903
3909enum class InterpolationMode : int32_t
3910{
3911 kNEAREST = 0,
3912 kLINEAR = 1,
3913 kCUBIC = 2
3914};
3915
3916namespace impl
3917{
3923template <>
3925{
3926 static constexpr int32_t kVALUE = 3;
3927};
3928} // namespace impl
3929
3938{
3951 kALIGN_CORNERS = 0,
3952
3959 kASYMMETRIC = 1,
3960
3967 kHALF_PIXEL = 2,
3968};
3969
3970namespace impl
3971{
3977template <>
3979{
3980 static constexpr int32_t kVALUE = 3;
3981};
3982} // namespace impl
3983
3991enum class ResizeSelector : int32_t
3992{
3994 kFORMULA = 0,
3995
3997 kUPPER = 1,
3998};
3999
4000namespace impl
4001{
4007template <>
4009{
4010 static constexpr int32_t kVALUE = 2;
4011};
4012} // namespace impl
4013
4021enum class ResizeRoundMode : int32_t
4022{
4024 kHALF_UP = 0,
4025
4027 kHALF_DOWN = 1,
4028
4030 kFLOOR = 2,
4031
4033 kCEIL = 3,
4034};
4035
4036namespace impl
4037{
4043template <>
4045{
4046 static constexpr int32_t kVALUE = 4;
4047};
4048} // namespace impl
4049
4086class IResizeLayer : public ILayer
4087{
4088public:
4107 void setOutputDimensions(Dims const& dimensions) noexcept
4108 {
4109 return mImpl->setOutputDimensions(dimensions);
4110 }
4111
4117 Dims getOutputDimensions() const noexcept
4118 {
4119 return mImpl->getOutputDimensions();
4120 }
4121
4147 void setScales(float const* scales, int32_t nbScales) noexcept
4148 {
4149 mImpl->setScales(scales, nbScales);
4150 }
4151
4166 int32_t getScales(int32_t size, float* scales) const noexcept
4167 {
4168 return mImpl->getScales(size, scales);
4169 }
4170
4178 void setResizeMode(InterpolationMode interpolationMode) noexcept
4179 {
4180 mImpl->setResizeMode(interpolationMode);
4181 }
4182
4189 {
4190 return mImpl->getResizeMode();
4191 }
4192
4212 using ILayer::setInput;
4213
4224 {
4225 mImpl->setCoordinateTransformation(coordTransform);
4226 }
4227
4234 {
4235 return mImpl->getCoordinateTransformation();
4236 }
4237
4249 {
4250 mImpl->setSelectorForSinglePixel(selector);
4251 }
4252
4259 {
4260 return mImpl->getSelectorForSinglePixel();
4261 }
4262
4273 {
4274 mImpl->setNearestRounding(value);
4275 }
4276
4283 {
4284 return mImpl->getNearestRounding();
4285 }
4286
4304 void setCubicCoeff(float A) noexcept
4305 {
4306 mImpl->setCubicCoeff(A);
4307 }
4308
4314 float getCubicCoeff() const noexcept
4315 {
4316 return mImpl->getCubicCoeff();
4317 }
4318
4327 void setExcludeOutside(bool excludeFlag) noexcept
4328 {
4329 mImpl->setExcludeOutside(excludeFlag);
4330 }
4331
4337 bool getExcludeOutside() const noexcept
4338 {
4339 return mImpl->getExcludeOutside();
4340 }
4341
4342protected:
4343 virtual ~IResizeLayer() noexcept = default;
4344 apiv::VResizeLayer* mImpl;
4345};
4346
4352enum class LoopOutput : int32_t
4353{
4355 kLAST_VALUE = 0,
4356
4358 kCONCATENATE = 1,
4359
4361 kREVERSE = 2
4362};
4363
4369template <>
4370constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4371{
4372 return 3;
4373}
4374
4380enum class TripLimit : int32_t
4381{
4382
4383 kCOUNT = 0,
4384 kWHILE = 1
4385};
4386
4392template <>
4393constexpr inline int32_t EnumMax<TripLimit>() noexcept
4394{
4395 return 2;
4396}
4397
4398class ILoop;
4399
4414{
4415public:
4419 ILoop* getLoop() const noexcept
4420 {
4421 return mBoundary->getLoop();
4422 }
4423
4424protected:
4425 virtual ~ILoopBoundaryLayer() noexcept = default;
4426 apiv::VLoopBoundaryLayer* mBoundary;
4427};
4428
4437{
4438public:
4443 {
4444 return mBoundary->getConditional();
4445 }
4446
4447protected:
4448 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4449 apiv::VConditionalBoundaryLayer* mBoundary;
4450};
4451
4458{
4459public:
4460protected:
4461 virtual ~IConditionLayer() noexcept = default;
4462 apiv::VConditionLayer* mImpl;
4463};
4464
4475{
4476public:
4477protected:
4478 virtual ~IIfConditionalOutputLayer() noexcept = default;
4479 apiv::VConditionalOutputLayer* mImpl;
4480};
4481
4488{
4489public:
4490protected:
4491 virtual ~IIfConditionalInputLayer() noexcept = default;
4492 apiv::VConditionalInputLayer* mImpl;
4493};
4494
4520{
4521public:
4532 {
4533 return mImpl->setCondition(condition);
4534 }
4535
4549 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4550 {
4551 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4552 }
4553
4562 {
4563 return mImpl->addInput(input);
4564 }
4565
4576 void setName(char const* name) noexcept
4577 {
4578 mImpl->setName(name);
4579 }
4580
4586 char const* getName() const noexcept
4587 {
4588 return mImpl->getName();
4589 }
4590
4591protected:
4592 virtual ~IIfConditional() noexcept = default;
4593 apiv::VIfConditional* mImpl;
4594};
4595
4604{
4605public:
4611 //
4624 using ILayer::setInput;
4625
4626protected:
4627 virtual ~IRecurrenceLayer() noexcept = default;
4628 apiv::VRecurrenceLayer* mImpl;
4629};
4630
4651{
4652public:
4656 LoopOutput getLoopOutput() const noexcept
4657 {
4658 return mImpl->getLoopOutput();
4659 }
4660
4673 void setAxis(int32_t axis) noexcept
4674 {
4675 mImpl->setAxis(axis);
4676 }
4677
4681 int32_t getAxis() const noexcept
4682 {
4683 return mImpl->getAxis();
4684 }
4685
4691 //
4706 using ILayer::setInput;
4707
4708protected:
4709 virtual ~ILoopOutputLayer() noexcept = default;
4710 apiv::VLoopOutputLayer* mImpl;
4711};
4712
4725{
4726public:
4730 TripLimit getTripLimit() const noexcept
4731 {
4732 return mImpl->getTripLimit();
4733 }
4734
4735protected:
4736 virtual ~ITripLimitLayer() noexcept = default;
4737 apiv::VTripLimitLayer* mImpl;
4738};
4739
4751{
4752public:
4756 void setAxis(int32_t axis) noexcept
4757 {
4758 mImpl->setAxis(axis);
4759 }
4760
4764 int32_t getAxis() const noexcept
4765 {
4766 return mImpl->getAxis();
4767 }
4768
4778 void setReverse(bool reverse) noexcept
4779 {
4780 mImpl->setReverse(reverse);
4781 }
4782
4788 bool getReverse() const noexcept
4789 {
4790 return mImpl->getReverse();
4791 }
4792
4793protected:
4794 virtual ~IIteratorLayer() noexcept = default;
4795 apiv::VIteratorLayer* mImpl;
4796};
4797
4808class ILoop : public INoCopy
4809{
4810public:
4817 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4818 {
4819 return mImpl->addRecurrence(initialValue);
4820 }
4821
4839 {
4840 return mImpl->addTripLimit(tensor, limit);
4841 }
4842
4851 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4852 {
4853 return mImpl->addIterator(tensor, axis, reverse);
4854 }
4855
4864 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4865 {
4866 return mImpl->addLoopOutput(tensor, outputKind, axis);
4867 }
4868
4879 void setName(char const* name) noexcept
4880 {
4881 mImpl->setName(name);
4882 }
4883
4889 char const* getName() const noexcept
4890 {
4891 return mImpl->getName();
4892 }
4893
4894protected:
4895 virtual ~ILoop() noexcept = default;
4896 apiv::VLoop* mImpl;
4897};
4898
4911class ISelectLayer : public ILayer
4912{
4913protected:
4914 virtual ~ISelectLayer() noexcept = default;
4915 apiv::VSelectLayer* mImpl;
4916};
4917
4934{
4935public:
4944 void setMessage(char const* message) noexcept
4945 {
4946 mImpl->setMessage(message);
4947 }
4948
4954 char const* getMessage() const noexcept
4955 {
4956 return mImpl->getMessage();
4957 }
4958
4959protected:
4960 virtual ~IAssertionLayer() noexcept = default;
4961
4962 apiv::VAssertionLayer* mImpl;
4963};
4964
4972enum class FillOperation : int32_t
4973{
4989 kLINSPACE = 0,
4990
4992 kRANDOM_UNIFORM = 1,
4993
4995 kRANDOM_NORMAL = 2
4996};
4997
5003template <>
5004constexpr inline int32_t EnumMax<FillOperation>() noexcept
5005{
5006 return 3;
5007}
5008
5044class IFillLayer : public ILayer
5045{
5046public:
5055 //
5056 void setDimensions(Dims const& dimensions) noexcept
5057 {
5058 mImpl->setDimensions(dimensions);
5059 }
5060
5071 Dims getDimensions() const noexcept
5072 {
5073 return mImpl->getDimensions();
5074 }
5075
5081 void setOperation(FillOperation op) noexcept
5082 {
5083 mImpl->setOperation(op);
5084 }
5085
5092 {
5093 return mImpl->getOperation();
5094 }
5095
5109 //
5110 void setAlpha(double alpha) noexcept
5111 {
5112 mImpl->setAlpha(alpha);
5113 }
5114
5125 double getAlpha() const noexcept
5126 {
5127 return mImpl->getAlpha();
5128 }
5129
5144 void setBeta(double beta) noexcept
5145 {
5146 mImpl->setBeta(beta);
5147 }
5148
5159 double getBeta() const noexcept
5160 {
5161 return mImpl->getBeta();
5162 }
5163
5204 using ILayer::setInput;
5205
5219 //
5220 void setAlphaInt64(int64_t alpha) noexcept
5221 {
5222 mImpl->setAlphaInt64(alpha);
5223 }
5224
5235 int64_t getAlphaInt64() const noexcept
5236 {
5237 return mImpl->getAlphaInt64();
5238 }
5239
5254 void setBetaInt64(int64_t beta) noexcept
5255 {
5256 mImpl->setBetaInt64(beta);
5257 }
5258
5269 int64_t getBetaInt64() const noexcept
5270 {
5271 return mImpl->getBetaInt64();
5272 }
5273
5277 bool isAlphaBetaInt64() const noexcept
5278 {
5279 return mImpl->isAlphaBetaInt64();
5280 }
5281
5294 void setToType(DataType toType) noexcept
5295 {
5296 mImpl->setToType(toType);
5297 }
5298
5306 DataType getToType() const noexcept
5307 {
5308 return mImpl->getToType();
5309 }
5310
5311protected:
5312 virtual ~IFillLayer() noexcept = default;
5313 apiv::VFillLayer* mImpl;
5314};
5315
5391{
5392public:
5401 int32_t getAxis() const noexcept
5402 {
5403 return mImpl->getAxis();
5404 }
5412 void setAxis(int32_t axis) noexcept
5413 {
5414 mImpl->setAxis(axis);
5415 }
5416
5428 void setToType(DataType toType) noexcept
5429 {
5430 mImpl->setToType(toType);
5431 }
5432
5440 DataType getToType() const noexcept
5441 {
5442 return mImpl->getToType();
5443 }
5444
5445protected:
5446 virtual ~IQuantizeLayer() noexcept = default;
5447 apiv::VQuantizeLayer* mImpl;
5448};
5449
5519{
5520public:
5529 int32_t getAxis() const noexcept
5530 {
5531 return mImpl->getAxis();
5532 }
5540 void setAxis(int32_t axis) noexcept
5541 {
5542 mImpl->setAxis(axis);
5543 }
5544
5556 void setToType(DataType toType) noexcept
5557 {
5558 mImpl->setToType(toType);
5559 }
5560
5568 DataType getToType() const noexcept
5569 {
5570 return mImpl->getToType();
5571 }
5572
5573protected:
5574 virtual ~IDequantizeLayer() noexcept = default;
5575 apiv::VDequantizeLayer* mImpl;
5576};
5577
5596{
5597public:
5609 using ILayer::setInput;
5610
5623 void setToType(DataType toType) noexcept
5624 {
5625 mImpl->setToType(toType);
5626 }
5627
5636 DataType getToType() const noexcept
5637 {
5638 return mImpl->getToType();
5639 }
5640
5649 void setScaleType(DataType scaleType) noexcept
5650 {
5651 mImpl->setScaleType(scaleType);
5652 }
5653
5662 DataType getScaleType() const noexcept
5663 {
5664 return mImpl->getScaleType();
5665 }
5666
5675 void setAxis(int32_t axis) noexcept
5676 {
5677 mImpl->setAxis(axis);
5678 }
5679
5685 int32_t getAxis() const noexcept
5686 {
5687 return mImpl->getAxis();
5688 }
5689
5698 void setBlockSize(int32_t size) noexcept
5699 {
5700 mImpl->setBlockSize(size);
5701 }
5702
5708 int32_t getBlockSize() const noexcept
5709 {
5710 return mImpl->getBlockSize();
5711 }
5712
5713protected:
5714 virtual ~IDynamicQuantizeLayer() noexcept = default;
5715 apiv::VDynamicQuantizeLayer* mImpl;
5716};
5717
5752class IEinsumLayer : public ILayer
5753{
5754public:
5764 bool setEquation(char const* equation) noexcept
5765 {
5766 return mImpl->setEquation(equation);
5767 }
5768
5774 char const* getEquation() const noexcept
5775 {
5776 return mImpl->getEquation();
5777 }
5778
5779protected:
5780 virtual ~IEinsumLayer() noexcept = default;
5781 apiv::VEinsumLayer* mImpl;
5782};
5783
5791enum class ScatterMode : int32_t
5792{
5793 kELEMENT = 0,
5794 kND = 1,
5795};
5796
5802template <>
5803constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5804{
5805 return 2;
5806}
5807
5865class IScatterLayer : public ILayer
5866{
5867public:
5873 void setMode(ScatterMode mode) noexcept
5874 {
5875 mImpl->setMode(mode);
5876 }
5877
5883 ScatterMode getMode() const noexcept
5884 {
5885 return mImpl->getMode();
5886 }
5887
5893 void setAxis(int32_t axis) noexcept
5894 {
5895 mImpl->setAxis(axis);
5896 }
5897
5901 int32_t getAxis() const noexcept
5902 {
5903 return mImpl->getAxis();
5904 }
5905
5906protected:
5907 apiv::VScatterLayer* mImpl;
5908 virtual ~IScatterLayer() noexcept = default;
5909}; // class IScatterLayer
5910
5937class IOneHotLayer : public ILayer
5938{
5939public:
5945 void setAxis(int32_t axis) noexcept
5946 {
5947 mImpl->setAxis(axis);
5948 }
5949
5953 int32_t getAxis() const noexcept
5954 {
5955 return mImpl->getAxis();
5956 }
5957
5958protected:
5959 apiv::VOneHotLayer* mImpl;
5960 virtual ~IOneHotLayer() noexcept = default;
5961};
5962
5975{
5976public:
5983 {
5984 mImpl->setInterpolationMode(mode);
5985 }
5986
5995 {
5996 return mImpl->getInterpolationMode();
5997 }
5998
6004 void setAlignCorners(bool alignCorners) noexcept
6005 {
6006 mImpl->setAlignCorners(alignCorners);
6007 }
6008
6016 bool getAlignCorners() const noexcept
6017 {
6018 return mImpl->getAlignCorners();
6019 }
6020
6028 bool setSampleMode(SampleMode mode) noexcept
6029 {
6030 return mImpl->setSampleMode(mode);
6031 }
6032
6040 SampleMode getSampleMode() const noexcept
6041 {
6042 return mImpl->getSampleMode();
6043 }
6044
6045protected:
6046 apiv::VGridSampleLayer* mImpl;
6047 virtual ~IGridSampleLayer() noexcept = default;
6048}; // class IGridSampleLayer
6049
6057enum class BoundingBoxFormat : int32_t
6058{
6060 kCORNER_PAIRS = 0,
6062 kCENTER_SIZES = 1
6063};
6064
6070template <>
6071constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6072{
6073 return 2;
6074}
6075
6126class INMSLayer : public ILayer
6127{
6128public:
6139 {
6140 mImpl->setBoundingBoxFormat(fmt);
6141 }
6142
6151 {
6152 return mImpl->getBoundingBoxFormat();
6153 }
6154
6164 void setTopKBoxLimit(int32_t limit) noexcept
6165 {
6166 mImpl->setTopKBoxLimit(limit);
6167 }
6168
6174 int32_t getTopKBoxLimit() const noexcept
6175 {
6176 return mImpl->getTopKBoxLimit();
6177 }
6178
6197 using ILayer::setInput;
6198
6209 bool setIndicesType(DataType type) noexcept
6210 {
6211 return mImpl->setIndicesType(type);
6212 }
6213
6221 DataType getIndicesType() const noexcept
6222 {
6223 return mImpl->getIndicesType();
6224 }
6225
6226protected:
6227 apiv::VNMSLayer* mImpl;
6228 virtual ~INMSLayer() noexcept = default;
6229}; // class INMSLayer
6230
6244{
6245public:
6254 void setBatchAxis(int32_t batchAxis) noexcept
6255 {
6256 mImpl->setBatchAxis(batchAxis);
6257 }
6258
6264 int32_t getBatchAxis() const noexcept
6265 {
6266 return mImpl->getBatchAxis();
6267 }
6268
6277 void setSequenceAxis(int32_t sequenceAxis) noexcept
6278 {
6279 mImpl->setSequenceAxis(sequenceAxis);
6280 }
6281
6287 int32_t getSequenceAxis() const noexcept
6288 {
6289 return mImpl->getSequenceAxis();
6290 }
6291
6292protected:
6293 apiv::VReverseSequenceLayer* mImpl;
6294 virtual ~IReverseSequenceLayer() noexcept = default;
6295}; // class IReverseSequenceLayer
6296
6316{
6317public:
6325 void setEpsilon(float eps) noexcept
6326 {
6327 return mImpl->setEpsilon(eps);
6328 }
6329
6335 float getEpsilon() const noexcept
6336 {
6337 return mImpl->getEpsilon();
6338 }
6339
6345 void setAxes(uint32_t axesMask) noexcept
6346 {
6347 return mImpl->setAxes(axesMask);
6348 }
6349
6355 uint32_t getAxes() const noexcept
6356 {
6357 return mImpl->getAxes();
6358 }
6359
6376 void setNbGroups(int64_t nbGroups) noexcept
6377 {
6378 return mImpl->setNbGroups(nbGroups);
6379 }
6380
6386 int64_t getNbGroups() const noexcept
6387 {
6388 return mImpl->getNbGroups();
6389 }
6390
6412 void setComputePrecision(DataType type) noexcept
6413 {
6414 return mImpl->setComputePrecision(type);
6415 }
6416
6423 {
6424 return mImpl->getComputePrecision();
6425 }
6426
6427protected:
6428 apiv::VNormalizationLayer* mImpl;
6429 virtual ~INormalizationLayer() noexcept = default;
6430};
6431
6432
6441class ISqueezeLayer : public ILayer
6442{
6443public:
6456 using ILayer::setInput;
6457
6458protected:
6459 apiv::VSqueezeLayer* mImpl;
6460 virtual ~ISqueezeLayer() noexcept = default;
6461};
6462
6471{
6472public:
6485 using ILayer::setInput;
6486
6487protected:
6488 apiv::VUnsqueezeLayer* mImpl;
6489 virtual ~IUnsqueezeLayer() noexcept = default;
6490};
6491
6503enum class CumulativeOperation : int32_t
6504{
6505 kSUM = 0,
6506};
6507
6508namespace impl
6509{
6510
6516template <>
6518{
6519 static constexpr int32_t kVALUE = 1;
6520};
6521
6522} // namespace impl
6523
6552{
6553public:
6564 {
6565 return mImpl->setOperation(op);
6566 }
6567
6576 {
6577 return mImpl->getOperation();
6578 }
6579
6587 void setExclusive(bool exclusive) noexcept
6588 {
6589 mImpl->setExclusive(exclusive);
6590 }
6591
6599 bool getExclusive() const noexcept
6600 {
6601 return mImpl->getExclusive();
6602 }
6603
6611 void setReverse(bool reverse) noexcept
6612 {
6613 mImpl->setReverse(reverse);
6614 }
6615
6623 bool getReverse() const noexcept
6624 {
6625 return mImpl->getReverse();
6626 }
6627
6628protected:
6629 apiv::VCumulativeLayer* mImpl;
6630 virtual ~ICumulativeLayer() noexcept = default;
6631};
6632
6638enum class AttentionNormalizationOp : int32_t
6639{
6640 kNONE
6641 = 0,
6642 kSOFTMAX = 1,
6643};
6644
6645namespace impl
6646{
6652template <>
6654{
6655 static constexpr int32_t kVALUE = 2;
6656};
6657
6658} // namespace impl
6659
6670{
6671public:
6675 IAttention* getAttention() const noexcept
6676 {
6677 return mBoundary->getAttention();
6678 }
6679
6680protected:
6681 virtual ~IAttentionBoundaryLayer() noexcept = default;
6682 apiv::VAttentionBoundaryLayer* mBoundary;
6683};
6684
6696{
6697public:
6713 using ILayer::setInput;
6714
6715protected:
6716 virtual ~IAttentionInputLayer() noexcept = default;
6717 apiv::VAttentionInputLayer* mImpl;
6718};
6719
6731{
6732public:
6733protected:
6734 virtual ~IAttentionOutputLayer() noexcept = default;
6735 apiv::VAttentionOutputLayer* mImpl;
6736};
6737
6783class IAttention : public INoCopy
6784{
6785public:
6794 {
6795 return mImpl->setNormalizationOperation(op);
6796 }
6797
6806 {
6807 return mImpl->getNormalizationOperation();
6808 }
6809
6822 bool setMask(ITensor& mask) noexcept
6823 {
6824 return mImpl->setMask(mask);
6825 }
6826
6834 ITensor* getMask() noexcept
6835 {
6836 return mImpl->getMask();
6837 }
6838
6847 bool setCausal(bool isCausal) noexcept
6848 {
6849 return mImpl->setCausal(isCausal);
6850 }
6851
6859 bool getCausal() const noexcept
6860 {
6861 return mImpl->getCausal();
6862 }
6863
6871 bool setDecomposable(bool decomposable) noexcept
6872 {
6873 return mImpl->setDecomposable(decomposable);
6874 }
6875
6884 bool getDecomposable() const noexcept
6885 {
6886 return mImpl->getDecomposable();
6887 }
6888
6903 bool setInput(int32_t index, ITensor& input) noexcept
6904 {
6905 return mImpl->setInput(index, input);
6906 }
6907
6912 int32_t getNbInputs() const noexcept
6913 {
6914 return mImpl->getNbInputs();
6915 }
6916
6924 ITensor* getInput(int32_t index) const noexcept
6925 {
6926 return mImpl->getInput(index);
6927 }
6928
6932 int32_t getNbOutputs() const noexcept
6933 {
6934 return mImpl->getNbOutputs();
6935 }
6936
6944 ITensor* getOutput(int32_t index) const noexcept
6945 {
6946 return mImpl->getOutput(index);
6947 }
6948
6961 bool setName(char const* name) noexcept
6962 {
6963 return mImpl->setName(name);
6964 }
6965
6973 char const* getName() const noexcept
6974 {
6975 return mImpl->getName();
6976 }
6977
6990 {
6991 return mImpl->setNormalizationQuantizeScale(tensor);
6992 }
6993
7001 {
7002 return mImpl->getNormalizationQuantizeScale();
7003 }
7004
7014 {
7015 return mImpl->setNormalizationQuantizeToType(type);
7016 }
7017
7026 {
7027 return mImpl->getNormalizationQuantizeToType();
7028 }
7029
7030
7031protected:
7032 apiv::VAttention* mImpl;
7033 virtual ~IAttention() noexcept = default;
7034};
7035
7054{
7055public:
7056 virtual ~INetworkDefinition() noexcept = default;
7057
7093 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
7094 {
7095 return mImpl->addInput(name, type, dimensions);
7096 }
7097
7107 void markOutput(ITensor& tensor) noexcept
7108 {
7109 mImpl->markOutput(tensor);
7110 }
7111
7125 bool markDebug(ITensor& tensor) noexcept
7126 {
7127 return mImpl->markDebug(tensor);
7128 }
7129
7141 bool unmarkDebug(ITensor& tensor) noexcept
7142 {
7143 return mImpl->unmarkDebug(tensor);
7144 }
7145
7151 bool isDebugTensor(ITensor const& tensor) const noexcept
7152 {
7153 return mImpl->isDebugTensor(tensor);
7154 }
7155
7174 {
7175 return mImpl->markUnfusedTensorsAsDebugTensors();
7176 }
7177
7188 {
7189 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
7190 }
7191
7208 {
7209 return mImpl->addActivation(input, type);
7210 }
7211
7226 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
7227 {
7228 return mImpl->addLRN(input, window, alpha, beta, k);
7229 }
7230
7252 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
7253 {
7254 return mImpl->addScale(input, mode, shift, scale, power);
7255 }
7256
7266 {
7267 return mImpl->addSoftMax(input);
7268 }
7269
7282 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
7283 {
7284 return mImpl->addConcatenation(inputs, nbInputs);
7285 }
7286
7310 {
7311 return mImpl->addElementWise(input1, input2, op);
7312 }
7313
7331 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
7332 {
7333 return mImpl->addUnary(input, operation);
7334 }
7335
7346 {
7347 return mImpl->addShuffle(input);
7348 }
7349
7362 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
7363 {
7364 return mImpl->addOneHot(indices, values, depth, axis);
7365 }
7366
7374 int32_t getNbLayers() const noexcept
7375 {
7376 return mImpl->getNbLayers();
7377 }
7378
7388 ILayer* getLayer(int32_t index) const noexcept
7389 {
7390 return mImpl->getLayer(index);
7391 }
7392
7400 int32_t getNbInputs() const noexcept
7401 {
7402 return mImpl->getNbInputs();
7403 }
7404
7416 ITensor* getInput(int32_t index) const noexcept
7417 {
7418 return mImpl->getInput(index);
7419 }
7420
7430 int32_t getNbOutputs() const noexcept
7431 {
7432 return mImpl->getNbOutputs();
7433 }
7434
7446 ITensor* getOutput(int32_t index) const noexcept
7447 {
7448 return mImpl->getOutput(index);
7449 }
7450
7473 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7474 {
7475 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7476 }
7477
7509 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7510 {
7511 return mImpl->addTopK(input, op, k, reduceAxes);
7512 }
7513
7543 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
7544 {
7545 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
7546 }
7547
7559 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7560 {
7561 return mImpl->addGather(data, indices, axis);
7562 }
7563
7575 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7576 {
7577 return mImpl->addGatherV2(data, indices, mode);
7578 }
7579
7595 {
7596 return mImpl->addRaggedSoftMax(input, bounds);
7597 }
7598
7616 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7617 {
7618 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7619 }
7620
7635 {
7636 return mImpl->addNonZero(input);
7637 }
7638
7650 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
7651 {
7652 return mImpl->addNonZeroV2(input, indicesType);
7653 }
7654
7674 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7675 {
7676 return mImpl->addConstant(dimensions, weights);
7677 }
7678
7689 {
7690 return mImpl->addIdentity(input);
7691 }
7692
7703 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7704 {
7705 return mImpl->addCast(input, toType);
7706 }
7707
7718 void removeTensor(ITensor& tensor) noexcept
7719 {
7720 mImpl->removeTensor(tensor);
7721 }
7722
7730 void unmarkOutput(ITensor& tensor) noexcept
7731 {
7732 mImpl->unmarkOutput(tensor);
7733 }
7734
7749 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7750 {
7751 return mImpl->addSlice(input, start, size, stride);
7752 }
7753
7773 void setName(char const* name) noexcept
7774 {
7775 mImpl->setName(name);
7776 }
7777
7787 char const* getName() const noexcept
7788 {
7789 return mImpl->getName();
7790 }
7791
7803 IShapeLayer* addShape(ITensor& input) noexcept
7804 {
7805 return mImpl->addShape(input);
7806 }
7807
7814 {
7815 return mImpl->getFlags();
7816 }
7817
7825 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7826 {
7827 return mImpl->getFlag(networkDefinitionCreationFlag);
7828 }
7829
7842 bool markOutputForShapes(ITensor& tensor) noexcept
7843 {
7844 return mImpl->markOutputForShapes(tensor);
7845 }
7846
7854 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7855 {
7856 return mImpl->unmarkOutputForShapes(tensor);
7857 }
7858
7873 {
7874 return mImpl->addParametricReLU(input, slope);
7875 }
7876
7895 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7896 {
7897 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7898 }
7899
7914 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7915 {
7916 return mImpl->addPoolingNd(input, type, windowSize);
7917 }
7918
7933 //
7937 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7938 {
7939 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7940 }
7941
7974 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7975 {
7976 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7977 }
7978
7991 {
7992 return mImpl->addResize(input);
7993 }
7994
8004 ILoop* addLoop() noexcept
8005 {
8006 return mImpl->addLoop();
8007 }
8008
8020 {
8021 return mImpl->addIfConditional();
8022 }
8023
8058 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
8059 {
8060 return mImpl->addSelect(condition, thenInput, elseInput);
8061 }
8062
8075 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
8076 {
8077 return mImpl->addAssertion(condition, message);
8078 }
8079
8101 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
8102 {
8103 return mImpl->addFillV2(dimensions, op, outputType);
8104 }
8105
8117 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
8118 {
8119 return mImpl->addPaddingNd(input, prePadding, postPadding);
8120 }
8121
8141 bool setWeightsName(Weights weights, char const* name) noexcept
8142 {
8143 return mImpl->setWeightsName(weights, name);
8144 }
8145
8157 //
8160 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8161 {
8162 mImpl->setErrorRecorder(recorder);
8163 }
8164
8176 {
8177 return mImpl->getErrorRecorder();
8178 }
8179
8198 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8199 {
8200 return mImpl->addDequantizeV2(input, scale, outputType);
8201 }
8202
8218 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
8219 {
8220 return mImpl->addScatter(data, indices, updates, mode);
8221 }
8222
8242 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8243 {
8244 return mImpl->addQuantizeV2(input, scale, outputType);
8245 }
8246
8270 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
8271 {
8272 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
8273 }
8274
8285 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
8286 {
8287 return mImpl->addEinsum(inputs, nbInputs, equation);
8288 }
8289
8304 {
8305 return mImpl->addGridSample(input, grid);
8306 }
8307
8325 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8326 {
8327 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8328 }
8329
8345 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
8346 {
8347 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
8348 }
8349
8363 {
8364 return mImpl->addReverseSequence(input, sequenceLens);
8365 }
8366
8388 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8389 {
8390 return mImpl->addNormalization(input, scale, bias, axesMask);
8391 }
8392
8410 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8411 {
8412 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8413 }
8414
8438 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
8439 {
8440 return mImpl->addAttention(query, key, value, normOp, causal);
8441 }
8442
8449 virtual IBuilder& getBuilder() const noexcept
8450 {
8451 return mImpl->getBuilder();
8452 }
8453
8462 bool markWeightsRefittable(char const* name) noexcept
8463 {
8464 return mImpl->markWeightsRefittable(name);
8465 }
8466
8474 bool unmarkWeightsRefittable(char const* name) noexcept
8475 {
8476 return mImpl->unmarkWeightsRefittable(name);
8477 }
8478
8487 bool areWeightsMarkedRefittable(char const* name) const noexcept
8488 {
8489 return mImpl->areWeightsMarkedRefittable(name);
8490 }
8491
8506 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8507 {
8508 return mImpl->addSqueeze(input, axes);
8509 }
8510
8528 {
8529 return mImpl->addUnsqueeze(input, axes);
8530 }
8531
8532protected:
8533 apiv::VNetworkDefinition* mImpl;
8534};
8535
8553enum class RuntimePlatform : int32_t
8554{
8557 kSAME_AS_BUILD = 0,
8558
8561 kWINDOWS_AMD64 = 1,
8562
8563
8564};
8565
8566namespace impl
8567{
8573template <>
8575{
8576 static constexpr int32_t kVALUE = 2;
8577};
8578} // namespace impl
8579
8586using BuilderFlags = uint32_t;
8587
8595enum class BuilderFlag : int32_t
8596{
8600
8604
8606 kDEBUG = 2,
8607
8609 kGPU_FALLBACK = 3,
8610
8612 kREFIT = 4,
8613
8616
8620 kTF32 = 6,
8621
8623 kSPARSE_WEIGHTS = 7,
8624
8631 kSAFETY_SCOPE = 8,
8632
8636
8641
8647
8651
8658
8664
8672
8676
8681
8687
8689 kSTRIP_PLAN = 19,
8690
8693
8700 kREFIT_IDENTICAL = 20,
8701
8727 kWEIGHT_STREAMING = 21,
8728
8732
8737 kREFIT_INDIVIDUAL = 23,
8738
8747 kSTRICT_NANS = 24,
8748
8750 kMONITOR_MEMORY = 25,
8751
8755
8758
8770
8771#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
8778 kREQUIRE_USER_ALLOCATION = 29,
8779#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
8780
8781};
8782
8788template <>
8789constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8790{
8791#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
8792 return 30;
8793#else
8794 return 29;
8795#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
8796}
8797
8798namespace v_1_0
8799{
8815{
8816 uint8_t data[16];
8817};
8818
8829{
8831 uint64_t tacticHash;
8835 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8836};
8837} // namespace v_1_0
8838
8855{
8856public:
8857 virtual ~ITimingCache() noexcept = default;
8858
8868 nvinfer1::IHostMemory* serialize() const noexcept
8869 {
8870 return mImpl->serialize();
8871 }
8872
8892 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8893 {
8894 return mImpl->combine(inputCache, ignoreMismatch);
8895 }
8896
8902 bool reset() noexcept
8903 {
8904 return mImpl->reset();
8905 }
8906
8921 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
8922 {
8923 return mImpl->queryKeys(keyBuffer, capacity);
8924 }
8925
8938 TimingCacheValue query(TimingCacheKey const& key) const noexcept
8939 {
8940 return mImpl->query(key);
8941 }
8942
8960 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
8961 {
8962 return mImpl->update(key, value);
8963 }
8964
8965protected:
8966 apiv::VTimingCache* mImpl;
8967};
8968
8976enum class MemoryPoolType : int32_t
8977{
8984 kWORKSPACE = 0,
8985
8993
8999 kDLA_LOCAL_DRAM = 2,
9000
9006 kDLA_GLOBAL_DRAM = 3,
9007
9015 kTACTIC_DRAM = 4,
9016
9030};
9031
9037template <>
9038constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9039{
9040 return 6;
9041}
9042
9051enum class PreviewFeature : int32_t
9052{
9059
9064
9071};
9072
9073namespace impl
9074{
9080template <>
9082{
9083 static constexpr int32_t kVALUE = 3;
9084};
9085} // namespace impl
9086
9095enum class HardwareCompatibilityLevel : int32_t
9096{
9099 kNONE = 0,
9100
9112 kAMPERE_PLUS = 1,
9113
9123};
9124
9125namespace impl
9126{
9132template <>
9134{
9135 static constexpr int32_t kVALUE = 3;
9136};
9137} // namespace impl
9138
9144enum class ComputeCapability : int32_t
9145{
9147 kNONE = 0,
9149 kCURRENT = 1,
9151 kSM75 = 75,
9153 kSM80 = 80,
9155 kSM86 = 86,
9157 kSM89 = 89,
9159 kSM120 = 120,
9160};
9161
9170enum class TilingOptimizationLevel : int32_t
9171{
9173 kNONE = 0,
9174
9176 kFAST = 1,
9177
9180 kMODERATE = 2,
9181
9183 kFULL = 3
9184
9185};
9186
9187namespace impl
9188{
9194template <>
9196{
9197 static constexpr int32_t kVALUE = 4;
9198};
9199} // namespace impl
9200
9201namespace v_1_0
9202{
9204{
9205public:
9206 IProgressMonitor() = default;
9207 virtual ~IProgressMonitor() noexcept = default;
9208
9212 InterfaceInfo getInterfaceInfo() const noexcept override
9213 {
9214 return InterfaceInfo{"IProgressMonitor", 1, 0};
9215 }
9216
9236 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9237
9250 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9251
9263 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9264
9265}; // class IProgressMonitor
9266} // namespace v_1_0
9267
9288
9297{
9298public:
9299 virtual ~IBuilderConfig() noexcept = default;
9300
9309 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9310 {
9311 mImpl->setAvgTimingIterations(avgTiming);
9312 }
9313
9321 int32_t getAvgTimingIterations() const noexcept
9322 {
9323 return mImpl->getAvgTimingIterations();
9324 }
9325
9334 void setEngineCapability(EngineCapability capability) noexcept
9335 {
9336 mImpl->setEngineCapability(capability);
9337 }
9338
9347 {
9348 return mImpl->getEngineCapability();
9349 }
9350
9363 void setFlags(BuilderFlags builderFlags) noexcept
9364 {
9365 mImpl->setFlags(builderFlags);
9366 }
9367
9375 BuilderFlags getFlags() const noexcept
9376 {
9377 return mImpl->getFlags();
9378 }
9379
9387 void clearFlag(BuilderFlag builderFlag) noexcept
9388 {
9389 mImpl->clearFlag(builderFlag);
9390 }
9391
9399 void setFlag(BuilderFlag builderFlag) noexcept
9400 {
9401 mImpl->setFlag(builderFlag);
9402 }
9403
9411 bool getFlag(BuilderFlag builderFlag) const noexcept
9412 {
9413 return mImpl->getFlag(builderFlag);
9414 }
9415
9428 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9429 {
9430 mImpl->setDeviceType(layer, deviceType);
9431 }
9432
9438 DeviceType getDeviceType(ILayer const* layer) const noexcept
9439 {
9440 return mImpl->getDeviceType(layer);
9441 }
9442
9450 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9451 {
9452 return mImpl->isDeviceTypeSet(layer);
9453 }
9454
9460 void resetDeviceType(ILayer const* layer) noexcept
9461 {
9462 mImpl->resetDeviceType(layer);
9463 }
9464
9470 bool canRunOnDLA(ILayer const* layer) const noexcept
9471 {
9472 return mImpl->canRunOnDLA(layer);
9473 }
9474
9486 void setDLACore(int32_t dlaCore) noexcept
9487 {
9488 mImpl->setDLACore(dlaCore);
9489 }
9490
9496 int32_t getDLACore() const noexcept
9497 {
9498 return mImpl->getDLACore();
9499 }
9500
9507 void setDefaultDeviceType(DeviceType deviceType) noexcept
9508 {
9509 mImpl->setDefaultDeviceType(deviceType);
9510 }
9511
9518 {
9519 return mImpl->getDefaultDeviceType();
9520 }
9521
9527 void reset() noexcept
9528 {
9529 mImpl->reset();
9530 }
9531
9539 void setProfileStream(const cudaStream_t stream) noexcept
9540 {
9541 return mImpl->setProfileStream(stream);
9542 }
9543
9551 cudaStream_t getProfileStream() const noexcept
9552 {
9553 return mImpl->getProfileStream();
9554 }
9555
9568 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9569 {
9570 return mImpl->addOptimizationProfile(profile);
9571 }
9572
9581 int32_t getNbOptimizationProfiles() const noexcept
9582 {
9583 return mImpl->getNbOptimizationProfiles();
9584 }
9585
9594 {
9595 mImpl->setProfilingVerbosity(verbosity);
9596 }
9597
9607 {
9608 return mImpl->getProfilingVerbosity();
9609 }
9610
9628 bool setTacticSources(TacticSources tacticSources) noexcept
9629 {
9630 return mImpl->setTacticSources(tacticSources);
9631 }
9632
9644 {
9645 return mImpl->getTacticSources();
9646 }
9647
9665 TRT_DEPRECATED nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9666 {
9667 return mImpl->createTimingCache(blob, size);
9668 }
9669
9690 TRT_DEPRECATED bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9691 {
9692 return mImpl->setTimingCache(cache, ignoreMismatch);
9693 }
9694
9703 {
9704 return mImpl->getTimingCache();
9705 }
9706
9734 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9735 {
9736 mImpl->setMemoryPoolLimit(pool, poolSize);
9737 }
9738
9753 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9754 {
9755 return mImpl->getMemoryPoolLimit(pool);
9756 }
9757
9771 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9772 {
9773 mImpl->setPreviewFeature(feature, enable);
9774 }
9775
9785 bool getPreviewFeature(PreviewFeature feature) const noexcept
9786 {
9787 return mImpl->getPreviewFeature(feature);
9788 }
9789
9818 void setBuilderOptimizationLevel(int32_t level) noexcept
9819 {
9820 mImpl->setBuilderOptimizationLevel(level);
9821 }
9822
9831 {
9832 return mImpl->getBuilderOptimizationLevel();
9833 }
9834
9847 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9848 {
9849 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9850 }
9851
9861 {
9862 return mImpl->getHardwareCompatibilityLevel();
9863 }
9864
9873 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9874 {
9875 mImpl->setPluginsToSerialize(paths, nbPaths);
9876 }
9877
9886 char const* getPluginToSerialize(int32_t index) const noexcept
9887 {
9888 return mImpl->getPluginToSerialize(index);
9889 }
9890
9896 int32_t getNbPluginsToSerialize() const noexcept
9897 {
9898 return mImpl->getNbPluginsToSerialize();
9899 }
9900
9925 void setMaxAuxStreams(int32_t nbStreams) noexcept
9926 {
9927 mImpl->setMaxAuxStreams(nbStreams);
9928 }
9929
9935 int32_t getMaxAuxStreams() const noexcept
9936 {
9937 return mImpl->getMaxAuxStreams();
9938 }
9939
9951 void setProgressMonitor(IProgressMonitor* monitor) noexcept
9952 {
9953 return mImpl->setProgressMonitor(monitor);
9954 }
9955
9962 {
9963 return mImpl->getProgressMonitor();
9964 }
9965
9977 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
9978 {
9979 mImpl->setRuntimePlatform(runtimePlatform);
9980 }
9981
9990 {
9991 return mImpl->getRuntimePlatform();
9992 }
9993
10001 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10002 {
10003 mImpl->setMaxNbTactics(maxNbTactics);
10004 }
10005
10013 int32_t getMaxNbTactics() const noexcept
10014 {
10015 return mImpl->getMaxNbTactics();
10016 }
10017
10030 {
10031 return mImpl->setTilingOptimizationLevel(level);
10032 }
10033
10042 {
10043 return mImpl->getTilingOptimizationLevel();
10044 }
10045
10057 bool setL2LimitForTiling(int64_t size) noexcept
10058 {
10059 return mImpl->setL2LimitForTiling(size);
10060 }
10061
10069 int64_t getL2LimitForTiling() const noexcept
10070 {
10071 return mImpl->getL2LimitForTiling();
10072 }
10073
10088 bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
10089 {
10090 return mImpl->setNbComputeCapabilities(maxNbComputeCapabilities);
10091 }
10092
10100 int32_t getNbComputeCapabilities() const noexcept
10101 {
10102 return mImpl->getNbComputeCapabilities();
10103 }
10104
10118 bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
10119 {
10120 return mImpl->setComputeCapability(computeCapability, index);
10121 }
10122
10132 ComputeCapability getComputeCapability(int32_t index) const noexcept
10133 {
10134 return mImpl->getComputeCapability(index);
10135 }
10136
10137protected:
10138 apiv::VBuilderConfig* mImpl;
10139};
10140
10149
10159{
10164
10169 kSTRONGLY_TYPED = 1,
10170};
10171
10177template <>
10178constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10179{
10180 return 2;
10181}
10182
10190class IBuilder : public INoCopy
10191{
10192public:
10193 virtual ~IBuilder() noexcept = default;
10194
10202 int32_t getMaxDLABatchSize() const noexcept
10203 {
10204 return mImpl->getMaxDLABatchSize();
10205 }
10206
10210 int32_t getNbDLACores() const noexcept
10211 {
10212 return mImpl->getNbDLACores();
10213 }
10214
10228 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10229 {
10230 mImpl->setGpuAllocator(allocator);
10231 }
10232
10243 {
10244 return mImpl->createBuilderConfig();
10245 }
10246
10269 {
10270 return mImpl->createNetworkV2(flags);
10271 }
10272
10284 {
10285 return mImpl->createOptimizationProfile();
10286 }
10287
10302 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10303 {
10304 mImpl->setErrorRecorder(recorder);
10305 }
10306
10318 {
10319 return mImpl->getErrorRecorder();
10320 }
10321
10325 void reset() noexcept
10326 {
10327 mImpl->reset();
10328 }
10329
10345 {
10346 return mImpl->buildSerializedNetwork(network, config);
10347 }
10348
10366 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
10367 {
10368 return mImpl->buildSerializedNetworkToStream(network, config, writer);
10369 }
10370
10371
10389 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10390 {
10391 return mImpl->isNetworkSupported(network, config);
10392 }
10393
10399 ILogger* getLogger() const noexcept
10400 {
10401 return mImpl->getLogger();
10402 }
10403
10415 bool setMaxThreads(int32_t maxThreads) noexcept
10416 {
10417 return mImpl->setMaxThreads(maxThreads);
10418 }
10419
10429 int32_t getMaxThreads() const noexcept
10430 {
10431 return mImpl->getMaxThreads();
10432 }
10433
10440 {
10441 return mImpl->getPluginRegistry();
10442 }
10443
10444protected:
10445 apiv::VBuilder* mImpl;
10446};
10447
10448} // namespace nvinfer1
10449
10454extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10455
10456namespace nvinfer1
10457{
10458namespace
10459{
10460
10468inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10469{
10470 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10471}
10472
10473} // namespace
10474
10487 nvinfer1::EngineCapability capability) noexcept;
10488
10489namespace safe
10490{
10492class IPluginRegistry;
10493} // namespace safe
10494
10495
10496} // namespace nvinfer1
10497
10498#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:218
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:221
An Activation layer in a network definition.
Definition: NvInfer.h:1265
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1313
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1274
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1284
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1322
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1331
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1299
An assertion layer in a network.
Definition: NvInfer.h:4934
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4944
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4954
virtual ~IAssertionLayer() noexcept=default
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6670
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6675
virtual ~IAttentionBoundaryLayer() noexcept=default
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6784
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:6834
bool setDecomposable(bool decomposable) noexcept
Set whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:6871
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:6961
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:6884
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:6924
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:6944
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:6932
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:6912
bool setCausal(bool isCausal) noexcept
Set whether the attention will run a causal inference. Cannot be used together with setMask().
Definition: NvInfer.h:6847
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6793
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:6973
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7013
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6805
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:6989
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7025
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7000
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:6903
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6822
bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:6859
apiv::VAttention * mImpl
Definition: NvInfer.h:7032
virtual ~IAttention() noexcept=default
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6696
virtual ~IAttentionInputLayer() noexcept=default
This layer represents an output of an IAttention.
Definition: NvInfer.h:6731
virtual ~IAttentionOutputLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9297
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9734
bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
Set one compute capability for runtime execution.
Definition: NvInfer.h:10118
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
Set the number of compute capabilities.
Definition: NvInfer.h:10088
TRT_DEPRECATED bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9690
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9771
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9785
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9830
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9628
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9873
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10029
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:10057
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9753
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9496
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9896
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9428
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9334
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9935
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9411
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10001
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:10069
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:9951
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9593
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9581
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9527
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9886
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9346
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:9989
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9517
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:9977
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10013
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9375
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9363
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9643
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9460
ComputeCapability getComputeCapability(int32_t index) const noexcept
Get one compute capability for runtime execution.
Definition: NvInfer.h:10132
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9486
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9860
int32_t getNbComputeCapabilities() const noexcept
Get the number of compute capabilities.
Definition: NvInfer.h:10100
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9387
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9568
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:9961
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:10138
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9321
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:9507
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9399
TRT_DEPRECATED nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9665
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9438
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9470
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9551
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9847
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:10041
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9925
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9606
TRT_DEPRECATED nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9702
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9450
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9818
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9539
Builds an engine from a network definition.
Definition: NvInfer.h:10191
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10210
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10317
apiv::VBuilder * mImpl
Definition: NvInfer.h:10445
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10399
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:10389
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10429
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10439
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10283
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10228
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10268
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10242
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10325
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10415
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10302
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10344
virtual ~IBuilder() noexcept=default
bool buildSerializedNetworkToStream(INetworkDefinition &network, IBuilderConfig &config, IStreamWriter &writer) noexcept
Builds and serializes a network into stream for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10365
A cast layer in a network.
Definition: NvInfer.h:3795
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3821
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3815
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3804
A concatenation layer in a network definition.
Definition: NvInfer.h:1975
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:1988
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:1998
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4458
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3834
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3844
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3854
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3866
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3884
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3878
A convolution layer in a network definition.
Definition: NvInfer.h:945
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1070
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1043
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1111
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1215
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1201
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1171
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1018
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1161
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1225
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:964
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1008
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1097
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:994
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1123
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:984
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:954
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1033
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1146
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1189
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1060
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1087
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1136
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6552
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6563
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6611
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6629
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6599
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6623
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6587
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6575
A deconvolution layer in a network definition.
Definition: NvInfer.h:2016
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2104
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2065
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2089
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2131
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2246
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2312
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2114
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2079
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2035
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2236
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2168
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2219
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2158
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2209
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2264
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2025
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2276
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2302
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2182
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2055
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2141
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2194
A Dequantize layer in a network definition.
Definition: NvInfer.h:5519
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5556
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5529
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5568
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5540
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5596
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5685
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5708
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5662
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5649
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5636
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5623
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5675
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5698
An Einsum layer in a network.
Definition: NvInfer.h:5753
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:5764
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5774
A elementwise layer in a network definition.
Definition: NvInfer.h:2386
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2415
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2409
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2397
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5045
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5277
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5091
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5081
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5306
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5220
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5254
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5144
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5235
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5269
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5125
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5056
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5110
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5294
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5071
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5159
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2519
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:2530
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2565
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2601
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2575
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2585
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2542
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2595
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:5975
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5982
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6028
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6004
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6046
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6040
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:5994
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6016
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:3782
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3784
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4437
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4442
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4520
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4561
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4586
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4531
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4549
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4576
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4488
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4475
virtual ~IIfConditionalOutputLayer() noexcept=default
A layer to do iterations.
Definition: NvInfer.h:4751
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4778
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4788
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4764
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4756
A LRN layer in a network definition.
Definition: NvInfer.h:1630
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1651
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1673
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1641
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1707
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1663
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1685
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1695
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1717
Base class for all layer classes in a network definition.
Definition: NvInfer.h:460
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:580
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:668
TRT_DEPRECATED bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:606
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:731
TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:713
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:481
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:499
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:744
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:683
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:592
TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:699
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:491
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:520
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:530
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:547
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:512
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:467
TRT_DEPRECATED void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:618
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1588
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4414
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4419
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4809
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4879
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4838
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4851
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:4864
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4889
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4817
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4651
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4681
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4656
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4673
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3629
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3657
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3651
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3639
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6127
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6164
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6138
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6150
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6209
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6227
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6174
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6221
A network definition for input to the builder.
Definition: NvInfer.h:7054
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:7282
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:7345
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8388
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7773
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7543
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:7125
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:7226
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8410
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:8075
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7634
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:7894
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7703
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:7973
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7787
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7872
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7446
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7416
TRT_DEPRECATED ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7509
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8198
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7854
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:8101
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:8004
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:8269
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:7173
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:7207
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7749
virtual ~INetworkDefinition() noexcept=default
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8449
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7388
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:7151
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7825
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:8019
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8175
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8506
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8325
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8362
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7400
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7813
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8242
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7472
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:7331
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:8303
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7718
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8487
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:8058
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:8218
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7374
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8533
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7842
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:7362
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:7252
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7730
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7688
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7575
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7650
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:7309
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7674
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8160
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7914
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8345
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7594
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7803
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:7559
IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:8437
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8474
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8462
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:7936
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7990
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8527
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7615
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:7265
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:7141
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:8285
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:7107
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:8117
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7430
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:8141
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:7187
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3683
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3707
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3695
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6316
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6335
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6355
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6325
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6422
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6428
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6386
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6345
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6412
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6376
A OneHot layer in a network definition.
Definition: NvInfer.h:5938
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5959
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5945
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5953
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2672
Layer that represents a padding operation.
Definition: NvInfer.h:2880
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2929
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2891
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:2917
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2903
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2935
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3898
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3900
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:139
Layer type for pluginV2.
Definition: NvInfer.h:2617
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2630
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2624
Layer type for V3 plugins.
Definition: NvInfer.h:2644
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2651
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2657
A Pooling layer in a network definition.
Definition: NvInfer.h:1379
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1398
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1531
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1507
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1451
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1479
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1388
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1544
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1520
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1554
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:1440
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1598
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1426
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1569
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1579
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1610
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1497
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1469
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1413
A Quantize layer in a network definition.
Definition: NvInfer.h:5391
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5428
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5412
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5401
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5440
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3732
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3734
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4604
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2800
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2847
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2807
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2817
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2837
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2827
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2863
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2857
A resize layer in a network definition.
Definition: NvInfer.h:4087
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4248
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4272
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:4166
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4107
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4304
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4147
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4314
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4258
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4188
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4223
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4327
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4178
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4117
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4282
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4337
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4233
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6244
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6277
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6264
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6293
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6287
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6254
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1776
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1833
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1853
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1823
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1843
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1793
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1803
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1889
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1813
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1783
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1868
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5866
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5873
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5907
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5893
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5901
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5883
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4912
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3405
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3407
Layer type for shuffling data.
Definition: NvInfer.h:2968
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3126
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2979
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3079
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3032
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3019
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2991
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3091
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3120
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3107
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3220
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3289
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3388
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3260
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3367
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3231
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3246
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3314
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3275
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3324
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3304
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3382
A Softmax layer in a network definition.
Definition: NvInfer.h:1920
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:1942
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:1952
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:6442
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6459
A tensor in a network definition.
Definition: NvInfer.h:185
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:336
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:233
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:202
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:401
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:214
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:380
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:306
TRT_DEPRECATED void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:283
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:314
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:298
apiv::VTensor * mImpl
Definition: NvInfer.h:448
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:427
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:442
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:247
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:349
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8855
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:8921
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8892
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:8938
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:8960
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8966
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8902
Layer that represents a TopK reduction.
Definition: NvInfer.h:3445
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3476
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3500
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3462
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3559
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3452
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3541
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3490
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3510
virtual ~ITopKLayer() noexcept=default
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3553
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4725
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4730
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2725
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2734
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2750
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2744
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6471
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6488
An Interface class for version control.
Definition: NvInferRuntimeBase.h:278
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:243
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInferRuntimeBase.h:415
Definition: NvInferRuntime.h:1656
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:9204
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.
Definition: NvInferRuntime.h:666
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:10468
The TensorRT-RTX API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2958
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3992
@ 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
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:8977
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1733
@ 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:8554
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9096
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6504
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6058
@ 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:8789
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:119
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:9145
@ 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:2678
@ 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:2787
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4393
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:138
@ 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:4973
@ 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:4022
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:911
@ 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:4381
@ 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:10148
PreviewFeature
Define preview features.
Definition: NvInfer.h:9052
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9171
@ 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:2437
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:145
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8586
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1350
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1745
LayerType
The type values of layer classes.
Definition: NvInfer.h:57
@ 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.
@ kATTENTION_INPUT
Attention Input.
@ 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.
@ kATTENTION_OUTPUT
Attention Output.
@ 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:3136
@ 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:2425
@ 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:130
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2970
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10159
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2335
@ 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:3152
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3910
@ 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:8596
@ 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:3428
TENSORRTAPI nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9038
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3417
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2773
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4370
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:10178
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5792
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3570
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3938
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2712
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4353
@ 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:6071
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3598
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1347
@ 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:9287
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5004
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6639
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5803
Represents a permutation of dimensions.
Definition: NvInfer.h:2945
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:8815
Definition: NvInfer.h:8829
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8831
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8833

  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