TensorRT 11.3.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h" // IWYU pragma: export
23
35
41
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 kROTARY_EMBEDDING = 53,
113 kKVCACHE_UPDATE = 54,
114 kMOE = 55,
115 kDIST_COLLECTIVE = 56,
116};
117
123template <>
125{
126 static constexpr int32_t kVALUE = 57;
127};
128
135using TensorFormats = uint32_t;
136
142enum class ActivationType : int32_t
143{
144 kRELU = 0,
145 kSIGMOID = 1,
146 kTANH = 2,
147 kLEAKY_RELU = 3,
148 kELU = 4,
149 kSELU = 5,
150 kSOFTSIGN = 6,
151 kSOFTPLUS = 7,
152 kCLIP = 8,
153 kHARD_SIGMOID = 9,
154 kSCALED_TANH = 10,
155 kTHRESHOLDED_RELU = 11,
156 kGELU_ERF = 12,
157 kGELU_TANH = 13
158};
159
165template <>
167{
168 static constexpr int32_t kVALUE = 14;
169};
170
185class ITensor : public INoCopy
186{
187public:
203 void setName(char const* name) noexcept
204 {
205 mImpl->setName(name);
206 }
207
215 char const* getName() const noexcept
216 {
217 return mImpl->getName();
218 }
219
234 void setDimensions(Dims const& dimensions) noexcept
235 {
236 mImpl->setDimensions(dimensions);
237 }
238
248 Dims getDimensions() const noexcept
249 {
250 return mImpl->getDimensions();
251 }
252
253
263 DataType getType() const noexcept
264 {
265 return mImpl->getType();
266 }
267
271 bool isNetworkInput() const noexcept
272 {
273 return mImpl->isNetworkInput();
274 }
275
279 bool isNetworkOutput() const noexcept
280 {
281 return mImpl->isNetworkOutput();
282 }
283
296 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
297 {
298 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
299 }
300
311 {
312 return mImpl->getBroadcastAcrossBatch();
313 }
314
323 {
324 return mImpl->getLocation();
325 }
326
342 {
343 mImpl->setLocation(location);
344 }
345
346
364 void setAllowedFormats(TensorFormats formats) noexcept
365 {
366 mImpl->setAllowedFormats(formats);
367 }
368
378 {
379 return mImpl->getAllowedFormats();
380 }
381
408 bool isShapeTensor() const noexcept
409 {
410 return mImpl->isShapeTensor();
411 }
412
429 bool isExecutionTensor() const noexcept
430 {
431 return mImpl->isExecutionTensor();
432 }
433
455 void setDimensionName(int32_t index, char const* name) noexcept
456 {
457 mImpl->setDimensionName(index, name);
458 }
459
470 char const* getDimensionName(int32_t index) const noexcept
471 {
472 return mImpl->getDimensionName(index);
473 }
474
475protected:
476 apiv::VTensor* mImpl;
477 virtual ~ITensor() noexcept = 0;
478};
479
480inline ITensor::~ITensor() noexcept = default;
481
489class ILayer : public INoCopy
490{
491public:
497 LayerType getType() const noexcept
498 {
499 return mLayer->getType();
500 }
501
511 void setName(char const* name) noexcept
512 {
513 mLayer->setName(name);
514 }
515
521 char const* getName() const noexcept
522 {
523 return mLayer->getName();
524 }
525
529 int32_t getNbInputs() const noexcept
530 {
531 return mLayer->getNbInputs();
532 }
533
542 ITensor* getInput(int32_t index) const noexcept
543 {
544 return mLayer->getInput(index);
545 }
546
550 int32_t getNbOutputs() const noexcept
551 {
552 return mLayer->getNbOutputs();
553 }
554
560 ITensor* getOutput(int32_t index) const noexcept
561 {
562 return mLayer->getOutput(index);
563 }
564
577 void setInput(int32_t index, ITensor& tensor) noexcept
578 {
579 return mLayer->setInput(index, tensor);
580 }
581
582
592 DataType getOutputType(int32_t index) const noexcept
593 {
594 return mLayer->getOutputType(index);
595 }
596
597
611 void setMetadata(char const* metadata) noexcept
612 {
613 mLayer->setMetadata(metadata);
614 }
615
624 char const* getMetadata() const noexcept
625 {
626 return mLayer->getMetadata();
627 }
628
645 bool setNbRanks(int32_t nbRanks) noexcept
646 {
647 return mLayer->setNbRanks(nbRanks);
648 }
649
657 int32_t getNbRanks() const noexcept
658 {
659 return mLayer->getNbRanks();
660 }
661
662protected:
663 virtual ~ILayer() noexcept = 0;
664 apiv::VLayer* mLayer;
665};
666
667inline ILayer::~ILayer() noexcept = default;
668
825enum class PaddingMode : int32_t
826{
829 kSAME_UPPER = 2,
830 kSAME_LOWER = 3,
831};
832
838template <>
840{
841 static constexpr int32_t kVALUE = 4;
842};
843
857{
858public:
866 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
867 {
868 mImpl->setNbOutputMaps(nbOutputMaps);
869 }
870
876 int64_t getNbOutputMaps() const noexcept
877 {
878 return mImpl->getNbOutputMaps();
879 }
880
896 void setNbGroups(int64_t nbGroups) noexcept
897 {
898 mImpl->setNbGroups(nbGroups);
899 }
900
906 int64_t getNbGroups() const noexcept
907 {
908 return mImpl->getNbGroups();
909 }
910
920 void setKernelWeights(Weights weights) noexcept
921 {
922 mImpl->setKernelWeights(weights);
923 }
924
930 Weights getKernelWeights() const noexcept
931 {
932 return mImpl->getKernelWeights();
933 }
934
945 void setBiasWeights(Weights weights) noexcept
946 {
947 mImpl->setBiasWeights(weights);
948 }
949
955 Weights getBiasWeights() const noexcept
956 {
957 return mImpl->getBiasWeights();
958 }
959
972 void setPrePadding(Dims const& padding) noexcept
973 {
974 mImpl->setPrePadding(padding);
975 }
976
982 Dims getPrePadding() const noexcept
983 {
984 return mImpl->getPrePadding();
985 }
986
999 void setPostPadding(Dims const& padding) noexcept
1000 {
1001 mImpl->setPostPadding(padding);
1002 }
1003
1009 Dims getPostPadding() const noexcept
1010 {
1011 return mImpl->getPostPadding();
1012 }
1013
1023 void setPaddingMode(PaddingMode paddingMode) noexcept
1024 {
1025 mImpl->setPaddingMode(paddingMode);
1026 }
1027
1036 {
1037 return mImpl->getPaddingMode();
1038 }
1039
1048 void setKernelSizeNd(Dims const& kernelSize) noexcept
1049 {
1050 mImpl->setKernelSizeNd(kernelSize);
1051 }
1052
1058 Dims getKernelSizeNd() const noexcept
1059 {
1060 return mImpl->getKernelSizeNd();
1061 }
1062
1073 void setStrideNd(Dims const& stride) noexcept
1074 {
1075 mImpl->setStrideNd(stride);
1076 }
1077
1083 Dims getStrideNd() const noexcept
1084 {
1085 return mImpl->getStrideNd();
1086 }
1087
1101 void setPaddingNd(Dims const& padding) noexcept
1102 {
1103 mImpl->setPaddingNd(padding);
1104 }
1105
1113 Dims getPaddingNd() const noexcept
1114 {
1115 return mImpl->getPaddingNd();
1116 }
1117
1127 void setDilationNd(Dims const& dilation) noexcept
1128 {
1129 mImpl->setDilationNd(dilation);
1130 }
1131
1137 Dims getDilationNd() const noexcept
1138 {
1139 return mImpl->getDilationNd();
1140 }
1141
1156 using ILayer::setInput;
1157
1158protected:
1159 virtual ~IConvolutionLayer() noexcept = 0;
1160 apiv::VConvolutionLayer* mImpl;
1161};
1162
1163inline IConvolutionLayer::~IConvolutionLayer() noexcept = default;
1164
1179{
1180public:
1189 {
1190 mImpl->setActivationType(type);
1191 }
1192
1199 {
1200 return mImpl->getActivationType();
1201 }
1202
1213 void setAlpha(float alpha) noexcept
1214 {
1215 mImpl->setAlpha(alpha);
1216 }
1217
1227 void setBeta(float beta) noexcept
1228 {
1229 mImpl->setBeta(beta);
1230 }
1231
1236 float getAlpha() const noexcept
1237 {
1238 return mImpl->getAlpha();
1239 }
1240
1245 float getBeta() const noexcept
1246 {
1247 return mImpl->getBeta();
1248 }
1249
1250protected:
1251 virtual ~IActivationLayer() noexcept = 0;
1252 apiv::VActivationLayer* mImpl;
1253};
1254
1255inline IActivationLayer::~IActivationLayer() noexcept = default;
1256
1262enum class PoolingType : int32_t
1263{
1264 kMAX = 0,
1265 kAVERAGE = 1,
1267};
1268
1274template <>
1276{
1277 static constexpr int32_t kVALUE = 3;
1278};
1279
1291class IPoolingLayer : public ILayer
1292{
1293public:
1301 void setPoolingType(PoolingType type) noexcept
1302 {
1303 mImpl->setPoolingType(type);
1304 }
1305
1312 {
1313 return mImpl->getPoolingType();
1314 }
1315
1326 void setBlendFactor(float blendFactor) noexcept
1327 {
1328 mImpl->setBlendFactor(blendFactor);
1329 }
1330
1339 float getBlendFactor() const noexcept
1340 {
1341 return mImpl->getBlendFactor();
1342 }
1343
1353 void setAverageCountExcludesPadding(bool exclusive) noexcept
1354 {
1355 mImpl->setAverageCountExcludesPadding(exclusive);
1356 }
1357
1365 {
1366 return mImpl->getAverageCountExcludesPadding();
1367 }
1368
1382 void setPrePadding(Dims const& padding) noexcept
1383 {
1384 mImpl->setPrePadding(padding);
1385 }
1386
1392 Dims getPrePadding() const noexcept
1393 {
1394 return mImpl->getPrePadding();
1395 }
1396
1410 void setPostPadding(Dims const& padding) noexcept
1411 {
1412 mImpl->setPostPadding(padding);
1413 }
1414
1420 Dims getPostPadding() const noexcept
1421 {
1422 return mImpl->getPostPadding();
1423 }
1424
1433 void setPaddingMode(PaddingMode paddingMode) noexcept
1434 {
1435 mImpl->setPaddingMode(paddingMode);
1436 }
1437
1445 {
1446 return mImpl->getPaddingMode();
1447 }
1448
1457 void setWindowSizeNd(Dims const& windowSize) noexcept
1458 {
1459 mImpl->setWindowSizeNd(windowSize);
1460 }
1461
1467 Dims getWindowSizeNd() const noexcept
1468 {
1469 return mImpl->getWindowSizeNd();
1470 }
1471
1481 void setStrideNd(Dims const& stride) noexcept
1482 {
1483 mImpl->setStrideNd(stride);
1484 }
1485
1491 Dims getStrideNd() const noexcept
1492 {
1493 return mImpl->getStrideNd();
1494 }
1495
1510 void setPaddingNd(Dims const& padding) noexcept
1511 {
1512 mImpl->setPaddingNd(padding);
1513 }
1514
1522 Dims getPaddingNd() const noexcept
1523 {
1524 return mImpl->getPaddingNd();
1525 }
1526
1527protected:
1528 virtual ~IPoolingLayer() noexcept = 0;
1529 apiv::VPoolingLayer* mImpl;
1530};
1531
1532inline IPoolingLayer::~IPoolingLayer() noexcept = default;
1533
1543class ILRNLayer : public ILayer
1544{
1545public:
1555 void setWindowSize(int64_t windowSize) noexcept
1556 {
1557 mImpl->setWindowSize(windowSize);
1558 }
1559
1565 int64_t getWindowSize() const noexcept
1566 {
1567 return mImpl->getWindowSize();
1568 }
1569
1577 void setAlpha(float alpha) noexcept
1578 {
1579 mImpl->setAlpha(alpha);
1580 }
1581
1587 float getAlpha() const noexcept
1588 {
1589 return mImpl->getAlpha();
1590 }
1591
1599 void setBeta(float beta) noexcept
1600 {
1601 mImpl->setBeta(beta);
1602 }
1603
1609 float getBeta() const noexcept
1610 {
1611 return mImpl->getBeta();
1612 }
1613
1621 void setK(float k) noexcept
1622 {
1623 mImpl->setK(k);
1624 }
1625
1631 float getK() const noexcept
1632 {
1633 return mImpl->getK();
1634 }
1635
1636protected:
1637 virtual ~ILRNLayer() noexcept = 0;
1638 apiv::VLRNLayer* mImpl;
1639};
1640
1641inline ILRNLayer::~ILRNLayer() noexcept = default;
1642
1648enum class ScaleMode : int32_t
1649{
1650 kUNIFORM = 0,
1651 kCHANNEL = 1,
1652 kELEMENTWISE = 2
1653};
1654
1660template <>
1662{
1663 static constexpr int32_t kVALUE = 3;
1664};
1665
1691class IScaleLayer : public ILayer
1692{
1693public:
1699 void setMode(ScaleMode mode) noexcept
1700 {
1701 mImpl->setMode(mode);
1702 }
1703
1709 ScaleMode getMode() const noexcept
1710 {
1711 return mImpl->getMode();
1712 }
1713
1719 void setShift(Weights shift) noexcept
1720 {
1721 mImpl->setShift(shift);
1722 }
1723
1729 Weights getShift() const noexcept
1730 {
1731 return mImpl->getShift();
1732 }
1733
1739 void setScale(Weights scale) noexcept
1740 {
1741 mImpl->setScale(scale);
1742 }
1743
1749 Weights getScale() const noexcept
1750 {
1751 return mImpl->getScale();
1752 }
1753
1759 void setPower(Weights power) noexcept
1760 {
1761 mImpl->setPower(power);
1762 }
1763
1769 Weights getPower() const noexcept
1770 {
1771 return mImpl->getPower();
1772 }
1773
1784 int32_t getChannelAxis() const noexcept
1785 {
1786 return mImpl->getChannelAxis();
1787 }
1788
1805 void setChannelAxis(int32_t channelAxis) noexcept
1806 {
1807 mImpl->setChannelAxis(channelAxis);
1808 }
1809
1810protected:
1811 virtual ~IScaleLayer() noexcept = 0;
1812 apiv::VScaleLayer* mImpl;
1813};
1814
1815inline IScaleLayer::~IScaleLayer() noexcept = default;
1816
1837class ISoftMaxLayer : public ILayer
1838{
1839public:
1860 void setAxes(uint32_t axes) noexcept
1861 {
1862 mImpl->setAxes(axes);
1863 }
1864
1870 uint32_t getAxes() const noexcept
1871 {
1872 return mImpl->getAxes();
1873 }
1874
1875protected:
1876 virtual ~ISoftMaxLayer() noexcept = 0;
1877 apiv::VSoftMaxLayer* mImpl;
1878};
1879
1880inline ISoftMaxLayer::~ISoftMaxLayer() noexcept = default;
1881
1895{
1896public:
1908 void setAxis(int32_t axis) noexcept
1909 {
1910 mImpl->setAxis(axis);
1911 }
1912
1918 int32_t getAxis() const noexcept
1919 {
1920 return mImpl->getAxis();
1921 }
1922
1923protected:
1924 virtual ~IConcatenationLayer() noexcept = 0;
1925 apiv::VConcatenationLayer* mImpl;
1926};
1927
1928inline IConcatenationLayer::~IConcatenationLayer() noexcept = default;
1929
1938{
1939public:
1947 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1948 {
1949 mImpl->setNbOutputMaps(nbOutputMaps);
1950 }
1951
1957 int64_t getNbOutputMaps() const noexcept
1958 {
1959 return mImpl->getNbOutputMaps();
1960 }
1961
1977 void setNbGroups(int64_t nbGroups) noexcept
1978 {
1979 mImpl->setNbGroups(nbGroups);
1980 }
1981
1987 int64_t getNbGroups() const noexcept
1988 {
1989 return mImpl->getNbGroups();
1990 }
1991
2001 void setKernelWeights(Weights weights) noexcept
2002 {
2003 mImpl->setKernelWeights(weights);
2004 }
2005
2011 Weights getKernelWeights() const noexcept
2012 {
2013 return mImpl->getKernelWeights();
2014 }
2015
2026 void setBiasWeights(Weights weights) noexcept
2027 {
2028 mImpl->setBiasWeights(weights);
2029 }
2030
2036 Weights getBiasWeights() const noexcept
2037 {
2038 return mImpl->getBiasWeights();
2039 }
2040
2053 void setPrePadding(Dims const& padding) noexcept
2054 {
2055 mImpl->setPrePadding(padding);
2056 }
2057
2063 Dims getPrePadding() const noexcept
2064 {
2065 return mImpl->getPrePadding();
2066 }
2067
2080 void setPostPadding(Dims const& padding) noexcept
2081 {
2082 mImpl->setPostPadding(padding);
2083 }
2084
2090 Dims getPostPadding() const noexcept
2091 {
2092 return mImpl->getPostPadding();
2093 }
2094
2104 void setPaddingMode(PaddingMode paddingMode) noexcept
2105 {
2106 mImpl->setPaddingMode(paddingMode);
2107 }
2108
2117 {
2118 return mImpl->getPaddingMode();
2119 }
2120
2131 void setKernelSizeNd(Dims const& kernelSize) noexcept
2132 {
2133 mImpl->setKernelSizeNd(kernelSize);
2134 }
2135
2141 Dims getKernelSizeNd() const noexcept
2142 {
2143 return mImpl->getKernelSizeNd();
2144 }
2145
2158 void setStrideNd(Dims const& stride) noexcept
2159 {
2160 mImpl->setStrideNd(stride);
2161 }
2162
2168 Dims getStrideNd() const noexcept
2169 {
2170 return mImpl->getStrideNd();
2171 }
2172
2186 void setPaddingNd(Dims const& padding) noexcept
2187 {
2188 mImpl->setPaddingNd(padding);
2189 }
2190
2198 Dims getPaddingNd() const noexcept
2199 {
2200 return mImpl->getPaddingNd();
2201 }
2202
2215 using ILayer::setInput;
2216
2224 void setDilationNd(Dims const& dilation) noexcept
2225 {
2226 mImpl->setDilationNd(dilation);
2227 }
2228
2234 Dims getDilationNd() const noexcept
2235 {
2236 return mImpl->getDilationNd();
2237 }
2238
2239protected:
2240 virtual ~IDeconvolutionLayer() noexcept = 0;
2241 apiv::VDeconvolutionLayer* mImpl;
2242};
2243
2244inline IDeconvolutionLayer::~IDeconvolutionLayer() noexcept = default;
2245
2258enum class ElementWiseOperation : int32_t
2259{
2260 kSUM = 0,
2261 kPROD = 1,
2262 kMAX = 2,
2263 kMIN = 3,
2264 kSUB = 4,
2265 kDIV = 5,
2266 kPOW = 6,
2267 kFLOOR_DIV = 7,
2268 kAND = 8,
2269 kOR = 9,
2270 kXOR = 10,
2271 kEQUAL = 11,
2272 kGREATER = 12,
2273 kLESS = 13
2274};
2275
2281template <>
2283{
2284 static constexpr int32_t kVALUE = 14;
2285};
2286
2307{
2308public:
2319 {
2320 return mImpl->setOperation(op);
2321 }
2322
2331 {
2332 return mImpl->getOperation();
2333 }
2334
2335protected:
2336 apiv::VElementWiseLayer* mImpl;
2337 virtual ~IElementWiseLayer() noexcept = 0;
2338};
2339
2340inline IElementWiseLayer::~IElementWiseLayer() noexcept = default;
2341
2347enum class GatherMode : int32_t
2348{
2349 kDEFAULT = 0,
2350 kELEMENT = 1,
2351 kND = 2
2352};
2353
2359template <>
2361{
2362 static constexpr int32_t kVALUE = 3;
2363};
2364
2441class IGatherLayer : public ILayer
2442{
2443public:
2453 void setGatherAxis(int32_t axis) noexcept
2454 {
2455 mImpl->setGatherAxis(axis);
2456 }
2457
2465 int32_t getGatherAxis() const noexcept
2466 {
2467 return mImpl->getGatherAxis();
2468 }
2469
2488 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2489 {
2490 mImpl->setNbElementWiseDims(elementWiseDims);
2491 }
2492
2498 int32_t getNbElementWiseDims() const noexcept
2499 {
2500 return mImpl->getNbElementWiseDims();
2501 }
2502
2508 void setMode(GatherMode mode) noexcept
2509 {
2510 mImpl->setMode(mode);
2511 }
2512
2518 GatherMode getMode() const noexcept
2519 {
2520 return mImpl->getMode();
2521 }
2522
2523protected:
2524 apiv::VGatherLayer* mImpl;
2525 virtual ~IGatherLayer() noexcept = 0;
2526};
2527
2528inline IGatherLayer::~IGatherLayer() noexcept = default;
2529
2542{
2543public:
2550 {
2551 return mImpl->getPlugin();
2552 }
2553
2554protected:
2555 apiv::VPluginV2Layer* mImpl;
2556 virtual ~IPluginV2Layer() noexcept = 0;
2557};
2558
2559inline IPluginV2Layer::~IPluginV2Layer() noexcept = default;
2560
2571{
2572public:
2579 {
2580 return mImpl->getPlugin();
2581 }
2582
2583protected:
2584 apiv::VPluginV3Layer* mImpl;
2585 virtual ~IPluginV3Layer() noexcept = 0;
2586};
2587
2588inline IPluginV3Layer::~IPluginV3Layer() noexcept = default;
2589
2606enum class UnaryOperation : int32_t
2607{
2608 kEXP = 0,
2609 kLOG = 1,
2610 kSQRT = 2,
2611 kRECIP = 3,
2612 kABS = 4,
2613 kNEG = 5,
2614 kSIN = 6,
2615 kCOS = 7,
2616 kTAN = 8,
2617 kSINH = 9,
2618 kCOSH = 10,
2619 kASIN = 11,
2620 kACOS = 12,
2621 kATAN = 13,
2622 kASINH = 14,
2623 kACOSH = 15,
2624 kATANH = 16,
2625 kCEIL = 17,
2626 kFLOOR = 18,
2627 kERF = 19,
2628 kNOT = 20,
2629 kSIGN = 21,
2630 kROUND = 22,
2631 kISINF = 23,
2632 kISNAN = 24,
2633};
2634
2640template <>
2642{
2643 static constexpr int32_t kVALUE = 25;
2644};
2645
2653class IUnaryLayer : public ILayer
2654{
2655public:
2664 {
2665 mImpl->setOperation(op);
2666 }
2667
2674 {
2675 return mImpl->getOperation();
2676 }
2677
2678protected:
2679 apiv::VUnaryLayer* mImpl;
2680 virtual ~IUnaryLayer() noexcept = 0;
2681};
2682
2683inline IUnaryLayer::~IUnaryLayer() noexcept = default;
2684
2708enum class ReduceOperation : int32_t
2709{
2710 kSUM = 0,
2711 kPROD = 1,
2712 kMAX = 2,
2713 kMIN = 3,
2714 kAVG = 4,
2715 kNONE = 5,
2716};
2717
2723template <>
2725{
2726 static constexpr int32_t kVALUE = 6;
2727};
2728
2736enum class CollectiveOperation : int32_t
2737{
2738 kALL_REDUCE = 0,
2739 kALL_GATHER = 1,
2740 kBROADCAST = 2,
2741 kREDUCE = 3,
2742 kREDUCE_SCATTER = 4,
2743 kALL_TO_ALL = 5,
2744 kGATHER = 6,
2745 kSCATTER = 7,
2746};
2747
2753template <>
2755{
2756 static constexpr int32_t kVALUE = 8;
2757};
2758
2766class IReduceLayer : public ILayer
2767{
2768public:
2775 {
2776 mImpl->setOperation(op);
2777 }
2778
2785 {
2786 return mImpl->getOperation();
2787 }
2788
2794 void setReduceAxes(uint32_t reduceAxes) noexcept
2795 {
2796 mImpl->setReduceAxes(reduceAxes);
2797 }
2798
2804 uint32_t getReduceAxes() const noexcept
2805 {
2806 return mImpl->getReduceAxes();
2807 }
2808
2814 void setKeepDimensions(bool keepDimensions) noexcept
2815 {
2816 mImpl->setKeepDimensions(keepDimensions);
2817 }
2818
2824 bool getKeepDimensions() const noexcept
2825 {
2826 return mImpl->getKeepDimensions();
2827 }
2828
2829protected:
2830 apiv::VReduceLayer* mImpl;
2831 virtual ~IReduceLayer() noexcept = 0;
2832};
2833
2834inline IReduceLayer::~IReduceLayer() noexcept = default;
2835
2848class IPaddingLayer : public ILayer
2849{
2850public:
2860 void setPrePaddingNd(Dims const& padding) noexcept
2861 {
2862 mImpl->setPrePaddingNd(padding);
2863 }
2864
2872 Dims getPrePaddingNd() const noexcept
2873 {
2874 return mImpl->getPrePaddingNd();
2875 }
2876
2886 void setPostPaddingNd(Dims const& padding) noexcept
2887 {
2888 mImpl->setPostPaddingNd(padding);
2889 }
2890
2898 Dims getPostPaddingNd() const noexcept
2899 {
2900 return mImpl->getPostPaddingNd();
2901 }
2902
2903protected:
2904 apiv::VPaddingLayer* mImpl;
2905 virtual ~IPaddingLayer() noexcept = 0;
2906};
2907
2908inline IPaddingLayer::~IPaddingLayer() noexcept = default;
2909
2916{
2923 int32_t order[Dims::MAX_DIMS];
2924};
2925
2938class IShuffleLayer : public ILayer
2939{
2940public:
2950 void setFirstTranspose(Permutation permutation) noexcept
2951 {
2952 mImpl->setFirstTranspose(permutation);
2953 }
2954
2963 {
2964 return mImpl->getFirstTranspose();
2965 }
2966
2990 void setReshapeDimensions(Dims const& dimensions) noexcept
2991 {
2992 mImpl->setReshapeDimensions(dimensions);
2993 }
2994
3004 {
3005 return mImpl->getReshapeDimensions();
3006 }
3007
3013 //
3036 using ILayer::setInput;
3037
3050 void setSecondTranspose(Permutation permutation) noexcept
3051 {
3052 mImpl->setSecondTranspose(permutation);
3053 }
3054
3063 {
3064 return mImpl->getSecondTranspose();
3065 }
3066
3078 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3079 {
3080 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3081 }
3082
3091 bool getZeroIsPlaceholder() const noexcept
3092 {
3093 return mImpl->getZeroIsPlaceholder();
3094 }
3095
3096protected:
3097 apiv::VShuffleLayer* mImpl;
3098 virtual ~IShuffleLayer() noexcept = 0;
3099};
3100
3101inline IShuffleLayer::~IShuffleLayer() noexcept = default;
3102
3108enum class SampleMode : int32_t
3109{
3110 kSTRICT_BOUNDS = 0,
3111 kWRAP = 1,
3112 kCLAMP = 2,
3113 kFILL = 3,
3114 kREFLECT = 4,
3117};
3118
3124template <>
3126{
3127 static constexpr int32_t kVALUE = 5;
3128};
3129
3192class ISliceLayer : public ILayer
3193{
3194public:
3204 void setStart(Dims const& start) noexcept
3205 {
3206 mImpl->setStart(start);
3207 }
3208
3219 Dims getStart() const noexcept
3220 {
3221 return mImpl->getStart();
3222 }
3223
3233 void setSize(Dims const& size) noexcept
3234 {
3235 return mImpl->setSize(size);
3236 }
3237
3248 Dims getSize() const noexcept
3249 {
3250 return mImpl->getSize();
3251 }
3252
3262 void setStride(Dims const& stride) noexcept
3263 {
3264 mImpl->setStride(stride);
3265 }
3266
3277 Dims getStride() const noexcept
3278 {
3279 return mImpl->getStride();
3280 }
3281
3287 void setMode(SampleMode mode) noexcept
3288 {
3289 mImpl->setMode(mode);
3290 }
3291
3297 SampleMode getMode() const noexcept
3298 {
3299 return mImpl->getMode();
3300 }
3301
3329 using ILayer::setInput;
3330
3340 void setAxes(Dims const& axes) noexcept
3341 {
3342 mImpl->setAxes(axes);
3343 }
3344
3355 Dims getAxes() const noexcept
3356 {
3357 return mImpl->getAxes();
3358 }
3359
3360protected:
3361 apiv::VSliceLayer* mImpl;
3362 virtual ~ISliceLayer() noexcept = 0;
3363};
3364
3365inline ISliceLayer::~ISliceLayer() noexcept = default;
3366
3379class IShapeLayer : public ILayer
3380{
3381protected:
3382 apiv::VShapeLayer* mImpl;
3383 virtual ~IShapeLayer() noexcept = 0;
3384};
3385
3386inline IShapeLayer::~IShapeLayer() noexcept = default;
3387
3393enum class TopKOperation : int32_t
3394{
3395 kMAX = 0,
3396 kMIN = 1,
3397};
3398
3404template <>
3406{
3407 static constexpr int32_t kVALUE = 2;
3408};
3409
3421class ITopKLayer : public ILayer
3422{
3423public:
3429 void setOperation(TopKOperation op) noexcept
3430 {
3431 mImpl->setOperation(op);
3432 }
3433
3440 {
3441 return mImpl->getOperation();
3442 }
3443
3453 void setK(int32_t k) noexcept
3454 {
3455 mImpl->setK(k);
3456 }
3457
3467 int32_t getK() const noexcept
3468 {
3469 return mImpl->getK();
3470 }
3471
3477 void setReduceAxes(uint32_t reduceAxes) noexcept
3478 {
3479 mImpl->setReduceAxes(reduceAxes);
3480 }
3481
3487 uint32_t getReduceAxes() const noexcept
3488 {
3489 return mImpl->getReduceAxes();
3490 }
3491
3506 using ILayer::setInput;
3507
3518 bool setIndicesType(DataType type) noexcept
3519 {
3520 return mImpl->setIndicesType(type);
3521 }
3522
3530 DataType getIndicesType() const noexcept
3531 {
3532 return mImpl->getIndicesType();
3533 }
3534
3535protected:
3536 apiv::VTopKLayer* mImpl;
3537 virtual ~ITopKLayer() noexcept = 0;
3538};
3539
3540inline ITopKLayer::~ITopKLayer() noexcept = default;
3541
3548enum class MatrixOperation : int32_t
3549{
3553 kNONE = 0,
3554
3556 kTRANSPOSE = 1,
3557
3568 kVECTOR = 2,
3569};
3570
3576template <>
3578{
3579 static constexpr int32_t kVALUE = 3;
3580};
3581
3608{
3609public:
3618 void setOperation(int32_t index, MatrixOperation op) noexcept
3619 {
3620 mImpl->setOperation(index, op);
3621 }
3622
3630 MatrixOperation getOperation(int32_t index) const noexcept
3631 {
3632 return mImpl->getOperation(index);
3633 }
3634
3635protected:
3636 apiv::VMatrixMultiplyLayer* mImpl;
3637 virtual ~IMatrixMultiplyLayer() noexcept = 0;
3638};
3639
3640inline IMatrixMultiplyLayer::~IMatrixMultiplyLayer() noexcept = default;
3641
3663class INonZeroLayer : public ILayer
3664{
3665public:
3676 bool setIndicesType(DataType type) noexcept
3677 {
3678 return mImpl->setIndicesType(type);
3679 }
3680
3688 DataType getIndicesType() const noexcept
3689 {
3690 return mImpl->getIndicesType();
3691 }
3692
3693protected:
3694 virtual ~INonZeroLayer() noexcept = 0;
3695 apiv::VNonZeroLayer* mImpl;
3696};
3697
3698inline INonZeroLayer::~INonZeroLayer() noexcept = default;
3699
3715{
3716protected:
3717 apiv::VRaggedSoftMaxLayer* mImpl;
3718 virtual ~IRaggedSoftMaxLayer() noexcept = 0;
3719};
3720
3721inline IRaggedSoftMaxLayer::~IRaggedSoftMaxLayer() noexcept = default;
3722
3767{
3768protected:
3769 apiv::VIdentityLayer* mImpl;
3770 virtual ~IIdentityLayer() noexcept = 0;
3771};
3772
3773inline IIdentityLayer::~IIdentityLayer() noexcept = default;
3774
3781class ICastLayer : public ILayer
3782{
3783public:
3791 void setToType(DataType toType) noexcept
3792 {
3793 mImpl->setToType(toType);
3794 }
3795
3802 DataType getToType() const noexcept
3803 {
3804 return mImpl->getToType();
3805 }
3806
3807protected:
3808 apiv::VCastLayer* mImpl;
3809 virtual ~ICastLayer() noexcept = 0;
3810};
3811
3812inline ICastLayer::~ICastLayer() noexcept = default;
3813
3823{
3824public:
3833 void setWeights(Weights weights) noexcept
3834 {
3835 mImpl->setWeights(weights);
3836 }
3837
3843 Weights getWeights() const noexcept
3844 {
3845 return mImpl->getWeights();
3846 }
3847
3855 void setDimensions(Dims const& dimensions) noexcept
3856 {
3857 mImpl->setDimensions(dimensions);
3858 }
3859
3867 Dims getDimensions() const noexcept
3868 {
3869 return mImpl->getDimensions();
3870 }
3871
3872protected:
3873 apiv::VConstantLayer* mImpl;
3874 virtual ~IConstantLayer() noexcept = 0;
3875};
3876
3877inline IConstantLayer::~IConstantLayer() noexcept = default;
3878
3889{
3890protected:
3891 apiv::VParametricReLULayer* mImpl;
3892 virtual ~IParametricReLULayer() noexcept = 0;
3893};
3894
3895inline IParametricReLULayer::~IParametricReLULayer() noexcept = default;
3896
3902enum class InterpolationMode : int32_t
3903{
3904 kNEAREST = 0,
3905 kLINEAR = 1,
3906 kCUBIC = 2
3907};
3908
3914template <>
3916{
3917 static constexpr int32_t kVALUE = 3;
3918};
3919
3928{
3941 kALIGN_CORNERS = 0,
3942
3949 kASYMMETRIC = 1,
3950
3957 kHALF_PIXEL = 2,
3958};
3959
3965template <>
3967{
3968 static constexpr int32_t kVALUE = 3;
3969};
3970
3978enum class ResizeSelector : int32_t
3979{
3981 kFORMULA = 0,
3982
3984 kUPPER = 1,
3985};
3986
3992template <>
3994{
3995 static constexpr int32_t kVALUE = 2;
3996};
3997
4005enum class ResizeRoundMode : int32_t
4006{
4008 kHALF_UP = 0,
4009
4011 kHALF_DOWN = 1,
4012
4014 kFLOOR = 2,
4015
4017 kCEIL = 3,
4018};
4019
4025template <>
4027{
4028 static constexpr int32_t kVALUE = 4;
4029};
4030
4067class IResizeLayer : public ILayer
4068{
4069public:
4088 void setOutputDimensions(Dims const& dimensions) noexcept
4089 {
4090 return mImpl->setOutputDimensions(dimensions);
4091 }
4092
4098 Dims getOutputDimensions() const noexcept
4099 {
4100 return mImpl->getOutputDimensions();
4101 }
4102
4128 void setScales(float const* scales, int32_t nbScales) noexcept
4129 {
4130 mImpl->setScales(scales, nbScales);
4131 }
4132
4147 int32_t getScales(int32_t size, float* scales) const noexcept
4148 {
4149 return mImpl->getScales(size, scales);
4150 }
4151
4159 void setResizeMode(InterpolationMode interpolationMode) noexcept
4160 {
4161 mImpl->setResizeMode(interpolationMode);
4162 }
4163
4170 {
4171 return mImpl->getResizeMode();
4172 }
4173
4193 using ILayer::setInput;
4194
4205 {
4206 mImpl->setCoordinateTransformation(coordTransform);
4207 }
4208
4215 {
4216 return mImpl->getCoordinateTransformation();
4217 }
4218
4230 {
4231 mImpl->setSelectorForSinglePixel(selector);
4232 }
4233
4240 {
4241 return mImpl->getSelectorForSinglePixel();
4242 }
4243
4254 {
4255 mImpl->setNearestRounding(value);
4256 }
4257
4264 {
4265 return mImpl->getNearestRounding();
4266 }
4267
4285 void setCubicCoeff(float A) noexcept
4286 {
4287 mImpl->setCubicCoeff(A);
4288 }
4289
4295 float getCubicCoeff() const noexcept
4296 {
4297 return mImpl->getCubicCoeff();
4298 }
4299
4308 void setExcludeOutside(bool excludeFlag) noexcept
4309 {
4310 mImpl->setExcludeOutside(excludeFlag);
4311 }
4312
4318 bool getExcludeOutside() const noexcept
4319 {
4320 return mImpl->getExcludeOutside();
4321 }
4322
4323protected:
4324 virtual ~IResizeLayer() noexcept = 0;
4325 apiv::VResizeLayer* mImpl;
4326};
4327
4328inline IResizeLayer::~IResizeLayer() noexcept = default;
4329
4335enum class LoopOutput : int32_t
4336{
4338 kLAST_VALUE = 0,
4339
4341 kCONCATENATE = 1,
4342
4344 kREVERSE = 2
4345};
4346
4352template <>
4354{
4355 static constexpr int32_t kVALUE = 3;
4356};
4357
4363enum class TripLimit : int32_t
4364{
4365
4366 kCOUNT = 0,
4367 kWHILE = 1
4368};
4369
4375template <>
4377{
4378 static constexpr int32_t kVALUE = 2;
4379};
4380
4381class ILoop;
4382
4397{
4398public:
4402 ILoop* getLoop() const noexcept
4403 {
4404 return mBoundary->getLoop();
4405 }
4406
4407protected:
4408 virtual ~ILoopBoundaryLayer() noexcept = 0;
4409 apiv::VLoopBoundaryLayer* mBoundary;
4410};
4411
4412inline ILoopBoundaryLayer::~ILoopBoundaryLayer() noexcept = default;
4413
4422{
4423public:
4428 {
4429 return mBoundary->getConditional();
4430 }
4431
4432protected:
4433 virtual ~IIfConditionalBoundaryLayer() noexcept = 0;
4434 apiv::VConditionalBoundaryLayer* mBoundary;
4435};
4436
4437inline IIfConditionalBoundaryLayer::~IIfConditionalBoundaryLayer() noexcept = default;
4438
4445{
4446public:
4447protected:
4448 virtual ~IConditionLayer() noexcept = 0;
4449 apiv::VConditionLayer* mImpl;
4450};
4451
4452inline IConditionLayer::~IConditionLayer() noexcept = default;
4453
4464{
4465public:
4466protected:
4467 virtual ~IIfConditionalOutputLayer() noexcept = 0;
4468 apiv::VConditionalOutputLayer* mImpl;
4469};
4470
4471inline IIfConditionalOutputLayer::~IIfConditionalOutputLayer() noexcept = default;
4472
4479{
4480public:
4481protected:
4482 virtual ~IIfConditionalInputLayer() noexcept = 0;
4483 apiv::VConditionalInputLayer* mImpl;
4484};
4485
4486inline IIfConditionalInputLayer::~IIfConditionalInputLayer() noexcept = default;
4487
4513{
4514public:
4525 {
4526 return mImpl->setCondition(condition);
4527 }
4528
4542 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4543 {
4544 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4545 }
4546
4555 {
4556 return mImpl->addInput(input);
4557 }
4558
4569 void setName(char const* name) noexcept
4570 {
4571 mImpl->setName(name);
4572 }
4573
4579 char const* getName() const noexcept
4580 {
4581 return mImpl->getName();
4582 }
4583
4584protected:
4585 virtual ~IIfConditional() noexcept = 0;
4586 apiv::VIfConditional* mImpl;
4587};
4588
4589inline IIfConditional::~IIfConditional() noexcept = default;
4590
4599{
4600public:
4606 //
4619 using ILayer::setInput;
4620
4621protected:
4622 virtual ~IRecurrenceLayer() noexcept = 0;
4623 apiv::VRecurrenceLayer* mImpl;
4624};
4625
4626inline IRecurrenceLayer::~IRecurrenceLayer() noexcept = default;
4627
4648{
4649public:
4653 LoopOutput getLoopOutput() const noexcept
4654 {
4655 return mImpl->getLoopOutput();
4656 }
4657
4670 void setAxis(int32_t axis) noexcept
4671 {
4672 mImpl->setAxis(axis);
4673 }
4674
4678 int32_t getAxis() const noexcept
4679 {
4680 return mImpl->getAxis();
4681 }
4682
4688 //
4703 using ILayer::setInput;
4704
4705protected:
4706 virtual ~ILoopOutputLayer() noexcept = 0;
4707 apiv::VLoopOutputLayer* mImpl;
4708};
4709
4710inline ILoopOutputLayer::~ILoopOutputLayer() noexcept = default;
4711
4724{
4725public:
4729 TripLimit getTripLimit() const noexcept
4730 {
4731 return mImpl->getTripLimit();
4732 }
4733
4734protected:
4735 virtual ~ITripLimitLayer() noexcept = 0;
4736 apiv::VTripLimitLayer* mImpl;
4737};
4738
4739inline ITripLimitLayer::~ITripLimitLayer() noexcept = default;
4740
4752{
4753public:
4757 void setAxis(int32_t axis) noexcept
4758 {
4759 mImpl->setAxis(axis);
4760 }
4761
4765 int32_t getAxis() const noexcept
4766 {
4767 return mImpl->getAxis();
4768 }
4769
4779 void setReverse(bool reverse) noexcept
4780 {
4781 mImpl->setReverse(reverse);
4782 }
4783
4789 bool getReverse() const noexcept
4790 {
4791 return mImpl->getReverse();
4792 }
4793
4794protected:
4795 virtual ~IIteratorLayer() noexcept = 0;
4796 apiv::VIteratorLayer* mImpl;
4797};
4798
4799inline IIteratorLayer::~IIteratorLayer() noexcept = default;
4800
4811class ILoop : public INoCopy
4812{
4813public:
4820 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4821 {
4822 return mImpl->addRecurrence(initialValue);
4823 }
4824
4842 {
4843 return mImpl->addTripLimit(tensor, limit);
4844 }
4845
4854 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4855 {
4856 return mImpl->addIterator(tensor, axis, reverse);
4857 }
4858
4867 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4868 {
4869 return mImpl->addLoopOutput(tensor, outputKind, axis);
4870 }
4871
4882 void setName(char const* name) noexcept
4883 {
4884 mImpl->setName(name);
4885 }
4886
4892 char const* getName() const noexcept
4893 {
4894 return mImpl->getName();
4895 }
4896
4897protected:
4898 virtual ~ILoop() noexcept = 0;
4899 apiv::VLoop* mImpl;
4900};
4901
4902inline ILoop::~ILoop() noexcept = default;
4903
4916class ISelectLayer : public ILayer
4917{
4918protected:
4919 virtual ~ISelectLayer() noexcept = 0;
4920 apiv::VSelectLayer* mImpl;
4921};
4922
4923inline ISelectLayer::~ISelectLayer() noexcept = default;
4924
4941{
4942public:
4951 void setMessage(char const* message) noexcept
4952 {
4953 mImpl->setMessage(message);
4954 }
4955
4961 char const* getMessage() const noexcept
4962 {
4963 return mImpl->getMessage();
4964 }
4965
4966protected:
4967 virtual ~IAssertionLayer() noexcept = 0;
4968
4969 apiv::VAssertionLayer* mImpl;
4970};
4971
4972inline IAssertionLayer::~IAssertionLayer() noexcept = default;
4973
4981enum class FillOperation : int32_t
4982{
4999 kLINSPACE = 0,
5000
5003 kRANDOM_UNIFORM = 1,
5004
5007 kRANDOM_NORMAL = 2
5008};
5009
5015template <>
5017{
5018 static constexpr int32_t kVALUE = 3;
5019};
5020
5056class IFillLayer : public ILayer
5057{
5058public:
5067 //
5068 void setDimensions(Dims const& dimensions) noexcept
5069 {
5070 mImpl->setDimensions(dimensions);
5071 }
5072
5083 Dims getDimensions() const noexcept
5084 {
5085 return mImpl->getDimensions();
5086 }
5087
5093 void setOperation(FillOperation op) noexcept
5094 {
5095 mImpl->setOperation(op);
5096 }
5097
5104 {
5105 return mImpl->getOperation();
5106 }
5107
5121 //
5122 void setAlpha(double alpha) noexcept
5123 {
5124 mImpl->setAlpha(alpha);
5125 }
5126
5137 double getAlpha() const noexcept
5138 {
5139 return mImpl->getAlpha();
5140 }
5141
5156 void setBeta(double beta) noexcept
5157 {
5158 mImpl->setBeta(beta);
5159 }
5160
5171 double getBeta() const noexcept
5172 {
5173 return mImpl->getBeta();
5174 }
5175
5216 using ILayer::setInput;
5217
5231 //
5232 void setAlphaInt64(int64_t alpha) noexcept
5233 {
5234 mImpl->setAlphaInt64(alpha);
5235 }
5236
5247 int64_t getAlphaInt64() const noexcept
5248 {
5249 return mImpl->getAlphaInt64();
5250 }
5251
5266 void setBetaInt64(int64_t beta) noexcept
5267 {
5268 mImpl->setBetaInt64(beta);
5269 }
5270
5281 int64_t getBetaInt64() const noexcept
5282 {
5283 return mImpl->getBetaInt64();
5284 }
5285
5289 bool isAlphaBetaInt64() const noexcept
5290 {
5291 return mImpl->isAlphaBetaInt64();
5292 }
5293
5307 void setToType(DataType toType) noexcept
5308 {
5309 mImpl->setToType(toType);
5310 }
5311
5319 DataType getToType() const noexcept
5320 {
5321 return mImpl->getToType();
5322 }
5323
5324protected:
5325 virtual ~IFillLayer() noexcept = 0;
5326 apiv::VFillLayer* mImpl;
5327};
5328
5329inline IFillLayer::~IFillLayer() noexcept = default;
5330
5406{
5407public:
5416 int32_t getAxis() const noexcept
5417 {
5418 return mImpl->getAxis();
5419 }
5427 void setAxis(int32_t axis) noexcept
5428 {
5429 mImpl->setAxis(axis);
5430 }
5431
5440 bool setBlockShape(Dims const& blockShape) noexcept
5441 {
5442 return mImpl->setBlockShape(blockShape);
5443 }
5444
5452 {
5453 return mImpl->getBlockShape();
5454 }
5455
5467 void setToType(DataType toType) noexcept
5468 {
5469 mImpl->setToType(toType);
5470 }
5471
5479 DataType getToType() const noexcept
5480 {
5481 return mImpl->getToType();
5482 }
5483
5484protected:
5485 virtual ~IQuantizeLayer() noexcept = 0;
5486 apiv::VQuantizeLayer* mImpl;
5487};
5488
5489inline IQuantizeLayer::~IQuantizeLayer() noexcept = default;
5490
5560{
5561public:
5570 int32_t getAxis() const noexcept
5571 {
5572 return mImpl->getAxis();
5573 }
5581 void setAxis(int32_t axis) noexcept
5582 {
5583 mImpl->setAxis(axis);
5584 }
5585
5598 bool setBlockShape(Dims const& blockShape) noexcept
5599 {
5600 return mImpl->setBlockShape(blockShape);
5601 }
5602
5610 {
5611 return mImpl->getBlockShape();
5612 }
5613
5625 void setToType(DataType toType) noexcept
5626 {
5627 mImpl->setToType(toType);
5628 }
5629
5637 DataType getToType() const noexcept
5638 {
5639 return mImpl->getToType();
5640 }
5641
5642protected:
5643 virtual ~IDequantizeLayer() noexcept = 0;
5644 apiv::VDequantizeLayer* mImpl;
5645};
5646
5647inline IDequantizeLayer::~IDequantizeLayer() noexcept = default;
5648
5667{
5668public:
5680 using ILayer::setInput;
5681
5694 void setToType(DataType toType) noexcept
5695 {
5696 mImpl->setToType(toType);
5697 }
5698
5707 DataType getToType() const noexcept
5708 {
5709 return mImpl->getToType();
5710 }
5711
5720 void setScaleType(DataType scaleType) noexcept
5721 {
5722 mImpl->setScaleType(scaleType);
5723 }
5724
5733 DataType getScaleType() const noexcept
5734 {
5735 return mImpl->getScaleType();
5736 }
5737
5746 TRT_DEPRECATED void setAxis(int32_t axis) noexcept
5747 {
5748 mImpl->setAxis(axis);
5749 }
5750
5756 TRT_DEPRECATED int32_t getAxis() const noexcept
5757 {
5758 return mImpl->getAxis();
5759 }
5760
5769 TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
5770 {
5771 mImpl->setBlockSize(size);
5772 }
5773
5779 TRT_DEPRECATED int32_t getBlockSize() const noexcept
5780 {
5781 return mImpl->getBlockSize();
5782 }
5783
5792 void setBlockShape(Dims const& blockShape) noexcept
5793 {
5794 mImpl->setBlockShape(blockShape);
5795 }
5796
5804 Dims getBlockShape() const noexcept
5805 {
5806 return mImpl->getBlockShape();
5807 }
5808
5809protected:
5810 virtual ~IDynamicQuantizeLayer() noexcept = 0;
5811 apiv::VDynamicQuantizeLayer* mImpl;
5812};
5813
5814inline IDynamicQuantizeLayer::~IDynamicQuantizeLayer() noexcept = default;
5815
5850class IEinsumLayer : public ILayer
5851{
5852public:
5862 bool setEquation(char const* equation) noexcept
5863 {
5864 return mImpl->setEquation(equation);
5865 }
5866
5872 char const* getEquation() const noexcept
5873 {
5874 return mImpl->getEquation();
5875 }
5876
5877protected:
5878 virtual ~IEinsumLayer() noexcept = 0;
5879 apiv::VEinsumLayer* mImpl;
5880};
5881
5882inline IEinsumLayer::~IEinsumLayer() noexcept = default;
5883
5891enum class ScatterMode : int32_t
5892{
5893 kELEMENT = 0,
5894 kND = 1,
5895};
5896
5902template <>
5904{
5905 static constexpr int32_t kVALUE = 2;
5906};
5907
5965class IScatterLayer : public ILayer
5966{
5967public:
5973 void setMode(ScatterMode mode) noexcept
5974 {
5975 mImpl->setMode(mode);
5976 }
5977
5983 ScatterMode getMode() const noexcept
5984 {
5985 return mImpl->getMode();
5986 }
5987
5993 void setAxis(int32_t axis) noexcept
5994 {
5995 mImpl->setAxis(axis);
5996 }
5997
6001 int32_t getAxis() const noexcept
6002 {
6003 return mImpl->getAxis();
6004 }
6005
6006protected:
6007 apiv::VScatterLayer* mImpl;
6008 virtual ~IScatterLayer() noexcept = 0;
6009}; // class IScatterLayer
6010
6011inline IScatterLayer::~IScatterLayer() noexcept = default;
6012
6040class IOneHotLayer : public ILayer
6041{
6042public:
6048 void setAxis(int32_t axis) noexcept
6049 {
6050 mImpl->setAxis(axis);
6051 }
6052
6056 int32_t getAxis() const noexcept
6057 {
6058 return mImpl->getAxis();
6059 }
6060
6061protected:
6062 apiv::VOneHotLayer* mImpl;
6063 virtual ~IOneHotLayer() noexcept = 0;
6064};
6065
6066inline IOneHotLayer::~IOneHotLayer() noexcept = default;
6067
6080{
6081public:
6088 {
6089 mImpl->setInterpolationMode(mode);
6090 }
6091
6100 {
6101 return mImpl->getInterpolationMode();
6102 }
6103
6109 void setAlignCorners(bool alignCorners) noexcept
6110 {
6111 mImpl->setAlignCorners(alignCorners);
6112 }
6113
6121 bool getAlignCorners() const noexcept
6122 {
6123 return mImpl->getAlignCorners();
6124 }
6125
6133 bool setSampleMode(SampleMode mode) noexcept
6134 {
6135 return mImpl->setSampleMode(mode);
6136 }
6137
6145 SampleMode getSampleMode() const noexcept
6146 {
6147 return mImpl->getSampleMode();
6148 }
6149
6150protected:
6151 apiv::VGridSampleLayer* mImpl;
6152 virtual ~IGridSampleLayer() noexcept = 0;
6153}; // class IGridSampleLayer
6154
6155inline IGridSampleLayer::~IGridSampleLayer() noexcept = default;
6156
6164enum class BoundingBoxFormat : int32_t
6165{
6167 kCORNER_PAIRS = 0,
6169 kCENTER_SIZES = 1
6170};
6171
6177template <>
6179{
6180 static constexpr int32_t kVALUE = 2;
6181};
6182
6233class INMSLayer : public ILayer
6234{
6235public:
6246 {
6247 mImpl->setBoundingBoxFormat(fmt);
6248 }
6249
6258 {
6259 return mImpl->getBoundingBoxFormat();
6260 }
6261
6271 void setTopKBoxLimit(int32_t limit) noexcept
6272 {
6273 mImpl->setTopKBoxLimit(limit);
6274 }
6275
6281 int32_t getTopKBoxLimit() const noexcept
6282 {
6283 return mImpl->getTopKBoxLimit();
6284 }
6285
6304 using ILayer::setInput;
6305
6316 bool setIndicesType(DataType type) noexcept
6317 {
6318 return mImpl->setIndicesType(type);
6319 }
6320
6328 DataType getIndicesType() const noexcept
6329 {
6330 return mImpl->getIndicesType();
6331 }
6332
6333protected:
6334 apiv::VNMSLayer* mImpl;
6335 virtual ~INMSLayer() noexcept = 0;
6336}; // class INMSLayer
6337
6338inline INMSLayer::~INMSLayer() noexcept = default;
6339
6353{
6354public:
6363 void setBatchAxis(int32_t batchAxis) noexcept
6364 {
6365 mImpl->setBatchAxis(batchAxis);
6366 }
6367
6373 int32_t getBatchAxis() const noexcept
6374 {
6375 return mImpl->getBatchAxis();
6376 }
6377
6386 void setSequenceAxis(int32_t sequenceAxis) noexcept
6387 {
6388 mImpl->setSequenceAxis(sequenceAxis);
6389 }
6390
6396 int32_t getSequenceAxis() const noexcept
6397 {
6398 return mImpl->getSequenceAxis();
6399 }
6400
6401protected:
6402 apiv::VReverseSequenceLayer* mImpl;
6403 virtual ~IReverseSequenceLayer() noexcept = 0;
6404}; // class IReverseSequenceLayer
6405
6406inline IReverseSequenceLayer::~IReverseSequenceLayer() noexcept = default;
6407
6427{
6428public:
6436 void setEpsilon(float eps) noexcept
6437 {
6438 return mImpl->setEpsilon(eps);
6439 }
6440
6446 float getEpsilon() const noexcept
6447 {
6448 return mImpl->getEpsilon();
6449 }
6450
6456 void setAxes(uint32_t axesMask) noexcept
6457 {
6458 return mImpl->setAxes(axesMask);
6459 }
6460
6466 uint32_t getAxes() const noexcept
6467 {
6468 return mImpl->getAxes();
6469 }
6470
6487 void setNbGroups(int64_t nbGroups) noexcept
6488 {
6489 return mImpl->setNbGroups(nbGroups);
6490 }
6491
6497 int64_t getNbGroups() const noexcept
6498 {
6499 return mImpl->getNbGroups();
6500 }
6501
6502
6508 TRT_NODISCARD bool isV2() const noexcept
6509 {
6510 return mImpl->isV2();
6511 }
6512
6513protected:
6514 apiv::VNormalizationLayer* mImpl;
6515 virtual ~INormalizationLayer() noexcept = 0;
6516};
6517
6518inline INormalizationLayer::~INormalizationLayer() noexcept = default;
6519
6520
6529class ISqueezeLayer : public ILayer
6530{
6531public:
6544 using ILayer::setInput;
6545
6546protected:
6547 apiv::VSqueezeLayer* mImpl;
6548 virtual ~ISqueezeLayer() noexcept = 0;
6549};
6550
6551inline ISqueezeLayer::~ISqueezeLayer() noexcept = default;
6552
6562{
6563public:
6577 using ILayer::setInput;
6578
6579protected:
6580 apiv::VUnsqueezeLayer* mImpl;
6581 virtual ~IUnsqueezeLayer() noexcept = 0;
6582};
6583
6584inline IUnsqueezeLayer::~IUnsqueezeLayer() noexcept = default;
6585
6597enum class CumulativeOperation : int32_t
6598{
6599 kSUM = 0,
6600};
6601
6607template <>
6609{
6610 static constexpr int32_t kVALUE = 1;
6611};
6612
6641{
6642public:
6653 {
6654 return mImpl->setOperation(op);
6655 }
6656
6665 {
6666 return mImpl->getOperation();
6667 }
6668
6676 void setExclusive(bool exclusive) noexcept
6677 {
6678 mImpl->setExclusive(exclusive);
6679 }
6680
6688 bool getExclusive() const noexcept
6689 {
6690 return mImpl->getExclusive();
6691 }
6692
6700 void setReverse(bool reverse) noexcept
6701 {
6702 mImpl->setReverse(reverse);
6703 }
6704
6712 bool getReverse() const noexcept
6713 {
6714 return mImpl->getReverse();
6715 }
6716
6717protected:
6718 apiv::VCumulativeLayer* mImpl;
6719 virtual ~ICumulativeLayer() noexcept = 0;
6720};
6721
6722inline ICumulativeLayer::~ICumulativeLayer() noexcept = default;
6723
6729enum class AttentionNormalizationOp : int32_t
6730{
6731 kNONE
6732 = 0,
6733 kSOFTMAX = 1,
6734};
6735
6741template <>
6743{
6744 static constexpr int32_t kVALUE = 2;
6745};
6746
6761enum class CausalMaskKind : int32_t
6762{
6764 kNONE = 0,
6765
6767 kUPPER_LEFT = 1,
6768
6770 kLOWER_RIGHT = 2,
6771};
6772
6778template <>
6780{
6781 static constexpr int32_t kVALUE = 3;
6782};
6783
6789enum class AttentionIOForm : int32_t
6790{
6793 kPADDED_BHND = 0,
6796 kPACKED_NHD = 1,
6797};
6798
6804template <>
6806{
6807 static constexpr int32_t kVALUE = 2;
6808};
6809
6820{
6821public:
6825 IAttention* getAttention() const noexcept
6826 {
6827 return mBoundary->getAttention();
6828 }
6829
6830protected:
6831 virtual ~IAttentionBoundaryLayer() noexcept = 0;
6832 apiv::VAttentionBoundaryLayer* mBoundary;
6833};
6834
6835inline IAttentionBoundaryLayer::~IAttentionBoundaryLayer() noexcept = default;
6836
6848{
6849public:
6867 using ILayer::setInput;
6868
6869protected:
6870 virtual ~IAttentionInputLayer() noexcept = 0;
6871 apiv::VAttentionInputLayer* mImpl;
6872};
6873
6874inline IAttentionInputLayer::~IAttentionInputLayer() noexcept = default;
6875
6887{
6888public:
6889protected:
6890 virtual ~IAttentionOutputLayer() noexcept = 0;
6891 apiv::VAttentionOutputLayer* mImpl;
6892};
6893
6894inline IAttentionOutputLayer::~IAttentionOutputLayer() noexcept = default;
6895
6956class IAttention : public INoCopy
6957{
6958public:
6967 {
6968 return mImpl->setNormalizationOperation(op);
6969 }
6970
6979 {
6980 return mImpl->getNormalizationOperation();
6981 }
6982
6995 bool setMask(ITensor& mask) noexcept
6996 {
6997 return mImpl->setMask(mask);
6998 }
6999
7007 ITensor* getMask() noexcept
7008 {
7009 return mImpl->getMask();
7010 }
7011
7025 TRT_DEPRECATED bool setCausal(bool isCausal) noexcept
7026 {
7027 return mImpl->setCausal(isCausal);
7028 }
7029
7039 TRT_DEPRECATED bool getCausal() const noexcept
7040 {
7041 return mImpl->getCausal();
7042 }
7043
7059 bool setCausalKind(CausalMaskKind kind) noexcept
7060 {
7061 return mImpl->setCausalKind(kind);
7062 }
7063
7072 {
7073 return mImpl->getCausalKind();
7074 }
7075
7083 bool setDecomposable(bool decomposable) noexcept
7084 {
7085 return mImpl->setDecomposable(decomposable);
7086 }
7087
7096 bool getDecomposable() const noexcept
7097 {
7098 return mImpl->getDecomposable();
7099 }
7100
7115 bool setInput(int32_t index, ITensor& input) noexcept
7116 {
7117 return mImpl->setInput(index, input);
7118 }
7119
7124 int32_t getNbInputs() const noexcept
7125 {
7126 return mImpl->getNbInputs();
7127 }
7128
7136 ITensor* getInput(int32_t index) const noexcept
7137 {
7138 return mImpl->getInput(index);
7139 }
7140
7144 int32_t getNbOutputs() const noexcept
7145 {
7146 return mImpl->getNbOutputs();
7147 }
7148
7156 ITensor* getOutput(int32_t index) const noexcept
7157 {
7158 return mImpl->getOutput(index);
7159 }
7160
7173 bool setName(char const* name) noexcept
7174 {
7175 return mImpl->setName(name);
7176 }
7177
7185 char const* getName() const noexcept
7186 {
7187 return mImpl->getName();
7188 }
7189
7202 {
7203 return mImpl->setNormalizationQuantizeScale(tensor);
7204 }
7205
7213 {
7214 return mImpl->getNormalizationQuantizeScale();
7215 }
7216
7226 {
7227 return mImpl->setNormalizationQuantizeToType(type);
7228 }
7229
7238 {
7239 return mImpl->getNormalizationQuantizeToType();
7240 }
7241
7257 bool setMetadata(char const* metadata) noexcept
7258 {
7259 return mImpl->setMetadata(metadata);
7260 }
7261
7270 char const* getMetadata() const noexcept
7271 {
7272 return mImpl->getMetadata();
7273 }
7274
7286 bool setNbRanks(int32_t nbRanks) noexcept
7287 {
7288 return mImpl->setNbRanks(nbRanks);
7289 }
7290
7298 int32_t getNbRanks() const noexcept
7299 {
7300 return mImpl->getNbRanks();
7301 }
7302
7316 {
7317 return mImpl->setQueryForm(form);
7318 }
7319
7329 {
7330 return mImpl->getQueryForm();
7331 }
7332
7346 {
7347 return mImpl->setKeyValueForm(form);
7348 }
7349
7359 {
7360 return mImpl->getKeyValueForm();
7361 }
7362
7382 TRT_NODISCARD bool setQueryLengths(ITensor* lengths) noexcept
7383 {
7384 return mImpl->setQueryLengths(lengths);
7385 }
7386
7395 {
7396 return mImpl->getQueryLengths();
7397 }
7398
7422 {
7423 return mImpl->setKeyValueLengths(lengths);
7424 }
7425
7434 {
7435 return mImpl->getKeyValueLengths();
7436 }
7437
7438protected:
7439 apiv::VAttention* mImpl;
7440 virtual ~IAttention() noexcept = 0;
7441};
7442
7443inline IAttention::~IAttention() noexcept = default;
7444
7452{
7453public:
7459 void setInterleaved(bool interleaved) noexcept
7460 {
7461 mImpl->setInterleaved(interleaved);
7462 }
7463
7464
7470 TRT_NODISCARD bool getInterleaved() const noexcept
7471 {
7472 return mImpl->getInterleaved();
7473 }
7474
7475
7481 TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
7482 {
7483 return mImpl->setRotaryEmbeddingDim(rotaryEmbeddingDim);
7484 }
7485
7486
7492 TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
7493 {
7494 return mImpl->getRotaryEmbeddingDim();
7495 }
7496
7497
7511 using ILayer::setInput;
7512
7513protected:
7514 apiv::VRotaryEmbeddingLayer* mImpl;
7515 virtual ~IRotaryEmbeddingLayer() noexcept = 0;
7516};
7517
7518inline IRotaryEmbeddingLayer::~IRotaryEmbeddingLayer() noexcept = default;
7519
7525enum class KVCacheMode : int32_t
7526{
7527 kLINEAR = 0,
7528};
7529
7535template <>
7537{
7538 static constexpr int32_t kVALUE = 1;
7539};
7540
7561{
7562public:
7577 using ILayer::setInput;
7578
7586 bool setCacheMode(KVCacheMode cacheMode) noexcept
7587 {
7588 return mImpl->setCacheMode(cacheMode);
7589 }
7590
7596 KVCacheMode getCacheMode() const noexcept
7597 {
7598 return mImpl->getCacheMode();
7599 }
7600
7615 {
7616 return mImpl->setUpdateForm(form);
7617 }
7618
7628 {
7629 return mImpl->getUpdateForm();
7630 }
7631
7650 {
7651 return mImpl->setUpdateLengths(lengths);
7652 }
7653
7662 {
7663 return mImpl->getUpdateLengths();
7664 }
7665
7666protected:
7667 apiv::VKVCacheUpdateLayer* mImpl;
7668 virtual ~IKVCacheUpdateLayer() noexcept = 0;
7669};
7670
7671inline IKVCacheUpdateLayer::~IKVCacheUpdateLayer() noexcept = default;
7672
7678enum class MoEActType : int32_t
7679{
7680 kNONE = 0,
7681 kSILU = 1,
7682};
7683
7689template <>
7691{
7692 static constexpr int32_t kVALUE = 2;
7693};
7694
7695
7811class IMoELayer : public ILayer
7812{
7813public:
7825 void setGatedWeights(ITensor& fcGateWeights, ITensor& fcUpWeights, ITensor& fcDownWeights, MoEActType activationType) noexcept
7826 {
7827 mImpl->setGatedWeights(fcGateWeights, fcUpWeights, fcDownWeights, activationType);
7828 }
7829
7837 void setGatedBiases(ITensor& fcGateBiases, ITensor& fcUpBiases, ITensor& fcDownBiases) noexcept
7838 {
7839 mImpl->setGatedBiases(fcGateBiases, fcUpBiases, fcDownBiases);
7840 }
7841
7849 void setActivationType(MoEActType activationType) noexcept
7850 {
7851 mImpl->setActivationType(activationType);
7852 }
7853
7862 {
7863 return mImpl->getActivationType();
7864 }
7865
7887 void setQuantizationStatic(ITensor& fcDownActivationScale, DataType dataType) noexcept
7888 {
7889 mImpl->setQuantizationStatic(fcDownActivationScale, dataType);
7890 }
7891
7920 void setQuantizationDynamicDblQ(ITensor& fcDownActivationDblQScale, DataType dataType, Dims const& blockShape, DataType dynQOutputScaleType) noexcept
7921 {
7922 mImpl->setQuantizationDynamicDblQ(fcDownActivationDblQScale, dataType, blockShape, dynQOutputScaleType);
7923 }
7924
7936 {
7937 mImpl->setQuantizationToType(type);
7938 }
7939
7948 {
7949 return mImpl->getQuantizationToType();
7950 }
7951
7963 void setQuantizationBlockShape(Dims const& blockShape) noexcept
7964 {
7965 mImpl->setQuantizationBlockShape(blockShape);
7966 }
7967
7976 {
7977 return mImpl->getQuantizationBlockShape();
7978 }
7979
7988 {
7989 mImpl->setDynQOutputScaleType(type);
7990 }
7991
8000 {
8001 return mImpl->getDynQOutputScaleType();
8002 }
8003
8020 void setSwigluParams(float limit, float alpha, float beta) noexcept
8021 {
8022 mImpl->setSwigluParams(limit, alpha, beta);
8023 }
8024
8034 void setSwigluParamLimit(float limit) noexcept
8035 {
8036 mImpl->setSwigluParamLimit(limit);
8037 }
8038
8046 float getSwigluParamLimit() const noexcept
8047 {
8048 return mImpl->getSwigluParamLimit();
8049 }
8050
8060 void setSwigluParamAlpha(float alpha) noexcept
8061 {
8062 mImpl->setSwigluParamAlpha(alpha);
8063 }
8064
8072 float getSwigluParamAlpha() const noexcept
8073 {
8074 return mImpl->getSwigluParamAlpha();
8075 }
8076
8086 void setSwigluParamBeta(float beta) noexcept
8087 {
8088 mImpl->setSwigluParamBeta(beta);
8089 }
8090
8098 float getSwigluParamBeta() const noexcept
8099 {
8100 return mImpl->getSwigluParamBeta();
8101 }
8102
8115 void setInput(int32_t index, ITensor& tensor) noexcept
8116 {
8117 mImpl->setInput(index, tensor);
8118 }
8119
8120 using ILayer::setInput;
8121
8122protected:
8123 virtual ~IMoELayer() noexcept = 0;
8124 apiv::VMoELayer* mImpl;
8125};
8126
8127inline IMoELayer::~IMoELayer() noexcept = default;
8128
8137{
8138protected:
8139 virtual ~IDistCollectiveLayer() noexcept = 0;
8140 apiv::VDistCollectiveLayer* mImpl;
8141}; // class IDistCollectiveLayer
8142
8143inline IDistCollectiveLayer::~IDistCollectiveLayer() noexcept = default;
8144
8163{
8164public:
8165 virtual ~INetworkDefinition() noexcept = 0;
8166
8202 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
8203 {
8204 return mImpl->addInput(name, type, dimensions);
8205 }
8206
8216 void markOutput(ITensor& tensor) noexcept
8217 {
8218 mImpl->markOutput(tensor);
8219 }
8220
8234 bool markDebug(ITensor& tensor) noexcept
8235 {
8236 return mImpl->markDebug(tensor);
8237 }
8238
8250 bool unmarkDebug(ITensor& tensor) noexcept
8251 {
8252 return mImpl->unmarkDebug(tensor);
8253 }
8254
8260 bool isDebugTensor(ITensor const& tensor) const noexcept
8261 {
8262 return mImpl->isDebugTensor(tensor);
8263 }
8264
8283 {
8284 return mImpl->markUnfusedTensorsAsDebugTensors();
8285 }
8286
8297 {
8298 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
8299 }
8300
8317 {
8318 return mImpl->addActivation(input, type);
8319 }
8320
8335 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
8336 {
8337 return mImpl->addLRN(input, window, alpha, beta, k);
8338 }
8339
8361 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
8362 {
8363 return mImpl->addScale(input, mode, shift, scale, power);
8364 }
8365
8375 {
8376 return mImpl->addSoftMax(input);
8377 }
8378
8391 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
8392 {
8393 return mImpl->addConcatenation(inputs, nbInputs);
8394 }
8395
8419 {
8420 return mImpl->addElementWise(input1, input2, op);
8421 }
8422
8440 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
8441 {
8442 return mImpl->addUnary(input, operation);
8443 }
8444
8455 {
8456 return mImpl->addShuffle(input);
8457 }
8458
8471 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
8472 {
8473 return mImpl->addOneHot(indices, values, depth, axis);
8474 }
8475
8483 int32_t getNbLayers() const noexcept
8484 {
8485 return mImpl->getNbLayers();
8486 }
8487
8497 ILayer* getLayer(int32_t index) const noexcept
8498 {
8499 return mImpl->getLayer(index);
8500 }
8501
8509 int32_t getNbInputs() const noexcept
8510 {
8511 return mImpl->getNbInputs();
8512 }
8513
8525 ITensor* getInput(int32_t index) const noexcept
8526 {
8527 return mImpl->getInput(index);
8528 }
8529
8539 int32_t getNbOutputs() const noexcept
8540 {
8541 return mImpl->getNbOutputs();
8542 }
8543
8555 ITensor* getOutput(int32_t index) const noexcept
8556 {
8557 return mImpl->getOutput(index);
8558 }
8559
8582 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
8583 {
8584 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
8585 }
8586
8617 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
8618 {
8619 return mImpl->addTopK(input, op, k, reduceAxes);
8620 }
8621
8650 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
8651 {
8652 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
8653 }
8654
8666 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
8667 {
8668 return mImpl->addGather(data, indices, axis);
8669 }
8670
8682 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
8683 {
8684 return mImpl->addGatherV2(data, indices, mode);
8685 }
8686
8702 {
8703 return mImpl->addRaggedSoftMax(input, bounds);
8704 }
8705
8723 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
8724 {
8725 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
8726 }
8727
8742 {
8743 return mImpl->addNonZero(input);
8744 }
8745
8757 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
8758 {
8759 return mImpl->addNonZeroV2(input, indicesType);
8760 }
8761
8781 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
8782 {
8783 return mImpl->addConstant(dimensions, weights);
8784 }
8785
8796 {
8797 return mImpl->addIdentity(input);
8798 }
8799
8810 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
8811 {
8812 return mImpl->addCast(input, toType);
8813 }
8814
8825 void removeTensor(ITensor& tensor) noexcept
8826 {
8827 mImpl->removeTensor(tensor);
8828 }
8829
8837 void unmarkOutput(ITensor& tensor) noexcept
8838 {
8839 mImpl->unmarkOutput(tensor);
8840 }
8841
8858 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
8859 {
8860 return mImpl->addPluginV2(inputs, nbInputs, plugin);
8861 }
8862
8876 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
8877 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
8878 {
8879 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
8880 }
8881
8896 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
8897 {
8898 return mImpl->addSlice(input, start, size, stride);
8899 }
8900
8920 void setName(char const* name) noexcept
8921 {
8922 mImpl->setName(name);
8923 }
8924
8934 char const* getName() const noexcept
8935 {
8936 return mImpl->getName();
8937 }
8938
8950 IShapeLayer* addShape(ITensor& input) noexcept
8951 {
8952 return mImpl->addShape(input);
8953 }
8954
8965 {
8966 return mImpl->hasImplicitBatchDimension();
8967 }
8968
8975 {
8976 return mImpl->getFlags();
8977 }
8978
8986 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8987 {
8988 return mImpl->getFlag(networkDefinitionCreationFlag);
8989 }
8990
9003 bool markOutputForShapes(ITensor& tensor) noexcept
9004 {
9005 return mImpl->markOutputForShapes(tensor);
9006 }
9007
9015 bool unmarkOutputForShapes(ITensor& tensor) noexcept
9016 {
9017 return mImpl->unmarkOutputForShapes(tensor);
9018 }
9019
9034 {
9035 return mImpl->addParametricReLU(input, slope);
9036 }
9037
9056 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
9057 {
9058 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
9059 }
9060
9075 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
9076 {
9077 return mImpl->addPoolingNd(input, type, windowSize);
9078 }
9079
9094 //
9098 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
9099 {
9100 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
9101 }
9102
9135 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
9136 {
9137 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
9138 }
9139
9152 {
9153 return mImpl->addResize(input);
9154 }
9155
9165 ILoop* addLoop() noexcept
9166 {
9167 return mImpl->addLoop();
9168 }
9169
9181 {
9182 return mImpl->addIfConditional();
9183 }
9184
9219 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
9220 {
9221 return mImpl->addSelect(condition, thenInput, elseInput);
9222 }
9223
9236 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
9237 {
9238 return mImpl->addAssertion(condition, message);
9239 }
9240
9262 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
9263 {
9264 return mImpl->addFillV2(dimensions, op, outputType);
9265 }
9266
9278 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
9279 {
9280 return mImpl->addPaddingNd(input, prePadding, postPadding);
9281 }
9282
9302 bool setWeightsName(Weights weights, char const* name) noexcept
9303 {
9304 return mImpl->setWeightsName(weights, name);
9305 }
9306
9318 //
9321 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9322 {
9323 mImpl->setErrorRecorder(recorder);
9324 }
9325
9337 {
9338 return mImpl->getErrorRecorder();
9339 }
9340
9359 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9360 {
9361 return mImpl->addDequantizeV2(input, scale, outputType);
9362 }
9363
9379 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
9380 {
9381 return mImpl->addScatter(data, indices, updates, mode);
9382 }
9383
9403 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9404 {
9405 return mImpl->addQuantizeV2(input, scale, outputType);
9406 }
9407
9431 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
9432 {
9433 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
9434 }
9435
9455 ITensor& input, Dims const& blockShape, DataType outputType, DataType scaleType) noexcept
9456 {
9457 return mImpl->addDynamicQuantizeV2(input, blockShape, outputType, scaleType);
9458 }
9459
9470 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
9471 {
9472 return mImpl->addEinsum(inputs, nbInputs, equation);
9473 }
9474
9489 {
9490 return mImpl->addGridSample(input, grid);
9491 }
9492
9510 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
9511 {
9512 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
9513 }
9514
9530 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
9531 {
9532 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
9533 }
9534
9548 {
9549 return mImpl->addReverseSequence(input, sequenceLens);
9550 }
9551
9579 TRT_DEPRECATED INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9580 {
9581 return mImpl->addNormalization(input, scale, bias, axesMask);
9582 }
9583
9601 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
9602 {
9603 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
9604 }
9605
9632 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
9633 {
9634 return mImpl->addAttention(query, key, value, normOp, causal);
9635 }
9636
9663 CausalMaskKind causalKind) noexcept
9664 {
9665 return mImpl->addAttentionV2(query, key, value, normOp, causalKind);
9666 }
9667
9687 IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
9688 {
9689 return mImpl->addRotaryEmbedding(input, cosCache, sinCache, interleaved, rotaryEmbeddingDim);
9690 }
9691
9722 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept
9723 {
9724 return mImpl->addKVCacheUpdate(cache, update, writeIndices, cacheMode);
9725 }
9726
9743 IMoELayer* addMoE(ITensor& hiddenStates, ITensor& selectedExpertsForTokens, ITensor& scoresForSelectedExperts) noexcept
9744 {
9745 return mImpl->addMoE(hiddenStates, selectedExpertsForTokens, scoresForSelectedExperts);
9746 }
9747
9776 ReduceOperation reduceOp, int64_t root, int64_t* groups, int64_t groupSize) noexcept
9777 {
9778 return mImpl->addDistCollective(input, distCollectiveOp, reduceOp, root, groups, groupSize);
9779 }
9780
9787 virtual IBuilder& getBuilder() const noexcept
9788 {
9789 return mImpl->getBuilder();
9790 }
9791
9802 bool markWeightsRefittable(char const* name) noexcept
9803 {
9804 return mImpl->markWeightsRefittable(name);
9805 }
9806
9815 bool unmarkWeightsRefittable(char const* name) noexcept
9816 {
9817 return mImpl->unmarkWeightsRefittable(name);
9818 }
9819
9828 bool areWeightsMarkedRefittable(char const* name) const noexcept
9829 {
9830 return mImpl->areWeightsMarkedRefittable(name);
9831 }
9832
9847 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
9848 {
9849 return mImpl->addSqueeze(input, axes);
9850 }
9851
9869 {
9870 return mImpl->addUnsqueeze(input, axes);
9871 }
9872
9894 TRT_NODISCARD INormalizationLayer* addNormalizationV2(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9895 {
9896 return mImpl->addNormalizationV2(input, scale, bias, axesMask);
9897 }
9898
9899protected:
9900 apiv::VNetworkDefinition* mImpl;
9901};
9902
9903inline INetworkDefinition::~INetworkDefinition() noexcept = default;
9904
9922enum class RuntimePlatform : int32_t
9923{
9926 kSAME_AS_BUILD = 0,
9927
9930 kWINDOWS_AMD64 = 1,
9931
9932
9933};
9934
9940template <>
9942{
9943 static constexpr int32_t kVALUE = 2;
9944};
9945
9946
9953using BuilderFlags = uint32_t;
9954
9962enum class BuilderFlag : int32_t
9963{
9964
9966 kDEBUG = 2,
9967
9969 kGPU_FALLBACK = 3,
9970
9972 kREFIT = 4,
9973
9976
9980 kTF32 = 6,
9981
9983 kSPARSE_WEIGHTS = 7,
9984
9997
9998
10004
10011
10017
10018
10022
10023
10029
10035 kSTRIP_PLAN = 18,
10036
10043 kREFIT_IDENTICAL = 19,
10044
10070 kWEIGHT_STREAMING = 20,
10071
10072
10078 kREFIT_INDIVIDUAL = 22,
10079
10088 kSTRICT_NANS = 23,
10089
10091 kMONITOR_MEMORY = 24,
10092
10093
10096
10108
10109
10110
10111};
10112
10118template <>
10120{
10121 static constexpr int32_t kVALUE = 28;
10122};
10123
10124namespace v_1_0
10125{
10139{
10140 uint8_t data[16];
10141};
10142
10151{
10153 uint64_t tacticHash;
10157 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
10158};
10159} // namespace v_1_0
10160
10174class ITimingCache : public INoCopy
10175{
10176public:
10177 virtual ~ITimingCache() noexcept = 0;
10178
10188 nvinfer1::IHostMemory* serialize() const noexcept
10189 {
10190 return mImpl->serialize();
10191 }
10192
10212 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
10213 {
10214 return mImpl->combine(inputCache, ignoreMismatch);
10215 }
10216
10222 bool reset() noexcept
10223 {
10224 return mImpl->reset();
10225 }
10226
10241 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
10242 {
10243 return mImpl->queryKeys(keyBuffer, capacity);
10244 }
10245
10258 TimingCacheValue query(TimingCacheKey const& key) const noexcept
10259 {
10260 return mImpl->query(key);
10261 }
10262
10280 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
10281 {
10282 return mImpl->update(key, value);
10283 }
10284
10285protected:
10286 apiv::VTimingCache* mImpl;
10287};
10288
10289inline ITimingCache::~ITimingCache() noexcept = default;
10290
10298enum class MemoryPoolType : int32_t
10299{
10305 kWORKSPACE = 0,
10306
10314
10320 kDLA_LOCAL_DRAM = 2,
10321
10327 kDLA_GLOBAL_DRAM = 3,
10328
10336 kTACTIC_DRAM = 4,
10337
10351};
10352
10358template <>
10360{
10361 static constexpr int32_t kVALUE = 6;
10362};
10363
10372enum class PreviewFeature : int32_t
10373{
10378
10385};
10386
10392template <>
10394{
10395 static constexpr int32_t kVALUE = 2;
10396};
10397
10406enum class HardwareCompatibilityLevel : int32_t
10407{
10410 kNONE = 0,
10411
10423 kAMPERE_PLUS = 1,
10424
10434};
10435
10441template <>
10443{
10444 static constexpr int32_t kVALUE = 3;
10445};
10446
10447
10456enum class TilingOptimizationLevel : int32_t
10457{
10459 kNONE = 0,
10460
10462 kFAST = 1,
10463
10466 kMODERATE = 2,
10467
10469 kFULL = 3
10470
10471};
10472
10478template <>
10480{
10481 static constexpr int32_t kVALUE = 4;
10482};
10483
10484namespace v_1_0
10485{
10487{
10488public:
10489 IProgressMonitor() = default;
10490 virtual ~IProgressMonitor() noexcept = default;
10491
10495 InterfaceInfo getInterfaceInfo() const noexcept override
10496 {
10497 return InterfaceInfo{"IProgressMonitor", 1, 0};
10498 }
10499
10519 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10520
10533 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10534
10546 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10547
10548}; // class IProgressMonitor
10549} // namespace v_1_0
10550
10571
10580{
10581public:
10582 virtual ~IBuilderConfig() noexcept = 0;
10583
10592 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10593 {
10594 mImpl->setAvgTimingIterations(avgTiming);
10595 }
10596
10604 int32_t getAvgTimingIterations() const noexcept
10605 {
10606 return mImpl->getAvgTimingIterations();
10607 }
10608
10617 void setEngineCapability(EngineCapability capability) noexcept
10618 {
10619 mImpl->setEngineCapability(capability);
10620 }
10621
10630 {
10631 return mImpl->getEngineCapability();
10632 }
10633
10646 void setFlags(BuilderFlags builderFlags) noexcept
10647 {
10648 mImpl->setFlags(builderFlags);
10649 }
10650
10658 BuilderFlags getFlags() const noexcept
10659 {
10660 return mImpl->getFlags();
10661 }
10662
10670 void clearFlag(BuilderFlag builderFlag) noexcept
10671 {
10672 mImpl->clearFlag(builderFlag);
10673 }
10674
10682 void setFlag(BuilderFlag builderFlag) noexcept
10683 {
10684 mImpl->setFlag(builderFlag);
10685 }
10686
10694 bool getFlag(BuilderFlag builderFlag) const noexcept
10695 {
10696 return mImpl->getFlag(builderFlag);
10697 }
10698
10711 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10712 {
10713 mImpl->setDeviceType(layer, deviceType);
10714 }
10715
10721 DeviceType getDeviceType(ILayer const* layer) const noexcept
10722 {
10723 return mImpl->getDeviceType(layer);
10724 }
10725
10733 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10734 {
10735 return mImpl->isDeviceTypeSet(layer);
10736 }
10737
10743 void resetDeviceType(ILayer const* layer) noexcept
10744 {
10745 mImpl->resetDeviceType(layer);
10746 }
10747
10753 bool canRunOnDLA(ILayer const* layer) const noexcept
10754 {
10755 return mImpl->canRunOnDLA(layer);
10756 }
10757
10769 void setDLACore(int32_t dlaCore) noexcept
10770 {
10771 mImpl->setDLACore(dlaCore);
10772 }
10773
10779 int32_t getDLACore() const noexcept
10780 {
10781 return mImpl->getDLACore();
10782 }
10783
10790 void setDefaultDeviceType(DeviceType deviceType) noexcept
10791 {
10792 mImpl->setDefaultDeviceType(deviceType);
10793 }
10794
10801 {
10802 return mImpl->getDefaultDeviceType();
10803 }
10804
10810 void reset() noexcept
10811 {
10812 mImpl->reset();
10813 }
10814
10822 void setProfileStream(const cudaStream_t stream) noexcept
10823 {
10824 return mImpl->setProfileStream(stream);
10825 }
10826
10834 cudaStream_t getProfileStream() const noexcept
10835 {
10836 return mImpl->getProfileStream();
10837 }
10838
10851 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10852 {
10853 return mImpl->addOptimizationProfile(profile);
10854 }
10855
10864 int32_t getNbOptimizationProfiles() const noexcept
10865 {
10866 return mImpl->getNbOptimizationProfiles();
10867 }
10868
10877 {
10878 mImpl->setProfilingVerbosity(verbosity);
10879 }
10880
10890 {
10891 return mImpl->getProfilingVerbosity();
10892 }
10893
10911 bool setTacticSources(TacticSources tacticSources) noexcept
10912 {
10913 return mImpl->setTacticSources(tacticSources);
10914 }
10915
10927 {
10928 return mImpl->getTacticSources();
10929 }
10930
10946 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
10947 {
10948 return mImpl->createTimingCache(blob, size);
10949 }
10950
10969 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
10970 {
10971 return mImpl->setTimingCache(cache, ignoreMismatch);
10972 }
10973
10980 {
10981 return mImpl->getTimingCache();
10982 }
10983
11011 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
11012 {
11013 mImpl->setMemoryPoolLimit(pool, poolSize);
11014 }
11015
11030 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
11031 {
11032 return mImpl->getMemoryPoolLimit(pool);
11033 }
11034
11048 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
11049 {
11050 mImpl->setPreviewFeature(feature, enable);
11051 }
11052
11062 bool getPreviewFeature(PreviewFeature feature) const noexcept
11063 {
11064 return mImpl->getPreviewFeature(feature);
11065 }
11066
11095 void setBuilderOptimizationLevel(int32_t level) noexcept
11096 {
11097 mImpl->setBuilderOptimizationLevel(level);
11098 }
11099
11108 {
11109 return mImpl->getBuilderOptimizationLevel();
11110 }
11111
11124 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
11125 {
11126 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
11127 }
11128
11138 {
11139 return mImpl->getHardwareCompatibilityLevel();
11140 }
11141
11150 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
11151 {
11152 mImpl->setPluginsToSerialize(paths, nbPaths);
11153 }
11154
11163 char const* getPluginToSerialize(int32_t index) const noexcept
11164 {
11165 return mImpl->getPluginToSerialize(index);
11166 }
11167
11173 int32_t getNbPluginsToSerialize() const noexcept
11174 {
11175 return mImpl->getNbPluginsToSerialize();
11176 }
11177
11204 bool setMaxAuxStreams(int32_t nbStreams) noexcept
11205 {
11206 return mImpl->setMaxAuxStreams(nbStreams);
11207 }
11208
11214 int32_t getMaxAuxStreams() const noexcept
11215 {
11216 return mImpl->getMaxAuxStreams();
11217 }
11218
11230 void setProgressMonitor(IProgressMonitor* monitor) noexcept
11231 {
11232 return mImpl->setProgressMonitor(monitor);
11233 }
11234
11241 {
11242 return mImpl->getProgressMonitor();
11243 }
11244
11256 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
11257 {
11258 mImpl->setRuntimePlatform(runtimePlatform);
11259 }
11260
11269 {
11270 return mImpl->getRuntimePlatform();
11271 }
11272
11280 void setMaxNbTactics(int32_t maxNbTactics) noexcept
11281 {
11282 mImpl->setMaxNbTactics(maxNbTactics);
11283 }
11284
11292 int32_t getMaxNbTactics() const noexcept
11293 {
11294 return mImpl->getMaxNbTactics();
11295 }
11296
11309 {
11310 return mImpl->setTilingOptimizationLevel(level);
11311 }
11312
11321 {
11322 return mImpl->getTilingOptimizationLevel();
11323 }
11324
11336 bool setL2LimitForTiling(int64_t size) noexcept
11337 {
11338 return mImpl->setL2LimitForTiling(size);
11339 }
11340
11348 int64_t getL2LimitForTiling() const noexcept
11349 {
11350 return mImpl->getL2LimitForTiling();
11351 }
11352
11362 bool setRemoteAutoTuningConfig(char const* config) noexcept
11363 {
11364 return mImpl->setRemoteAutoTuningConfig(config);
11365 }
11366
11372 char const* getRemoteAutoTuningConfig() const noexcept
11373 {
11374 return mImpl->getRemoteAutoTuningConfig();
11375 }
11376
11377
11395 bool setBuildRoute(char const* buildRoute) noexcept
11396 {
11397 return mImpl->setBuildRoute(buildRoute);
11398 }
11399
11409 char const* getBuildRoute() const noexcept
11410 {
11411 return mImpl->getBuildRoute();
11412 }
11413
11445 char const* getAllBuildRoutes() const noexcept
11446 {
11447 return mImpl->getAllBuildRoutes();
11448 }
11449
11450protected:
11451 apiv::VBuilderConfig* mImpl;
11452};
11453
11454inline IBuilderConfig::~IBuilderConfig() noexcept = default;
11455
11464
11474{
11487
11492};
11493
11499template <>
11501{
11502 static constexpr int32_t kVALUE = 3;
11503};
11504
11505
11513class IBuilder : public INoCopy
11514{
11515public:
11516 virtual ~IBuilder() noexcept = 0;
11517
11525 int32_t getMaxDLABatchSize() const noexcept
11526 {
11527 return mImpl->getMaxDLABatchSize();
11528 }
11529
11533 int32_t getNbDLACores() const noexcept
11534 {
11535 return mImpl->getNbDLACores();
11536 }
11537
11551 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11552 {
11553 mImpl->setGpuAllocator(allocator);
11554 }
11555
11566 {
11567 return mImpl->createBuilderConfig();
11568 }
11569
11570
11593 {
11594 return mImpl->createNetworkV2(flags);
11595 }
11596
11608 {
11609 return mImpl->createOptimizationProfile();
11610 }
11611
11626 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11627 {
11628 mImpl->setErrorRecorder(recorder);
11629 }
11630
11642 {
11643 return mImpl->getErrorRecorder();
11644 }
11645
11649 void reset() noexcept
11650 {
11651 mImpl->reset();
11652 }
11653
11669 {
11670 return mImpl->buildSerializedNetwork(network, config);
11671 }
11672
11690 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11691 {
11692 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11693 }
11694
11714 INetworkDefinition& network, IBuilderConfig& config, IHostMemory*& kernelText) noexcept
11715 {
11716 return mImpl->buildSerializedNetworkWithKernelText(network, config, kernelText);
11717 }
11718
11719
11736 {
11737 return mImpl->buildEngineWithConfig(network, config);
11738 }
11739
11761 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11762 {
11763 return mImpl->isNetworkSupported(network, config);
11764 }
11765
11771 ILogger* getLogger() const noexcept
11772 {
11773 return mImpl->getLogger();
11774 }
11775
11787 bool setMaxThreads(int32_t maxThreads) noexcept
11788 {
11789 return mImpl->setMaxThreads(maxThreads);
11790 }
11791
11801 int32_t getMaxThreads() const noexcept
11802 {
11803 return mImpl->getMaxThreads();
11804 }
11805
11812 {
11813 return mImpl->getPluginRegistry();
11814 }
11815
11816protected:
11817 apiv::VBuilder* mImpl;
11818};
11819
11820inline IBuilder::~IBuilder() noexcept = default;
11821
11822} // namespace nvinfer1
11823
11828extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11829
11830namespace nvinfer1
11831{
11832namespace
11833{
11834
11842inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11843{
11844 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11845}
11846
11847} // namespace
11848
11861 nvinfer1::EngineCapability capability) noexcept;
11862
11872extern "C" TENSORRTAPI bool setInternalLibraryPath(AsciiChar const* path) noexcept;
11873
11874namespace safe
11875{
11877class IPluginRegistry;
11878} // namespace safe
11879
11887extern "C" TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
11888 nvinfer1::EngineCapability capability) noexcept;
11889
11890} // namespace nvinfer1
11891
11892#endif // NV_INFER_H
#define TRT_DEPRECATED_API
Definition: NvInferRuntimeBase.h:44
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:70
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:102
#define TRT_NODISCARD
A stand-in for [[nodiscard]] and [[nodiscard(REASON)]] that works with older compilers.
Definition: NvInferRuntimeBase.h:57
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h:224
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:227
An Activation layer in a network definition.
Definition: NvInfer.h:1179
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1227
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1188
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1198
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1236
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1245
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1213
virtual ~IActivationLayer() noexcept=0
An assertion layer in a network.
Definition: NvInfer.h:4941
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4951
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4961
virtual ~IAssertionLayer() noexcept=0
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6820
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6825
virtual ~IAttentionBoundaryLayer() noexcept=0
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6957
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:7007
bool setMetadata(char const *metadata) noexcept
Set the metadata for IAttention.
Definition: NvInfer.h:7257
TRT_NODISCARD bool setQueryLengths(ITensor *lengths) noexcept
Set the query lengths tensor.
Definition: NvInfer.h:7382
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:7083
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7173
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7096
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7136
CausalMaskKind getCausalKind() const noexcept
Get the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7071
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7156
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7144
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device attention execution.
Definition: NvInfer.h:7286
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7124
TRT_NODISCARD bool setKeyValueLengths(ITensor *lengths) noexcept
Set the key-value lengths tensor.
Definition: NvInfer.h:7421
TRT_NODISCARD ITensor * getKeyValueLengths() const noexcept
Get the key-value lengths tensor.
Definition: NvInfer.h:7433
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6966
TRT_NODISCARD AttentionIOForm getKeyValueForm() const noexcept
Get the key-value form.
Definition: NvInfer.h:7358
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7185
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7225
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:7298
TRT_DEPRECATED bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:7039
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6978
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7201
bool setCausalKind(CausalMaskKind kind) noexcept
Set the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7059
TRT_NODISCARD AttentionIOForm getQueryForm() const noexcept
Get the query form.
Definition: NvInfer.h:7328
char const * getMetadata() const noexcept
Get the metadata of IAttention.
Definition: NvInfer.h:7270
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7237
TRT_NODISCARD bool setQueryForm(AttentionIOForm form) noexcept
Set the query form.
Definition: NvInfer.h:7315
virtual ~IAttention() noexcept=0
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7212
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7115
TRT_NODISCARD ITensor * getQueryLengths() const noexcept
Get the query lengths tensor.
Definition: NvInfer.h:7394
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6995
TRT_NODISCARD bool setKeyValueForm(AttentionIOForm form) noexcept
Set the key-value form.
Definition: NvInfer.h:7345
TRT_DEPRECATED bool setCausal(bool isCausal) noexcept
Set whether the attention will run a causal inference. Cannot be used together with setMask().
Definition: NvInfer.h:7025
apiv::VAttention * mImpl
Definition: NvInfer.h:7439
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6848
virtual ~IAttentionInputLayer() noexcept=0
This layer represents an output of an IAttention.
Definition: NvInfer.h:6887
virtual ~IAttentionOutputLayer() noexcept=0
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10580
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:11011
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:10946
bool setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11204
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:11048
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:11062
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:11107
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:10911
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:11150
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:11308
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11336
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:11030
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10779
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:11173
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10711
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10617
virtual ~IBuilderConfig() noexcept=0
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11214
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10694
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:11280
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11348
bool setRemoteAutoTuningConfig(char const *config) noexcept
Set a config string for remote auto tuning.
Definition: NvInfer.h:11362
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:11230
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10876
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10864
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:10979
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10810
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:10969
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:11163
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10629
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:11268
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10800
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:11256
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:11292
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10658
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10646
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:10926
char const * getAllBuildRoutes() const noexcept
Get all available build routes.
Definition: NvInfer.h:11445
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10743
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10769
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:11137
char const * getRemoteAutoTuningConfig() const noexcept
Get a config string for remote auto tuning.
Definition: NvInfer.h:11372
bool setBuildRoute(char const *buildRoute) noexcept
Set the build route to be passed to the compiler.
Definition: NvInfer.h:11395
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10670
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10851
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:11240
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11451
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10604
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:10790
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10682
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10721
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10753
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10834
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:11124
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11320
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10889
char const * getBuildRoute() const noexcept
Get the build route string.
Definition: NvInfer.h:11409
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10733
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:11095
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10822
Builds an engine from a network definition.
Definition: NvInfer.h:11514
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11533
virtual ~IBuilder() noexcept=0
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11641
apiv::VBuilder * mImpl
Definition: NvInfer.h:11817
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11771
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:11761
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11801
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11811
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11607
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11551
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11592
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11565
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11649
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11787
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11626
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11668
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:11689
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11735
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config, IHostMemory *&kernelText) noexcept
Extended form of buildSerializedNetwork that optionally permits getting the kernelText.
Definition: NvInfer.h:11713
A cast layer in a network.
Definition: NvInfer.h:3782
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3808
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3802
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3791
virtual ~ICastLayer() noexcept=0
A concatenation layer in a network definition.
Definition: NvInfer.h:1895
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:1908
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:1918
virtual ~IConcatenationLayer() noexcept=0
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4445
virtual ~IConditionLayer() noexcept=0
Layer that represents a constant value.
Definition: NvInfer.h:3823
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3833
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3843
virtual ~IConstantLayer() noexcept=0
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3855
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3873
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3867
A convolution layer in a network definition.
Definition: NvInfer.h:857
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:982
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:955
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1023
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1127
virtual ~IConvolutionLayer() noexcept=0
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1113
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1083
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:930
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1073
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1137
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:876
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:920
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1009
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:906
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1035
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:896
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:866
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:945
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1058
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1101
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:972
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:999
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1048
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3088
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6641
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6652
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6700
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6718
virtual ~ICumulativeLayer() noexcept=0
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6688
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6712
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6676
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6664
A deconvolution layer in a network definition.
Definition: NvInfer.h:1938
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2026
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:1987
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2011
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2053
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2168
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2234
virtual ~IDeconvolutionLayer() noexcept=0
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2036
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2001
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1957
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2158
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2090
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2141
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2080
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2131
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2186
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1947
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2198
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2224
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2104
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:1977
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2063
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2116
A Dequantize layer in a network definition.
Definition: NvInfer.h:5560
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5609
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5625
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5570
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5598
virtual ~IDequantizeLayer() noexcept=0
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5637
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5581
Definition: NvInfer.h:8137
virtual ~IDistCollectiveLayer() noexcept=0
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5667
virtual ~IDynamicQuantizeLayer() noexcept=0
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5733
TRT_DEPRECATED void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5746
TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5769
Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5804
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5720
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5707
TRT_DEPRECATED int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5756
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5694
void setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5792
TRT_DEPRECATED int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5779
An Einsum layer in a network.
Definition: NvInfer.h:5851
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:5862
virtual ~IEinsumLayer() noexcept=0
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5872
A elementwise layer in a network definition.
Definition: NvInfer.h:2307
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2336
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2330
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2318
virtual ~IElementWiseLayer() noexcept=0
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5057
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5289
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5103
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5093
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5319
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5232
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5266
virtual ~IFillLayer() noexcept=0
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5156
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5247
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5281
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5137
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5068
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5122
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5307
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5083
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5171
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2442
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:2453
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2488
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2524
virtual ~IGatherLayer() noexcept=0
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2498
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2508
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2465
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2518
A GridSample layer in a network definition.
Definition: NvInfer.h:6080
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6087
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6133
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6109
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6151
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6145
virtual ~IGridSampleLayer() noexcept=0
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6099
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6121
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:150
A layer that represents the identity function.
Definition: NvInfer.h:3767
virtual ~IIdentityLayer() noexcept=0
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3769
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4422
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4427
virtual ~IIfConditionalBoundaryLayer() noexcept=0
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4513
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4554
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4579
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4524
virtual ~IIfConditional() noexcept=0
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4542
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4569
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4479
virtual ~IIfConditionalInputLayer() noexcept=0
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4464
virtual ~IIfConditionalOutputLayer() noexcept=0
A layer to do iterations.
Definition: NvInfer.h:4752
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4779
virtual ~IIteratorLayer() noexcept=0
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4789
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4765
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4757
Layer that represents a KVCacheUpdate operation.
Definition: NvInfer.h:7561
bool setCacheMode(KVCacheMode cacheMode) noexcept
Set the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7586
TRT_NODISCARD ITensor * getUpdateLengths() const noexcept
Get the update lengths tensor.
Definition: NvInfer.h:7661
virtual ~IKVCacheUpdateLayer() noexcept=0
TRT_NODISCARD AttentionIOForm getUpdateForm() const noexcept
Get the update form.
Definition: NvInfer.h:7627
TRT_NODISCARD bool setUpdateLengths(ITensor *lengths) noexcept
Set the update lengths tensor.
Definition: NvInfer.h:7649
TRT_NODISCARD bool setUpdateForm(AttentionIOForm form) noexcept
Set the update form.
Definition: NvInfer.h:7614
KVCacheMode getCacheMode() const noexcept
Get the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7596
apiv::VKVCacheUpdateLayer * mImpl
Definition: NvInfer.h:7667
A LRN layer in a network definition.
Definition: NvInfer.h:1544
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1565
virtual ~ILRNLayer() noexcept=0
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1587
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1555
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1621
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1577
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1599
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1609
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1631
Base class for all layer classes in a network definition.
Definition: NvInfer.h:490
virtual ~ILayer() noexcept=0
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:611
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:511
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:529
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:657
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:624
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:592
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:521
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:550
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:560
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:577
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:542
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device execution.
Definition: NvInfer.h:645
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:497
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4397
virtual ~ILoopBoundaryLayer() noexcept=0
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4402
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4812
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4882
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4841
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4854
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:4867
virtual ~ILoop() noexcept=0
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4892
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4820
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4648
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4678
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4653
virtual ~ILoopOutputLayer() noexcept=0
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4670
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3608
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3636
virtual ~IMatrixMultiplyLayer() noexcept=0
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3630
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3618
A MoE layer in a network definition. Mixture of Experts (MoE) is a collection of experts with each ex...
Definition: NvInfer.h:7812
void setSwigluParamLimit(float limit) noexcept
Set the SwiGLU parameter limit.
Definition: NvInfer.h:8034
void setDynQOutputScaleType(DataType type) noexcept
Set the dynamic quantization output scale type.
Definition: NvInfer.h:7987
MoEActType getActivationType() const noexcept
Get the activation type for the MoE layer.
Definition: NvInfer.h:7861
void setQuantizationToType(DataType type) noexcept
Set the data type the mul output is quantized to.
Definition: NvInfer.h:7935
void setQuantizationDynamicDblQ(ITensor &fcDownActivationDblQScale, DataType dataType, Dims const &blockShape, DataType dynQOutputScaleType) noexcept
Configure dynamic quantization (with double quantization) after the mul op.
Definition: NvInfer.h:7920
void setQuantizationStatic(ITensor &fcDownActivationScale, DataType dataType) noexcept
Configure static quantization after the mul op.
Definition: NvInfer.h:7887
float getSwigluParamLimit() const noexcept
Get the SwiGLU parameter limit.
Definition: NvInfer.h:8046
DataType getQuantizationToType() const noexcept
Get the data type the mul in MoE layer is quantized to.
Definition: NvInfer.h:7947
DataType getDynQOutputScaleType() const noexcept
Get the dynamic quantization output scale type.
Definition: NvInfer.h:7999
virtual ~IMoELayer() noexcept=0
void setActivationType(MoEActType activationType) noexcept
Set the activation type for the MoE layer.
Definition: NvInfer.h:7849
Dims getQuantizationBlockShape() const noexcept
Get the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7975
void setGatedWeights(ITensor &fcGateWeights, ITensor &fcUpWeights, ITensor &fcDownWeights, MoEActType activationType) noexcept
Set the weights of the experts when each expert is a GLU (gated linear unit). In each GLU,...
Definition: NvInfer.h:7825
float getSwigluParamBeta() const noexcept
Get the SwiGLU parameter beta.
Definition: NvInfer.h:8098
void setSwigluParamBeta(float beta) noexcept
Set the SwiGLU parameter beta.
Definition: NvInfer.h:8086
void setGatedBiases(ITensor &fcGateBiases, ITensor &fcUpBiases, ITensor &fcDownBiases) noexcept
Set the biases of the experts when each expert is a GLU (gated linear unit). In each GLU,...
Definition: NvInfer.h:7837
void setSwigluParams(float limit, float alpha, float beta) noexcept
Set the SwiGLU parameters.
Definition: NvInfer.h:8020
void setQuantizationBlockShape(Dims const &blockShape) noexcept
Set the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7963
void setInput(int32_t index, ITensor &tensor) noexcept
Set the input of the MoE layer.
Definition: NvInfer.h:8115
float getSwigluParamAlpha() const noexcept
Get the SwiGLU parameter alpha.
Definition: NvInfer.h:8072
void setSwigluParamAlpha(float alpha) noexcept
Set the SwiGLU parameter alpha.
Definition: NvInfer.h:8060
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6234
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6271
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6245
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6257
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6316
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6334
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6281
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6328
virtual ~INMSLayer() noexcept=0
A network definition for input to the builder.
Definition: NvInfer.h:8163
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:8391
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:8454
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:8920
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:8650
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:8234
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:8335
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:9601
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:9236
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8741
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:9055
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:8810
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:9134
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:8934
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:9033
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:8555
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:8525
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:8617
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:9359
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:9015
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:9262
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:9165
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:8282
TRT_NODISCARD INormalizationLayer * addNormalizationV2(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9894
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:8316
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:8896
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:9787
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:8497
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:8260
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:8986
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:9180
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9336
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:9847
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9510
IAttention * addAttentionV2(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, CausalMaskKind causalKind) noexcept
Add an attention to the network with explicit causal mask kind.
Definition: NvInfer.h:9662
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:9547
TRT_DEPRECATED 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:9430
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:8509
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:8974
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:9403
IDynamicQuantizeLayer * addDynamicQuantizeV2(ITensor &input, Dims const &blockShape, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:9454
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:8581
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:8440
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:9488
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:8825
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:9828
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:9219
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:9379
TRT_DEPRECATED INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9579
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:8483
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:8964
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:9900
IKVCacheUpdateLayer * addKVCacheUpdate(ITensor &cache, ITensor &update, ITensor &writeIndices, KVCacheMode cacheMode) noexcept
Add a KVCacheUpdate layer to the network.
Definition: NvInfer.h:9721
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:9003
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:8471
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:8361
IPluginV3Layer * addPluginV3(ITensor *const *inputs, int32_t nbInputs, ITensor *const *shapeInputs, int32_t nbShapeInputs, IPluginV3 &plugin) noexcept
Add a plugin layer implementing the IPluginV3 interface to the network.
Definition: NvInfer.h:8876
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:8837
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:8795
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:8682
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8757
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:8418
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:8781
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9321
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:9075
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9530
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:8701
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:8950
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:8666
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9815
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9802
IRotaryEmbeddingLayer * addRotaryEmbedding(ITensor &input, ITensor &cosCache, ITensor &sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
Add a Rotary Position Embedding (RoPE) layer to the network.
Definition: NvInfer.h:9687
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:9097
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:9151
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:9868
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:8722
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:8374
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:8250
TRT_DEPRECATED IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:9631
virtual ~INetworkDefinition() noexcept=0
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:9470
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:8216
TRT_DEPRECATED IPluginV2Layer * addPluginV2(ITensor *const *inputs, int32_t nbInputs, IPluginV2 &plugin) noexcept
Add a plugin layer to the network using the IPluginV2 interface.
Definition: NvInfer.h:8858
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:9278
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:8539
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:9302
TRT_NODISCARD IDistCollectiveLayer * addDistCollective(ITensor &input, CollectiveOperation distCollectiveOp, ReduceOperation reduceOp, int64_t root, int64_t *groups, int64_t groupSize) noexcept
Add a DistCollective layer to the network.
Definition: NvInfer.h:9775
IMoELayer * addMoE(ITensor &hiddenStates, ITensor &selectedExpertsForTokens, ITensor &scoresForSelectedExperts) noexcept
Add a MoE (Mixture of Experts) layer to the network.
Definition: NvInfer.h:9743
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:8296
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3664
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3688
virtual ~INonZeroLayer() noexcept=0
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3676
A normalization layer in a network definition.
Definition: NvInfer.h:6427
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6446
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6466
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6436
virtual ~INormalizationLayer() noexcept=0
TRT_NODISCARD bool isV2() const noexcept
Returns true if this layer was created through addNormalizationV2().
Definition: NvInfer.h:6508
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6514
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6497
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6456
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6487
A OneHot layer in a network definition.
Definition: NvInfer.h:6041
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6062
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:6048
virtual ~IOneHotLayer() noexcept=0
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6056
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2650
Layer that represents a padding operation.
Definition: NvInfer.h:2849
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2898
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2860
virtual ~IPaddingLayer() noexcept=0
void setPostPaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2886
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2872
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2904
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3889
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3891
virtual ~IParametricReLULayer() noexcept=0
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:139
Layer type for pluginV2.
Definition: NvInfer.h:2542
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2555
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2549
virtual ~IPluginV2Layer() noexcept=0
Layer type for V3 plugins.
Definition: NvInfer.h:2571
virtual ~IPluginV3Layer() noexcept=0
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2578
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2584
A Pooling layer in a network definition.
Definition: NvInfer.h:1292
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1311
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1444
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1420
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1364
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1392
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1301
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1457
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1433
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1467
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:1353
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1510
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1339
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1481
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1491
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1522
virtual ~IPoolingLayer() noexcept=0
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1410
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1382
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1326
A Quantize layer in a network definition.
Definition: NvInfer.h:5406
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5467
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5440
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5427
virtual ~IQuantizeLayer() noexcept=0
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5451
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5416
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5479
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3715
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3717
virtual ~IRaggedSoftMaxLayer() noexcept=0
A recurrence layer in a network definition.
Definition: NvInfer.h:4599
virtual ~IRecurrenceLayer() noexcept=0
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2767
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2814
virtual ~IReduceLayer() noexcept=0
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2774
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2784
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2804
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2794
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2830
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2824
A resize layer in a network definition.
Definition: NvInfer.h:4068
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4229
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4253
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:4147
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4088
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4285
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4128
virtual ~IResizeLayer() noexcept=0
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4295
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4239
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4169
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4204
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4308
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4159
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4098
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4263
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4318
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4214
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6353
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6386
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6373
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6402
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6396
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6363
virtual ~IReverseSequenceLayer() noexcept=0
Layer that implements Rotary Position Embedding (RoPE) (https://arxiv.org/abs/2104....
Definition: NvInfer.h:7452
TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
Get the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7492
void setInterleaved(bool interleaved) noexcept
Set whether the input is in interleaved format, i.e., whether the 2-d vectors rotated are taken from ...
Definition: NvInfer.h:7459
virtual ~IRotaryEmbeddingLayer() noexcept=0
TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
Set the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7481
apiv::VRotaryEmbeddingLayer * mImpl
Definition: NvInfer.h:7514
TRT_NODISCARD bool getInterleaved() const noexcept
Get whether the input is in interleaved format. The default value is false.
Definition: NvInfer.h:7470
A Scale layer in a network definition.
Definition: NvInfer.h:1692
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1749
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1769
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1739
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1759
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1709
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1719
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1805
virtual ~IScaleLayer() noexcept=0
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1729
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1699
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1784
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5966
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5973
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:6007
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5993
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:6001
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5983
virtual ~IScatterLayer() noexcept=0
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4917
virtual ~ISelectLayer() noexcept=0
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3380
virtual ~IShapeLayer() noexcept=0
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3382
Layer type for shuffling data.
Definition: NvInfer.h:2939
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3097
virtual ~IShuffleLayer() noexcept=0
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2950
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3050
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3003
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:2990
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2962
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3062
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3091
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3078
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3193
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3262
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3361
virtual ~ISliceLayer() noexcept=0
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3233
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3340
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3204
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3219
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3287
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3248
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3297
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3277
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3355
A Softmax layer in a network definition.
Definition: NvInfer.h:1838
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:1860
virtual ~ISoftMaxLayer() noexcept=0
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:1870
Layer that represents a squeeze operation, removing unit dimensions of the first input tensor on a se...
Definition: NvInfer.h:6530
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6547
virtual ~ISqueezeLayer() noexcept=0
A tensor in a network definition.
Definition: NvInfer.h:186
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:364
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:322
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:234
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:203
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:429
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:215
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:408
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:271
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:296
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:310
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:279
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:263
virtual ~ITensor() noexcept=0
apiv::VTensor * mImpl
Definition: NvInfer.h:476
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:455
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:470
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:341
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:248
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:377
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:10175
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:10241
virtual ~ITimingCache() noexcept=0
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:10212
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:10258
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:10280
apiv::VTimingCache * mImpl
Definition: NvInfer.h:10286
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:10222
Layer that represents a TopK reduction.
Definition: NvInfer.h:3422
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3453
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3477
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3439
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3536
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3429
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3518
virtual ~ITopKLayer() noexcept=0
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3467
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3487
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3530
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4724
virtual ~ITripLimitLayer() noexcept=0
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4729
Layer that represents an unary operation.
Definition: NvInfer.h:2654
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2663
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2679
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2673
virtual ~IUnaryLayer() noexcept=0
Layer that represents an unsqueeze operation, which reshapes the first input tensor by inserting unit...
Definition: NvInfer.h:6562
virtual ~IUnsqueezeLayer() noexcept=0
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6580
An Interface class for version control.
Definition: NvInferRuntimeBase.h:284
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:249
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:132
Definition: NvInferRuntimeBase.h:421
Definition: NvInferRuntime.h:1691
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1614
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:10487
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:654
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:11842
The TensorRT API version 1 namespace.
Definition: NvInferSafePlugin.h:33
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2855
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3979
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:10299
AttentionIOForm
Enumerates the layout of the input/output tensors in an Attention layer.
Definition: NvInfer.h:6790
TENSORRTAPI bool setInternalLibraryPath(AsciiChar const *path) noexcept
Set a custom directory path for loading internal TensorRT libraries when building engines.
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1649
@ 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:9923
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10407
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6598
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6165
@ 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
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2607
@ 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.
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:143
@ 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:4982
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4006
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
char_t AsciiChar
Definition: NvInferRuntimeBase.h:116
CausalMaskKind
Enumerates the causal mask alignment orientation for the attention.
Definition: NvInfer.h:6762
@ kUPPER_LEFT
Diagonal anchored at top-left corner (legacy default when causal=true).
@ kLOWER_RIGHT
Diagonal anchored at bottom-right corner (decode-aligned semantics).
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:826
@ 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:4364
@ 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:11463
PreviewFeature
Define preview features.
Definition: NvInfer.h:10373
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10457
@ 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.
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:151
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kDEBUG...
Definition: NvInfer.h:9953
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1352
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.
@ kROTARY_EMBEDDING
Rotary Embedding 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.
@ kKVCACHE_UPDATE
KV Cache Update layer.
@ kPLUGIN
Plugin layer.
@ kDIST_COLLECTIVE
DistCollective layer.
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3109
@ 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:2348
@ kDEFAULT
Similar to ONNX Gather.
@ kELEMENT
Similar to ONNX GatherElements.
@ kND
Similar to ONNX GatherND.
MoEActType
Enumerates the activation type for the MoE layer.
Definition: NvInfer.h:7679
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:135
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2867
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11474
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2259
@ 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.
CollectiveOperation
Enumerates the collective operations that may be performed by a DistCollective layer.
Definition: NvInfer.h:2737
@ kALL_TO_ALL
All-to-all exchange.
@ kREDUCE_SCATTER
Reduce scatter.
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3903
@ kNEAREST
ND (0 < N <= 8) nearest neighbor resizing.
@ kCUBIC
Supports bicubic (2D) and tricubic (3D) 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:9963
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ 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.
@ 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.
TENSORRTAPI nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3394
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2709
@ kAVG
Average of the elements.
TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry * getBuilderSafePluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Safety engine, or nullptr if no registry exists.
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5892
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3549
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3928
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4336
@ 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.
KVCacheMode
Enumerates the KVCache modes that may be performed by a KVCacheUpdate layer.
Definition: NvInfer.h:7526
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1263
@ 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:10570
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:214
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6730
Represents a permutation of dimensions.
Definition: NvInfer.h:2916
Declaration of EnumMaxImpl struct to store the exclusive upper bound of an enumeration type.
Definition: NvInferRuntimeBase.h:132
The key to retrieve timing cache entries.
Definition: NvInfer.h:10139
Definition: NvInfer.h:10151
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:10153
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:10155

  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