TensorRT 11.4.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
6532class ISqueezeLayer : public ILayer
6533{
6534public:
6550 using ILayer::setInput;
6551
6552protected:
6553 apiv::VSqueezeLayer* mImpl;
6554 virtual ~ISqueezeLayer() noexcept = 0;
6555};
6556
6557inline ISqueezeLayer::~ISqueezeLayer() noexcept = default;
6558
6568{
6569public:
6583 using ILayer::setInput;
6584
6585protected:
6586 apiv::VUnsqueezeLayer* mImpl;
6587 virtual ~IUnsqueezeLayer() noexcept = 0;
6588};
6589
6590inline IUnsqueezeLayer::~IUnsqueezeLayer() noexcept = default;
6591
6603enum class CumulativeOperation : int32_t
6604{
6605 kSUM = 0,
6606};
6607
6613template <>
6615{
6616 static constexpr int32_t kVALUE = 1;
6617};
6618
6647{
6648public:
6659 {
6660 return mImpl->setOperation(op);
6661 }
6662
6671 {
6672 return mImpl->getOperation();
6673 }
6674
6682 void setExclusive(bool exclusive) noexcept
6683 {
6684 mImpl->setExclusive(exclusive);
6685 }
6686
6694 bool getExclusive() const noexcept
6695 {
6696 return mImpl->getExclusive();
6697 }
6698
6706 void setReverse(bool reverse) noexcept
6707 {
6708 mImpl->setReverse(reverse);
6709 }
6710
6718 bool getReverse() const noexcept
6719 {
6720 return mImpl->getReverse();
6721 }
6722
6723protected:
6724 apiv::VCumulativeLayer* mImpl;
6725 virtual ~ICumulativeLayer() noexcept = 0;
6726};
6727
6728inline ICumulativeLayer::~ICumulativeLayer() noexcept = default;
6729
6735enum class AttentionNormalizationOp : int32_t
6736{
6737 kNONE
6738 = 0,
6739 kSOFTMAX = 1,
6740};
6741
6747template <>
6749{
6750 static constexpr int32_t kVALUE = 2;
6751};
6752
6767enum class CausalMaskKind : int32_t
6768{
6770 kNONE = 0,
6771
6773 kUPPER_LEFT = 1,
6774
6776 kLOWER_RIGHT = 2,
6777};
6778
6784template <>
6786{
6787 static constexpr int32_t kVALUE = 3;
6788};
6789
6795enum class AttentionIOForm : int32_t
6796{
6799 kPADDED_BHND = 0,
6802 kPACKED_NHD = 1,
6803};
6804
6810template <>
6812{
6813 static constexpr int32_t kVALUE = 2;
6814};
6815
6826{
6827public:
6831 IAttention* getAttention() const noexcept
6832 {
6833 return mBoundary->getAttention();
6834 }
6835
6836protected:
6837 virtual ~IAttentionBoundaryLayer() noexcept = 0;
6838 apiv::VAttentionBoundaryLayer* mBoundary;
6839};
6840
6841inline IAttentionBoundaryLayer::~IAttentionBoundaryLayer() noexcept = default;
6842
6854{
6855public:
6873 using ILayer::setInput;
6874
6875protected:
6876 virtual ~IAttentionInputLayer() noexcept = 0;
6877 apiv::VAttentionInputLayer* mImpl;
6878};
6879
6880inline IAttentionInputLayer::~IAttentionInputLayer() noexcept = default;
6881
6893{
6894public:
6895protected:
6896 virtual ~IAttentionOutputLayer() noexcept = 0;
6897 apiv::VAttentionOutputLayer* mImpl;
6898};
6899
6900inline IAttentionOutputLayer::~IAttentionOutputLayer() noexcept = default;
6901
6962class IAttention : public INoCopy
6963{
6964public:
6973 {
6974 return mImpl->setNormalizationOperation(op);
6975 }
6976
6985 {
6986 return mImpl->getNormalizationOperation();
6987 }
6988
7001 bool setMask(ITensor& mask) noexcept
7002 {
7003 return mImpl->setMask(mask);
7004 }
7005
7013 ITensor* getMask() noexcept
7014 {
7015 return mImpl->getMask();
7016 }
7017
7031 TRT_DEPRECATED bool setCausal(bool isCausal) noexcept
7032 {
7033 return mImpl->setCausal(isCausal);
7034 }
7035
7045 TRT_DEPRECATED bool getCausal() const noexcept
7046 {
7047 return mImpl->getCausal();
7048 }
7049
7065 bool setCausalKind(CausalMaskKind kind) noexcept
7066 {
7067 return mImpl->setCausalKind(kind);
7068 }
7069
7078 {
7079 return mImpl->getCausalKind();
7080 }
7081
7089 bool setDecomposable(bool decomposable) noexcept
7090 {
7091 return mImpl->setDecomposable(decomposable);
7092 }
7093
7102 bool getDecomposable() const noexcept
7103 {
7104 return mImpl->getDecomposable();
7105 }
7106
7121 bool setInput(int32_t index, ITensor& input) noexcept
7122 {
7123 return mImpl->setInput(index, input);
7124 }
7125
7130 int32_t getNbInputs() const noexcept
7131 {
7132 return mImpl->getNbInputs();
7133 }
7134
7142 ITensor* getInput(int32_t index) const noexcept
7143 {
7144 return mImpl->getInput(index);
7145 }
7146
7150 int32_t getNbOutputs() const noexcept
7151 {
7152 return mImpl->getNbOutputs();
7153 }
7154
7162 ITensor* getOutput(int32_t index) const noexcept
7163 {
7164 return mImpl->getOutput(index);
7165 }
7166
7179 bool setName(char const* name) noexcept
7180 {
7181 return mImpl->setName(name);
7182 }
7183
7191 char const* getName() const noexcept
7192 {
7193 return mImpl->getName();
7194 }
7195
7208 {
7209 return mImpl->setNormalizationQuantizeScale(tensor);
7210 }
7211
7219 {
7220 return mImpl->getNormalizationQuantizeScale();
7221 }
7222
7232 {
7233 return mImpl->setNormalizationQuantizeToType(type);
7234 }
7235
7244 {
7245 return mImpl->getNormalizationQuantizeToType();
7246 }
7247
7263 bool setMetadata(char const* metadata) noexcept
7264 {
7265 return mImpl->setMetadata(metadata);
7266 }
7267
7276 char const* getMetadata() const noexcept
7277 {
7278 return mImpl->getMetadata();
7279 }
7280
7292 bool setNbRanks(int32_t nbRanks) noexcept
7293 {
7294 return mImpl->setNbRanks(nbRanks);
7295 }
7296
7304 int32_t getNbRanks() const noexcept
7305 {
7306 return mImpl->getNbRanks();
7307 }
7308
7322 {
7323 return mImpl->setQueryForm(form);
7324 }
7325
7335 {
7336 return mImpl->getQueryForm();
7337 }
7338
7352 {
7353 return mImpl->setKeyValueForm(form);
7354 }
7355
7365 {
7366 return mImpl->getKeyValueForm();
7367 }
7368
7388 TRT_NODISCARD bool setQueryLengths(ITensor* lengths) noexcept
7389 {
7390 return mImpl->setQueryLengths(lengths);
7391 }
7392
7401 {
7402 return mImpl->getQueryLengths();
7403 }
7404
7428 {
7429 return mImpl->setKeyValueLengths(lengths);
7430 }
7431
7440 {
7441 return mImpl->getKeyValueLengths();
7442 }
7443
7444protected:
7445 apiv::VAttention* mImpl;
7446 virtual ~IAttention() noexcept = 0;
7447};
7448
7449inline IAttention::~IAttention() noexcept = default;
7450
7458{
7459public:
7465 void setInterleaved(bool interleaved) noexcept
7466 {
7467 mImpl->setInterleaved(interleaved);
7468 }
7469
7470
7476 TRT_NODISCARD bool getInterleaved() const noexcept
7477 {
7478 return mImpl->getInterleaved();
7479 }
7480
7481
7487 TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
7488 {
7489 return mImpl->setRotaryEmbeddingDim(rotaryEmbeddingDim);
7490 }
7491
7492
7498 TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
7499 {
7500 return mImpl->getRotaryEmbeddingDim();
7501 }
7502
7503
7517 using ILayer::setInput;
7518
7519protected:
7520 apiv::VRotaryEmbeddingLayer* mImpl;
7521 virtual ~IRotaryEmbeddingLayer() noexcept = 0;
7522};
7523
7524inline IRotaryEmbeddingLayer::~IRotaryEmbeddingLayer() noexcept = default;
7525
7531enum class KVCacheMode : int32_t
7532{
7533 kLINEAR = 0,
7534};
7535
7541template <>
7543{
7544 static constexpr int32_t kVALUE = 1;
7545};
7546
7567{
7568public:
7583 using ILayer::setInput;
7584
7592 bool setCacheMode(KVCacheMode cacheMode) noexcept
7593 {
7594 return mImpl->setCacheMode(cacheMode);
7595 }
7596
7602 KVCacheMode getCacheMode() const noexcept
7603 {
7604 return mImpl->getCacheMode();
7605 }
7606
7621 {
7622 return mImpl->setUpdateForm(form);
7623 }
7624
7634 {
7635 return mImpl->getUpdateForm();
7636 }
7637
7656 {
7657 return mImpl->setUpdateLengths(lengths);
7658 }
7659
7668 {
7669 return mImpl->getUpdateLengths();
7670 }
7671
7672protected:
7673 apiv::VKVCacheUpdateLayer* mImpl;
7674 virtual ~IKVCacheUpdateLayer() noexcept = 0;
7675};
7676
7677inline IKVCacheUpdateLayer::~IKVCacheUpdateLayer() noexcept = default;
7678
7684enum class MoEActType : int32_t
7685{
7686 kNONE = 0,
7687 kSILU = 1,
7688};
7689
7695template <>
7697{
7698 static constexpr int32_t kVALUE = 2;
7699};
7700
7701
7817class IMoELayer : public ILayer
7818{
7819public:
7831 void setGatedWeights(ITensor& fcGateWeights, ITensor& fcUpWeights, ITensor& fcDownWeights, MoEActType activationType) noexcept
7832 {
7833 mImpl->setGatedWeights(fcGateWeights, fcUpWeights, fcDownWeights, activationType);
7834 }
7835
7843 void setGatedBiases(ITensor& fcGateBiases, ITensor& fcUpBiases, ITensor& fcDownBiases) noexcept
7844 {
7845 mImpl->setGatedBiases(fcGateBiases, fcUpBiases, fcDownBiases);
7846 }
7847
7855 void setActivationType(MoEActType activationType) noexcept
7856 {
7857 mImpl->setActivationType(activationType);
7858 }
7859
7868 {
7869 return mImpl->getActivationType();
7870 }
7871
7893 void setQuantizationStatic(ITensor& fcDownActivationScale, DataType dataType) noexcept
7894 {
7895 mImpl->setQuantizationStatic(fcDownActivationScale, dataType);
7896 }
7897
7926 void setQuantizationDynamicDblQ(ITensor& fcDownActivationDblQScale, DataType dataType, Dims const& blockShape, DataType dynQOutputScaleType) noexcept
7927 {
7928 mImpl->setQuantizationDynamicDblQ(fcDownActivationDblQScale, dataType, blockShape, dynQOutputScaleType);
7929 }
7930
7942 {
7943 mImpl->setQuantizationToType(type);
7944 }
7945
7954 {
7955 return mImpl->getQuantizationToType();
7956 }
7957
7969 void setQuantizationBlockShape(Dims const& blockShape) noexcept
7970 {
7971 mImpl->setQuantizationBlockShape(blockShape);
7972 }
7973
7982 {
7983 return mImpl->getQuantizationBlockShape();
7984 }
7985
7994 {
7995 mImpl->setDynQOutputScaleType(type);
7996 }
7997
8006 {
8007 return mImpl->getDynQOutputScaleType();
8008 }
8009
8026 void setSwigluParams(float limit, float alpha, float beta) noexcept
8027 {
8028 mImpl->setSwigluParams(limit, alpha, beta);
8029 }
8030
8040 void setSwigluParamLimit(float limit) noexcept
8041 {
8042 mImpl->setSwigluParamLimit(limit);
8043 }
8044
8052 float getSwigluParamLimit() const noexcept
8053 {
8054 return mImpl->getSwigluParamLimit();
8055 }
8056
8066 void setSwigluParamAlpha(float alpha) noexcept
8067 {
8068 mImpl->setSwigluParamAlpha(alpha);
8069 }
8070
8078 float getSwigluParamAlpha() const noexcept
8079 {
8080 return mImpl->getSwigluParamAlpha();
8081 }
8082
8092 void setSwigluParamBeta(float beta) noexcept
8093 {
8094 mImpl->setSwigluParamBeta(beta);
8095 }
8096
8104 float getSwigluParamBeta() const noexcept
8105 {
8106 return mImpl->getSwigluParamBeta();
8107 }
8108
8121 void setInput(int32_t index, ITensor& tensor) noexcept
8122 {
8123 mImpl->setInput(index, tensor);
8124 }
8125
8126 using ILayer::setInput;
8127
8128protected:
8129 virtual ~IMoELayer() noexcept = 0;
8130 apiv::VMoELayer* mImpl;
8131};
8132
8133inline IMoELayer::~IMoELayer() noexcept = default;
8134
8143{
8144protected:
8145 virtual ~IDistCollectiveLayer() noexcept = 0;
8146 apiv::VDistCollectiveLayer* mImpl;
8147}; // class IDistCollectiveLayer
8148
8149inline IDistCollectiveLayer::~IDistCollectiveLayer() noexcept = default;
8150
8169{
8170public:
8171 virtual ~INetworkDefinition() noexcept = 0;
8172
8208 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
8209 {
8210 return mImpl->addInput(name, type, dimensions);
8211 }
8212
8222 void markOutput(ITensor& tensor) noexcept
8223 {
8224 mImpl->markOutput(tensor);
8225 }
8226
8240 bool markDebug(ITensor& tensor) noexcept
8241 {
8242 return mImpl->markDebug(tensor);
8243 }
8244
8256 bool unmarkDebug(ITensor& tensor) noexcept
8257 {
8258 return mImpl->unmarkDebug(tensor);
8259 }
8260
8266 bool isDebugTensor(ITensor const& tensor) const noexcept
8267 {
8268 return mImpl->isDebugTensor(tensor);
8269 }
8270
8289 {
8290 return mImpl->markUnfusedTensorsAsDebugTensors();
8291 }
8292
8303 {
8304 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
8305 }
8306
8323 {
8324 return mImpl->addActivation(input, type);
8325 }
8326
8341 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
8342 {
8343 return mImpl->addLRN(input, window, alpha, beta, k);
8344 }
8345
8367 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
8368 {
8369 return mImpl->addScale(input, mode, shift, scale, power);
8370 }
8371
8381 {
8382 return mImpl->addSoftMax(input);
8383 }
8384
8397 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
8398 {
8399 return mImpl->addConcatenation(inputs, nbInputs);
8400 }
8401
8425 {
8426 return mImpl->addElementWise(input1, input2, op);
8427 }
8428
8446 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
8447 {
8448 return mImpl->addUnary(input, operation);
8449 }
8450
8461 {
8462 return mImpl->addShuffle(input);
8463 }
8464
8477 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
8478 {
8479 return mImpl->addOneHot(indices, values, depth, axis);
8480 }
8481
8489 int32_t getNbLayers() const noexcept
8490 {
8491 return mImpl->getNbLayers();
8492 }
8493
8503 ILayer* getLayer(int32_t index) const noexcept
8504 {
8505 return mImpl->getLayer(index);
8506 }
8507
8515 int32_t getNbInputs() const noexcept
8516 {
8517 return mImpl->getNbInputs();
8518 }
8519
8531 ITensor* getInput(int32_t index) const noexcept
8532 {
8533 return mImpl->getInput(index);
8534 }
8535
8545 int32_t getNbOutputs() const noexcept
8546 {
8547 return mImpl->getNbOutputs();
8548 }
8549
8561 ITensor* getOutput(int32_t index) const noexcept
8562 {
8563 return mImpl->getOutput(index);
8564 }
8565
8588 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
8589 {
8590 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
8591 }
8592
8623 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
8624 {
8625 return mImpl->addTopK(input, op, k, reduceAxes);
8626 }
8627
8656 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
8657 {
8658 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
8659 }
8660
8672 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
8673 {
8674 return mImpl->addGather(data, indices, axis);
8675 }
8676
8688 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
8689 {
8690 return mImpl->addGatherV2(data, indices, mode);
8691 }
8692
8708 {
8709 return mImpl->addRaggedSoftMax(input, bounds);
8710 }
8711
8729 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
8730 {
8731 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
8732 }
8733
8748 {
8749 return mImpl->addNonZero(input);
8750 }
8751
8763 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
8764 {
8765 return mImpl->addNonZeroV2(input, indicesType);
8766 }
8767
8787 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
8788 {
8789 return mImpl->addConstant(dimensions, weights);
8790 }
8791
8802 {
8803 return mImpl->addIdentity(input);
8804 }
8805
8816 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
8817 {
8818 return mImpl->addCast(input, toType);
8819 }
8820
8831 void removeTensor(ITensor& tensor) noexcept
8832 {
8833 mImpl->removeTensor(tensor);
8834 }
8835
8843 void unmarkOutput(ITensor& tensor) noexcept
8844 {
8845 mImpl->unmarkOutput(tensor);
8846 }
8847
8864 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
8865 {
8866 return mImpl->addPluginV2(inputs, nbInputs, plugin);
8867 }
8868
8882 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
8883 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
8884 {
8885 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
8886 }
8887
8902 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
8903 {
8904 return mImpl->addSlice(input, start, size, stride);
8905 }
8906
8926 void setName(char const* name) noexcept
8927 {
8928 mImpl->setName(name);
8929 }
8930
8940 char const* getName() const noexcept
8941 {
8942 return mImpl->getName();
8943 }
8944
8956 IShapeLayer* addShape(ITensor& input) noexcept
8957 {
8958 return mImpl->addShape(input);
8959 }
8960
8971 {
8972 return mImpl->hasImplicitBatchDimension();
8973 }
8974
8981 {
8982 return mImpl->getFlags();
8983 }
8984
8992 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8993 {
8994 return mImpl->getFlag(networkDefinitionCreationFlag);
8995 }
8996
9009 bool markOutputForShapes(ITensor& tensor) noexcept
9010 {
9011 return mImpl->markOutputForShapes(tensor);
9012 }
9013
9021 bool unmarkOutputForShapes(ITensor& tensor) noexcept
9022 {
9023 return mImpl->unmarkOutputForShapes(tensor);
9024 }
9025
9040 {
9041 return mImpl->addParametricReLU(input, slope);
9042 }
9043
9062 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
9063 {
9064 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
9065 }
9066
9081 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
9082 {
9083 return mImpl->addPoolingNd(input, type, windowSize);
9084 }
9085
9100 //
9104 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
9105 {
9106 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
9107 }
9108
9141 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
9142 {
9143 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
9144 }
9145
9158 {
9159 return mImpl->addResize(input);
9160 }
9161
9171 ILoop* addLoop() noexcept
9172 {
9173 return mImpl->addLoop();
9174 }
9175
9187 {
9188 return mImpl->addIfConditional();
9189 }
9190
9225 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
9226 {
9227 return mImpl->addSelect(condition, thenInput, elseInput);
9228 }
9229
9242 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
9243 {
9244 return mImpl->addAssertion(condition, message);
9245 }
9246
9268 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
9269 {
9270 return mImpl->addFillV2(dimensions, op, outputType);
9271 }
9272
9284 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
9285 {
9286 return mImpl->addPaddingNd(input, prePadding, postPadding);
9287 }
9288
9308 bool setWeightsName(Weights weights, char const* name) noexcept
9309 {
9310 return mImpl->setWeightsName(weights, name);
9311 }
9312
9324 //
9327 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9328 {
9329 mImpl->setErrorRecorder(recorder);
9330 }
9331
9343 {
9344 return mImpl->getErrorRecorder();
9345 }
9346
9365 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9366 {
9367 return mImpl->addDequantizeV2(input, scale, outputType);
9368 }
9369
9385 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
9386 {
9387 return mImpl->addScatter(data, indices, updates, mode);
9388 }
9389
9409 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9410 {
9411 return mImpl->addQuantizeV2(input, scale, outputType);
9412 }
9413
9437 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
9438 {
9439 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
9440 }
9441
9461 ITensor& input, Dims const& blockShape, DataType outputType, DataType scaleType) noexcept
9462 {
9463 return mImpl->addDynamicQuantizeV2(input, blockShape, outputType, scaleType);
9464 }
9465
9476 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
9477 {
9478 return mImpl->addEinsum(inputs, nbInputs, equation);
9479 }
9480
9495 {
9496 return mImpl->addGridSample(input, grid);
9497 }
9498
9516 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
9517 {
9518 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
9519 }
9520
9536 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
9537 {
9538 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
9539 }
9540
9554 {
9555 return mImpl->addReverseSequence(input, sequenceLens);
9556 }
9557
9585 TRT_DEPRECATED INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9586 {
9587 return mImpl->addNormalization(input, scale, bias, axesMask);
9588 }
9589
9607 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
9608 {
9609 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
9610 }
9611
9638 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
9639 {
9640 return mImpl->addAttention(query, key, value, normOp, causal);
9641 }
9642
9669 CausalMaskKind causalKind) noexcept
9670 {
9671 return mImpl->addAttentionV2(query, key, value, normOp, causalKind);
9672 }
9673
9693 IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
9694 {
9695 return mImpl->addRotaryEmbedding(input, cosCache, sinCache, interleaved, rotaryEmbeddingDim);
9696 }
9697
9728 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept
9729 {
9730 return mImpl->addKVCacheUpdate(cache, update, writeIndices, cacheMode);
9731 }
9732
9749 IMoELayer* addMoE(ITensor& hiddenStates, ITensor& selectedExpertsForTokens, ITensor& scoresForSelectedExperts) noexcept
9750 {
9751 return mImpl->addMoE(hiddenStates, selectedExpertsForTokens, scoresForSelectedExperts);
9752 }
9753
9782 ReduceOperation reduceOp, int64_t root, int64_t* groups, int64_t groupSize) noexcept
9783 {
9784 return mImpl->addDistCollective(input, distCollectiveOp, reduceOp, root, groups, groupSize);
9785 }
9786
9793 virtual IBuilder& getBuilder() const noexcept
9794 {
9795 return mImpl->getBuilder();
9796 }
9797
9808 bool markWeightsRefittable(char const* name) noexcept
9809 {
9810 return mImpl->markWeightsRefittable(name);
9811 }
9812
9821 bool unmarkWeightsRefittable(char const* name) noexcept
9822 {
9823 return mImpl->unmarkWeightsRefittable(name);
9824 }
9825
9834 bool areWeightsMarkedRefittable(char const* name) const noexcept
9835 {
9836 return mImpl->areWeightsMarkedRefittable(name);
9837 }
9838
9853 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
9854 {
9855 return mImpl->addSqueeze(input, axes);
9856 }
9857
9882 ISqueezeLayer* addSqueeze(ITensor& input, ITensor* axes) noexcept
9883 {
9884 return mImpl->addSqueezeV2(input, axes);
9885 }
9886
9904 {
9905 return mImpl->addUnsqueeze(input, axes);
9906 }
9907
9929 TRT_NODISCARD INormalizationLayer* addNormalizationV2(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9930 {
9931 return mImpl->addNormalizationV2(input, scale, bias, axesMask);
9932 }
9933
9934protected:
9935 apiv::VNetworkDefinition* mImpl;
9936};
9937
9938inline INetworkDefinition::~INetworkDefinition() noexcept = default;
9939
9957enum class RuntimePlatform : int32_t
9958{
9961 kSAME_AS_BUILD = 0,
9962
9965 kWINDOWS_AMD64 = 1,
9966
9967
9968};
9969
9975template <>
9977{
9978 static constexpr int32_t kVALUE = 2;
9979};
9980
9981
9988using BuilderFlags = uint32_t;
9989
9997enum class BuilderFlag : int32_t
9998{
9999
10001 kDEBUG = 2,
10002
10004 kGPU_FALLBACK = 3,
10005
10007 kREFIT = 4,
10008
10011
10015 kTF32 = 6,
10016
10018 kSPARSE_WEIGHTS = 7,
10019
10032
10033
10039
10046
10052
10053
10057
10058
10064
10070 kSTRIP_PLAN = 18,
10071
10078 kREFIT_IDENTICAL = 19,
10079
10105 kWEIGHT_STREAMING = 20,
10106
10107
10113 kREFIT_INDIVIDUAL = 22,
10114
10123 kSTRICT_NANS = 23,
10124
10126 kMONITOR_MEMORY = 24,
10127
10128
10131
10143
10144
10145
10146};
10147
10153template <>
10155{
10156 static constexpr int32_t kVALUE = 28;
10157};
10158
10159namespace v_1_0
10160{
10174{
10175 uint8_t data[16];
10176};
10177
10186{
10188 uint64_t tacticHash;
10192 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
10193};
10194} // namespace v_1_0
10195
10209class ITimingCache : public INoCopy
10210{
10211public:
10212 virtual ~ITimingCache() noexcept = 0;
10213
10223 nvinfer1::IHostMemory* serialize() const noexcept
10224 {
10225 return mImpl->serialize();
10226 }
10227
10247 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
10248 {
10249 return mImpl->combine(inputCache, ignoreMismatch);
10250 }
10251
10257 bool reset() noexcept
10258 {
10259 return mImpl->reset();
10260 }
10261
10276 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
10277 {
10278 return mImpl->queryKeys(keyBuffer, capacity);
10279 }
10280
10293 TimingCacheValue query(TimingCacheKey const& key) const noexcept
10294 {
10295 return mImpl->query(key);
10296 }
10297
10315 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
10316 {
10317 return mImpl->update(key, value);
10318 }
10319
10320protected:
10321 apiv::VTimingCache* mImpl;
10322};
10323
10324inline ITimingCache::~ITimingCache() noexcept = default;
10325
10333enum class MemoryPoolType : int32_t
10334{
10340 kWORKSPACE = 0,
10341
10350
10358 kDLA_LOCAL_DRAM = 2,
10359
10367 kDLA_GLOBAL_DRAM = 3,
10368
10376 kTACTIC_DRAM = 4,
10377
10391};
10392
10398template <>
10400{
10401 static constexpr int32_t kVALUE = 6;
10402};
10403
10412enum class PreviewFeature : int32_t
10413{
10418
10425};
10426
10432template <>
10434{
10435 static constexpr int32_t kVALUE = 2;
10436};
10437
10446enum class HardwareCompatibilityLevel : int32_t
10447{
10450 kNONE = 0,
10451
10463 kAMPERE_PLUS = 1,
10464
10477};
10478
10484template <>
10486{
10487 static constexpr int32_t kVALUE = 3;
10488};
10489
10490
10499enum class TilingOptimizationLevel : int32_t
10500{
10502 kNONE = 0,
10503
10505 kFAST = 1,
10506
10509 kMODERATE = 2,
10510
10512 kFULL = 3
10513
10514};
10515
10521template <>
10523{
10524 static constexpr int32_t kVALUE = 4;
10525};
10526
10527namespace v_1_0
10528{
10530{
10531public:
10532 IProgressMonitor() = default;
10533 virtual ~IProgressMonitor() noexcept = default;
10534
10538 InterfaceInfo getInterfaceInfo() const noexcept override
10539 {
10540 return InterfaceInfo{"IProgressMonitor", 1, 0};
10541 }
10542
10562 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10563
10576 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10577
10589 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10590
10591}; // class IProgressMonitor
10592} // namespace v_1_0
10593
10614
10623{
10624public:
10625 virtual ~IBuilderConfig() noexcept = 0;
10626
10635 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10636 {
10637 mImpl->setAvgTimingIterations(avgTiming);
10638 }
10639
10647 int32_t getAvgTimingIterations() const noexcept
10648 {
10649 return mImpl->getAvgTimingIterations();
10650 }
10651
10660 void setEngineCapability(EngineCapability capability) noexcept
10661 {
10662 mImpl->setEngineCapability(capability);
10663 }
10664
10673 {
10674 return mImpl->getEngineCapability();
10675 }
10676
10689 void setFlags(BuilderFlags builderFlags) noexcept
10690 {
10691 mImpl->setFlags(builderFlags);
10692 }
10693
10701 BuilderFlags getFlags() const noexcept
10702 {
10703 return mImpl->getFlags();
10704 }
10705
10713 void clearFlag(BuilderFlag builderFlag) noexcept
10714 {
10715 mImpl->clearFlag(builderFlag);
10716 }
10717
10725 void setFlag(BuilderFlag builderFlag) noexcept
10726 {
10727 mImpl->setFlag(builderFlag);
10728 }
10729
10737 bool getFlag(BuilderFlag builderFlag) const noexcept
10738 {
10739 return mImpl->getFlag(builderFlag);
10740 }
10741
10754 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10755 {
10756 mImpl->setDeviceType(layer, deviceType);
10757 }
10758
10764 DeviceType getDeviceType(ILayer const* layer) const noexcept
10765 {
10766 return mImpl->getDeviceType(layer);
10767 }
10768
10776 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10777 {
10778 return mImpl->isDeviceTypeSet(layer);
10779 }
10780
10786 void resetDeviceType(ILayer const* layer) noexcept
10787 {
10788 mImpl->resetDeviceType(layer);
10789 }
10790
10796 bool canRunOnDLA(ILayer const* layer) const noexcept
10797 {
10798 return mImpl->canRunOnDLA(layer);
10799 }
10800
10812 void setDLACore(int32_t dlaCore) noexcept
10813 {
10814 mImpl->setDLACore(dlaCore);
10815 }
10816
10822 int32_t getDLACore() const noexcept
10823 {
10824 return mImpl->getDLACore();
10825 }
10826
10833 void setDefaultDeviceType(DeviceType deviceType) noexcept
10834 {
10835 mImpl->setDefaultDeviceType(deviceType);
10836 }
10837
10844 {
10845 return mImpl->getDefaultDeviceType();
10846 }
10847
10853 void reset() noexcept
10854 {
10855 mImpl->reset();
10856 }
10857
10892 void setProfileStream(cudaStream_t const stream) noexcept
10893 {
10894 return mImpl->setProfileStream(stream);
10895 }
10896
10904 cudaStream_t getProfileStream() const noexcept
10905 {
10906 return mImpl->getProfileStream();
10907 }
10908
10921 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10922 {
10923 return mImpl->addOptimizationProfile(profile);
10924 }
10925
10934 int32_t getNbOptimizationProfiles() const noexcept
10935 {
10936 return mImpl->getNbOptimizationProfiles();
10937 }
10938
10947 {
10948 mImpl->setProfilingVerbosity(verbosity);
10949 }
10950
10960 {
10961 return mImpl->getProfilingVerbosity();
10962 }
10963
10981 bool setTacticSources(TacticSources tacticSources) noexcept
10982 {
10983 return mImpl->setTacticSources(tacticSources);
10984 }
10985
10997 {
10998 return mImpl->getTacticSources();
10999 }
11000
11016 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
11017 {
11018 return mImpl->createTimingCache(blob, size);
11019 }
11020
11039 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
11040 {
11041 return mImpl->setTimingCache(cache, ignoreMismatch);
11042 }
11043
11050 {
11051 return mImpl->getTimingCache();
11052 }
11053
11081 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
11082 {
11083 mImpl->setMemoryPoolLimit(pool, poolSize);
11084 }
11085
11100 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
11101 {
11102 return mImpl->getMemoryPoolLimit(pool);
11103 }
11104
11118 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
11119 {
11120 mImpl->setPreviewFeature(feature, enable);
11121 }
11122
11132 bool getPreviewFeature(PreviewFeature feature) const noexcept
11133 {
11134 return mImpl->getPreviewFeature(feature);
11135 }
11136
11165 void setBuilderOptimizationLevel(int32_t level) noexcept
11166 {
11167 mImpl->setBuilderOptimizationLevel(level);
11168 }
11169
11178 {
11179 return mImpl->getBuilderOptimizationLevel();
11180 }
11181
11194 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
11195 {
11196 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
11197 }
11198
11208 {
11209 return mImpl->getHardwareCompatibilityLevel();
11210 }
11211
11220 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
11221 {
11222 mImpl->setPluginsToSerialize(paths, nbPaths);
11223 }
11224
11233 char const* getPluginToSerialize(int32_t index) const noexcept
11234 {
11235 return mImpl->getPluginToSerialize(index);
11236 }
11237
11243 int32_t getNbPluginsToSerialize() const noexcept
11244 {
11245 return mImpl->getNbPluginsToSerialize();
11246 }
11247
11274 bool setMaxAuxStreams(int32_t nbStreams) noexcept
11275 {
11276 return mImpl->setMaxAuxStreams(nbStreams);
11277 }
11278
11284 int32_t getMaxAuxStreams() const noexcept
11285 {
11286 return mImpl->getMaxAuxStreams();
11287 }
11288
11300 void setProgressMonitor(IProgressMonitor* monitor) noexcept
11301 {
11302 return mImpl->setProgressMonitor(monitor);
11303 }
11304
11311 {
11312 return mImpl->getProgressMonitor();
11313 }
11314
11326 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
11327 {
11328 mImpl->setRuntimePlatform(runtimePlatform);
11329 }
11330
11339 {
11340 return mImpl->getRuntimePlatform();
11341 }
11342
11350 void setMaxNbTactics(int32_t maxNbTactics) noexcept
11351 {
11352 mImpl->setMaxNbTactics(maxNbTactics);
11353 }
11354
11362 int32_t getMaxNbTactics() const noexcept
11363 {
11364 return mImpl->getMaxNbTactics();
11365 }
11366
11379 {
11380 return mImpl->setTilingOptimizationLevel(level);
11381 }
11382
11391 {
11392 return mImpl->getTilingOptimizationLevel();
11393 }
11394
11406 bool setL2LimitForTiling(int64_t size) noexcept
11407 {
11408 return mImpl->setL2LimitForTiling(size);
11409 }
11410
11418 int64_t getL2LimitForTiling() const noexcept
11419 {
11420 return mImpl->getL2LimitForTiling();
11421 }
11422
11432 bool setRemoteAutoTuningConfig(char const* config) noexcept
11433 {
11434 return mImpl->setRemoteAutoTuningConfig(config);
11435 }
11436
11442 char const* getRemoteAutoTuningConfig() const noexcept
11443 {
11444 return mImpl->getRemoteAutoTuningConfig();
11445 }
11446
11447
11465 bool setBuildRoute(char const* buildRoute) noexcept
11466 {
11467 return mImpl->setBuildRoute(buildRoute);
11468 }
11469
11479 char const* getBuildRoute() const noexcept
11480 {
11481 return mImpl->getBuildRoute();
11482 }
11483
11515 char const* getAllBuildRoutes() const noexcept
11516 {
11517 return mImpl->getAllBuildRoutes();
11518 }
11519
11520protected:
11521 apiv::VBuilderConfig* mImpl;
11522};
11523
11524inline IBuilderConfig::~IBuilderConfig() noexcept = default;
11525
11534
11544{
11557
11562};
11563
11569template <>
11571{
11572 static constexpr int32_t kVALUE = 3;
11573};
11574
11575
11583class IBuilder : public INoCopy
11584{
11585public:
11586 virtual ~IBuilder() noexcept = 0;
11587
11595 int32_t getMaxDLABatchSize() const noexcept
11596 {
11597 return mImpl->getMaxDLABatchSize();
11598 }
11599
11603 int32_t getNbDLACores() const noexcept
11604 {
11605 return mImpl->getNbDLACores();
11606 }
11607
11621 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11622 {
11623 mImpl->setGpuAllocator(allocator);
11624 }
11625
11636 {
11637 return mImpl->createBuilderConfig();
11638 }
11639
11640
11663 {
11664 return mImpl->createNetworkV2(flags);
11665 }
11666
11678 {
11679 return mImpl->createOptimizationProfile();
11680 }
11681
11696 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11697 {
11698 mImpl->setErrorRecorder(recorder);
11699 }
11700
11712 {
11713 return mImpl->getErrorRecorder();
11714 }
11715
11719 void reset() noexcept
11720 {
11721 mImpl->reset();
11722 }
11723
11740 {
11741 return mImpl->buildSerializedNetwork(network, config);
11742 }
11743
11762 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11763 {
11764 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11765 }
11766
11787 INetworkDefinition& network, IBuilderConfig& config, IHostMemory*& kernelText) noexcept
11788 {
11789 return mImpl->buildSerializedNetworkWithKernelText(network, config, kernelText);
11790 }
11791
11792
11810 {
11811 return mImpl->buildEngineWithConfig(network, config);
11812 }
11813
11835 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11836 {
11837 return mImpl->isNetworkSupported(network, config);
11838 }
11839
11845 ILogger* getLogger() const noexcept
11846 {
11847 return mImpl->getLogger();
11848 }
11849
11861 bool setMaxThreads(int32_t maxThreads) noexcept
11862 {
11863 return mImpl->setMaxThreads(maxThreads);
11864 }
11865
11875 int32_t getMaxThreads() const noexcept
11876 {
11877 return mImpl->getMaxThreads();
11878 }
11879
11886 {
11887 return mImpl->getPluginRegistry();
11888 }
11889
11890protected:
11891 apiv::VBuilder* mImpl;
11892};
11893
11894inline IBuilder::~IBuilder() noexcept = default;
11895
11896} // namespace nvinfer1
11897
11902extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11903
11904namespace nvinfer1
11905{
11906namespace
11907{
11908
11916inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11917{
11918 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11919}
11920
11921} // namespace
11922
11935 nvinfer1::EngineCapability capability) noexcept;
11936
11946extern "C" TENSORRTAPI bool setInternalLibraryPath(AsciiChar const* path) noexcept;
11947
11948namespace safe
11949{
11951class IPluginRegistry;
11952} // namespace safe
11953
11961extern "C" TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
11962 nvinfer1::EngineCapability capability) noexcept;
11963
11964} // namespace nvinfer1
11965
11966#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:6826
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6831
virtual ~IAttentionBoundaryLayer() noexcept=0
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6963
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:7013
bool setMetadata(char const *metadata) noexcept
Set the metadata for IAttention.
Definition: NvInfer.h:7263
TRT_NODISCARD bool setQueryLengths(ITensor *lengths) noexcept
Set the query lengths tensor.
Definition: NvInfer.h:7388
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:7089
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7179
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7102
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7142
CausalMaskKind getCausalKind() const noexcept
Get the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7077
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7162
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7150
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device attention execution.
Definition: NvInfer.h:7292
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7130
TRT_NODISCARD bool setKeyValueLengths(ITensor *lengths) noexcept
Set the key-value lengths tensor.
Definition: NvInfer.h:7427
TRT_NODISCARD ITensor * getKeyValueLengths() const noexcept
Get the key-value lengths tensor.
Definition: NvInfer.h:7439
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6972
TRT_NODISCARD AttentionIOForm getKeyValueForm() const noexcept
Get the key-value form.
Definition: NvInfer.h:7364
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7191
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7231
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:7304
TRT_DEPRECATED bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:7045
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6984
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7207
bool setCausalKind(CausalMaskKind kind) noexcept
Set the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7065
TRT_NODISCARD AttentionIOForm getQueryForm() const noexcept
Get the query form.
Definition: NvInfer.h:7334
char const * getMetadata() const noexcept
Get the metadata of IAttention.
Definition: NvInfer.h:7276
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7243
TRT_NODISCARD bool setQueryForm(AttentionIOForm form) noexcept
Set the query form.
Definition: NvInfer.h:7321
virtual ~IAttention() noexcept=0
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7218
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7121
TRT_NODISCARD ITensor * getQueryLengths() const noexcept
Get the query lengths tensor.
Definition: NvInfer.h:7400
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:7001
TRT_NODISCARD bool setKeyValueForm(AttentionIOForm form) noexcept
Set the key-value form.
Definition: NvInfer.h:7351
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:7031
apiv::VAttention * mImpl
Definition: NvInfer.h:7445
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6854
virtual ~IAttentionInputLayer() noexcept=0
This layer represents an output of an IAttention.
Definition: NvInfer.h:6893
virtual ~IAttentionOutputLayer() noexcept=0
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10623
void setProfileStream(cudaStream_t const stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10892
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:11081
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:11016
bool setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11274
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:11118
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:11132
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:11177
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:10981
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:11220
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:11378
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11406
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:11100
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10822
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:11243
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10754
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10660
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:11284
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10737
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:11350
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11418
bool setRemoteAutoTuningConfig(char const *config) noexcept
Set a config string for remote auto tuning.
Definition: NvInfer.h:11432
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:11300
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10946
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10934
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:11049
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10853
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:11039
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:11233
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10672
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:11338
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10843
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:11326
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:11362
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10701
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10689
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:10996
char const * getAllBuildRoutes() const noexcept
Get all available build routes.
Definition: NvInfer.h:11515
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10786
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10812
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:11207
char const * getRemoteAutoTuningConfig() const noexcept
Get a config string for remote auto tuning.
Definition: NvInfer.h:11442
bool setBuildRoute(char const *buildRoute) noexcept
Set the build route to be passed to the compiler.
Definition: NvInfer.h:11465
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10713
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10921
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:11310
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11521
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10647
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:10833
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10725
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10764
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10796
cudaStream_t getProfileStream() const noexcept
Get the default engine-level CUDA stream used to profile this network.
Definition: NvInfer.h:10904
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:11194
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11390
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10959
char const * getBuildRoute() const noexcept
Get the build route string.
Definition: NvInfer.h:11479
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10776
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:11165
Builds an engine from a network definition.
Definition: NvInfer.h:11584
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11603
virtual ~IBuilder() noexcept=0
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11711
apiv::VBuilder * mImpl
Definition: NvInfer.h:11891
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11845
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:11835
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11875
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11885
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11677
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11621
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11662
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11635
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11719
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11861
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11696
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11739
bool buildSerializedNetworkToStream(INetworkDefinition &network, IBuilderConfig &config, IStreamWriter &writer) noexcept
Builds network using the config configuration, and serializes an engine into writer.
Definition: NvInfer.h:11761
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11809
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config, IHostMemory *&kernelText) noexcept
Extended form of buildSerializedNetwork that optionally permits getting the kernel text.
Definition: NvInfer.h:11786
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:3144
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6647
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6658
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6706
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6724
virtual ~ICumulativeLayer() noexcept=0
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6694
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6718
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6682
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6670
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:8143
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:7567
bool setCacheMode(KVCacheMode cacheMode) noexcept
Set the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7592
TRT_NODISCARD ITensor * getUpdateLengths() const noexcept
Get the update lengths tensor.
Definition: NvInfer.h:7667
virtual ~IKVCacheUpdateLayer() noexcept=0
TRT_NODISCARD AttentionIOForm getUpdateForm() const noexcept
Get the update form.
Definition: NvInfer.h:7633
TRT_NODISCARD bool setUpdateLengths(ITensor *lengths) noexcept
Set the update lengths tensor.
Definition: NvInfer.h:7655
TRT_NODISCARD bool setUpdateForm(AttentionIOForm form) noexcept
Set the update form.
Definition: NvInfer.h:7620
KVCacheMode getCacheMode() const noexcept
Get the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7602
apiv::VKVCacheUpdateLayer * mImpl
Definition: NvInfer.h:7673
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:7818
void setSwigluParamLimit(float limit) noexcept
Set the SwiGLU parameter limit.
Definition: NvInfer.h:8040
void setDynQOutputScaleType(DataType type) noexcept
Set the dynamic quantization output scale type.
Definition: NvInfer.h:7993
MoEActType getActivationType() const noexcept
Get the activation type for the MoE layer.
Definition: NvInfer.h:7867
void setQuantizationToType(DataType type) noexcept
Set the data type the mul output is quantized to.
Definition: NvInfer.h:7941
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:7926
void setQuantizationStatic(ITensor &fcDownActivationScale, DataType dataType) noexcept
Configure static quantization after the mul op.
Definition: NvInfer.h:7893
float getSwigluParamLimit() const noexcept
Get the SwiGLU parameter limit.
Definition: NvInfer.h:8052
DataType getQuantizationToType() const noexcept
Get the data type the mul in MoE layer is quantized to.
Definition: NvInfer.h:7953
DataType getDynQOutputScaleType() const noexcept
Get the dynamic quantization output scale type.
Definition: NvInfer.h:8005
virtual ~IMoELayer() noexcept=0
void setActivationType(MoEActType activationType) noexcept
Set the activation type for the MoE layer.
Definition: NvInfer.h:7855
Dims getQuantizationBlockShape() const noexcept
Get the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7981
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:7831
float getSwigluParamBeta() const noexcept
Get the SwiGLU parameter beta.
Definition: NvInfer.h:8104
void setSwigluParamBeta(float beta) noexcept
Set the SwiGLU parameter beta.
Definition: NvInfer.h:8092
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:7843
void setSwigluParams(float limit, float alpha, float beta) noexcept
Set the SwiGLU parameters.
Definition: NvInfer.h:8026
void setQuantizationBlockShape(Dims const &blockShape) noexcept
Set the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7969
void setInput(int32_t index, ITensor &tensor) noexcept
Set the input of the MoE layer.
Definition: NvInfer.h:8121
float getSwigluParamAlpha() const noexcept
Get the SwiGLU parameter alpha.
Definition: NvInfer.h:8078
void setSwigluParamAlpha(float alpha) noexcept
Set the SwiGLU parameter alpha.
Definition: NvInfer.h:8066
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:8169
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:8397
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:8460
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:8926
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:8656
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:8240
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:8341
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:9607
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:9242
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8747
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:9061
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:8816
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:9140
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:8940
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:9039
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:8561
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:8531
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:8623
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:9365
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:9021
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:9268
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:9171
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:8288
TRT_NODISCARD INormalizationLayer * addNormalizationV2(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9929
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:8322
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:8902
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:9793
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:8503
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:8266
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:8992
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:9186
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9342
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:9853
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9516
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:9668
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:9553
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:9436
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:8515
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:8980
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:9409
IDynamicQuantizeLayer * addDynamicQuantizeV2(ITensor &input, Dims const &blockShape, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:9460
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:8587
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:8446
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:9494
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:8831
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:9834
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:9225
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:9385
TRT_DEPRECATED INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9585
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:8489
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:8970
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:9935
IKVCacheUpdateLayer * addKVCacheUpdate(ITensor &cache, ITensor &update, ITensor &writeIndices, KVCacheMode cacheMode) noexcept
Add a KVCacheUpdate layer to the network.
Definition: NvInfer.h:9727
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:9009
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:8477
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:8367
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:8882
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:8843
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:8801
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:8688
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8763
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:8424
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:8787
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9327
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:9081
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9536
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:8707
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:8956
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:8672
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9821
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9808
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:9693
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:9103
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:9157
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:9903
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:8728
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:8380
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:8256
TRT_DEPRECATED IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:9637
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:9476
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:8222
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:8864
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:9284
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:8545
ISqueezeLayer * addSqueeze(ITensor &input, ITensor *axes) noexcept
Add a squeeze layer to the network, with axes given by a tensor or a nullptr.
Definition: NvInfer.h:9882
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:9308
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:9781
IMoELayer * addMoE(ITensor &hiddenStates, ITensor &selectedExpertsForTokens, ITensor &scoresForSelectedExperts) noexcept
Add a MoE (Mixture of Experts) layer to the network.
Definition: NvInfer.h:9749
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:8302
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:2667
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:7458
TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
Get the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7498
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:7465
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:7487
apiv::VRotaryEmbeddingLayer * mImpl
Definition: NvInfer.h:7520
TRT_NODISCARD bool getInterleaved() const noexcept
Get whether the input is in interleaved format. The default value is false.
Definition: NvInfer.h:7476
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:6533
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6553
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:10210
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:10276
virtual ~ITimingCache() noexcept=0
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:10247
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:10293
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:10315
apiv::VTimingCache * mImpl
Definition: NvInfer.h:10321
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:10257
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:6568
virtual ~IUnsqueezeLayer() noexcept=0
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6586
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:10530
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:11916
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:2910
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:10334
AttentionIOForm
Enumerates the layout of the input/output tensors in an Attention layer.
Definition: NvInfer.h:6796
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:9958
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10447
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6604
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:6768
@ 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:11533
PreviewFeature
Define preview features.
Definition: NvInfer.h:10413
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10500
@ 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:9988
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:7685
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:2922
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11544
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:9998
@ 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:7532
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:10613
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:6736
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:10174
Definition: NvInfer.h:10186
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:10188
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:10190

  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