TensorRT-RTX 1.1.1
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h"
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110 kATTENTION_INPUT = 51,
111 kATTENTION_OUTPUT = 52,
112};
113
119template <>
120constexpr inline int32_t EnumMax<LayerType>() noexcept
121{
122 return 53;
123}
124
131using TensorFormats = uint32_t;
132
138enum class ActivationType : int32_t
139{
140 kRELU = 0,
141 kSIGMOID = 1,
142 kTANH = 2,
143 kLEAKY_RELU = 3,
144 kELU = 4,
145 kSELU = 5,
146 kSOFTSIGN = 6,
147 kSOFTPLUS = 7,
148 kCLIP = 8,
149 kHARD_SIGMOID = 9,
150 kSCALED_TANH = 10,
151 kTHRESHOLDED_RELU = 11,
152 kGELU_ERF = 12,
153 kGELU_TANH = 13
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
2621enum class UnaryOperation : int32_t
2622{
2623 kEXP = 0,
2624 kLOG = 1,
2625 kSQRT = 2,
2626 kRECIP = 3,
2627 kABS = 4,
2628 kNEG = 5,
2629 kSIN = 6,
2630 kCOS = 7,
2631 kTAN = 8,
2632 kSINH = 9,
2633 kCOSH = 10,
2634 kASIN = 11,
2635 kACOS = 12,
2636 kATAN = 13,
2637 kASINH = 14,
2638 kACOSH = 15,
2639 kATANH = 16,
2640 kCEIL = 17,
2641 kFLOOR = 18,
2642 kERF = 19,
2643 kNOT = 20,
2644 kSIGN = 21,
2645 kROUND = 22,
2646 kISINF = 23,
2647 kISNAN = 24,
2648};
2649
2655template <>
2656constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2657{
2658 return 25;
2659}
2660
2668class IUnaryLayer : public ILayer
2669{
2670public:
2679 {
2680 mImpl->setOperation(op);
2681 }
2682
2689 {
2690 return mImpl->getOperation();
2691 }
2692
2693protected:
2694 apiv::VUnaryLayer* mImpl;
2695 virtual ~IUnaryLayer() noexcept = default;
2696};
2697
2716enum class ReduceOperation : int32_t
2717{
2718 kSUM = 0,
2719 kPROD = 1,
2720 kMAX = 2,
2721 kMIN = 3,
2722 kAVG = 4
2723};
2724
2730template <>
2731constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2732{
2733 return 5;
2734}
2735
2743class IReduceLayer : public ILayer
2744{
2745public:
2752 {
2753 mImpl->setOperation(op);
2754 }
2755
2762 {
2763 return mImpl->getOperation();
2764 }
2765
2771 void setReduceAxes(uint32_t reduceAxes) noexcept
2772 {
2773 mImpl->setReduceAxes(reduceAxes);
2774 }
2775
2781 uint32_t getReduceAxes() const noexcept
2782 {
2783 return mImpl->getReduceAxes();
2784 }
2785
2791 void setKeepDimensions(bool keepDimensions) noexcept
2792 {
2793 mImpl->setKeepDimensions(keepDimensions);
2794 }
2795
2801 bool getKeepDimensions() const noexcept
2802 {
2803 return mImpl->getKeepDimensions();
2804 }
2805
2806protected:
2807 apiv::VReduceLayer* mImpl;
2808 virtual ~IReduceLayer() noexcept = default;
2809};
2810
2823class IPaddingLayer : public ILayer
2824{
2825public:
2835 void setPrePaddingNd(Dims const& padding) noexcept
2836 {
2837 mImpl->setPrePaddingNd(padding);
2838 }
2839
2847 Dims getPrePaddingNd() const noexcept
2848 {
2849 return mImpl->getPrePaddingNd();
2850 }
2851
2861 void setPostPaddingNd(Dims const& padding) noexcept
2862 {
2863 mImpl->setPostPaddingNd(padding);
2864 }
2865
2873 Dims getPostPaddingNd() const noexcept
2874 {
2875 return mImpl->getPostPaddingNd();
2876 }
2877
2878protected:
2879 apiv::VPaddingLayer* mImpl;
2880 virtual ~IPaddingLayer() noexcept = default;
2881};
2882
2889{
2896 int32_t order[Dims::MAX_DIMS];
2897};
2898
2911class IShuffleLayer : public ILayer
2912{
2913public:
2923 void setFirstTranspose(Permutation permutation) noexcept
2924 {
2925 mImpl->setFirstTranspose(permutation);
2926 }
2927
2936 {
2937 return mImpl->getFirstTranspose();
2938 }
2939
2963 void setReshapeDimensions(Dims const& dimensions) noexcept
2964 {
2965 mImpl->setReshapeDimensions(dimensions);
2966 }
2967
2977 {
2978 return mImpl->getReshapeDimensions();
2979 }
2980
2986 //
3009 using ILayer::setInput;
3010
3023 void setSecondTranspose(Permutation permutation) noexcept
3024 {
3025 mImpl->setSecondTranspose(permutation);
3026 }
3027
3036 {
3037 return mImpl->getSecondTranspose();
3038 }
3039
3051 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3052 {
3053 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3054 }
3055
3064 bool getZeroIsPlaceholder() const noexcept
3065 {
3066 return mImpl->getZeroIsPlaceholder();
3067 }
3068
3069protected:
3070 apiv::VShuffleLayer* mImpl;
3071 virtual ~IShuffleLayer() noexcept = default;
3072};
3073
3079enum class SampleMode : int32_t
3080{
3081 kSTRICT_BOUNDS = 0,
3082 kWRAP = 1,
3083 kCLAMP = 2,
3084 kFILL = 3,
3085 kREFLECT = 4,
3088};
3089
3095template <>
3096constexpr inline int32_t EnumMax<SampleMode>() noexcept
3097{
3098 return 5;
3099}
3100
3163class ISliceLayer : public ILayer
3164{
3165public:
3175 void setStart(Dims const& start) noexcept
3176 {
3177 mImpl->setStart(start);
3178 }
3179
3190 Dims getStart() const noexcept
3191 {
3192 return mImpl->getStart();
3193 }
3194
3204 void setSize(Dims const& size) noexcept
3205 {
3206 return mImpl->setSize(size);
3207 }
3208
3219 Dims getSize() const noexcept
3220 {
3221 return mImpl->getSize();
3222 }
3223
3233 void setStride(Dims const& stride) noexcept
3234 {
3235 mImpl->setStride(stride);
3236 }
3237
3248 Dims getStride() const noexcept
3249 {
3250 return mImpl->getStride();
3251 }
3252
3258 void setMode(SampleMode mode) noexcept
3259 {
3260 mImpl->setMode(mode);
3261 }
3262
3268 SampleMode getMode() const noexcept
3269 {
3270 return mImpl->getMode();
3271 }
3272
3300 using ILayer::setInput;
3301
3311 void setAxes(Dims const& axes) noexcept
3312 {
3313 mImpl->setAxes(axes);
3314 }
3315
3326 Dims getAxes() const noexcept
3327 {
3328 return mImpl->getAxes();
3329 }
3330
3331protected:
3332 apiv::VSliceLayer* mImpl;
3333 virtual ~ISliceLayer() noexcept = default;
3334};
3335
3348class IShapeLayer : public ILayer
3349{
3350protected:
3351 apiv::VShapeLayer* mImpl;
3352 virtual ~IShapeLayer() noexcept = default;
3353};
3354
3360enum class TopKOperation : int32_t
3361{
3362 kMAX = 0,
3363 kMIN = 1,
3364};
3365
3371template <>
3372constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3373{
3374 return 2;
3375}
3376
3388class ITopKLayer : public ILayer
3389{
3390public:
3396 void setOperation(TopKOperation op) noexcept
3397 {
3398 mImpl->setOperation(op);
3399 }
3400
3407 {
3408 return mImpl->getOperation();
3409 }
3410
3420 void setK(int32_t k) noexcept
3421 {
3422 mImpl->setK(k);
3423 }
3424
3434 int32_t getK() const noexcept
3435 {
3436 return mImpl->getK();
3437 }
3438
3444 void setReduceAxes(uint32_t reduceAxes) noexcept
3445 {
3446 mImpl->setReduceAxes(reduceAxes);
3447 }
3448
3454 uint32_t getReduceAxes() const noexcept
3455 {
3456 return mImpl->getReduceAxes();
3457 }
3458
3473 using ILayer::setInput;
3474
3485 bool setIndicesType(DataType type) noexcept
3486 {
3487 return mImpl->setIndicesType(type);
3488 }
3489
3497 DataType getIndicesType() const noexcept
3498 {
3499 return mImpl->getIndicesType();
3500 }
3501
3502protected:
3503 apiv::VTopKLayer* mImpl;
3504 virtual ~ITopKLayer() noexcept = default;
3505};
3506
3513enum class MatrixOperation : int32_t
3514{
3518 kNONE = 0,
3519
3521 kTRANSPOSE = 1,
3522
3533 kVECTOR = 2,
3534};
3535
3541template <>
3542constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3543{
3544 return 3;
3545}
3546
3573{
3574public:
3583 void setOperation(int32_t index, MatrixOperation op) noexcept
3584 {
3585 mImpl->setOperation(index, op);
3586 }
3587
3595 MatrixOperation getOperation(int32_t index) const noexcept
3596 {
3597 return mImpl->getOperation(index);
3598 }
3599
3600protected:
3601 apiv::VMatrixMultiplyLayer* mImpl;
3602 virtual ~IMatrixMultiplyLayer() noexcept = default;
3603};
3604
3626class INonZeroLayer : public ILayer
3627{
3628public:
3639 bool setIndicesType(DataType type) noexcept
3640 {
3641 return mImpl->setIndicesType(type);
3642 }
3643
3651 DataType getIndicesType() const noexcept
3652 {
3653 return mImpl->getIndicesType();
3654 }
3655
3656protected:
3657 virtual ~INonZeroLayer() noexcept = default;
3658 apiv::VNonZeroLayer* mImpl;
3659};
3660
3676{
3677protected:
3678 apiv::VRaggedSoftMaxLayer* mImpl;
3679 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3680};
3681
3726{
3727protected:
3728 apiv::VIdentityLayer* mImpl;
3729 virtual ~IIdentityLayer() noexcept = default;
3730};
3731
3738class ICastLayer : public ILayer
3739{
3740public:
3748 void setToType(DataType toType) noexcept
3749 {
3750 mImpl->setToType(toType);
3751 }
3752
3759 DataType getToType() const noexcept
3760 {
3761 return mImpl->getToType();
3762 }
3763
3764protected:
3765 apiv::VCastLayer* mImpl;
3766 virtual ~ICastLayer() noexcept = default;
3767};
3768
3778{
3779public:
3788 void setWeights(Weights weights) noexcept
3789 {
3790 mImpl->setWeights(weights);
3791 }
3792
3798 Weights getWeights() const noexcept
3799 {
3800 return mImpl->getWeights();
3801 }
3802
3810 void setDimensions(Dims const& dimensions) noexcept
3811 {
3812 mImpl->setDimensions(dimensions);
3813 }
3814
3822 Dims getDimensions() const noexcept
3823 {
3824 return mImpl->getDimensions();
3825 }
3826
3827protected:
3828 apiv::VConstantLayer* mImpl;
3829 virtual ~IConstantLayer() noexcept = default;
3830};
3831
3842{
3843protected:
3844 apiv::VParametricReLULayer* mImpl;
3845 virtual ~IParametricReLULayer() noexcept = default;
3846};
3847
3853enum class InterpolationMode : int32_t
3854{
3855 kNEAREST = 0,
3856 kLINEAR = 1,
3857 kCUBIC = 2
3858};
3859
3860namespace impl
3861{
3867template <>
3869{
3870 static constexpr int32_t kVALUE = 3;
3871};
3872} // namespace impl
3873
3882{
3895 kALIGN_CORNERS = 0,
3896
3903 kASYMMETRIC = 1,
3904
3911 kHALF_PIXEL = 2,
3912};
3913
3914namespace impl
3915{
3921template <>
3923{
3924 static constexpr int32_t kVALUE = 3;
3925};
3926} // namespace impl
3927
3935enum class ResizeSelector : int32_t
3936{
3938 kFORMULA = 0,
3939
3941 kUPPER = 1,
3942};
3943
3944namespace impl
3945{
3951template <>
3953{
3954 static constexpr int32_t kVALUE = 2;
3955};
3956} // namespace impl
3957
3965enum class ResizeRoundMode : int32_t
3966{
3968 kHALF_UP = 0,
3969
3971 kHALF_DOWN = 1,
3972
3974 kFLOOR = 2,
3975
3977 kCEIL = 3,
3978};
3979
3980namespace impl
3981{
3987template <>
3989{
3990 static constexpr int32_t kVALUE = 4;
3991};
3992} // namespace impl
3993
4030class IResizeLayer : public ILayer
4031{
4032public:
4051 void setOutputDimensions(Dims const& dimensions) noexcept
4052 {
4053 return mImpl->setOutputDimensions(dimensions);
4054 }
4055
4061 Dims getOutputDimensions() const noexcept
4062 {
4063 return mImpl->getOutputDimensions();
4064 }
4065
4091 void setScales(float const* scales, int32_t nbScales) noexcept
4092 {
4093 mImpl->setScales(scales, nbScales);
4094 }
4095
4110 int32_t getScales(int32_t size, float* scales) const noexcept
4111 {
4112 return mImpl->getScales(size, scales);
4113 }
4114
4122 void setResizeMode(InterpolationMode interpolationMode) noexcept
4123 {
4124 mImpl->setResizeMode(interpolationMode);
4125 }
4126
4133 {
4134 return mImpl->getResizeMode();
4135 }
4136
4156 using ILayer::setInput;
4157
4168 {
4169 mImpl->setCoordinateTransformation(coordTransform);
4170 }
4171
4178 {
4179 return mImpl->getCoordinateTransformation();
4180 }
4181
4193 {
4194 mImpl->setSelectorForSinglePixel(selector);
4195 }
4196
4203 {
4204 return mImpl->getSelectorForSinglePixel();
4205 }
4206
4217 {
4218 mImpl->setNearestRounding(value);
4219 }
4220
4227 {
4228 return mImpl->getNearestRounding();
4229 }
4230
4248 void setCubicCoeff(float A) noexcept
4249 {
4250 mImpl->setCubicCoeff(A);
4251 }
4252
4258 float getCubicCoeff() const noexcept
4259 {
4260 return mImpl->getCubicCoeff();
4261 }
4262
4271 void setExcludeOutside(bool excludeFlag) noexcept
4272 {
4273 mImpl->setExcludeOutside(excludeFlag);
4274 }
4275
4281 bool getExcludeOutside() const noexcept
4282 {
4283 return mImpl->getExcludeOutside();
4284 }
4285
4286protected:
4287 virtual ~IResizeLayer() noexcept = default;
4288 apiv::VResizeLayer* mImpl;
4289};
4290
4296enum class LoopOutput : int32_t
4297{
4299 kLAST_VALUE = 0,
4300
4302 kCONCATENATE = 1,
4303
4305 kREVERSE = 2
4306};
4307
4313template <>
4314constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4315{
4316 return 3;
4317}
4318
4324enum class TripLimit : int32_t
4325{
4326
4327 kCOUNT = 0,
4328 kWHILE = 1
4329};
4330
4336template <>
4337constexpr inline int32_t EnumMax<TripLimit>() noexcept
4338{
4339 return 2;
4340}
4341
4342class ILoop;
4343
4358{
4359public:
4363 ILoop* getLoop() const noexcept
4364 {
4365 return mBoundary->getLoop();
4366 }
4367
4368protected:
4369 virtual ~ILoopBoundaryLayer() noexcept = default;
4370 apiv::VLoopBoundaryLayer* mBoundary;
4371};
4372
4381{
4382public:
4387 {
4388 return mBoundary->getConditional();
4389 }
4390
4391protected:
4392 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4393 apiv::VConditionalBoundaryLayer* mBoundary;
4394};
4395
4402{
4403public:
4404protected:
4405 virtual ~IConditionLayer() noexcept = default;
4406 apiv::VConditionLayer* mImpl;
4407};
4408
4419{
4420public:
4421protected:
4422 virtual ~IIfConditionalOutputLayer() noexcept = default;
4423 apiv::VConditionalOutputLayer* mImpl;
4424};
4425
4432{
4433public:
4434protected:
4435 virtual ~IIfConditionalInputLayer() noexcept = default;
4436 apiv::VConditionalInputLayer* mImpl;
4437};
4438
4464{
4465public:
4476 {
4477 return mImpl->setCondition(condition);
4478 }
4479
4493 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4494 {
4495 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4496 }
4497
4506 {
4507 return mImpl->addInput(input);
4508 }
4509
4520 void setName(char const* name) noexcept
4521 {
4522 mImpl->setName(name);
4523 }
4524
4530 char const* getName() const noexcept
4531 {
4532 return mImpl->getName();
4533 }
4534
4535protected:
4536 virtual ~IIfConditional() noexcept = default;
4537 apiv::VIfConditional* mImpl;
4538};
4539
4548{
4549public:
4555 //
4568 using ILayer::setInput;
4569
4570protected:
4571 virtual ~IRecurrenceLayer() noexcept = default;
4572 apiv::VRecurrenceLayer* mImpl;
4573};
4574
4595{
4596public:
4600 LoopOutput getLoopOutput() const noexcept
4601 {
4602 return mImpl->getLoopOutput();
4603 }
4604
4617 void setAxis(int32_t axis) noexcept
4618 {
4619 mImpl->setAxis(axis);
4620 }
4621
4625 int32_t getAxis() const noexcept
4626 {
4627 return mImpl->getAxis();
4628 }
4629
4635 //
4650 using ILayer::setInput;
4651
4652protected:
4653 virtual ~ILoopOutputLayer() noexcept = default;
4654 apiv::VLoopOutputLayer* mImpl;
4655};
4656
4669{
4670public:
4674 TripLimit getTripLimit() const noexcept
4675 {
4676 return mImpl->getTripLimit();
4677 }
4678
4679protected:
4680 virtual ~ITripLimitLayer() noexcept = default;
4681 apiv::VTripLimitLayer* mImpl;
4682};
4683
4695{
4696public:
4700 void setAxis(int32_t axis) noexcept
4701 {
4702 mImpl->setAxis(axis);
4703 }
4704
4708 int32_t getAxis() const noexcept
4709 {
4710 return mImpl->getAxis();
4711 }
4712
4722 void setReverse(bool reverse) noexcept
4723 {
4724 mImpl->setReverse(reverse);
4725 }
4726
4732 bool getReverse() const noexcept
4733 {
4734 return mImpl->getReverse();
4735 }
4736
4737protected:
4738 virtual ~IIteratorLayer() noexcept = default;
4739 apiv::VIteratorLayer* mImpl;
4740};
4741
4752class ILoop : public INoCopy
4753{
4754public:
4761 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4762 {
4763 return mImpl->addRecurrence(initialValue);
4764 }
4765
4783 {
4784 return mImpl->addTripLimit(tensor, limit);
4785 }
4786
4795 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4796 {
4797 return mImpl->addIterator(tensor, axis, reverse);
4798 }
4799
4808 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4809 {
4810 return mImpl->addLoopOutput(tensor, outputKind, axis);
4811 }
4812
4823 void setName(char const* name) noexcept
4824 {
4825 mImpl->setName(name);
4826 }
4827
4833 char const* getName() const noexcept
4834 {
4835 return mImpl->getName();
4836 }
4837
4838protected:
4839 virtual ~ILoop() noexcept = default;
4840 apiv::VLoop* mImpl;
4841};
4842
4855class ISelectLayer : public ILayer
4856{
4857protected:
4858 virtual ~ISelectLayer() noexcept = default;
4859 apiv::VSelectLayer* mImpl;
4860};
4861
4878{
4879public:
4888 void setMessage(char const* message) noexcept
4889 {
4890 mImpl->setMessage(message);
4891 }
4892
4898 char const* getMessage() const noexcept
4899 {
4900 return mImpl->getMessage();
4901 }
4902
4903protected:
4904 virtual ~IAssertionLayer() noexcept = default;
4905
4906 apiv::VAssertionLayer* mImpl;
4907};
4908
4916enum class FillOperation : int32_t
4917{
4933 kLINSPACE = 0,
4934
4936 kRANDOM_UNIFORM = 1,
4937
4939 kRANDOM_NORMAL = 2
4940};
4941
4947template <>
4948constexpr inline int32_t EnumMax<FillOperation>() noexcept
4949{
4950 return 3;
4951}
4952
4988class IFillLayer : public ILayer
4989{
4990public:
4999 //
5000 void setDimensions(Dims const& dimensions) noexcept
5001 {
5002 mImpl->setDimensions(dimensions);
5003 }
5004
5015 Dims getDimensions() const noexcept
5016 {
5017 return mImpl->getDimensions();
5018 }
5019
5025 void setOperation(FillOperation op) noexcept
5026 {
5027 mImpl->setOperation(op);
5028 }
5029
5036 {
5037 return mImpl->getOperation();
5038 }
5039
5053 //
5054 void setAlpha(double alpha) noexcept
5055 {
5056 mImpl->setAlpha(alpha);
5057 }
5058
5069 double getAlpha() const noexcept
5070 {
5071 return mImpl->getAlpha();
5072 }
5073
5088 void setBeta(double beta) noexcept
5089 {
5090 mImpl->setBeta(beta);
5091 }
5092
5103 double getBeta() const noexcept
5104 {
5105 return mImpl->getBeta();
5106 }
5107
5148 using ILayer::setInput;
5149
5163 //
5164 void setAlphaInt64(int64_t alpha) noexcept
5165 {
5166 mImpl->setAlphaInt64(alpha);
5167 }
5168
5179 int64_t getAlphaInt64() const noexcept
5180 {
5181 return mImpl->getAlphaInt64();
5182 }
5183
5198 void setBetaInt64(int64_t beta) noexcept
5199 {
5200 mImpl->setBetaInt64(beta);
5201 }
5202
5213 int64_t getBetaInt64() const noexcept
5214 {
5215 return mImpl->getBetaInt64();
5216 }
5217
5221 bool isAlphaBetaInt64() const noexcept
5222 {
5223 return mImpl->isAlphaBetaInt64();
5224 }
5225
5238 void setToType(DataType toType) noexcept
5239 {
5240 mImpl->setToType(toType);
5241 }
5242
5250 DataType getToType() const noexcept
5251 {
5252 return mImpl->getToType();
5253 }
5254
5255protected:
5256 virtual ~IFillLayer() noexcept = default;
5257 apiv::VFillLayer* mImpl;
5258};
5259
5335{
5336public:
5345 int32_t getAxis() const noexcept
5346 {
5347 return mImpl->getAxis();
5348 }
5356 void setAxis(int32_t axis) noexcept
5357 {
5358 mImpl->setAxis(axis);
5359 }
5360
5372 void setToType(DataType toType) noexcept
5373 {
5374 mImpl->setToType(toType);
5375 }
5376
5384 DataType getToType() const noexcept
5385 {
5386 return mImpl->getToType();
5387 }
5388
5389protected:
5390 virtual ~IQuantizeLayer() noexcept = default;
5391 apiv::VQuantizeLayer* mImpl;
5392};
5393
5463{
5464public:
5473 int32_t getAxis() const noexcept
5474 {
5475 return mImpl->getAxis();
5476 }
5484 void setAxis(int32_t axis) noexcept
5485 {
5486 mImpl->setAxis(axis);
5487 }
5488
5500 void setToType(DataType toType) noexcept
5501 {
5502 mImpl->setToType(toType);
5503 }
5504
5512 DataType getToType() const noexcept
5513 {
5514 return mImpl->getToType();
5515 }
5516
5517protected:
5518 virtual ~IDequantizeLayer() noexcept = default;
5519 apiv::VDequantizeLayer* mImpl;
5520};
5521
5540{
5541public:
5553 using ILayer::setInput;
5554
5567 void setToType(DataType toType) noexcept
5568 {
5569 mImpl->setToType(toType);
5570 }
5571
5580 DataType getToType() const noexcept
5581 {
5582 return mImpl->getToType();
5583 }
5584
5593 void setScaleType(DataType scaleType) noexcept
5594 {
5595 mImpl->setScaleType(scaleType);
5596 }
5597
5606 DataType getScaleType() const noexcept
5607 {
5608 return mImpl->getScaleType();
5609 }
5610
5619 void setAxis(int32_t axis) noexcept
5620 {
5621 mImpl->setAxis(axis);
5622 }
5623
5629 int32_t getAxis() const noexcept
5630 {
5631 return mImpl->getAxis();
5632 }
5633
5642 void setBlockSize(int32_t size) noexcept
5643 {
5644 mImpl->setBlockSize(size);
5645 }
5646
5652 int32_t getBlockSize() const noexcept
5653 {
5654 return mImpl->getBlockSize();
5655 }
5656
5657protected:
5658 virtual ~IDynamicQuantizeLayer() noexcept = default;
5659 apiv::VDynamicQuantizeLayer* mImpl;
5660};
5661
5696class IEinsumLayer : public ILayer
5697{
5698public:
5708 bool setEquation(char const* equation) noexcept
5709 {
5710 return mImpl->setEquation(equation);
5711 }
5712
5718 char const* getEquation() const noexcept
5719 {
5720 return mImpl->getEquation();
5721 }
5722
5723protected:
5724 virtual ~IEinsumLayer() noexcept = default;
5725 apiv::VEinsumLayer* mImpl;
5726};
5727
5735enum class ScatterMode : int32_t
5736{
5737 kELEMENT = 0,
5738 kND = 1,
5739};
5740
5746template <>
5747constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5748{
5749 return 2;
5750}
5751
5809class IScatterLayer : public ILayer
5810{
5811public:
5817 void setMode(ScatterMode mode) noexcept
5818 {
5819 mImpl->setMode(mode);
5820 }
5821
5827 ScatterMode getMode() const noexcept
5828 {
5829 return mImpl->getMode();
5830 }
5831
5837 void setAxis(int32_t axis) noexcept
5838 {
5839 mImpl->setAxis(axis);
5840 }
5841
5845 int32_t getAxis() const noexcept
5846 {
5847 return mImpl->getAxis();
5848 }
5849
5850protected:
5851 apiv::VScatterLayer* mImpl;
5852 virtual ~IScatterLayer() noexcept = default;
5853}; // class IScatterLayer
5854
5881class IOneHotLayer : public ILayer
5882{
5883public:
5889 void setAxis(int32_t axis) noexcept
5890 {
5891 mImpl->setAxis(axis);
5892 }
5893
5897 int32_t getAxis() const noexcept
5898 {
5899 return mImpl->getAxis();
5900 }
5901
5902protected:
5903 apiv::VOneHotLayer* mImpl;
5904 virtual ~IOneHotLayer() noexcept = default;
5905};
5906
5919{
5920public:
5927 {
5928 mImpl->setInterpolationMode(mode);
5929 }
5930
5939 {
5940 return mImpl->getInterpolationMode();
5941 }
5942
5948 void setAlignCorners(bool alignCorners) noexcept
5949 {
5950 mImpl->setAlignCorners(alignCorners);
5951 }
5952
5960 bool getAlignCorners() const noexcept
5961 {
5962 return mImpl->getAlignCorners();
5963 }
5964
5972 bool setSampleMode(SampleMode mode) noexcept
5973 {
5974 return mImpl->setSampleMode(mode);
5975 }
5976
5984 SampleMode getSampleMode() const noexcept
5985 {
5986 return mImpl->getSampleMode();
5987 }
5988
5989protected:
5990 apiv::VGridSampleLayer* mImpl;
5991 virtual ~IGridSampleLayer() noexcept = default;
5992}; // class IGridSampleLayer
5993
6001enum class BoundingBoxFormat : int32_t
6002{
6004 kCORNER_PAIRS = 0,
6006 kCENTER_SIZES = 1
6007};
6008
6014template <>
6015constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6016{
6017 return 2;
6018}
6019
6070class INMSLayer : public ILayer
6071{
6072public:
6083 {
6084 mImpl->setBoundingBoxFormat(fmt);
6085 }
6086
6095 {
6096 return mImpl->getBoundingBoxFormat();
6097 }
6098
6108 void setTopKBoxLimit(int32_t limit) noexcept
6109 {
6110 mImpl->setTopKBoxLimit(limit);
6111 }
6112
6118 int32_t getTopKBoxLimit() const noexcept
6119 {
6120 return mImpl->getTopKBoxLimit();
6121 }
6122
6141 using ILayer::setInput;
6142
6153 bool setIndicesType(DataType type) noexcept
6154 {
6155 return mImpl->setIndicesType(type);
6156 }
6157
6165 DataType getIndicesType() const noexcept
6166 {
6167 return mImpl->getIndicesType();
6168 }
6169
6170protected:
6171 apiv::VNMSLayer* mImpl;
6172 virtual ~INMSLayer() noexcept = default;
6173}; // class INMSLayer
6174
6188{
6189public:
6198 void setBatchAxis(int32_t batchAxis) noexcept
6199 {
6200 mImpl->setBatchAxis(batchAxis);
6201 }
6202
6208 int32_t getBatchAxis() const noexcept
6209 {
6210 return mImpl->getBatchAxis();
6211 }
6212
6221 void setSequenceAxis(int32_t sequenceAxis) noexcept
6222 {
6223 mImpl->setSequenceAxis(sequenceAxis);
6224 }
6225
6231 int32_t getSequenceAxis() const noexcept
6232 {
6233 return mImpl->getSequenceAxis();
6234 }
6235
6236protected:
6237 apiv::VReverseSequenceLayer* mImpl;
6238 virtual ~IReverseSequenceLayer() noexcept = default;
6239}; // class IReverseSequenceLayer
6240
6260{
6261public:
6269 void setEpsilon(float eps) noexcept
6270 {
6271 return mImpl->setEpsilon(eps);
6272 }
6273
6279 float getEpsilon() const noexcept
6280 {
6281 return mImpl->getEpsilon();
6282 }
6283
6289 void setAxes(uint32_t axesMask) noexcept
6290 {
6291 return mImpl->setAxes(axesMask);
6292 }
6293
6299 uint32_t getAxes() const noexcept
6300 {
6301 return mImpl->getAxes();
6302 }
6303
6320 void setNbGroups(int64_t nbGroups) noexcept
6321 {
6322 return mImpl->setNbGroups(nbGroups);
6323 }
6324
6330 int64_t getNbGroups() const noexcept
6331 {
6332 return mImpl->getNbGroups();
6333 }
6334
6356 void setComputePrecision(DataType type) noexcept
6357 {
6358 return mImpl->setComputePrecision(type);
6359 }
6360
6367 {
6368 return mImpl->getComputePrecision();
6369 }
6370
6371protected:
6372 apiv::VNormalizationLayer* mImpl;
6373 virtual ~INormalizationLayer() noexcept = default;
6374};
6375
6376
6385class ISqueezeLayer : public ILayer
6386{
6387public:
6400 using ILayer::setInput;
6401
6402protected:
6403 apiv::VSqueezeLayer* mImpl;
6404 virtual ~ISqueezeLayer() noexcept = default;
6405};
6406
6415{
6416public:
6429 using ILayer::setInput;
6430
6431protected:
6432 apiv::VUnsqueezeLayer* mImpl;
6433 virtual ~IUnsqueezeLayer() noexcept = default;
6434};
6435
6447enum class CumulativeOperation : int32_t
6448{
6449 kSUM = 0,
6450};
6451
6452namespace impl
6453{
6454
6460template <>
6462{
6463 static constexpr int32_t kVALUE = 1;
6464};
6465
6466} // namespace impl
6467
6496{
6497public:
6508 {
6509 return mImpl->setOperation(op);
6510 }
6511
6520 {
6521 return mImpl->getOperation();
6522 }
6523
6531 void setExclusive(bool exclusive) noexcept
6532 {
6533 mImpl->setExclusive(exclusive);
6534 }
6535
6543 bool getExclusive() const noexcept
6544 {
6545 return mImpl->getExclusive();
6546 }
6547
6555 void setReverse(bool reverse) noexcept
6556 {
6557 mImpl->setReverse(reverse);
6558 }
6559
6567 bool getReverse() const noexcept
6568 {
6569 return mImpl->getReverse();
6570 }
6571
6572protected:
6573 apiv::VCumulativeLayer* mImpl;
6574 virtual ~ICumulativeLayer() noexcept = default;
6575};
6576
6582enum class AttentionNormalizationOp : int32_t
6583{
6584 kNONE
6585 = 0,
6586 kSOFTMAX = 1,
6587};
6588
6589namespace impl
6590{
6596template <>
6598{
6599 static constexpr int32_t kVALUE = 2;
6600};
6601
6602} // namespace impl
6603
6614{
6615public:
6619 IAttention* getAttention() const noexcept
6620 {
6621 return mBoundary->getAttention();
6622 }
6623
6624protected:
6625 virtual ~IAttentionBoundaryLayer() noexcept = default;
6626 apiv::VAttentionBoundaryLayer* mBoundary;
6627};
6628
6640{
6641public:
6655 using ILayer::setInput;
6656
6657protected:
6658 virtual ~IAttentionInputLayer() noexcept = default;
6659 apiv::VAttentionInputLayer* mImpl;
6660};
6661
6673{
6674public:
6675protected:
6676 virtual ~IAttentionOutputLayer() noexcept = default;
6677 apiv::VAttentionOutputLayer* mImpl;
6678};
6679
6721class IAttention : public INoCopy
6722{
6723public:
6732 {
6733 return mImpl->setNormalizationOperation(op);
6734 }
6735
6744 {
6745 return mImpl->getNormalizationOperation();
6746 }
6747
6760 bool setMask(ITensor& mask) noexcept
6761 {
6762 return mImpl->setMask(mask);
6763 }
6764
6772 ITensor* getMask() noexcept
6773 {
6774 return mImpl->getMask();
6775 }
6776
6785 bool setCausal(bool isCausal) noexcept
6786 {
6787 return mImpl->setCausal(isCausal);
6788 }
6789
6797 bool getCausal() const noexcept
6798 {
6799 return mImpl->getCausal();
6800 }
6801
6809 bool setDecomposable(bool decomposable) noexcept
6810 {
6811 return mImpl->setDecomposable(decomposable);
6812 }
6813
6822 bool getDecomposable() const noexcept
6823 {
6824 return mImpl->getDecomposable();
6825 }
6826
6841 bool setInput(int32_t index, ITensor& input) noexcept
6842 {
6843 return mImpl->setInput(index, input);
6844 }
6845
6850 int32_t getNbInputs() const noexcept
6851 {
6852 return mImpl->getNbInputs();
6853 }
6854
6862 ITensor* getInput(int32_t index) const noexcept
6863 {
6864 return mImpl->getInput(index);
6865 }
6866
6870 int32_t getNbOutputs() const noexcept
6871 {
6872 return mImpl->getNbOutputs();
6873 }
6874
6882 ITensor* getOutput(int32_t index) const noexcept
6883 {
6884 return mImpl->getOutput(index);
6885 }
6886
6899 bool setName(char const* name) noexcept
6900 {
6901 return mImpl->setName(name);
6902 }
6903
6911 char const* getName() const noexcept
6912 {
6913 return mImpl->getName();
6914 }
6915
6916protected:
6917 apiv::VAttention* mImpl;
6918 virtual ~IAttention() noexcept = default;
6919};
6920
6939{
6940public:
6941 virtual ~INetworkDefinition() noexcept = default;
6942
6978 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6979 {
6980 return mImpl->addInput(name, type, dimensions);
6981 }
6982
6992 void markOutput(ITensor& tensor) noexcept
6993 {
6994 mImpl->markOutput(tensor);
6995 }
6996
7010 bool markDebug(ITensor& tensor) noexcept
7011 {
7012 return mImpl->markDebug(tensor);
7013 }
7014
7026 bool unmarkDebug(ITensor& tensor) noexcept
7027 {
7028 return mImpl->unmarkDebug(tensor);
7029 }
7030
7036 bool isDebugTensor(ITensor const& tensor) const noexcept
7037 {
7038 return mImpl->isDebugTensor(tensor);
7039 }
7040
7059 {
7060 return mImpl->markUnfusedTensorsAsDebugTensors();
7061 }
7062
7073 {
7074 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
7075 }
7076
7093 {
7094 return mImpl->addActivation(input, type);
7095 }
7096
7111 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
7112 {
7113 return mImpl->addLRN(input, window, alpha, beta, k);
7114 }
7115
7137 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
7138 {
7139 return mImpl->addScale(input, mode, shift, scale, power);
7140 }
7141
7151 {
7152 return mImpl->addSoftMax(input);
7153 }
7154
7167 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
7168 {
7169 return mImpl->addConcatenation(inputs, nbInputs);
7170 }
7171
7195 {
7196 return mImpl->addElementWise(input1, input2, op);
7197 }
7198
7216 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
7217 {
7218 return mImpl->addUnary(input, operation);
7219 }
7220
7231 {
7232 return mImpl->addShuffle(input);
7233 }
7234
7247 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
7248 {
7249 return mImpl->addOneHot(indices, values, depth, axis);
7250 }
7251
7259 int32_t getNbLayers() const noexcept
7260 {
7261 return mImpl->getNbLayers();
7262 }
7263
7273 ILayer* getLayer(int32_t index) const noexcept
7274 {
7275 return mImpl->getLayer(index);
7276 }
7277
7285 int32_t getNbInputs() const noexcept
7286 {
7287 return mImpl->getNbInputs();
7288 }
7289
7301 ITensor* getInput(int32_t index) const noexcept
7302 {
7303 return mImpl->getInput(index);
7304 }
7305
7315 int32_t getNbOutputs() const noexcept
7316 {
7317 return mImpl->getNbOutputs();
7318 }
7319
7331 ITensor* getOutput(int32_t index) const noexcept
7332 {
7333 return mImpl->getOutput(index);
7334 }
7335
7358 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7359 {
7360 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7361 }
7362
7394 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7395 {
7396 return mImpl->addTopK(input, op, k, reduceAxes);
7397 }
7398
7428 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
7429 {
7430 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
7431 }
7432
7444 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7445 {
7446 return mImpl->addGather(data, indices, axis);
7447 }
7448
7460 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7461 {
7462 return mImpl->addGatherV2(data, indices, mode);
7463 }
7464
7480 {
7481 return mImpl->addRaggedSoftMax(input, bounds);
7482 }
7483
7501 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7502 {
7503 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7504 }
7505
7520 {
7521 return mImpl->addNonZero(input);
7522 }
7523
7535 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
7536 {
7537 return mImpl->addNonZeroV2(input, indicesType);
7538 }
7539
7559 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7560 {
7561 return mImpl->addConstant(dimensions, weights);
7562 }
7563
7574 {
7575 return mImpl->addIdentity(input);
7576 }
7577
7588 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7589 {
7590 return mImpl->addCast(input, toType);
7591 }
7592
7603 void removeTensor(ITensor& tensor) noexcept
7604 {
7605 mImpl->removeTensor(tensor);
7606 }
7607
7615 void unmarkOutput(ITensor& tensor) noexcept
7616 {
7617 mImpl->unmarkOutput(tensor);
7618 }
7619
7634 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7635 {
7636 return mImpl->addSlice(input, start, size, stride);
7637 }
7638
7658 void setName(char const* name) noexcept
7659 {
7660 mImpl->setName(name);
7661 }
7662
7672 char const* getName() const noexcept
7673 {
7674 return mImpl->getName();
7675 }
7676
7688 IShapeLayer* addShape(ITensor& input) noexcept
7689 {
7690 return mImpl->addShape(input);
7691 }
7692
7699 {
7700 return mImpl->getFlags();
7701 }
7702
7710 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7711 {
7712 return mImpl->getFlag(networkDefinitionCreationFlag);
7713 }
7714
7727 bool markOutputForShapes(ITensor& tensor) noexcept
7728 {
7729 return mImpl->markOutputForShapes(tensor);
7730 }
7731
7739 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7740 {
7741 return mImpl->unmarkOutputForShapes(tensor);
7742 }
7743
7758 {
7759 return mImpl->addParametricReLU(input, slope);
7760 }
7761
7780 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7781 {
7782 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7783 }
7784
7799 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7800 {
7801 return mImpl->addPoolingNd(input, type, windowSize);
7802 }
7803
7818 //
7822 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7823 {
7824 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7825 }
7826
7859 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7860 {
7861 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7862 }
7863
7876 {
7877 return mImpl->addResize(input);
7878 }
7879
7889 ILoop* addLoop() noexcept
7890 {
7891 return mImpl->addLoop();
7892 }
7893
7905 {
7906 return mImpl->addIfConditional();
7907 }
7908
7943 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7944 {
7945 return mImpl->addSelect(condition, thenInput, elseInput);
7946 }
7947
7960 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7961 {
7962 return mImpl->addAssertion(condition, message);
7963 }
7964
7986 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7987 {
7988 return mImpl->addFillV2(dimensions, op, outputType);
7989 }
7990
8002 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
8003 {
8004 return mImpl->addPaddingNd(input, prePadding, postPadding);
8005 }
8006
8026 bool setWeightsName(Weights weights, char const* name) noexcept
8027 {
8028 return mImpl->setWeightsName(weights, name);
8029 }
8030
8042 //
8045 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8046 {
8047 mImpl->setErrorRecorder(recorder);
8048 }
8049
8061 {
8062 return mImpl->getErrorRecorder();
8063 }
8064
8083 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8084 {
8085 return mImpl->addDequantizeV2(input, scale, outputType);
8086 }
8087
8103 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
8104 {
8105 return mImpl->addScatter(data, indices, updates, mode);
8106 }
8107
8127 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8128 {
8129 return mImpl->addQuantizeV2(input, scale, outputType);
8130 }
8131
8155 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
8156 {
8157 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
8158 }
8159
8170 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
8171 {
8172 return mImpl->addEinsum(inputs, nbInputs, equation);
8173 }
8174
8189 {
8190 return mImpl->addGridSample(input, grid);
8191 }
8192
8210 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8211 {
8212 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8213 }
8214
8230 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
8231 {
8232 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
8233 }
8234
8248 {
8249 return mImpl->addReverseSequence(input, sequenceLens);
8250 }
8251
8273 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8274 {
8275 return mImpl->addNormalization(input, scale, bias, axesMask);
8276 }
8277
8295 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8296 {
8297 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8298 }
8299
8323 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
8324 {
8325 return mImpl->addAttention(query, key, value, normOp, causal);
8326 }
8327
8334 virtual IBuilder& getBuilder() const noexcept
8335 {
8336 return mImpl->getBuilder();
8337 }
8338
8347 bool markWeightsRefittable(char const* name) noexcept
8348 {
8349 return mImpl->markWeightsRefittable(name);
8350 }
8351
8359 bool unmarkWeightsRefittable(char const* name) noexcept
8360 {
8361 return mImpl->unmarkWeightsRefittable(name);
8362 }
8363
8372 bool areWeightsMarkedRefittable(char const* name) const noexcept
8373 {
8374 return mImpl->areWeightsMarkedRefittable(name);
8375 }
8376
8391 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8392 {
8393 return mImpl->addSqueeze(input, axes);
8394 }
8395
8413 {
8414 return mImpl->addUnsqueeze(input, axes);
8415 }
8416protected:
8417 apiv::VNetworkDefinition* mImpl;
8418};
8419
8437enum class RuntimePlatform : int32_t
8438{
8441 kSAME_AS_BUILD = 0,
8442
8445 kWINDOWS_AMD64 = 1,
8446};
8447
8448namespace impl
8449{
8455template <>
8457{
8458 static constexpr int32_t kVALUE = 2;
8459};
8460} // namespace impl
8461
8468using BuilderFlags = uint32_t;
8469
8477enum class BuilderFlag : int32_t
8478{
8482
8486
8488 kDEBUG = 2,
8489
8491 kGPU_FALLBACK = 3,
8492
8494 kREFIT = 4,
8495
8498
8502 kTF32 = 6,
8503
8505 kSPARSE_WEIGHTS = 7,
8506
8513 kSAFETY_SCOPE = 8,
8514
8518
8523
8529
8533
8540
8546
8554
8558
8563
8569
8571 kSTRIP_PLAN = 19,
8572
8575
8582 kREFIT_IDENTICAL = 20,
8583
8609 kWEIGHT_STREAMING = 21,
8610
8614
8619 kREFIT_INDIVIDUAL = 23,
8620
8629 kSTRICT_NANS = 24,
8630
8632 kMONITOR_MEMORY = 25,
8633
8637
8640
8652};
8653
8659template <>
8660constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8661{
8662 return 29;
8663}
8664
8665namespace v_1_0
8666{
8680{
8681 uint8_t data[16];
8682};
8683
8692{
8694 uint64_t tacticHash;
8698 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8699};
8700} // namespace v_1_0
8701
8715class ITimingCache : public INoCopy
8716{
8717public:
8718 virtual ~ITimingCache() noexcept = default;
8719
8729 nvinfer1::IHostMemory* serialize() const noexcept
8730 {
8731 return mImpl->serialize();
8732 }
8733
8753 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8754 {
8755 return mImpl->combine(inputCache, ignoreMismatch);
8756 }
8757
8763 bool reset() noexcept
8764 {
8765 return mImpl->reset();
8766 }
8767
8782 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
8783 {
8784 return mImpl->queryKeys(keyBuffer, capacity);
8785 }
8786
8799 TimingCacheValue query(TimingCacheKey const& key) const noexcept
8800 {
8801 return mImpl->query(key);
8802 }
8803
8821 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
8822 {
8823 return mImpl->update(key, value);
8824 }
8825
8826protected:
8827 apiv::VTimingCache* mImpl;
8828};
8829
8837enum class MemoryPoolType : int32_t
8838{
8845 kWORKSPACE = 0,
8846
8854
8860 kDLA_LOCAL_DRAM = 2,
8861
8867 kDLA_GLOBAL_DRAM = 3,
8868
8876 kTACTIC_DRAM = 4,
8877
8891};
8892
8898template <>
8899constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
8900{
8901 return 6;
8902}
8903
8912enum class PreviewFeature : int32_t
8913{
8920
8925
8932};
8933
8934namespace impl
8935{
8941template <>
8943{
8944 static constexpr int32_t kVALUE = 3;
8945};
8946} // namespace impl
8947
8956enum class HardwareCompatibilityLevel : int32_t
8957{
8960 kNONE = 0,
8961
8973 kAMPERE_PLUS = 1,
8974
8984};
8985
8986namespace impl
8987{
8993template <>
8995{
8996 static constexpr int32_t kVALUE = 3;
8997};
8998} // namespace impl
8999
9005enum class ComputeCapability : int32_t
9006{
9008 kNONE = 0,
9010 kCURRENT = 1,
9012 kSM75 = 75,
9014 kSM80 = 80,
9016 kSM86 = 86,
9018 kSM89 = 89,
9020 kSM120 = 120,
9021};
9022
9031enum class TilingOptimizationLevel : int32_t
9032{
9034 kNONE = 0,
9035
9037 kFAST = 1,
9038
9041 kMODERATE = 2,
9042
9044 kFULL = 3
9045
9046};
9047
9048namespace impl
9049{
9055template <>
9057{
9058 static constexpr int32_t kVALUE = 4;
9059};
9060} // namespace impl
9061
9062namespace v_1_0
9063{
9065{
9066public:
9067 IProgressMonitor() = default;
9068 virtual ~IProgressMonitor() noexcept = default;
9069
9073 InterfaceInfo getInterfaceInfo() const noexcept override
9074 {
9075 return InterfaceInfo{"IProgressMonitor", 1, 0};
9076 }
9077
9097 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9098
9111 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9112
9124 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9125
9126}; // class IProgressMonitor
9127} // namespace v_1_0
9128
9149
9158{
9159public:
9160 virtual ~IBuilderConfig() noexcept = default;
9161
9170 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9171 {
9172 mImpl->setAvgTimingIterations(avgTiming);
9173 }
9174
9182 int32_t getAvgTimingIterations() const noexcept
9183 {
9184 return mImpl->getAvgTimingIterations();
9185 }
9186
9195 void setEngineCapability(EngineCapability capability) noexcept
9196 {
9197 mImpl->setEngineCapability(capability);
9198 }
9199
9208 {
9209 return mImpl->getEngineCapability();
9210 }
9211
9224 void setFlags(BuilderFlags builderFlags) noexcept
9225 {
9226 mImpl->setFlags(builderFlags);
9227 }
9228
9236 BuilderFlags getFlags() const noexcept
9237 {
9238 return mImpl->getFlags();
9239 }
9240
9248 void clearFlag(BuilderFlag builderFlag) noexcept
9249 {
9250 mImpl->clearFlag(builderFlag);
9251 }
9252
9260 void setFlag(BuilderFlag builderFlag) noexcept
9261 {
9262 mImpl->setFlag(builderFlag);
9263 }
9264
9272 bool getFlag(BuilderFlag builderFlag) const noexcept
9273 {
9274 return mImpl->getFlag(builderFlag);
9275 }
9276
9289 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9290 {
9291 mImpl->setDeviceType(layer, deviceType);
9292 }
9293
9299 DeviceType getDeviceType(ILayer const* layer) const noexcept
9300 {
9301 return mImpl->getDeviceType(layer);
9302 }
9303
9311 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9312 {
9313 return mImpl->isDeviceTypeSet(layer);
9314 }
9315
9321 void resetDeviceType(ILayer const* layer) noexcept
9322 {
9323 mImpl->resetDeviceType(layer);
9324 }
9325
9331 bool canRunOnDLA(ILayer const* layer) const noexcept
9332 {
9333 return mImpl->canRunOnDLA(layer);
9334 }
9335
9347 void setDLACore(int32_t dlaCore) noexcept
9348 {
9349 mImpl->setDLACore(dlaCore);
9350 }
9351
9357 int32_t getDLACore() const noexcept
9358 {
9359 return mImpl->getDLACore();
9360 }
9361
9368 void setDefaultDeviceType(DeviceType deviceType) noexcept
9369 {
9370 mImpl->setDefaultDeviceType(deviceType);
9371 }
9372
9379 {
9380 return mImpl->getDefaultDeviceType();
9381 }
9382
9388 void reset() noexcept
9389 {
9390 mImpl->reset();
9391 }
9392
9400 void setProfileStream(const cudaStream_t stream) noexcept
9401 {
9402 return mImpl->setProfileStream(stream);
9403 }
9404
9412 cudaStream_t getProfileStream() const noexcept
9413 {
9414 return mImpl->getProfileStream();
9415 }
9416
9429 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9430 {
9431 return mImpl->addOptimizationProfile(profile);
9432 }
9433
9442 int32_t getNbOptimizationProfiles() const noexcept
9443 {
9444 return mImpl->getNbOptimizationProfiles();
9445 }
9446
9455 {
9456 mImpl->setProfilingVerbosity(verbosity);
9457 }
9458
9468 {
9469 return mImpl->getProfilingVerbosity();
9470 }
9471
9489 bool setTacticSources(TacticSources tacticSources) noexcept
9490 {
9491 return mImpl->setTacticSources(tacticSources);
9492 }
9493
9505 {
9506 return mImpl->getTacticSources();
9507 }
9508
9524 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9525 {
9526 return mImpl->createTimingCache(blob, size);
9527 }
9528
9547 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9548 {
9549 return mImpl->setTimingCache(cache, ignoreMismatch);
9550 }
9551
9558 {
9559 return mImpl->getTimingCache();
9560 }
9561
9589 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9590 {
9591 mImpl->setMemoryPoolLimit(pool, poolSize);
9592 }
9593
9608 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9609 {
9610 return mImpl->getMemoryPoolLimit(pool);
9611 }
9612
9626 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9627 {
9628 mImpl->setPreviewFeature(feature, enable);
9629 }
9630
9640 bool getPreviewFeature(PreviewFeature feature) const noexcept
9641 {
9642 return mImpl->getPreviewFeature(feature);
9643 }
9644
9673 void setBuilderOptimizationLevel(int32_t level) noexcept
9674 {
9675 mImpl->setBuilderOptimizationLevel(level);
9676 }
9677
9686 {
9687 return mImpl->getBuilderOptimizationLevel();
9688 }
9689
9702 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9703 {
9704 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9705 }
9706
9716 {
9717 return mImpl->getHardwareCompatibilityLevel();
9718 }
9719
9728 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9729 {
9730 mImpl->setPluginsToSerialize(paths, nbPaths);
9731 }
9732
9741 char const* getPluginToSerialize(int32_t index) const noexcept
9742 {
9743 return mImpl->getPluginToSerialize(index);
9744 }
9745
9751 int32_t getNbPluginsToSerialize() const noexcept
9752 {
9753 return mImpl->getNbPluginsToSerialize();
9754 }
9755
9780 void setMaxAuxStreams(int32_t nbStreams) noexcept
9781 {
9782 mImpl->setMaxAuxStreams(nbStreams);
9783 }
9784
9790 int32_t getMaxAuxStreams() const noexcept
9791 {
9792 return mImpl->getMaxAuxStreams();
9793 }
9794
9806 void setProgressMonitor(IProgressMonitor* monitor) noexcept
9807 {
9808 return mImpl->setProgressMonitor(monitor);
9809 }
9810
9817 {
9818 return mImpl->getProgressMonitor();
9819 }
9820
9832 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
9833 {
9834 mImpl->setRuntimePlatform(runtimePlatform);
9835 }
9836
9845 {
9846 return mImpl->getRuntimePlatform();
9847 }
9848
9856 void setMaxNbTactics(int32_t maxNbTactics) noexcept
9857 {
9858 mImpl->setMaxNbTactics(maxNbTactics);
9859 }
9860
9868 int32_t getMaxNbTactics() const noexcept
9869 {
9870 return mImpl->getMaxNbTactics();
9871 }
9872
9885 {
9886 return mImpl->setTilingOptimizationLevel(level);
9887 }
9888
9897 {
9898 return mImpl->getTilingOptimizationLevel();
9899 }
9900
9912 bool setL2LimitForTiling(int64_t size) noexcept
9913 {
9914 return mImpl->setL2LimitForTiling(size);
9915 }
9916
9924 int64_t getL2LimitForTiling() const noexcept
9925 {
9926 return mImpl->getL2LimitForTiling();
9927 }
9928
9943 bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
9944 {
9945 return mImpl->setNbComputeCapabilities(maxNbComputeCapabilities);
9946 }
9947
9955 int32_t getNbComputeCapabilities() const noexcept
9956 {
9957 return mImpl->getNbComputeCapabilities();
9958 }
9959
9973 bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
9974 {
9975 return mImpl->setComputeCapability(computeCapability, index);
9976 }
9977
9987 ComputeCapability getComputeCapability(int32_t index) const noexcept
9988 {
9989 return mImpl->getComputeCapability(index);
9990 }
9991
9992protected:
9993 apiv::VBuilderConfig* mImpl;
9994};
9995
10004
10014{
10019
10024 kSTRONGLY_TYPED = 1,
10025};
10026
10032template <>
10033constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10034{
10035 return 2;
10036}
10037
10045class IBuilder : public INoCopy
10046{
10047public:
10048 virtual ~IBuilder() noexcept = default;
10049
10057 int32_t getMaxDLABatchSize() const noexcept
10058 {
10059 return mImpl->getMaxDLABatchSize();
10060 }
10061
10065 int32_t getNbDLACores() const noexcept
10066 {
10067 return mImpl->getNbDLACores();
10068 }
10069
10083 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10084 {
10085 mImpl->setGpuAllocator(allocator);
10086 }
10087
10098 {
10099 return mImpl->createBuilderConfig();
10100 }
10101
10124 {
10125 return mImpl->createNetworkV2(flags);
10126 }
10127
10139 {
10140 return mImpl->createOptimizationProfile();
10141 }
10142
10157 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10158 {
10159 mImpl->setErrorRecorder(recorder);
10160 }
10161
10173 {
10174 return mImpl->getErrorRecorder();
10175 }
10176
10180 void reset() noexcept
10181 {
10182 mImpl->reset();
10183 }
10184
10200 {
10201 return mImpl->buildSerializedNetwork(network, config);
10202 }
10203
10221 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
10222 {
10223 return mImpl->buildSerializedNetworkToStream(network, config, writer);
10224 }
10225
10226
10244 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10245 {
10246 return mImpl->isNetworkSupported(network, config);
10247 }
10248
10254 ILogger* getLogger() const noexcept
10255 {
10256 return mImpl->getLogger();
10257 }
10258
10270 bool setMaxThreads(int32_t maxThreads) noexcept
10271 {
10272 return mImpl->setMaxThreads(maxThreads);
10273 }
10274
10284 int32_t getMaxThreads() const noexcept
10285 {
10286 return mImpl->getMaxThreads();
10287 }
10288
10295 {
10296 return mImpl->getPluginRegistry();
10297 }
10298
10299protected:
10300 apiv::VBuilder* mImpl;
10301};
10302
10303} // namespace nvinfer1
10304
10309extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10310
10311namespace nvinfer1
10312{
10313namespace
10314{
10315
10323inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10324{
10325 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10326}
10327
10328} // namespace
10329
10342 nvinfer1::EngineCapability capability) noexcept;
10343
10344namespace safe
10345{
10347class IPluginRegistry;
10348} // namespace safe
10349
10350
10351} // namespace nvinfer1
10352
10353#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:69
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:101
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h:216
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:219
An Activation layer in a network definition.
Definition: NvInfer.h: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:4878
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4888
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4898
virtual ~IAssertionLayer() noexcept=default
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6614
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6619
virtual ~IAttentionBoundaryLayer() noexcept=default
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6722
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:6772
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:6809
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:6899
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:6822
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:6862
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:6882
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:6870
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:6850
bool setCausal(bool isCausal) noexcept
Set whether the attention will run a causal inference. Cannot be used together with setMask().
Definition: NvInfer.h:6785
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6731
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:6911
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6743
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:6841
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6760
bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:6797
apiv::VAttention * mImpl
Definition: NvInfer.h:6917
virtual ~IAttention() noexcept=default
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6640
virtual ~IAttentionInputLayer() noexcept=default
This layer represents an output of an IAttention.
Definition: NvInfer.h:6673
virtual ~IAttentionOutputLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9158
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9589
bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
Set one compute capability for runtime execution.
Definition: NvInfer.h:9973
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9524
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
Set the number of compute capabilities.
Definition: NvInfer.h:9943
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9626
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9640
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9685
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9489
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9728
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:9884
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:9912
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9608
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9357
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9751
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9289
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9195
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9790
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9272
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:9856
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:9924
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:9806
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9454
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9442
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9557
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9388
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9547
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9741
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9207
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:9844
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9378
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:9832
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:9868
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9236
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9224
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9504
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9321
ComputeCapability getComputeCapability(int32_t index) const noexcept
Get one compute capability for runtime execution.
Definition: NvInfer.h:9987
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9347
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9715
int32_t getNbComputeCapabilities() const noexcept
Get the number of compute capabilities.
Definition: NvInfer.h:9955
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9248
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9429
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:9816
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:9993
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9182
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:9368
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9260
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9299
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9331
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9412
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9702
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:9896
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9780
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9467
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9311
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9673
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9400
Builds an engine from a network definition.
Definition: NvInfer.h:10046
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10065
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10172
apiv::VBuilder * mImpl
Definition: NvInfer.h:10300
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10254
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:10244
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10284
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10294
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10138
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10083
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10123
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10097
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10180
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10270
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10157
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10199
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:10220
A cast layer in a network.
Definition: NvInfer.h:3739
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3765
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3759
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3748
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:4402
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3778
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3788
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3798
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3810
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3828
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3822
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:6496
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6507
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6555
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6573
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6543
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6567
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6531
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6519
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:5463
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5500
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5473
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5512
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5484
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5540
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5629
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5652
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5606
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5593
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5580
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5567
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5619
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5642
An Einsum layer in a network.
Definition: NvInfer.h:5697
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:5708
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5718
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:4989
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5221
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5035
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5025
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5250
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5164
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5198
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5088
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5179
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5213
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5069
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5000
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5054
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5238
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5015
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5103
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:5919
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5926
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:5972
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:5948
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:5990
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:5984
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:5938
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:5960
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:3726
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3728
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4381
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4386
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4464
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4505
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4530
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4475
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4493
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4520
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4432
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4419
virtual ~IIfConditionalOutputLayer() noexcept=default
A layer to do iterations.
Definition: NvInfer.h:4695
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4722
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4732
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4708
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4700
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:1098
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4358
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4363
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4753
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4823
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4782
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4795
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:4808
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4833
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4761
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4595
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4625
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4600
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4617
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3573
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3601
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3595
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3583
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6071
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6108
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6082
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6094
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6153
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6171
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6118
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6165
A network definition for input to the builder.
Definition: NvInfer.h:6939
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:7167
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:7230
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8273
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7658
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:7428
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:7010
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:7111
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8295
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7960
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7519
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:7779
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7588
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:7858
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7672
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7757
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7331
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7301
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:7394
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8083
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7739
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7986
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7889
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:8154
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:7058
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:7092
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7634
virtual ~INetworkDefinition() noexcept=default
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8334
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7273
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:7036
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7710
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7904
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8060
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8391
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8210
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8247
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7285
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7698
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8127
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7357
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:7216
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:8188
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7603
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8372
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7943
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:8103
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7259
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8417
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7727
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:7247
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:7137
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7615
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7573
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7460
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7535
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:7194
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7559
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8045
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7799
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8230
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7479
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7688
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:7444
IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:8322
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8359
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8347
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:7821
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7875
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8412
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7500
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:7150
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:7026
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:8170
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6992
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:8002
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7315
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:8026
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:7072
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3627
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3651
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3639
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6260
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6279
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6299
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6269
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6366
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6372
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6330
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6289
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6356
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6320
A OneHot layer in a network definition.
Definition: NvInfer.h:5882
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5903
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5889
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5897
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2182
Layer that represents a padding operation.
Definition: NvInfer.h:2824
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2873
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2835
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:2861
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2847
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2879
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3842
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3844
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
A Pooling layer in a network definition.
Definition: NvInfer.h: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:5335
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5372
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5356
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5345
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5384
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3676
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3678
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4548
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2744
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2791
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2751
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2761
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2781
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2771
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2807
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2801
A resize layer in a network definition.
Definition: NvInfer.h:4031
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4192
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4216
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:4110
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4051
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4248
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4091
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4258
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4202
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4132
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4167
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4271
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4122
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4061
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4226
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4281
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4177
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6188
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6221
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6208
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6237
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6231
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6198
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:5810
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5817
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5851
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5837
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5845
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5827
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4856
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3349
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3351
Layer type for shuffling data.
Definition: NvInfer.h:2912
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3070
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2923
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3023
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:2976
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:2963
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2935
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3035
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3064
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3051
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3164
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3233
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3332
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3204
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3311
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3175
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3190
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3258
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3219
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3268
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3248
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3326
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:6386
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6403
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:8716
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:8782
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8753
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:8799
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:8821
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8827
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8763
Layer that represents a TopK reduction.
Definition: NvInfer.h:3389
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3420
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3444
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3406
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3503
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3396
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3485
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3434
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3454
virtual ~ITopKLayer() noexcept=default
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3497
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4669
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4674
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2669
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2678
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2694
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2688
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6415
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6432
An Interface class for version control.
Definition: NvInferRuntimeBase.h:276
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:241
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInferRuntimeBase.h:413
Definition: NvInferRuntime.h:1166
Definition: NvInfer.h:9065
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:10323
The TensorRT API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2468
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3936
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:8838
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:8438
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:8957
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6448
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6002
@ 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:8660
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:120
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:9006
@ 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:2622
@ 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:2731
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4337
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:139
@ 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:4917
@ 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:3966
@ 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:4325
@ 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:10003
PreviewFeature
Define preview features.
Definition: NvInfer.h:8913
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9032
@ 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.
Definition: NvInferRuntimeBase.h:143
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8468
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:860
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1745
LayerType
The type values of layer classes.
Definition: NvInfer.h:58
@ kGRID_SAMPLE
Grid sample layer.
@ kRAGGED_SOFTMAX
Ragged softmax layer.
@ kDECONVOLUTION
Deconvolution layer.
@ kREDUCE
Reduce layer.
@ kASSERTION
Assertion layer.
@ kTOPK
TopK layer.
@ kRESIZE
Resize Layer.
@ kCAST
Cast layer.
@ kPADDING
Padding layer.
@ kSQUEEZE
Squeeze Layer.
@ 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:3080
@ 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:131
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2480
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10014
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:3096
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3854
@ 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:8478
@ 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:3372
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:8899
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3361
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2717
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4314
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:10033
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5736
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3514
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3882
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2656
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4297
@ 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:6015
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3542
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:9148
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:4948
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6583
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5747
Represents a permutation of dimensions.
Definition: NvInfer.h:2889
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:8680
Definition: NvInfer.h:8692
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8694
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8696

  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