TensorRT for RTX 1.7.1
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
301 void setAllowedFormats(TensorFormats formats) noexcept
302 {
303 mImpl->setAllowedFormats(formats);
304 }
305
315 {
316 return mImpl->getAllowedFormats();
317 }
318
345 bool isShapeTensor() const noexcept
346 {
347 return mImpl->isShapeTensor();
348 }
349
366 bool isExecutionTensor() const noexcept
367 {
368 return mImpl->isExecutionTensor();
369 }
370
392 void setDimensionName(int32_t index, char const* name) noexcept
393 {
394 mImpl->setDimensionName(index, name);
395 }
396
407 char const* getDimensionName(int32_t index) const noexcept
408 {
409 return mImpl->getDimensionName(index);
410 }
411
412protected:
413 apiv::VTensor* mImpl;
414 virtual ~ITensor() noexcept = 0;
415};
416
417inline ITensor::~ITensor() noexcept = default;
418
426class ILayer : public INoCopy
427{
428public:
434 LayerType getType() const noexcept
435 {
436 return mLayer->getType();
437 }
438
448 void setName(char const* name) noexcept
449 {
450 mLayer->setName(name);
451 }
452
458 char const* getName() const noexcept
459 {
460 return mLayer->getName();
461 }
462
466 int32_t getNbInputs() const noexcept
467 {
468 return mLayer->getNbInputs();
469 }
470
479 ITensor* getInput(int32_t index) const noexcept
480 {
481 return mLayer->getInput(index);
482 }
483
487 int32_t getNbOutputs() const noexcept
488 {
489 return mLayer->getNbOutputs();
490 }
491
497 ITensor* getOutput(int32_t index) const noexcept
498 {
499 return mLayer->getOutput(index);
500 }
501
514 void setInput(int32_t index, ITensor& tensor) noexcept
515 {
516 return mLayer->setInput(index, tensor);
517 }
518
519
529 DataType getOutputType(int32_t index) const noexcept
530 {
531 return mLayer->getOutputType(index);
532 }
533
534
548 void setMetadata(char const* metadata) noexcept
549 {
550 mLayer->setMetadata(metadata);
551 }
552
561 char const* getMetadata() const noexcept
562 {
563 return mLayer->getMetadata();
564 }
565
582 bool setNbRanks(int32_t nbRanks) noexcept
583 {
584 return mLayer->setNbRanks(nbRanks);
585 }
586
594 int32_t getNbRanks() const noexcept
595 {
596 return mLayer->getNbRanks();
597 }
598
599protected:
600 virtual ~ILayer() noexcept = 0;
601 apiv::VLayer* mLayer;
602};
603
604inline ILayer::~ILayer() noexcept = default;
605
762enum class PaddingMode : int32_t
763{
766 kSAME_UPPER = 2,
767 kSAME_LOWER = 3,
768};
769
775template <>
777{
778 static constexpr int32_t kVALUE = 4;
779};
780
794{
795public:
803 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
804 {
805 mImpl->setNbOutputMaps(nbOutputMaps);
806 }
807
813 int64_t getNbOutputMaps() const noexcept
814 {
815 return mImpl->getNbOutputMaps();
816 }
817
833 void setNbGroups(int64_t nbGroups) noexcept
834 {
835 mImpl->setNbGroups(nbGroups);
836 }
837
843 int64_t getNbGroups() const noexcept
844 {
845 return mImpl->getNbGroups();
846 }
847
857 void setKernelWeights(Weights weights) noexcept
858 {
859 mImpl->setKernelWeights(weights);
860 }
861
867 Weights getKernelWeights() const noexcept
868 {
869 return mImpl->getKernelWeights();
870 }
871
882 void setBiasWeights(Weights weights) noexcept
883 {
884 mImpl->setBiasWeights(weights);
885 }
886
892 Weights getBiasWeights() const noexcept
893 {
894 return mImpl->getBiasWeights();
895 }
896
909 void setPrePadding(Dims const& padding) noexcept
910 {
911 mImpl->setPrePadding(padding);
912 }
913
919 Dims getPrePadding() const noexcept
920 {
921 return mImpl->getPrePadding();
922 }
923
936 void setPostPadding(Dims const& padding) noexcept
937 {
938 mImpl->setPostPadding(padding);
939 }
940
946 Dims getPostPadding() const noexcept
947 {
948 return mImpl->getPostPadding();
949 }
950
960 void setPaddingMode(PaddingMode paddingMode) noexcept
961 {
962 mImpl->setPaddingMode(paddingMode);
963 }
964
973 {
974 return mImpl->getPaddingMode();
975 }
976
985 void setKernelSizeNd(Dims const& kernelSize) noexcept
986 {
987 mImpl->setKernelSizeNd(kernelSize);
988 }
989
995 Dims getKernelSizeNd() const noexcept
996 {
997 return mImpl->getKernelSizeNd();
998 }
999
1010 void setStrideNd(Dims const& stride) noexcept
1011 {
1012 mImpl->setStrideNd(stride);
1013 }
1014
1020 Dims getStrideNd() const noexcept
1021 {
1022 return mImpl->getStrideNd();
1023 }
1024
1038 void setPaddingNd(Dims const& padding) noexcept
1039 {
1040 mImpl->setPaddingNd(padding);
1041 }
1042
1050 Dims getPaddingNd() const noexcept
1051 {
1052 return mImpl->getPaddingNd();
1053 }
1054
1064 void setDilationNd(Dims const& dilation) noexcept
1065 {
1066 mImpl->setDilationNd(dilation);
1067 }
1068
1074 Dims getDilationNd() const noexcept
1075 {
1076 return mImpl->getDilationNd();
1077 }
1078
1093 using ILayer::setInput;
1094
1095protected:
1096 virtual ~IConvolutionLayer() noexcept = 0;
1097 apiv::VConvolutionLayer* mImpl;
1098};
1099
1100inline IConvolutionLayer::~IConvolutionLayer() noexcept = default;
1101
1116{
1117public:
1126 {
1127 mImpl->setActivationType(type);
1128 }
1129
1136 {
1137 return mImpl->getActivationType();
1138 }
1139
1150 void setAlpha(float alpha) noexcept
1151 {
1152 mImpl->setAlpha(alpha);
1153 }
1154
1164 void setBeta(float beta) noexcept
1165 {
1166 mImpl->setBeta(beta);
1167 }
1168
1173 float getAlpha() const noexcept
1174 {
1175 return mImpl->getAlpha();
1176 }
1177
1182 float getBeta() const noexcept
1183 {
1184 return mImpl->getBeta();
1185 }
1186
1187protected:
1188 virtual ~IActivationLayer() noexcept = 0;
1189 apiv::VActivationLayer* mImpl;
1190};
1191
1192inline IActivationLayer::~IActivationLayer() noexcept = default;
1193
1199enum class PoolingType : int32_t
1200{
1201 kMAX = 0,
1202 kAVERAGE = 1,
1204};
1205
1211template <>
1213{
1214 static constexpr int32_t kVALUE = 3;
1215};
1216
1228class IPoolingLayer : public ILayer
1229{
1230public:
1238 void setPoolingType(PoolingType type) noexcept
1239 {
1240 mImpl->setPoolingType(type);
1241 }
1242
1249 {
1250 return mImpl->getPoolingType();
1251 }
1252
1263 void setBlendFactor(float blendFactor) noexcept
1264 {
1265 mImpl->setBlendFactor(blendFactor);
1266 }
1267
1276 float getBlendFactor() const noexcept
1277 {
1278 return mImpl->getBlendFactor();
1279 }
1280
1290 void setAverageCountExcludesPadding(bool exclusive) noexcept
1291 {
1292 mImpl->setAverageCountExcludesPadding(exclusive);
1293 }
1294
1302 {
1303 return mImpl->getAverageCountExcludesPadding();
1304 }
1305
1319 void setPrePadding(Dims const& padding) noexcept
1320 {
1321 mImpl->setPrePadding(padding);
1322 }
1323
1329 Dims getPrePadding() const noexcept
1330 {
1331 return mImpl->getPrePadding();
1332 }
1333
1347 void setPostPadding(Dims const& padding) noexcept
1348 {
1349 mImpl->setPostPadding(padding);
1350 }
1351
1357 Dims getPostPadding() const noexcept
1358 {
1359 return mImpl->getPostPadding();
1360 }
1361
1370 void setPaddingMode(PaddingMode paddingMode) noexcept
1371 {
1372 mImpl->setPaddingMode(paddingMode);
1373 }
1374
1382 {
1383 return mImpl->getPaddingMode();
1384 }
1385
1394 void setWindowSizeNd(Dims const& windowSize) noexcept
1395 {
1396 mImpl->setWindowSizeNd(windowSize);
1397 }
1398
1404 Dims getWindowSizeNd() const noexcept
1405 {
1406 return mImpl->getWindowSizeNd();
1407 }
1408
1418 void setStrideNd(Dims const& stride) noexcept
1419 {
1420 mImpl->setStrideNd(stride);
1421 }
1422
1428 Dims getStrideNd() const noexcept
1429 {
1430 return mImpl->getStrideNd();
1431 }
1432
1447 void setPaddingNd(Dims const& padding) noexcept
1448 {
1449 mImpl->setPaddingNd(padding);
1450 }
1451
1459 Dims getPaddingNd() const noexcept
1460 {
1461 return mImpl->getPaddingNd();
1462 }
1463
1464protected:
1465 virtual ~IPoolingLayer() noexcept = 0;
1466 apiv::VPoolingLayer* mImpl;
1467};
1468
1469inline IPoolingLayer::~IPoolingLayer() noexcept = default;
1470
1480class ILRNLayer : public ILayer
1481{
1482public:
1492 void setWindowSize(int64_t windowSize) noexcept
1493 {
1494 mImpl->setWindowSize(windowSize);
1495 }
1496
1502 int64_t getWindowSize() const noexcept
1503 {
1504 return mImpl->getWindowSize();
1505 }
1506
1514 void setAlpha(float alpha) noexcept
1515 {
1516 mImpl->setAlpha(alpha);
1517 }
1518
1524 float getAlpha() const noexcept
1525 {
1526 return mImpl->getAlpha();
1527 }
1528
1536 void setBeta(float beta) noexcept
1537 {
1538 mImpl->setBeta(beta);
1539 }
1540
1546 float getBeta() const noexcept
1547 {
1548 return mImpl->getBeta();
1549 }
1550
1558 void setK(float k) noexcept
1559 {
1560 mImpl->setK(k);
1561 }
1562
1568 float getK() const noexcept
1569 {
1570 return mImpl->getK();
1571 }
1572
1573protected:
1574 virtual ~ILRNLayer() noexcept = 0;
1575 apiv::VLRNLayer* mImpl;
1576};
1577
1578inline ILRNLayer::~ILRNLayer() noexcept = default;
1579
1585enum class ScaleMode : int32_t
1586{
1587 kUNIFORM = 0,
1588 kCHANNEL = 1,
1589 kELEMENTWISE = 2
1590};
1591
1597template <>
1599{
1600 static constexpr int32_t kVALUE = 3;
1601};
1602
1628class IScaleLayer : public ILayer
1629{
1630public:
1636 void setMode(ScaleMode mode) noexcept
1637 {
1638 mImpl->setMode(mode);
1639 }
1640
1646 ScaleMode getMode() const noexcept
1647 {
1648 return mImpl->getMode();
1649 }
1650
1656 void setShift(Weights shift) noexcept
1657 {
1658 mImpl->setShift(shift);
1659 }
1660
1666 Weights getShift() const noexcept
1667 {
1668 return mImpl->getShift();
1669 }
1670
1676 void setScale(Weights scale) noexcept
1677 {
1678 mImpl->setScale(scale);
1679 }
1680
1686 Weights getScale() const noexcept
1687 {
1688 return mImpl->getScale();
1689 }
1690
1696 void setPower(Weights power) noexcept
1697 {
1698 mImpl->setPower(power);
1699 }
1700
1706 Weights getPower() const noexcept
1707 {
1708 return mImpl->getPower();
1709 }
1710
1721 int32_t getChannelAxis() const noexcept
1722 {
1723 return mImpl->getChannelAxis();
1724 }
1725
1742 void setChannelAxis(int32_t channelAxis) noexcept
1743 {
1744 mImpl->setChannelAxis(channelAxis);
1745 }
1746
1747protected:
1748 virtual ~IScaleLayer() noexcept = 0;
1749 apiv::VScaleLayer* mImpl;
1750};
1751
1752inline IScaleLayer::~IScaleLayer() noexcept = default;
1753
1774class ISoftMaxLayer : public ILayer
1775{
1776public:
1797 void setAxes(uint32_t axes) noexcept
1798 {
1799 mImpl->setAxes(axes);
1800 }
1801
1807 uint32_t getAxes() const noexcept
1808 {
1809 return mImpl->getAxes();
1810 }
1811
1812protected:
1813 virtual ~ISoftMaxLayer() noexcept = 0;
1814 apiv::VSoftMaxLayer* mImpl;
1815};
1816
1817inline ISoftMaxLayer::~ISoftMaxLayer() noexcept = default;
1818
1832{
1833public:
1845 void setAxis(int32_t axis) noexcept
1846 {
1847 mImpl->setAxis(axis);
1848 }
1849
1855 int32_t getAxis() const noexcept
1856 {
1857 return mImpl->getAxis();
1858 }
1859
1860protected:
1861 virtual ~IConcatenationLayer() noexcept = 0;
1862 apiv::VConcatenationLayer* mImpl;
1863};
1864
1865inline IConcatenationLayer::~IConcatenationLayer() noexcept = default;
1866
1875{
1876public:
1884 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1885 {
1886 mImpl->setNbOutputMaps(nbOutputMaps);
1887 }
1888
1894 int64_t getNbOutputMaps() const noexcept
1895 {
1896 return mImpl->getNbOutputMaps();
1897 }
1898
1914 void setNbGroups(int64_t nbGroups) noexcept
1915 {
1916 mImpl->setNbGroups(nbGroups);
1917 }
1918
1924 int64_t getNbGroups() const noexcept
1925 {
1926 return mImpl->getNbGroups();
1927 }
1928
1938 void setKernelWeights(Weights weights) noexcept
1939 {
1940 mImpl->setKernelWeights(weights);
1941 }
1942
1948 Weights getKernelWeights() const noexcept
1949 {
1950 return mImpl->getKernelWeights();
1951 }
1952
1963 void setBiasWeights(Weights weights) noexcept
1964 {
1965 mImpl->setBiasWeights(weights);
1966 }
1967
1973 Weights getBiasWeights() const noexcept
1974 {
1975 return mImpl->getBiasWeights();
1976 }
1977
1990 void setPrePadding(Dims const& padding) noexcept
1991 {
1992 mImpl->setPrePadding(padding);
1993 }
1994
2000 Dims getPrePadding() const noexcept
2001 {
2002 return mImpl->getPrePadding();
2003 }
2004
2017 void setPostPadding(Dims const& padding) noexcept
2018 {
2019 mImpl->setPostPadding(padding);
2020 }
2021
2027 Dims getPostPadding() const noexcept
2028 {
2029 return mImpl->getPostPadding();
2030 }
2031
2041 void setPaddingMode(PaddingMode paddingMode) noexcept
2042 {
2043 mImpl->setPaddingMode(paddingMode);
2044 }
2045
2054 {
2055 return mImpl->getPaddingMode();
2056 }
2057
2068 void setKernelSizeNd(Dims const& kernelSize) noexcept
2069 {
2070 mImpl->setKernelSizeNd(kernelSize);
2071 }
2072
2078 Dims getKernelSizeNd() const noexcept
2079 {
2080 return mImpl->getKernelSizeNd();
2081 }
2082
2095 void setStrideNd(Dims const& stride) noexcept
2096 {
2097 mImpl->setStrideNd(stride);
2098 }
2099
2105 Dims getStrideNd() const noexcept
2106 {
2107 return mImpl->getStrideNd();
2108 }
2109
2123 void setPaddingNd(Dims const& padding) noexcept
2124 {
2125 mImpl->setPaddingNd(padding);
2126 }
2127
2135 Dims getPaddingNd() const noexcept
2136 {
2137 return mImpl->getPaddingNd();
2138 }
2139
2152 using ILayer::setInput;
2153
2161 void setDilationNd(Dims const& dilation) noexcept
2162 {
2163 mImpl->setDilationNd(dilation);
2164 }
2165
2171 Dims getDilationNd() const noexcept
2172 {
2173 return mImpl->getDilationNd();
2174 }
2175
2176protected:
2177 virtual ~IDeconvolutionLayer() noexcept = 0;
2178 apiv::VDeconvolutionLayer* mImpl;
2179};
2180
2181inline IDeconvolutionLayer::~IDeconvolutionLayer() noexcept = default;
2182
2195enum class ElementWiseOperation : int32_t
2196{
2197 kSUM = 0,
2198 kPROD = 1,
2199 kMAX = 2,
2200 kMIN = 3,
2201 kSUB = 4,
2202 kDIV = 5,
2203 kPOW = 6,
2204 kFLOOR_DIV = 7,
2205 kAND = 8,
2206 kOR = 9,
2207 kXOR = 10,
2208 kEQUAL = 11,
2209 kGREATER = 12,
2210 kLESS = 13
2211};
2212
2218template <>
2220{
2221 static constexpr int32_t kVALUE = 14;
2222};
2223
2244{
2245public:
2256 {
2257 return mImpl->setOperation(op);
2258 }
2259
2268 {
2269 return mImpl->getOperation();
2270 }
2271
2272protected:
2273 apiv::VElementWiseLayer* mImpl;
2274 virtual ~IElementWiseLayer() noexcept = 0;
2275};
2276
2277inline IElementWiseLayer::~IElementWiseLayer() noexcept = default;
2278
2284enum class GatherMode : int32_t
2285{
2286 kDEFAULT = 0,
2287 kELEMENT = 1,
2288 kND = 2
2289};
2290
2296template <>
2298{
2299 static constexpr int32_t kVALUE = 3;
2300};
2301
2378class IGatherLayer : public ILayer
2379{
2380public:
2390 void setGatherAxis(int32_t axis) noexcept
2391 {
2392 mImpl->setGatherAxis(axis);
2393 }
2394
2402 int32_t getGatherAxis() const noexcept
2403 {
2404 return mImpl->getGatherAxis();
2405 }
2406
2425 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2426 {
2427 mImpl->setNbElementWiseDims(elementWiseDims);
2428 }
2429
2435 int32_t getNbElementWiseDims() const noexcept
2436 {
2437 return mImpl->getNbElementWiseDims();
2438 }
2439
2445 void setMode(GatherMode mode) noexcept
2446 {
2447 mImpl->setMode(mode);
2448 }
2449
2455 GatherMode getMode() const noexcept
2456 {
2457 return mImpl->getMode();
2458 }
2459
2460protected:
2461 apiv::VGatherLayer* mImpl;
2462 virtual ~IGatherLayer() noexcept = 0;
2463};
2464
2465inline IGatherLayer::~IGatherLayer() noexcept = default;
2466
2479{
2480public:
2487 {
2488 return mImpl->getPlugin();
2489 }
2490
2491protected:
2492 apiv::VPluginV2Layer* mImpl;
2493 virtual ~IPluginV2Layer() noexcept = 0;
2494};
2495
2496inline IPluginV2Layer::~IPluginV2Layer() noexcept = default;
2497
2508{
2509public:
2516 {
2517 return mImpl->getPlugin();
2518 }
2519
2520protected:
2521 apiv::VPluginV3Layer* mImpl;
2522 virtual ~IPluginV3Layer() noexcept = 0;
2523};
2524
2525inline IPluginV3Layer::~IPluginV3Layer() noexcept = default;
2526
2543enum class UnaryOperation : int32_t
2544{
2545 kEXP = 0,
2546 kLOG = 1,
2547 kSQRT = 2,
2548 kRECIP = 3,
2549 kABS = 4,
2550 kNEG = 5,
2551 kSIN = 6,
2552 kCOS = 7,
2553 kTAN = 8,
2554 kSINH = 9,
2555 kCOSH = 10,
2556 kASIN = 11,
2557 kACOS = 12,
2558 kATAN = 13,
2559 kASINH = 14,
2560 kACOSH = 15,
2561 kATANH = 16,
2562 kCEIL = 17,
2563 kFLOOR = 18,
2564 kERF = 19,
2565 kNOT = 20,
2566 kSIGN = 21,
2567 kROUND = 22,
2568 kISINF = 23,
2569 kISNAN = 24,
2570};
2571
2577template <>
2579{
2580 static constexpr int32_t kVALUE = 25;
2581};
2582
2590class IUnaryLayer : public ILayer
2591{
2592public:
2601 {
2602 mImpl->setOperation(op);
2603 }
2604
2611 {
2612 return mImpl->getOperation();
2613 }
2614
2615protected:
2616 apiv::VUnaryLayer* mImpl;
2617 virtual ~IUnaryLayer() noexcept = 0;
2618};
2619
2620inline IUnaryLayer::~IUnaryLayer() noexcept = default;
2621
2645enum class ReduceOperation : int32_t
2646{
2647 kSUM = 0,
2648 kPROD = 1,
2649 kMAX = 2,
2650 kMIN = 3,
2651 kAVG = 4,
2652 kNONE = 5,
2653};
2654
2660template <>
2662{
2663 static constexpr int32_t kVALUE = 6;
2664};
2665
2673enum class CollectiveOperation : int32_t
2674{
2675 kALL_REDUCE = 0,
2676 kALL_GATHER = 1,
2677 kBROADCAST = 2,
2678 kREDUCE = 3,
2679 kREDUCE_SCATTER = 4,
2680 kALL_TO_ALL = 5,
2681 kGATHER = 6,
2682 kSCATTER = 7,
2683};
2684
2690template <>
2692{
2693 static constexpr int32_t kVALUE = 8;
2694};
2695
2703class IReduceLayer : public ILayer
2704{
2705public:
2712 {
2713 mImpl->setOperation(op);
2714 }
2715
2722 {
2723 return mImpl->getOperation();
2724 }
2725
2731 void setReduceAxes(uint32_t reduceAxes) noexcept
2732 {
2733 mImpl->setReduceAxes(reduceAxes);
2734 }
2735
2741 uint32_t getReduceAxes() const noexcept
2742 {
2743 return mImpl->getReduceAxes();
2744 }
2745
2751 void setKeepDimensions(bool keepDimensions) noexcept
2752 {
2753 mImpl->setKeepDimensions(keepDimensions);
2754 }
2755
2761 bool getKeepDimensions() const noexcept
2762 {
2763 return mImpl->getKeepDimensions();
2764 }
2765
2766protected:
2767 apiv::VReduceLayer* mImpl;
2768 virtual ~IReduceLayer() noexcept = 0;
2769};
2770
2771inline IReduceLayer::~IReduceLayer() noexcept = default;
2772
2785class IPaddingLayer : public ILayer
2786{
2787public:
2797 void setPrePaddingNd(Dims const& padding) noexcept
2798 {
2799 mImpl->setPrePaddingNd(padding);
2800 }
2801
2809 Dims getPrePaddingNd() const noexcept
2810 {
2811 return mImpl->getPrePaddingNd();
2812 }
2813
2823 void setPostPaddingNd(Dims const& padding) noexcept
2824 {
2825 mImpl->setPostPaddingNd(padding);
2826 }
2827
2835 Dims getPostPaddingNd() const noexcept
2836 {
2837 return mImpl->getPostPaddingNd();
2838 }
2839
2840protected:
2841 apiv::VPaddingLayer* mImpl;
2842 virtual ~IPaddingLayer() noexcept = 0;
2843};
2844
2845inline IPaddingLayer::~IPaddingLayer() noexcept = default;
2846
2853{
2860 int32_t order[Dims::MAX_DIMS];
2861};
2862
2875class IShuffleLayer : public ILayer
2876{
2877public:
2887 void setFirstTranspose(Permutation permutation) noexcept
2888 {
2889 mImpl->setFirstTranspose(permutation);
2890 }
2891
2900 {
2901 return mImpl->getFirstTranspose();
2902 }
2903
2927 void setReshapeDimensions(Dims const& dimensions) noexcept
2928 {
2929 mImpl->setReshapeDimensions(dimensions);
2930 }
2931
2941 {
2942 return mImpl->getReshapeDimensions();
2943 }
2944
2950 //
2973 using ILayer::setInput;
2974
2987 void setSecondTranspose(Permutation permutation) noexcept
2988 {
2989 mImpl->setSecondTranspose(permutation);
2990 }
2991
3000 {
3001 return mImpl->getSecondTranspose();
3002 }
3003
3015 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3016 {
3017 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3018 }
3019
3028 bool getZeroIsPlaceholder() const noexcept
3029 {
3030 return mImpl->getZeroIsPlaceholder();
3031 }
3032
3033protected:
3034 apiv::VShuffleLayer* mImpl;
3035 virtual ~IShuffleLayer() noexcept = 0;
3036};
3037
3038inline IShuffleLayer::~IShuffleLayer() noexcept = default;
3039
3045enum class SampleMode : int32_t
3046{
3047 kSTRICT_BOUNDS = 0,
3048 kWRAP = 1,
3049 kCLAMP = 2,
3050 kFILL = 3,
3051 kREFLECT = 4,
3054};
3055
3061template <>
3063{
3064 static constexpr int32_t kVALUE = 5;
3065};
3066
3129class ISliceLayer : public ILayer
3130{
3131public:
3141 void setStart(Dims const& start) noexcept
3142 {
3143 mImpl->setStart(start);
3144 }
3145
3156 Dims getStart() const noexcept
3157 {
3158 return mImpl->getStart();
3159 }
3160
3170 void setSize(Dims const& size) noexcept
3171 {
3172 return mImpl->setSize(size);
3173 }
3174
3185 Dims getSize() const noexcept
3186 {
3187 return mImpl->getSize();
3188 }
3189
3199 void setStride(Dims const& stride) noexcept
3200 {
3201 mImpl->setStride(stride);
3202 }
3203
3214 Dims getStride() const noexcept
3215 {
3216 return mImpl->getStride();
3217 }
3218
3224 void setMode(SampleMode mode) noexcept
3225 {
3226 mImpl->setMode(mode);
3227 }
3228
3234 SampleMode getMode() const noexcept
3235 {
3236 return mImpl->getMode();
3237 }
3238
3266 using ILayer::setInput;
3267
3277 void setAxes(Dims const& axes) noexcept
3278 {
3279 mImpl->setAxes(axes);
3280 }
3281
3292 Dims getAxes() const noexcept
3293 {
3294 return mImpl->getAxes();
3295 }
3296
3297protected:
3298 apiv::VSliceLayer* mImpl;
3299 virtual ~ISliceLayer() noexcept = 0;
3300};
3301
3302inline ISliceLayer::~ISliceLayer() noexcept = default;
3303
3316class IShapeLayer : public ILayer
3317{
3318protected:
3319 apiv::VShapeLayer* mImpl;
3320 virtual ~IShapeLayer() noexcept = 0;
3321};
3322
3323inline IShapeLayer::~IShapeLayer() noexcept = default;
3324
3330enum class TopKOperation : int32_t
3331{
3332 kMAX = 0,
3333 kMIN = 1,
3334};
3335
3341template <>
3343{
3344 static constexpr int32_t kVALUE = 2;
3345};
3346
3358class ITopKLayer : public ILayer
3359{
3360public:
3366 void setOperation(TopKOperation op) noexcept
3367 {
3368 mImpl->setOperation(op);
3369 }
3370
3377 {
3378 return mImpl->getOperation();
3379 }
3380
3390 void setK(int32_t k) noexcept
3391 {
3392 mImpl->setK(k);
3393 }
3394
3404 int32_t getK() const noexcept
3405 {
3406 return mImpl->getK();
3407 }
3408
3414 void setReduceAxes(uint32_t reduceAxes) noexcept
3415 {
3416 mImpl->setReduceAxes(reduceAxes);
3417 }
3418
3424 uint32_t getReduceAxes() const noexcept
3425 {
3426 return mImpl->getReduceAxes();
3427 }
3428
3443 using ILayer::setInput;
3444
3455 bool setIndicesType(DataType type) noexcept
3456 {
3457 return mImpl->setIndicesType(type);
3458 }
3459
3467 DataType getIndicesType() const noexcept
3468 {
3469 return mImpl->getIndicesType();
3470 }
3471
3472protected:
3473 apiv::VTopKLayer* mImpl;
3474 virtual ~ITopKLayer() noexcept = 0;
3475};
3476
3477inline ITopKLayer::~ITopKLayer() noexcept = default;
3478
3485enum class MatrixOperation : int32_t
3486{
3490 kNONE = 0,
3491
3493 kTRANSPOSE = 1,
3494
3505 kVECTOR = 2,
3506};
3507
3513template <>
3515{
3516 static constexpr int32_t kVALUE = 3;
3517};
3518
3545{
3546public:
3555 void setOperation(int32_t index, MatrixOperation op) noexcept
3556 {
3557 mImpl->setOperation(index, op);
3558 }
3559
3567 MatrixOperation getOperation(int32_t index) const noexcept
3568 {
3569 return mImpl->getOperation(index);
3570 }
3571
3572protected:
3573 apiv::VMatrixMultiplyLayer* mImpl;
3574 virtual ~IMatrixMultiplyLayer() noexcept = 0;
3575};
3576
3577inline IMatrixMultiplyLayer::~IMatrixMultiplyLayer() noexcept = default;
3578
3600class INonZeroLayer : public ILayer
3601{
3602public:
3613 bool setIndicesType(DataType type) noexcept
3614 {
3615 return mImpl->setIndicesType(type);
3616 }
3617
3625 DataType getIndicesType() const noexcept
3626 {
3627 return mImpl->getIndicesType();
3628 }
3629
3630protected:
3631 virtual ~INonZeroLayer() noexcept = 0;
3632 apiv::VNonZeroLayer* mImpl;
3633};
3634
3635inline INonZeroLayer::~INonZeroLayer() noexcept = default;
3636
3652{
3653protected:
3654 apiv::VRaggedSoftMaxLayer* mImpl;
3655 virtual ~IRaggedSoftMaxLayer() noexcept = 0;
3656};
3657
3658inline IRaggedSoftMaxLayer::~IRaggedSoftMaxLayer() noexcept = default;
3659
3704{
3705protected:
3706 apiv::VIdentityLayer* mImpl;
3707 virtual ~IIdentityLayer() noexcept = 0;
3708};
3709
3710inline IIdentityLayer::~IIdentityLayer() noexcept = default;
3711
3718class ICastLayer : public ILayer
3719{
3720public:
3728 void setToType(DataType toType) noexcept
3729 {
3730 mImpl->setToType(toType);
3731 }
3732
3739 DataType getToType() const noexcept
3740 {
3741 return mImpl->getToType();
3742 }
3743
3744protected:
3745 apiv::VCastLayer* mImpl;
3746 virtual ~ICastLayer() noexcept = 0;
3747};
3748
3749inline ICastLayer::~ICastLayer() noexcept = default;
3750
3760{
3761public:
3770 void setWeights(Weights weights) noexcept
3771 {
3772 mImpl->setWeights(weights);
3773 }
3774
3780 Weights getWeights() const noexcept
3781 {
3782 return mImpl->getWeights();
3783 }
3784
3792 void setDimensions(Dims const& dimensions) noexcept
3793 {
3794 mImpl->setDimensions(dimensions);
3795 }
3796
3804 Dims getDimensions() const noexcept
3805 {
3806 return mImpl->getDimensions();
3807 }
3808
3809protected:
3810 apiv::VConstantLayer* mImpl;
3811 virtual ~IConstantLayer() noexcept = 0;
3812};
3813
3814inline IConstantLayer::~IConstantLayer() noexcept = default;
3815
3826{
3827protected:
3828 apiv::VParametricReLULayer* mImpl;
3829 virtual ~IParametricReLULayer() noexcept = 0;
3830};
3831
3832inline IParametricReLULayer::~IParametricReLULayer() noexcept = default;
3833
3839enum class InterpolationMode : int32_t
3840{
3841 kNEAREST = 0,
3842 kLINEAR = 1,
3843 kCUBIC = 2
3844};
3845
3851template <>
3853{
3854 static constexpr int32_t kVALUE = 3;
3855};
3856
3865{
3878 kALIGN_CORNERS = 0,
3879
3886 kASYMMETRIC = 1,
3887
3894 kHALF_PIXEL = 2,
3895};
3896
3902template <>
3904{
3905 static constexpr int32_t kVALUE = 3;
3906};
3907
3915enum class ResizeSelector : int32_t
3916{
3918 kFORMULA = 0,
3919
3921 kUPPER = 1,
3922};
3923
3929template <>
3931{
3932 static constexpr int32_t kVALUE = 2;
3933};
3934
3942enum class ResizeRoundMode : int32_t
3943{
3945 kHALF_UP = 0,
3946
3948 kHALF_DOWN = 1,
3949
3951 kFLOOR = 2,
3952
3954 kCEIL = 3,
3955};
3956
3962template <>
3964{
3965 static constexpr int32_t kVALUE = 4;
3966};
3967
4004class IResizeLayer : public ILayer
4005{
4006public:
4025 void setOutputDimensions(Dims const& dimensions) noexcept
4026 {
4027 return mImpl->setOutputDimensions(dimensions);
4028 }
4029
4035 Dims getOutputDimensions() const noexcept
4036 {
4037 return mImpl->getOutputDimensions();
4038 }
4039
4065 void setScales(float const* scales, int32_t nbScales) noexcept
4066 {
4067 mImpl->setScales(scales, nbScales);
4068 }
4069
4084 int32_t getScales(int32_t size, float* scales) const noexcept
4085 {
4086 return mImpl->getScales(size, scales);
4087 }
4088
4096 void setResizeMode(InterpolationMode interpolationMode) noexcept
4097 {
4098 mImpl->setResizeMode(interpolationMode);
4099 }
4100
4107 {
4108 return mImpl->getResizeMode();
4109 }
4110
4130 using ILayer::setInput;
4131
4142 {
4143 mImpl->setCoordinateTransformation(coordTransform);
4144 }
4145
4152 {
4153 return mImpl->getCoordinateTransformation();
4154 }
4155
4167 {
4168 mImpl->setSelectorForSinglePixel(selector);
4169 }
4170
4177 {
4178 return mImpl->getSelectorForSinglePixel();
4179 }
4180
4191 {
4192 mImpl->setNearestRounding(value);
4193 }
4194
4201 {
4202 return mImpl->getNearestRounding();
4203 }
4204
4222 void setCubicCoeff(float A) noexcept
4223 {
4224 mImpl->setCubicCoeff(A);
4225 }
4226
4232 float getCubicCoeff() const noexcept
4233 {
4234 return mImpl->getCubicCoeff();
4235 }
4236
4245 void setExcludeOutside(bool excludeFlag) noexcept
4246 {
4247 mImpl->setExcludeOutside(excludeFlag);
4248 }
4249
4255 bool getExcludeOutside() const noexcept
4256 {
4257 return mImpl->getExcludeOutside();
4258 }
4259
4260protected:
4261 virtual ~IResizeLayer() noexcept = 0;
4262 apiv::VResizeLayer* mImpl;
4263};
4264
4265inline IResizeLayer::~IResizeLayer() noexcept = default;
4266
4272enum class LoopOutput : int32_t
4273{
4275 kLAST_VALUE = 0,
4276
4278 kCONCATENATE = 1,
4279
4281 kREVERSE = 2
4282};
4283
4289template <>
4291{
4292 static constexpr int32_t kVALUE = 3;
4293};
4294
4300enum class TripLimit : int32_t
4301{
4302
4303 kCOUNT = 0,
4304 kWHILE = 1
4305};
4306
4312template <>
4314{
4315 static constexpr int32_t kVALUE = 2;
4316};
4317
4318class ILoop;
4319
4334{
4335public:
4339 ILoop* getLoop() const noexcept
4340 {
4341 return mBoundary->getLoop();
4342 }
4343
4344protected:
4345 virtual ~ILoopBoundaryLayer() noexcept = 0;
4346 apiv::VLoopBoundaryLayer* mBoundary;
4347};
4348
4349inline ILoopBoundaryLayer::~ILoopBoundaryLayer() noexcept = default;
4350
4359{
4360public:
4365 {
4366 return mBoundary->getConditional();
4367 }
4368
4369protected:
4370 virtual ~IIfConditionalBoundaryLayer() noexcept = 0;
4371 apiv::VConditionalBoundaryLayer* mBoundary;
4372};
4373
4374inline IIfConditionalBoundaryLayer::~IIfConditionalBoundaryLayer() noexcept = default;
4375
4382{
4383public:
4384protected:
4385 virtual ~IConditionLayer() noexcept = 0;
4386 apiv::VConditionLayer* mImpl;
4387};
4388
4389inline IConditionLayer::~IConditionLayer() noexcept = default;
4390
4401{
4402public:
4403protected:
4404 virtual ~IIfConditionalOutputLayer() noexcept = 0;
4405 apiv::VConditionalOutputLayer* mImpl;
4406};
4407
4408inline IIfConditionalOutputLayer::~IIfConditionalOutputLayer() noexcept = default;
4409
4416{
4417public:
4418protected:
4419 virtual ~IIfConditionalInputLayer() noexcept = 0;
4420 apiv::VConditionalInputLayer* mImpl;
4421};
4422
4423inline IIfConditionalInputLayer::~IIfConditionalInputLayer() noexcept = default;
4424
4450{
4451public:
4462 {
4463 return mImpl->setCondition(condition);
4464 }
4465
4479 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4480 {
4481 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4482 }
4483
4492 {
4493 return mImpl->addInput(input);
4494 }
4495
4506 void setName(char const* name) noexcept
4507 {
4508 mImpl->setName(name);
4509 }
4510
4516 char const* getName() const noexcept
4517 {
4518 return mImpl->getName();
4519 }
4520
4521protected:
4522 virtual ~IIfConditional() noexcept = 0;
4523 apiv::VIfConditional* mImpl;
4524};
4525
4526inline IIfConditional::~IIfConditional() noexcept = default;
4527
4536{
4537public:
4543 //
4556 using ILayer::setInput;
4557
4558protected:
4559 virtual ~IRecurrenceLayer() noexcept = 0;
4560 apiv::VRecurrenceLayer* mImpl;
4561};
4562
4563inline IRecurrenceLayer::~IRecurrenceLayer() noexcept = default;
4564
4585{
4586public:
4590 LoopOutput getLoopOutput() const noexcept
4591 {
4592 return mImpl->getLoopOutput();
4593 }
4594
4607 void setAxis(int32_t axis) noexcept
4608 {
4609 mImpl->setAxis(axis);
4610 }
4611
4615 int32_t getAxis() const noexcept
4616 {
4617 return mImpl->getAxis();
4618 }
4619
4625 //
4640 using ILayer::setInput;
4641
4642protected:
4643 virtual ~ILoopOutputLayer() noexcept = 0;
4644 apiv::VLoopOutputLayer* mImpl;
4645};
4646
4647inline ILoopOutputLayer::~ILoopOutputLayer() noexcept = default;
4648
4661{
4662public:
4666 TripLimit getTripLimit() const noexcept
4667 {
4668 return mImpl->getTripLimit();
4669 }
4670
4671protected:
4672 virtual ~ITripLimitLayer() noexcept = 0;
4673 apiv::VTripLimitLayer* mImpl;
4674};
4675
4676inline ITripLimitLayer::~ITripLimitLayer() noexcept = default;
4677
4689{
4690public:
4694 void setAxis(int32_t axis) noexcept
4695 {
4696 mImpl->setAxis(axis);
4697 }
4698
4702 int32_t getAxis() const noexcept
4703 {
4704 return mImpl->getAxis();
4705 }
4706
4716 void setReverse(bool reverse) noexcept
4717 {
4718 mImpl->setReverse(reverse);
4719 }
4720
4726 bool getReverse() const noexcept
4727 {
4728 return mImpl->getReverse();
4729 }
4730
4731protected:
4732 virtual ~IIteratorLayer() noexcept = 0;
4733 apiv::VIteratorLayer* mImpl;
4734};
4735
4736inline IIteratorLayer::~IIteratorLayer() noexcept = default;
4737
4748class ILoop : public INoCopy
4749{
4750public:
4757 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4758 {
4759 return mImpl->addRecurrence(initialValue);
4760 }
4761
4779 {
4780 return mImpl->addTripLimit(tensor, limit);
4781 }
4782
4791 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4792 {
4793 return mImpl->addIterator(tensor, axis, reverse);
4794 }
4795
4804 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4805 {
4806 return mImpl->addLoopOutput(tensor, outputKind, axis);
4807 }
4808
4819 void setName(char const* name) noexcept
4820 {
4821 mImpl->setName(name);
4822 }
4823
4829 char const* getName() const noexcept
4830 {
4831 return mImpl->getName();
4832 }
4833
4834protected:
4835 virtual ~ILoop() noexcept = 0;
4836 apiv::VLoop* mImpl;
4837};
4838
4839inline ILoop::~ILoop() noexcept = default;
4840
4853class ISelectLayer : public ILayer
4854{
4855protected:
4856 virtual ~ISelectLayer() noexcept = 0;
4857 apiv::VSelectLayer* mImpl;
4858};
4859
4860inline ISelectLayer::~ISelectLayer() noexcept = default;
4861
4878{
4879public:
4888 void setMessage(char const* message) noexcept
4889 {
4890 mImpl->setMessage(message);
4891 }
4892
4898 char const* getMessage() const noexcept
4899 {
4900 return mImpl->getMessage();
4901 }
4902
4903protected:
4904 virtual ~IAssertionLayer() noexcept = 0;
4905
4906 apiv::VAssertionLayer* mImpl;
4907};
4908
4909inline IAssertionLayer::~IAssertionLayer() noexcept = default;
4910
4918enum class FillOperation : int32_t
4919{
4936 kLINSPACE = 0,
4937
4940 kRANDOM_UNIFORM = 1,
4941
4944 kRANDOM_NORMAL = 2
4945};
4946
4952template <>
4954{
4955 static constexpr int32_t kVALUE = 3;
4956};
4957
4993class IFillLayer : public ILayer
4994{
4995public:
5004 //
5005 void setDimensions(Dims const& dimensions) noexcept
5006 {
5007 mImpl->setDimensions(dimensions);
5008 }
5009
5020 Dims getDimensions() const noexcept
5021 {
5022 return mImpl->getDimensions();
5023 }
5024
5030 void setOperation(FillOperation op) noexcept
5031 {
5032 mImpl->setOperation(op);
5033 }
5034
5041 {
5042 return mImpl->getOperation();
5043 }
5044
5058 //
5059 void setAlpha(double alpha) noexcept
5060 {
5061 mImpl->setAlpha(alpha);
5062 }
5063
5074 double getAlpha() const noexcept
5075 {
5076 return mImpl->getAlpha();
5077 }
5078
5093 void setBeta(double beta) noexcept
5094 {
5095 mImpl->setBeta(beta);
5096 }
5097
5108 double getBeta() const noexcept
5109 {
5110 return mImpl->getBeta();
5111 }
5112
5153 using ILayer::setInput;
5154
5168 //
5169 void setAlphaInt64(int64_t alpha) noexcept
5170 {
5171 mImpl->setAlphaInt64(alpha);
5172 }
5173
5184 int64_t getAlphaInt64() const noexcept
5185 {
5186 return mImpl->getAlphaInt64();
5187 }
5188
5203 void setBetaInt64(int64_t beta) noexcept
5204 {
5205 mImpl->setBetaInt64(beta);
5206 }
5207
5218 int64_t getBetaInt64() const noexcept
5219 {
5220 return mImpl->getBetaInt64();
5221 }
5222
5226 bool isAlphaBetaInt64() const noexcept
5227 {
5228 return mImpl->isAlphaBetaInt64();
5229 }
5230
5244 void setToType(DataType toType) noexcept
5245 {
5246 mImpl->setToType(toType);
5247 }
5248
5256 DataType getToType() const noexcept
5257 {
5258 return mImpl->getToType();
5259 }
5260
5261protected:
5262 virtual ~IFillLayer() noexcept = 0;
5263 apiv::VFillLayer* mImpl;
5264};
5265
5266inline IFillLayer::~IFillLayer() noexcept = default;
5267
5343{
5344public:
5353 int32_t getAxis() const noexcept
5354 {
5355 return mImpl->getAxis();
5356 }
5364 void setAxis(int32_t axis) noexcept
5365 {
5366 mImpl->setAxis(axis);
5367 }
5368
5377 bool setBlockShape(Dims const& blockShape) noexcept
5378 {
5379 return mImpl->setBlockShape(blockShape);
5380 }
5381
5389 {
5390 return mImpl->getBlockShape();
5391 }
5392
5404 void setToType(DataType toType) noexcept
5405 {
5406 mImpl->setToType(toType);
5407 }
5408
5416 DataType getToType() const noexcept
5417 {
5418 return mImpl->getToType();
5419 }
5420
5421protected:
5422 virtual ~IQuantizeLayer() noexcept = 0;
5423 apiv::VQuantizeLayer* mImpl;
5424};
5425
5426inline IQuantizeLayer::~IQuantizeLayer() noexcept = default;
5427
5497{
5498public:
5507 int32_t getAxis() const noexcept
5508 {
5509 return mImpl->getAxis();
5510 }
5518 void setAxis(int32_t axis) noexcept
5519 {
5520 mImpl->setAxis(axis);
5521 }
5522
5535 bool setBlockShape(Dims const& blockShape) noexcept
5536 {
5537 return mImpl->setBlockShape(blockShape);
5538 }
5539
5547 {
5548 return mImpl->getBlockShape();
5549 }
5550
5562 void setToType(DataType toType) noexcept
5563 {
5564 mImpl->setToType(toType);
5565 }
5566
5574 DataType getToType() const noexcept
5575 {
5576 return mImpl->getToType();
5577 }
5578
5579protected:
5580 virtual ~IDequantizeLayer() noexcept = 0;
5581 apiv::VDequantizeLayer* mImpl;
5582};
5583
5584inline IDequantizeLayer::~IDequantizeLayer() noexcept = default;
5585
5604{
5605public:
5617 using ILayer::setInput;
5618
5631 void setToType(DataType toType) noexcept
5632 {
5633 mImpl->setToType(toType);
5634 }
5635
5644 DataType getToType() const noexcept
5645 {
5646 return mImpl->getToType();
5647 }
5648
5657 void setScaleType(DataType scaleType) noexcept
5658 {
5659 mImpl->setScaleType(scaleType);
5660 }
5661
5670 DataType getScaleType() const noexcept
5671 {
5672 return mImpl->getScaleType();
5673 }
5674
5683 TRT_DEPRECATED void setAxis(int32_t axis) noexcept
5684 {
5685 mImpl->setAxis(axis);
5686 }
5687
5693 TRT_DEPRECATED int32_t getAxis() const noexcept
5694 {
5695 return mImpl->getAxis();
5696 }
5697
5706 TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
5707 {
5708 mImpl->setBlockSize(size);
5709 }
5710
5716 TRT_DEPRECATED int32_t getBlockSize() const noexcept
5717 {
5718 return mImpl->getBlockSize();
5719 }
5720
5729 void setBlockShape(Dims const& blockShape) noexcept
5730 {
5731 mImpl->setBlockShape(blockShape);
5732 }
5733
5741 Dims getBlockShape() const noexcept
5742 {
5743 return mImpl->getBlockShape();
5744 }
5745
5746protected:
5747 virtual ~IDynamicQuantizeLayer() noexcept = 0;
5748 apiv::VDynamicQuantizeLayer* mImpl;
5749};
5750
5751inline IDynamicQuantizeLayer::~IDynamicQuantizeLayer() noexcept = default;
5752
5787class IEinsumLayer : public ILayer
5788{
5789public:
5799 bool setEquation(char const* equation) noexcept
5800 {
5801 return mImpl->setEquation(equation);
5802 }
5803
5809 char const* getEquation() const noexcept
5810 {
5811 return mImpl->getEquation();
5812 }
5813
5814protected:
5815 virtual ~IEinsumLayer() noexcept = 0;
5816 apiv::VEinsumLayer* mImpl;
5817};
5818
5819inline IEinsumLayer::~IEinsumLayer() noexcept = default;
5820
5828enum class ScatterMode : int32_t
5829{
5830 kELEMENT = 0,
5831 kND = 1,
5832};
5833
5839template <>
5841{
5842 static constexpr int32_t kVALUE = 2;
5843};
5844
5902class IScatterLayer : public ILayer
5903{
5904public:
5910 void setMode(ScatterMode mode) noexcept
5911 {
5912 mImpl->setMode(mode);
5913 }
5914
5920 ScatterMode getMode() const noexcept
5921 {
5922 return mImpl->getMode();
5923 }
5924
5930 void setAxis(int32_t axis) noexcept
5931 {
5932 mImpl->setAxis(axis);
5933 }
5934
5938 int32_t getAxis() const noexcept
5939 {
5940 return mImpl->getAxis();
5941 }
5942
5943protected:
5944 apiv::VScatterLayer* mImpl;
5945 virtual ~IScatterLayer() noexcept = 0;
5946}; // class IScatterLayer
5947
5948inline IScatterLayer::~IScatterLayer() noexcept = default;
5949
5977class IOneHotLayer : public ILayer
5978{
5979public:
5985 void setAxis(int32_t axis) noexcept
5986 {
5987 mImpl->setAxis(axis);
5988 }
5989
5993 int32_t getAxis() const noexcept
5994 {
5995 return mImpl->getAxis();
5996 }
5997
5998protected:
5999 apiv::VOneHotLayer* mImpl;
6000 virtual ~IOneHotLayer() noexcept = 0;
6001};
6002
6003inline IOneHotLayer::~IOneHotLayer() noexcept = default;
6004
6017{
6018public:
6025 {
6026 mImpl->setInterpolationMode(mode);
6027 }
6028
6037 {
6038 return mImpl->getInterpolationMode();
6039 }
6040
6046 void setAlignCorners(bool alignCorners) noexcept
6047 {
6048 mImpl->setAlignCorners(alignCorners);
6049 }
6050
6058 bool getAlignCorners() const noexcept
6059 {
6060 return mImpl->getAlignCorners();
6061 }
6062
6070 bool setSampleMode(SampleMode mode) noexcept
6071 {
6072 return mImpl->setSampleMode(mode);
6073 }
6074
6082 SampleMode getSampleMode() const noexcept
6083 {
6084 return mImpl->getSampleMode();
6085 }
6086
6087protected:
6088 apiv::VGridSampleLayer* mImpl;
6089 virtual ~IGridSampleLayer() noexcept = 0;
6090}; // class IGridSampleLayer
6091
6092inline IGridSampleLayer::~IGridSampleLayer() noexcept = default;
6093
6101enum class BoundingBoxFormat : int32_t
6102{
6104 kCORNER_PAIRS = 0,
6106 kCENTER_SIZES = 1
6107};
6108
6114template <>
6116{
6117 static constexpr int32_t kVALUE = 2;
6118};
6119
6170class INMSLayer : public ILayer
6171{
6172public:
6183 {
6184 mImpl->setBoundingBoxFormat(fmt);
6185 }
6186
6195 {
6196 return mImpl->getBoundingBoxFormat();
6197 }
6198
6208 void setTopKBoxLimit(int32_t limit) noexcept
6209 {
6210 mImpl->setTopKBoxLimit(limit);
6211 }
6212
6218 int32_t getTopKBoxLimit() const noexcept
6219 {
6220 return mImpl->getTopKBoxLimit();
6221 }
6222
6241 using ILayer::setInput;
6242
6253 bool setIndicesType(DataType type) noexcept
6254 {
6255 return mImpl->setIndicesType(type);
6256 }
6257
6265 DataType getIndicesType() const noexcept
6266 {
6267 return mImpl->getIndicesType();
6268 }
6269
6270protected:
6271 apiv::VNMSLayer* mImpl;
6272 virtual ~INMSLayer() noexcept = 0;
6273}; // class INMSLayer
6274
6275inline INMSLayer::~INMSLayer() noexcept = default;
6276
6290{
6291public:
6300 void setBatchAxis(int32_t batchAxis) noexcept
6301 {
6302 mImpl->setBatchAxis(batchAxis);
6303 }
6304
6310 int32_t getBatchAxis() const noexcept
6311 {
6312 return mImpl->getBatchAxis();
6313 }
6314
6323 void setSequenceAxis(int32_t sequenceAxis) noexcept
6324 {
6325 mImpl->setSequenceAxis(sequenceAxis);
6326 }
6327
6333 int32_t getSequenceAxis() const noexcept
6334 {
6335 return mImpl->getSequenceAxis();
6336 }
6337
6338protected:
6339 apiv::VReverseSequenceLayer* mImpl;
6340 virtual ~IReverseSequenceLayer() noexcept = 0;
6341}; // class IReverseSequenceLayer
6342
6343inline IReverseSequenceLayer::~IReverseSequenceLayer() noexcept = default;
6344
6364{
6365public:
6373 void setEpsilon(float eps) noexcept
6374 {
6375 return mImpl->setEpsilon(eps);
6376 }
6377
6383 float getEpsilon() const noexcept
6384 {
6385 return mImpl->getEpsilon();
6386 }
6387
6393 void setAxes(uint32_t axesMask) noexcept
6394 {
6395 return mImpl->setAxes(axesMask);
6396 }
6397
6403 uint32_t getAxes() const noexcept
6404 {
6405 return mImpl->getAxes();
6406 }
6407
6424 void setNbGroups(int64_t nbGroups) noexcept
6425 {
6426 return mImpl->setNbGroups(nbGroups);
6427 }
6428
6434 int64_t getNbGroups() const noexcept
6435 {
6436 return mImpl->getNbGroups();
6437 }
6438
6439
6445 TRT_NODISCARD bool isV2() const noexcept
6446 {
6447 return mImpl->isV2();
6448 }
6449
6450protected:
6451 apiv::VNormalizationLayer* mImpl;
6452 virtual ~INormalizationLayer() noexcept = 0;
6453};
6454
6455inline INormalizationLayer::~INormalizationLayer() noexcept = default;
6456
6457
6469class ISqueezeLayer : public ILayer
6470{
6471public:
6487 using ILayer::setInput;
6488
6489protected:
6490 apiv::VSqueezeLayer* mImpl;
6491 virtual ~ISqueezeLayer() noexcept = 0;
6492};
6493
6494inline ISqueezeLayer::~ISqueezeLayer() noexcept = default;
6495
6505{
6506public:
6520 using ILayer::setInput;
6521
6522protected:
6523 apiv::VUnsqueezeLayer* mImpl;
6524 virtual ~IUnsqueezeLayer() noexcept = 0;
6525};
6526
6527inline IUnsqueezeLayer::~IUnsqueezeLayer() noexcept = default;
6528
6540enum class CumulativeOperation : int32_t
6541{
6542 kSUM = 0,
6543};
6544
6550template <>
6552{
6553 static constexpr int32_t kVALUE = 1;
6554};
6555
6584{
6585public:
6596 {
6597 return mImpl->setOperation(op);
6598 }
6599
6608 {
6609 return mImpl->getOperation();
6610 }
6611
6619 void setExclusive(bool exclusive) noexcept
6620 {
6621 mImpl->setExclusive(exclusive);
6622 }
6623
6631 bool getExclusive() const noexcept
6632 {
6633 return mImpl->getExclusive();
6634 }
6635
6643 void setReverse(bool reverse) noexcept
6644 {
6645 mImpl->setReverse(reverse);
6646 }
6647
6655 bool getReverse() const noexcept
6656 {
6657 return mImpl->getReverse();
6658 }
6659
6660protected:
6661 apiv::VCumulativeLayer* mImpl;
6662 virtual ~ICumulativeLayer() noexcept = 0;
6663};
6664
6665inline ICumulativeLayer::~ICumulativeLayer() noexcept = default;
6666
6672enum class AttentionNormalizationOp : int32_t
6673{
6674 kNONE
6675 = 0,
6676 kSOFTMAX = 1,
6677};
6678
6684template <>
6686{
6687 static constexpr int32_t kVALUE = 2;
6688};
6689
6704enum class CausalMaskKind : int32_t
6705{
6707 kNONE = 0,
6708
6710 kUPPER_LEFT = 1,
6711
6713 kLOWER_RIGHT = 2,
6714};
6715
6721template <>
6723{
6724 static constexpr int32_t kVALUE = 3;
6725};
6726
6732enum class AttentionIOForm : int32_t
6733{
6736 kPADDED_BHND = 0,
6739 kPACKED_NHD = 1,
6740};
6741
6747template <>
6749{
6750 static constexpr int32_t kVALUE = 2;
6751};
6752
6763{
6764public:
6768 IAttention* getAttention() const noexcept
6769 {
6770 return mBoundary->getAttention();
6771 }
6772
6773protected:
6774 virtual ~IAttentionBoundaryLayer() noexcept = 0;
6775 apiv::VAttentionBoundaryLayer* mBoundary;
6776};
6777
6778inline IAttentionBoundaryLayer::~IAttentionBoundaryLayer() noexcept = default;
6779
6791{
6792public:
6810 using ILayer::setInput;
6811
6812protected:
6813 virtual ~IAttentionInputLayer() noexcept = 0;
6814 apiv::VAttentionInputLayer* mImpl;
6815};
6816
6817inline IAttentionInputLayer::~IAttentionInputLayer() noexcept = default;
6818
6830{
6831public:
6832protected:
6833 virtual ~IAttentionOutputLayer() noexcept = 0;
6834 apiv::VAttentionOutputLayer* mImpl;
6835};
6836
6837inline IAttentionOutputLayer::~IAttentionOutputLayer() noexcept = default;
6838
6899class IAttention : public INoCopy
6900{
6901public:
6910 {
6911 return mImpl->setNormalizationOperation(op);
6912 }
6913
6922 {
6923 return mImpl->getNormalizationOperation();
6924 }
6925
6938 bool setMask(ITensor& mask) noexcept
6939 {
6940 return mImpl->setMask(mask);
6941 }
6942
6950 ITensor* getMask() noexcept
6951 {
6952 return mImpl->getMask();
6953 }
6954
6968 TRT_DEPRECATED bool setCausal(bool isCausal) noexcept
6969 {
6970 return mImpl->setCausal(isCausal);
6971 }
6972
6982 TRT_DEPRECATED bool getCausal() const noexcept
6983 {
6984 return mImpl->getCausal();
6985 }
6986
7002 bool setCausalKind(CausalMaskKind kind) noexcept
7003 {
7004 return mImpl->setCausalKind(kind);
7005 }
7006
7015 {
7016 return mImpl->getCausalKind();
7017 }
7018
7026 bool setDecomposable(bool decomposable) noexcept
7027 {
7028 return mImpl->setDecomposable(decomposable);
7029 }
7030
7039 bool getDecomposable() const noexcept
7040 {
7041 return mImpl->getDecomposable();
7042 }
7043
7058 bool setInput(int32_t index, ITensor& input) noexcept
7059 {
7060 return mImpl->setInput(index, input);
7061 }
7062
7067 int32_t getNbInputs() const noexcept
7068 {
7069 return mImpl->getNbInputs();
7070 }
7071
7079 ITensor* getInput(int32_t index) const noexcept
7080 {
7081 return mImpl->getInput(index);
7082 }
7083
7087 int32_t getNbOutputs() const noexcept
7088 {
7089 return mImpl->getNbOutputs();
7090 }
7091
7099 ITensor* getOutput(int32_t index) const noexcept
7100 {
7101 return mImpl->getOutput(index);
7102 }
7103
7116 bool setName(char const* name) noexcept
7117 {
7118 return mImpl->setName(name);
7119 }
7120
7128 char const* getName() const noexcept
7129 {
7130 return mImpl->getName();
7131 }
7132
7145 {
7146 return mImpl->setNormalizationQuantizeScale(tensor);
7147 }
7148
7156 {
7157 return mImpl->getNormalizationQuantizeScale();
7158 }
7159
7169 {
7170 return mImpl->setNormalizationQuantizeToType(type);
7171 }
7172
7181 {
7182 return mImpl->getNormalizationQuantizeToType();
7183 }
7184
7200 bool setMetadata(char const* metadata) noexcept
7201 {
7202 return mImpl->setMetadata(metadata);
7203 }
7204
7213 char const* getMetadata() const noexcept
7214 {
7215 return mImpl->getMetadata();
7216 }
7217
7229 bool setNbRanks(int32_t nbRanks) noexcept
7230 {
7231 return mImpl->setNbRanks(nbRanks);
7232 }
7233
7241 int32_t getNbRanks() const noexcept
7242 {
7243 return mImpl->getNbRanks();
7244 }
7245
7259 {
7260 return mImpl->setQueryForm(form);
7261 }
7262
7272 {
7273 return mImpl->getQueryForm();
7274 }
7275
7289 {
7290 return mImpl->setKeyValueForm(form);
7291 }
7292
7302 {
7303 return mImpl->getKeyValueForm();
7304 }
7305
7325 TRT_NODISCARD bool setQueryLengths(ITensor* lengths) noexcept
7326 {
7327 return mImpl->setQueryLengths(lengths);
7328 }
7329
7338 {
7339 return mImpl->getQueryLengths();
7340 }
7341
7365 {
7366 return mImpl->setKeyValueLengths(lengths);
7367 }
7368
7377 {
7378 return mImpl->getKeyValueLengths();
7379 }
7380
7381protected:
7382 apiv::VAttention* mImpl;
7383 virtual ~IAttention() noexcept = 0;
7384};
7385
7386inline IAttention::~IAttention() noexcept = default;
7387
7395{
7396public:
7402 void setInterleaved(bool interleaved) noexcept
7403 {
7404 mImpl->setInterleaved(interleaved);
7405 }
7406
7407
7413 TRT_NODISCARD bool getInterleaved() const noexcept
7414 {
7415 return mImpl->getInterleaved();
7416 }
7417
7418
7424 TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
7425 {
7426 return mImpl->setRotaryEmbeddingDim(rotaryEmbeddingDim);
7427 }
7428
7429
7435 TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
7436 {
7437 return mImpl->getRotaryEmbeddingDim();
7438 }
7439
7440
7454 using ILayer::setInput;
7455
7456protected:
7457 apiv::VRotaryEmbeddingLayer* mImpl;
7458 virtual ~IRotaryEmbeddingLayer() noexcept = 0;
7459};
7460
7461inline IRotaryEmbeddingLayer::~IRotaryEmbeddingLayer() noexcept = default;
7462
7468enum class KVCacheMode : int32_t
7469{
7470 kLINEAR = 0,
7471};
7472
7478template <>
7480{
7481 static constexpr int32_t kVALUE = 1;
7482};
7483
7504{
7505public:
7520 using ILayer::setInput;
7521
7529 bool setCacheMode(KVCacheMode cacheMode) noexcept
7530 {
7531 return mImpl->setCacheMode(cacheMode);
7532 }
7533
7539 KVCacheMode getCacheMode() const noexcept
7540 {
7541 return mImpl->getCacheMode();
7542 }
7543
7558 {
7559 return mImpl->setUpdateForm(form);
7560 }
7561
7571 {
7572 return mImpl->getUpdateForm();
7573 }
7574
7593 {
7594 return mImpl->setUpdateLengths(lengths);
7595 }
7596
7605 {
7606 return mImpl->getUpdateLengths();
7607 }
7608
7609protected:
7610 apiv::VKVCacheUpdateLayer* mImpl;
7611 virtual ~IKVCacheUpdateLayer() noexcept = 0;
7612};
7613
7614inline IKVCacheUpdateLayer::~IKVCacheUpdateLayer() noexcept = default;
7615
7621enum class MoEActType : int32_t
7622{
7623 kNONE = 0,
7624 kSILU = 1,
7625};
7626
7632template <>
7634{
7635 static constexpr int32_t kVALUE = 2;
7636};
7637
7638
7754class IMoELayer : public ILayer
7755{
7756public:
7768 void setGatedWeights(ITensor& fcGateWeights, ITensor& fcUpWeights, ITensor& fcDownWeights, MoEActType activationType) noexcept
7769 {
7770 mImpl->setGatedWeights(fcGateWeights, fcUpWeights, fcDownWeights, activationType);
7771 }
7772
7780 void setGatedBiases(ITensor& fcGateBiases, ITensor& fcUpBiases, ITensor& fcDownBiases) noexcept
7781 {
7782 mImpl->setGatedBiases(fcGateBiases, fcUpBiases, fcDownBiases);
7783 }
7784
7792 void setActivationType(MoEActType activationType) noexcept
7793 {
7794 mImpl->setActivationType(activationType);
7795 }
7796
7805 {
7806 return mImpl->getActivationType();
7807 }
7808
7830 void setQuantizationStatic(ITensor& fcDownActivationScale, DataType dataType) noexcept
7831 {
7832 mImpl->setQuantizationStatic(fcDownActivationScale, dataType);
7833 }
7834
7863 void setQuantizationDynamicDblQ(ITensor& fcDownActivationDblQScale, DataType dataType, Dims const& blockShape, DataType dynQOutputScaleType) noexcept
7864 {
7865 mImpl->setQuantizationDynamicDblQ(fcDownActivationDblQScale, dataType, blockShape, dynQOutputScaleType);
7866 }
7867
7879 {
7880 mImpl->setQuantizationToType(type);
7881 }
7882
7891 {
7892 return mImpl->getQuantizationToType();
7893 }
7894
7906 void setQuantizationBlockShape(Dims const& blockShape) noexcept
7907 {
7908 mImpl->setQuantizationBlockShape(blockShape);
7909 }
7910
7919 {
7920 return mImpl->getQuantizationBlockShape();
7921 }
7922
7931 {
7932 mImpl->setDynQOutputScaleType(type);
7933 }
7934
7943 {
7944 return mImpl->getDynQOutputScaleType();
7945 }
7946
7963 void setSwigluParams(float limit, float alpha, float beta) noexcept
7964 {
7965 mImpl->setSwigluParams(limit, alpha, beta);
7966 }
7967
7977 void setSwigluParamLimit(float limit) noexcept
7978 {
7979 mImpl->setSwigluParamLimit(limit);
7980 }
7981
7989 float getSwigluParamLimit() const noexcept
7990 {
7991 return mImpl->getSwigluParamLimit();
7992 }
7993
8003 void setSwigluParamAlpha(float alpha) noexcept
8004 {
8005 mImpl->setSwigluParamAlpha(alpha);
8006 }
8007
8015 float getSwigluParamAlpha() const noexcept
8016 {
8017 return mImpl->getSwigluParamAlpha();
8018 }
8019
8029 void setSwigluParamBeta(float beta) noexcept
8030 {
8031 mImpl->setSwigluParamBeta(beta);
8032 }
8033
8041 float getSwigluParamBeta() const noexcept
8042 {
8043 return mImpl->getSwigluParamBeta();
8044 }
8045
8058 void setInput(int32_t index, ITensor& tensor) noexcept
8059 {
8060 mImpl->setInput(index, tensor);
8061 }
8062
8063 using ILayer::setInput;
8064
8065protected:
8066 virtual ~IMoELayer() noexcept = 0;
8067 apiv::VMoELayer* mImpl;
8068};
8069
8070inline IMoELayer::~IMoELayer() noexcept = default;
8071
8080{
8081protected:
8082 virtual ~IDistCollectiveLayer() noexcept = 0;
8083 apiv::VDistCollectiveLayer* mImpl;
8084}; // class IDistCollectiveLayer
8085
8086inline IDistCollectiveLayer::~IDistCollectiveLayer() noexcept = default;
8087
8106{
8107public:
8108 virtual ~INetworkDefinition() noexcept = 0;
8109
8145 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
8146 {
8147 return mImpl->addInput(name, type, dimensions);
8148 }
8149
8159 void markOutput(ITensor& tensor) noexcept
8160 {
8161 mImpl->markOutput(tensor);
8162 }
8163
8177 bool markDebug(ITensor& tensor) noexcept
8178 {
8179 return mImpl->markDebug(tensor);
8180 }
8181
8193 bool unmarkDebug(ITensor& tensor) noexcept
8194 {
8195 return mImpl->unmarkDebug(tensor);
8196 }
8197
8203 bool isDebugTensor(ITensor const& tensor) const noexcept
8204 {
8205 return mImpl->isDebugTensor(tensor);
8206 }
8207
8226 {
8227 return mImpl->markUnfusedTensorsAsDebugTensors();
8228 }
8229
8240 {
8241 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
8242 }
8243
8260 {
8261 return mImpl->addActivation(input, type);
8262 }
8263
8278 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
8279 {
8280 return mImpl->addLRN(input, window, alpha, beta, k);
8281 }
8282
8304 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
8305 {
8306 return mImpl->addScale(input, mode, shift, scale, power);
8307 }
8308
8318 {
8319 return mImpl->addSoftMax(input);
8320 }
8321
8334 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
8335 {
8336 return mImpl->addConcatenation(inputs, nbInputs);
8337 }
8338
8362 {
8363 return mImpl->addElementWise(input1, input2, op);
8364 }
8365
8383 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
8384 {
8385 return mImpl->addUnary(input, operation);
8386 }
8387
8398 {
8399 return mImpl->addShuffle(input);
8400 }
8401
8414 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
8415 {
8416 return mImpl->addOneHot(indices, values, depth, axis);
8417 }
8418
8426 int32_t getNbLayers() const noexcept
8427 {
8428 return mImpl->getNbLayers();
8429 }
8430
8440 ILayer* getLayer(int32_t index) const noexcept
8441 {
8442 return mImpl->getLayer(index);
8443 }
8444
8452 int32_t getNbInputs() const noexcept
8453 {
8454 return mImpl->getNbInputs();
8455 }
8456
8468 ITensor* getInput(int32_t index) const noexcept
8469 {
8470 return mImpl->getInput(index);
8471 }
8472
8482 int32_t getNbOutputs() const noexcept
8483 {
8484 return mImpl->getNbOutputs();
8485 }
8486
8498 ITensor* getOutput(int32_t index) const noexcept
8499 {
8500 return mImpl->getOutput(index);
8501 }
8502
8525 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
8526 {
8527 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
8528 }
8529
8560 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
8561 {
8562 return mImpl->addTopK(input, op, k, reduceAxes);
8563 }
8564
8593 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
8594 {
8595 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
8596 }
8597
8609 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
8610 {
8611 return mImpl->addGather(data, indices, axis);
8612 }
8613
8625 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
8626 {
8627 return mImpl->addGatherV2(data, indices, mode);
8628 }
8629
8645 {
8646 return mImpl->addRaggedSoftMax(input, bounds);
8647 }
8648
8666 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
8667 {
8668 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
8669 }
8670
8685 {
8686 return mImpl->addNonZero(input);
8687 }
8688
8700 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
8701 {
8702 return mImpl->addNonZeroV2(input, indicesType);
8703 }
8704
8724 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
8725 {
8726 return mImpl->addConstant(dimensions, weights);
8727 }
8728
8739 {
8740 return mImpl->addIdentity(input);
8741 }
8742
8753 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
8754 {
8755 return mImpl->addCast(input, toType);
8756 }
8757
8768 void removeTensor(ITensor& tensor) noexcept
8769 {
8770 mImpl->removeTensor(tensor);
8771 }
8772
8780 void unmarkOutput(ITensor& tensor) noexcept
8781 {
8782 mImpl->unmarkOutput(tensor);
8783 }
8784
8799 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
8800 {
8801 return mImpl->addSlice(input, start, size, stride);
8802 }
8803
8823 void setName(char const* name) noexcept
8824 {
8825 mImpl->setName(name);
8826 }
8827
8837 char const* getName() const noexcept
8838 {
8839 return mImpl->getName();
8840 }
8841
8853 IShapeLayer* addShape(ITensor& input) noexcept
8854 {
8855 return mImpl->addShape(input);
8856 }
8857
8864 {
8865 return mImpl->getFlags();
8866 }
8867
8875 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8876 {
8877 return mImpl->getFlag(networkDefinitionCreationFlag);
8878 }
8879
8892 bool markOutputForShapes(ITensor& tensor) noexcept
8893 {
8894 return mImpl->markOutputForShapes(tensor);
8895 }
8896
8904 bool unmarkOutputForShapes(ITensor& tensor) noexcept
8905 {
8906 return mImpl->unmarkOutputForShapes(tensor);
8907 }
8908
8923 {
8924 return mImpl->addParametricReLU(input, slope);
8925 }
8926
8945 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8946 {
8947 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8948 }
8949
8964 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
8965 {
8966 return mImpl->addPoolingNd(input, type, windowSize);
8967 }
8968
8983 //
8987 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8988 {
8989 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8990 }
8991
9024 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
9025 {
9026 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
9027 }
9028
9041 {
9042 return mImpl->addResize(input);
9043 }
9044
9054 ILoop* addLoop() noexcept
9055 {
9056 return mImpl->addLoop();
9057 }
9058
9070 {
9071 return mImpl->addIfConditional();
9072 }
9073
9108 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
9109 {
9110 return mImpl->addSelect(condition, thenInput, elseInput);
9111 }
9112
9125 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
9126 {
9127 return mImpl->addAssertion(condition, message);
9128 }
9129
9151 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
9152 {
9153 return mImpl->addFillV2(dimensions, op, outputType);
9154 }
9155
9167 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
9168 {
9169 return mImpl->addPaddingNd(input, prePadding, postPadding);
9170 }
9171
9191 bool setWeightsName(Weights weights, char const* name) noexcept
9192 {
9193 return mImpl->setWeightsName(weights, name);
9194 }
9195
9207 //
9210 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9211 {
9212 mImpl->setErrorRecorder(recorder);
9213 }
9214
9226 {
9227 return mImpl->getErrorRecorder();
9228 }
9229
9248 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9249 {
9250 return mImpl->addDequantizeV2(input, scale, outputType);
9251 }
9252
9268 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
9269 {
9270 return mImpl->addScatter(data, indices, updates, mode);
9271 }
9272
9292 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9293 {
9294 return mImpl->addQuantizeV2(input, scale, outputType);
9295 }
9296
9320 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
9321 {
9322 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
9323 }
9324
9344 ITensor& input, Dims const& blockShape, DataType outputType, DataType scaleType) noexcept
9345 {
9346 return mImpl->addDynamicQuantizeV2(input, blockShape, outputType, scaleType);
9347 }
9348
9359 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
9360 {
9361 return mImpl->addEinsum(inputs, nbInputs, equation);
9362 }
9363
9378 {
9379 return mImpl->addGridSample(input, grid);
9380 }
9381
9399 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
9400 {
9401 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
9402 }
9403
9419 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
9420 {
9421 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
9422 }
9423
9437 {
9438 return mImpl->addReverseSequence(input, sequenceLens);
9439 }
9440
9468 TRT_DEPRECATED INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9469 {
9470 return mImpl->addNormalization(input, scale, bias, axesMask);
9471 }
9472
9490 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
9491 {
9492 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
9493 }
9494
9521 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
9522 {
9523 return mImpl->addAttention(query, key, value, normOp, causal);
9524 }
9525
9552 CausalMaskKind causalKind) noexcept
9553 {
9554 return mImpl->addAttentionV2(query, key, value, normOp, causalKind);
9555 }
9556
9576 IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
9577 {
9578 return mImpl->addRotaryEmbedding(input, cosCache, sinCache, interleaved, rotaryEmbeddingDim);
9579 }
9580
9611 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept
9612 {
9613 return mImpl->addKVCacheUpdate(cache, update, writeIndices, cacheMode);
9614 }
9615
9632 IMoELayer* addMoE(ITensor& hiddenStates, ITensor& selectedExpertsForTokens, ITensor& scoresForSelectedExperts) noexcept
9633 {
9634 return mImpl->addMoE(hiddenStates, selectedExpertsForTokens, scoresForSelectedExperts);
9635 }
9636
9665 ReduceOperation reduceOp, int64_t root, int64_t* groups, int64_t groupSize) noexcept
9666 {
9667 return mImpl->addDistCollective(input, distCollectiveOp, reduceOp, root, groups, groupSize);
9668 }
9669
9676 virtual IBuilder& getBuilder() const noexcept
9677 {
9678 return mImpl->getBuilder();
9679 }
9680
9691 bool markWeightsRefittable(char const* name) noexcept
9692 {
9693 return mImpl->markWeightsRefittable(name);
9694 }
9695
9704 bool unmarkWeightsRefittable(char const* name) noexcept
9705 {
9706 return mImpl->unmarkWeightsRefittable(name);
9707 }
9708
9717 bool areWeightsMarkedRefittable(char const* name) const noexcept
9718 {
9719 return mImpl->areWeightsMarkedRefittable(name);
9720 }
9721
9736 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
9737 {
9738 return mImpl->addSqueeze(input, axes);
9739 }
9740
9765 ISqueezeLayer* addSqueeze(ITensor& input, ITensor* axes) noexcept
9766 {
9767 return mImpl->addSqueezeV2(input, axes);
9768 }
9769
9787 {
9788 return mImpl->addUnsqueeze(input, axes);
9789 }
9790
9812 TRT_NODISCARD INormalizationLayer* addNormalizationV2(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9813 {
9814 return mImpl->addNormalizationV2(input, scale, bias, axesMask);
9815 }
9816
9817protected:
9818 apiv::VNetworkDefinition* mImpl;
9819};
9820
9821inline INetworkDefinition::~INetworkDefinition() noexcept = default;
9822
9840enum class RuntimePlatform : int32_t
9841{
9844 kSAME_AS_BUILD = 0,
9845
9848 kWINDOWS_AMD64 = 1,
9849
9850
9851};
9852
9858template <>
9860{
9861 static constexpr int32_t kVALUE = 2;
9862};
9863
9864
9871using BuilderFlags = uint32_t;
9872
9880enum class BuilderFlag : int32_t
9881{
9882
9884 kDEBUG = 2,
9885
9887 kGPU_FALLBACK = 3,
9888
9890 kREFIT = 4,
9891
9894
9898 kTF32 = 6,
9899
9901 kSPARSE_WEIGHTS = 7,
9902
9915
9916
9922
9929
9935
9936
9940
9941
9947
9953 kSTRIP_PLAN = 18,
9954
9961 kREFIT_IDENTICAL = 19,
9962
9988 kWEIGHT_STREAMING = 20,
9989
9990
9996 kREFIT_INDIVIDUAL = 22,
9997
10006 kSTRICT_NANS = 23,
10007
10009 kMONITOR_MEMORY = 24,
10010
10011
10014
10026
10034
10035
10036};
10037
10043template <>
10045{
10046 static constexpr int32_t kVALUE = 29;
10047};
10048
10049namespace v_1_0
10050{
10066{
10067 uint8_t data[16];
10068};
10069
10080{
10082 uint64_t tacticHash;
10086 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
10087};
10088} // namespace v_1_0
10089
10106{
10107public:
10108 virtual ~ITimingCache() noexcept = 0;
10109
10119 nvinfer1::IHostMemory* serialize() const noexcept
10120 {
10121 return mImpl->serialize();
10122 }
10123
10143 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
10144 {
10145 return mImpl->combine(inputCache, ignoreMismatch);
10146 }
10147
10153 bool reset() noexcept
10154 {
10155 return mImpl->reset();
10156 }
10157
10172 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
10173 {
10174 return mImpl->queryKeys(keyBuffer, capacity);
10175 }
10176
10189 TimingCacheValue query(TimingCacheKey const& key) const noexcept
10190 {
10191 return mImpl->query(key);
10192 }
10193
10211 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
10212 {
10213 return mImpl->update(key, value);
10214 }
10215
10216protected:
10217 apiv::VTimingCache* mImpl;
10218};
10219
10220inline ITimingCache::~ITimingCache() noexcept = default;
10221
10229enum class MemoryPoolType : int32_t
10230{
10236 kWORKSPACE = 0,
10237
10246
10254 kDLA_LOCAL_DRAM = 2,
10255
10263 kDLA_GLOBAL_DRAM = 3,
10264
10272 kTACTIC_DRAM = 4,
10273
10287};
10288
10294template <>
10296{
10297 static constexpr int32_t kVALUE = 6;
10298};
10299
10308enum class PreviewFeature : int32_t
10309{
10314
10321};
10322
10328template <>
10330{
10331 static constexpr int32_t kVALUE = 2;
10332};
10333
10342enum class HardwareCompatibilityLevel : int32_t
10343{
10346 kNONE = 0,
10347
10359 kAMPERE_PLUS = 1,
10360
10373};
10374
10380template <>
10382{
10383 static constexpr int32_t kVALUE = 3;
10384};
10385
10391enum class ComputeCapability : int32_t
10392{
10394 kNONE = 0,
10396 kCURRENT = 1,
10398 kSM75 = 75,
10400 kSM80 = 80,
10402 kSM86 = 86,
10404 kSM89 = 89,
10406 kSM120 = 120,
10408 kSM121 = 121,
10409};
10410
10419enum class TilingOptimizationLevel : int32_t
10420{
10422 kNONE = 0,
10423
10425 kFAST = 1,
10426
10429 kMODERATE = 2,
10430
10432 kFULL = 3
10433
10434};
10435
10441template <>
10443{
10444 static constexpr int32_t kVALUE = 4;
10445};
10446
10447namespace v_1_0
10448{
10450{
10451public:
10452 IProgressMonitor() = default;
10453 virtual ~IProgressMonitor() noexcept = default;
10454
10458 InterfaceInfo getInterfaceInfo() const noexcept override
10459 {
10460 return InterfaceInfo{"IProgressMonitor", 1, 0};
10461 }
10462
10482 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10483
10496 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10497
10509 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10510
10511}; // class IProgressMonitor
10512} // namespace v_1_0
10513
10534
10543{
10544public:
10545 virtual ~IBuilderConfig() noexcept = 0;
10546
10555 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10556 {
10557 mImpl->setAvgTimingIterations(avgTiming);
10558 }
10559
10567 int32_t getAvgTimingIterations() const noexcept
10568 {
10569 return mImpl->getAvgTimingIterations();
10570 }
10571
10580 void setEngineCapability(EngineCapability capability) noexcept
10581 {
10582 mImpl->setEngineCapability(capability);
10583 }
10584
10593 {
10594 return mImpl->getEngineCapability();
10595 }
10596
10609 void setFlags(BuilderFlags builderFlags) noexcept
10610 {
10611 mImpl->setFlags(builderFlags);
10612 }
10613
10621 BuilderFlags getFlags() const noexcept
10622 {
10623 return mImpl->getFlags();
10624 }
10625
10633 void clearFlag(BuilderFlag builderFlag) noexcept
10634 {
10635 mImpl->clearFlag(builderFlag);
10636 }
10637
10645 void setFlag(BuilderFlag builderFlag) noexcept
10646 {
10647 mImpl->setFlag(builderFlag);
10648 }
10649
10657 bool getFlag(BuilderFlag builderFlag) const noexcept
10658 {
10659 return mImpl->getFlag(builderFlag);
10660 }
10661
10674 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10675 {
10676 mImpl->setDeviceType(layer, deviceType);
10677 }
10678
10684 DeviceType getDeviceType(ILayer const* layer) const noexcept
10685 {
10686 return mImpl->getDeviceType(layer);
10687 }
10688
10696 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10697 {
10698 return mImpl->isDeviceTypeSet(layer);
10699 }
10700
10706 void resetDeviceType(ILayer const* layer) noexcept
10707 {
10708 mImpl->resetDeviceType(layer);
10709 }
10710
10716 bool canRunOnDLA(ILayer const* layer) const noexcept
10717 {
10718 return mImpl->canRunOnDLA(layer);
10719 }
10720
10732 void setDLACore(int32_t dlaCore) noexcept
10733 {
10734 mImpl->setDLACore(dlaCore);
10735 }
10736
10742 int32_t getDLACore() const noexcept
10743 {
10744 return mImpl->getDLACore();
10745 }
10746
10753 void setDefaultDeviceType(DeviceType deviceType) noexcept
10754 {
10755 mImpl->setDefaultDeviceType(deviceType);
10756 }
10757
10764 {
10765 return mImpl->getDefaultDeviceType();
10766 }
10767
10773 void reset() noexcept
10774 {
10775 mImpl->reset();
10776 }
10777
10812 void setProfileStream(cudaStream_t const stream) noexcept
10813 {
10814 return mImpl->setProfileStream(stream);
10815 }
10816
10824 cudaStream_t getProfileStream() const noexcept
10825 {
10826 return mImpl->getProfileStream();
10827 }
10828
10841 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10842 {
10843 return mImpl->addOptimizationProfile(profile);
10844 }
10845
10854 int32_t getNbOptimizationProfiles() const noexcept
10855 {
10856 return mImpl->getNbOptimizationProfiles();
10857 }
10858
10867 {
10868 mImpl->setProfilingVerbosity(verbosity);
10869 }
10870
10880 {
10881 return mImpl->getProfilingVerbosity();
10882 }
10883
10901 bool setTacticSources(TacticSources tacticSources) noexcept
10902 {
10903 return mImpl->setTacticSources(tacticSources);
10904 }
10905
10917 {
10918 return mImpl->getTacticSources();
10919 }
10920
10938 TRT_DEPRECATED nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
10939 {
10940 return mImpl->createTimingCache(blob, size);
10941 }
10942
10963 TRT_DEPRECATED bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
10964 {
10965 return mImpl->setTimingCache(cache, ignoreMismatch);
10966 }
10967
10976 {
10977 return mImpl->getTimingCache();
10978 }
10979
11007 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
11008 {
11009 mImpl->setMemoryPoolLimit(pool, poolSize);
11010 }
11011
11026 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
11027 {
11028 return mImpl->getMemoryPoolLimit(pool);
11029 }
11030
11044 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
11045 {
11046 mImpl->setPreviewFeature(feature, enable);
11047 }
11048
11058 bool getPreviewFeature(PreviewFeature feature) const noexcept
11059 {
11060 return mImpl->getPreviewFeature(feature);
11061 }
11062
11091 void setBuilderOptimizationLevel(int32_t level) noexcept
11092 {
11093 mImpl->setBuilderOptimizationLevel(level);
11094 }
11095
11104 {
11105 return mImpl->getBuilderOptimizationLevel();
11106 }
11107
11120 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
11121 {
11122 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
11123 }
11124
11134 {
11135 return mImpl->getHardwareCompatibilityLevel();
11136 }
11137
11146 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
11147 {
11148 mImpl->setPluginsToSerialize(paths, nbPaths);
11149 }
11150
11159 char const* getPluginToSerialize(int32_t index) const noexcept
11160 {
11161 return mImpl->getPluginToSerialize(index);
11162 }
11163
11169 int32_t getNbPluginsToSerialize() const noexcept
11170 {
11171 return mImpl->getNbPluginsToSerialize();
11172 }
11173
11200 bool setMaxAuxStreams(int32_t nbStreams) noexcept
11201 {
11202 return mImpl->setMaxAuxStreams(nbStreams);
11203 }
11204
11210 int32_t getMaxAuxStreams() const noexcept
11211 {
11212 return mImpl->getMaxAuxStreams();
11213 }
11214
11226 void setProgressMonitor(IProgressMonitor* monitor) noexcept
11227 {
11228 return mImpl->setProgressMonitor(monitor);
11229 }
11230
11237 {
11238 return mImpl->getProgressMonitor();
11239 }
11240
11252 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
11253 {
11254 mImpl->setRuntimePlatform(runtimePlatform);
11255 }
11256
11265 {
11266 return mImpl->getRuntimePlatform();
11267 }
11268
11276 void setMaxNbTactics(int32_t maxNbTactics) noexcept
11277 {
11278 mImpl->setMaxNbTactics(maxNbTactics);
11279 }
11280
11288 int32_t getMaxNbTactics() const noexcept
11289 {
11290 return mImpl->getMaxNbTactics();
11291 }
11292
11305 {
11306 return mImpl->setTilingOptimizationLevel(level);
11307 }
11308
11317 {
11318 return mImpl->getTilingOptimizationLevel();
11319 }
11320
11332 bool setL2LimitForTiling(int64_t size) noexcept
11333 {
11334 return mImpl->setL2LimitForTiling(size);
11335 }
11336
11344 int64_t getL2LimitForTiling() const noexcept
11345 {
11346 return mImpl->getL2LimitForTiling();
11347 }
11348
11363 bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
11364 {
11365 return mImpl->setNbComputeCapabilities(maxNbComputeCapabilities);
11366 }
11367
11375 int32_t getNbComputeCapabilities() const noexcept
11376 {
11377 return mImpl->getNbComputeCapabilities();
11378 }
11379
11393 bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
11394 {
11395 return mImpl->setComputeCapability(computeCapability, index);
11396 }
11397
11407 ComputeCapability getComputeCapability(int32_t index) const noexcept
11408 {
11409 return mImpl->getComputeCapability(index);
11410 }
11411
11429 bool setBuildRoute(char const* buildRoute) noexcept
11430 {
11431 return mImpl->setBuildRoute(buildRoute);
11432 }
11433
11443 char const* getBuildRoute() const noexcept
11444 {
11445 return mImpl->getBuildRoute();
11446 }
11447
11479 char const* getAllBuildRoutes() const noexcept
11480 {
11481 return mImpl->getAllBuildRoutes();
11482 }
11483
11484protected:
11485 apiv::VBuilderConfig* mImpl;
11486};
11487
11488inline IBuilderConfig::~IBuilderConfig() noexcept = default;
11489
11498
11508{
11517};
11518
11524template <>
11526{
11527 static constexpr int32_t kVALUE = 1;
11528};
11529
11530
11538class IBuilder : public INoCopy
11539{
11540public:
11541 virtual ~IBuilder() noexcept = 0;
11542
11550 int32_t getMaxDLABatchSize() const noexcept
11551 {
11552 return mImpl->getMaxDLABatchSize();
11553 }
11554
11558 int32_t getNbDLACores() const noexcept
11559 {
11560 return mImpl->getNbDLACores();
11561 }
11562
11576 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11577 {
11578 mImpl->setGpuAllocator(allocator);
11579 }
11580
11591 {
11592 return mImpl->createBuilderConfig();
11593 }
11594
11595
11618 {
11619 return mImpl->createNetworkV2(flags);
11620 }
11621
11633 {
11634 return mImpl->createOptimizationProfile();
11635 }
11636
11651 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11652 {
11653 mImpl->setErrorRecorder(recorder);
11654 }
11655
11667 {
11668 return mImpl->getErrorRecorder();
11669 }
11670
11674 void reset() noexcept
11675 {
11676 mImpl->reset();
11677 }
11678
11695 {
11696 return mImpl->buildSerializedNetwork(network, config);
11697 }
11698
11717 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11718 {
11719 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11720 }
11721
11722
11723
11745 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11746 {
11747 return mImpl->isNetworkSupported(network, config);
11748 }
11749
11755 ILogger* getLogger() const noexcept
11756 {
11757 return mImpl->getLogger();
11758 }
11759
11771 bool setMaxThreads(int32_t maxThreads) noexcept
11772 {
11773 return mImpl->setMaxThreads(maxThreads);
11774 }
11775
11785 int32_t getMaxThreads() const noexcept
11786 {
11787 return mImpl->getMaxThreads();
11788 }
11789
11796 {
11797 return mImpl->getPluginRegistry();
11798 }
11799
11800protected:
11801 apiv::VBuilder* mImpl;
11802};
11803
11804inline IBuilder::~IBuilder() noexcept = default;
11805
11806} // namespace nvinfer1
11807
11812extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11813
11814namespace nvinfer1
11815{
11816namespace
11817{
11818
11826inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11827{
11828 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11829}
11830
11831} // namespace
11832
11845 nvinfer1::EngineCapability capability) noexcept;
11846
11856extern "C" TENSORRTAPI bool setInternalLibraryPath(AsciiChar const* path) noexcept;
11857
11858namespace safe
11859{
11861class IPluginRegistry;
11862} // namespace safe
11863
11864
11865} // namespace nvinfer1
11866
11867#endif // NV_INFER_H
#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:1116
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1164
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1125
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1135
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1173
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1182
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1150
virtual ~IActivationLayer() noexcept=0
An assertion layer in a network.
Definition: NvInfer.h:4878
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4888
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4898
virtual ~IAssertionLayer() noexcept=0
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6763
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6768
virtual ~IAttentionBoundaryLayer() noexcept=0
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6900
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:6950
bool setMetadata(char const *metadata) noexcept
Set the metadata for IAttention.
Definition: NvInfer.h:7200
TRT_NODISCARD bool setQueryLengths(ITensor *lengths) noexcept
Set the query lengths tensor.
Definition: NvInfer.h:7325
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:7026
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7116
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7039
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7079
CausalMaskKind getCausalKind() const noexcept
Get the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7014
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7099
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7087
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device attention execution.
Definition: NvInfer.h:7229
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7067
TRT_NODISCARD bool setKeyValueLengths(ITensor *lengths) noexcept
Set the key-value lengths tensor.
Definition: NvInfer.h:7364
TRT_NODISCARD ITensor * getKeyValueLengths() const noexcept
Get the key-value lengths tensor.
Definition: NvInfer.h:7376
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6909
TRT_NODISCARD AttentionIOForm getKeyValueForm() const noexcept
Get the key-value form.
Definition: NvInfer.h:7301
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7128
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7168
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:7241
TRT_DEPRECATED bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:6982
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6921
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7144
bool setCausalKind(CausalMaskKind kind) noexcept
Set the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7002
TRT_NODISCARD AttentionIOForm getQueryForm() const noexcept
Get the query form.
Definition: NvInfer.h:7271
char const * getMetadata() const noexcept
Get the metadata of IAttention.
Definition: NvInfer.h:7213
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7180
TRT_NODISCARD bool setQueryForm(AttentionIOForm form) noexcept
Set the query form.
Definition: NvInfer.h:7258
virtual ~IAttention() noexcept=0
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7155
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7058
TRT_NODISCARD ITensor * getQueryLengths() const noexcept
Get the query lengths tensor.
Definition: NvInfer.h:7337
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6938
TRT_NODISCARD bool setKeyValueForm(AttentionIOForm form) noexcept
Set the key-value form.
Definition: NvInfer.h:7288
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:6968
apiv::VAttention * mImpl
Definition: NvInfer.h:7382
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6791
virtual ~IAttentionInputLayer() noexcept=0
This layer represents an output of an IAttention.
Definition: NvInfer.h:6830
virtual ~IAttentionOutputLayer() noexcept=0
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10543
void setProfileStream(cudaStream_t const stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10812
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:11007
bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
Set one compute capability for runtime execution.
Definition: NvInfer.h:11393
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
Set the number of compute capabilities.
Definition: NvInfer.h:11363
TRT_DEPRECATED bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:10963
bool setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11200
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:11044
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:11058
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:11103
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:10901
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:11146
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:11304
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11332
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:11026
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10742
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:11169
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10674
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10580
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:11210
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10657
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:11276
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11344
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:11226
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10866
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10854
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10773
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:11159
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10592
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:11264
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10763
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:11252
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:11288
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10621
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10609
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:10916
char const * getAllBuildRoutes() const noexcept
Get all available build routes.
Definition: NvInfer.h:11479
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10706
ComputeCapability getComputeCapability(int32_t index) const noexcept
Get one compute capability for runtime execution.
Definition: NvInfer.h:11407
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10732
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:11133
int32_t getNbComputeCapabilities() const noexcept
Get the number of compute capabilities.
Definition: NvInfer.h:11375
bool setBuildRoute(char const *buildRoute) noexcept
Set the build route to be passed to the compiler.
Definition: NvInfer.h:11429
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10633
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10841
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:11236
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11485
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10567
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:10753
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10645
TRT_DEPRECATED nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:10938
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10684
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10716
cudaStream_t getProfileStream() const noexcept
Get the default engine-level CUDA stream used to profile this network.
Definition: NvInfer.h:10824
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:11120
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11316
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10879
TRT_DEPRECATED nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:10975
char const * getBuildRoute() const noexcept
Get the build route string.
Definition: NvInfer.h:11443
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10696
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:11091
Builds an engine from a network definition.
Definition: NvInfer.h:11539
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11558
virtual ~IBuilder() noexcept=0
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11666
apiv::VBuilder * mImpl
Definition: NvInfer.h:11801
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11755
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:11745
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11785
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11795
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11632
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11576
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11617
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11590
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11674
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11771
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11651
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11694
bool buildSerializedNetworkToStream(INetworkDefinition &network, IBuilderConfig &config, IStreamWriter &writer) noexcept
Builds network using the config configuration, and serializes an engine into writer.
Definition: NvInfer.h:11716
A cast layer in a network.
Definition: NvInfer.h:3719
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3745
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3739
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3728
virtual ~ICastLayer() noexcept=0
A concatenation layer in a network definition.
Definition: NvInfer.h:1832
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:1845
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:1855
virtual ~IConcatenationLayer() noexcept=0
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4382
virtual ~IConditionLayer() noexcept=0
Layer that represents a constant value.
Definition: NvInfer.h:3760
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3770
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3780
virtual ~IConstantLayer() noexcept=0
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3792
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3810
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3804
A convolution layer in a network definition.
Definition: NvInfer.h:794
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:919
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:892
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:960
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1064
virtual ~IConvolutionLayer() noexcept=0
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1050
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1020
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:867
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1010
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1074
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:813
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:857
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:946
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:843
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:972
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:833
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:803
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:882
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:995
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1038
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:909
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:936
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:985
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6584
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6595
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6643
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6661
virtual ~ICumulativeLayer() noexcept=0
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6631
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6655
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6619
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6607
A deconvolution layer in a network definition.
Definition: NvInfer.h:1875
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:1963
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:1924
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:1948
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:1990
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2105
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2171
virtual ~IDeconvolutionLayer() noexcept=0
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:1973
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:1938
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1894
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2095
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2027
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2078
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2017
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2068
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2123
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1884
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2135
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2161
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2041
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:1914
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2000
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2053
A Dequantize layer in a network definition.
Definition: NvInfer.h:5497
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5546
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5562
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5507
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5535
virtual ~IDequantizeLayer() noexcept=0
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5574
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5518
Definition: NvInfer.h:8080
virtual ~IDistCollectiveLayer() noexcept=0
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5604
virtual ~IDynamicQuantizeLayer() noexcept=0
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5670
TRT_DEPRECATED void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5683
TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5706
Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5741
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5657
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5644
TRT_DEPRECATED int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5693
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5631
void setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5729
TRT_DEPRECATED int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5716
An Einsum layer in a network.
Definition: NvInfer.h:5788
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:5799
virtual ~IEinsumLayer() noexcept=0
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5809
A elementwise layer in a network definition.
Definition: NvInfer.h:2244
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2273
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2267
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2255
virtual ~IElementWiseLayer() noexcept=0
Generate a tensor according to a specified mode.
Definition: NvInfer.h:4994
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5226
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5040
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5030
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5256
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5169
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5203
virtual ~IFillLayer() noexcept=0
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5093
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5184
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5218
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5074
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5005
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5059
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5244
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5020
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5108
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2379
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:2390
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2425
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2461
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:2435
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2445
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2402
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2455
A GridSample layer in a network definition.
Definition: NvInfer.h:6017
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6024
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6070
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6046
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6088
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6082
virtual ~IGridSampleLayer() noexcept=0
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6036
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6058
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:3704
virtual ~IIdentityLayer() noexcept=0
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3706
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4359
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4364
virtual ~IIfConditionalBoundaryLayer() noexcept=0
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4450
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4491
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4516
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4461
virtual ~IIfConditional() noexcept=0
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4479
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4506
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4416
virtual ~IIfConditionalInputLayer() noexcept=0
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4401
virtual ~IIfConditionalOutputLayer() noexcept=0
A layer to do iterations.
Definition: NvInfer.h:4689
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4716
virtual ~IIteratorLayer() noexcept=0
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4726
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4702
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4694
Layer that represents a KVCacheUpdate operation.
Definition: NvInfer.h:7504
bool setCacheMode(KVCacheMode cacheMode) noexcept
Set the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7529
TRT_NODISCARD ITensor * getUpdateLengths() const noexcept
Get the update lengths tensor.
Definition: NvInfer.h:7604
virtual ~IKVCacheUpdateLayer() noexcept=0
TRT_NODISCARD AttentionIOForm getUpdateForm() const noexcept
Get the update form.
Definition: NvInfer.h:7570
TRT_NODISCARD bool setUpdateLengths(ITensor *lengths) noexcept
Set the update lengths tensor.
Definition: NvInfer.h:7592
TRT_NODISCARD bool setUpdateForm(AttentionIOForm form) noexcept
Set the update form.
Definition: NvInfer.h:7557
KVCacheMode getCacheMode() const noexcept
Get the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7539
apiv::VKVCacheUpdateLayer * mImpl
Definition: NvInfer.h:7610
A LRN layer in a network definition.
Definition: NvInfer.h:1481
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1502
virtual ~ILRNLayer() noexcept=0
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1524
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1492
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1558
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1514
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1536
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1546
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1568
Base class for all layer classes in a network definition.
Definition: NvInfer.h:427
virtual ~ILayer() noexcept=0
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:548
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:448
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:466
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:594
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:561
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:529
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:458
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:487
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:497
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:514
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:479
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device execution.
Definition: NvInfer.h:582
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:434
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4334
virtual ~ILoopBoundaryLayer() noexcept=0
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4339
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4749
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4819
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4778
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4791
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:4804
virtual ~ILoop() noexcept=0
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4829
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4757
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4585
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4615
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4590
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:4607
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3545
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3573
virtual ~IMatrixMultiplyLayer() noexcept=0
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3567
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3555
A MoE layer in a network definition. Mixture of Experts (MoE) is a collection of experts with each ex...
Definition: NvInfer.h:7755
void setSwigluParamLimit(float limit) noexcept
Set the SwiGLU parameter limit.
Definition: NvInfer.h:7977
void setDynQOutputScaleType(DataType type) noexcept
Set the dynamic quantization output scale type.
Definition: NvInfer.h:7930
MoEActType getActivationType() const noexcept
Get the activation type for the MoE layer.
Definition: NvInfer.h:7804
void setQuantizationToType(DataType type) noexcept
Set the data type the mul output is quantized to.
Definition: NvInfer.h:7878
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:7863
void setQuantizationStatic(ITensor &fcDownActivationScale, DataType dataType) noexcept
Configure static quantization after the mul op.
Definition: NvInfer.h:7830
float getSwigluParamLimit() const noexcept
Get the SwiGLU parameter limit.
Definition: NvInfer.h:7989
DataType getQuantizationToType() const noexcept
Get the data type the mul in MoE layer is quantized to.
Definition: NvInfer.h:7890
DataType getDynQOutputScaleType() const noexcept
Get the dynamic quantization output scale type.
Definition: NvInfer.h:7942
virtual ~IMoELayer() noexcept=0
void setActivationType(MoEActType activationType) noexcept
Set the activation type for the MoE layer.
Definition: NvInfer.h:7792
Dims getQuantizationBlockShape() const noexcept
Get the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7918
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:7768
float getSwigluParamBeta() const noexcept
Get the SwiGLU parameter beta.
Definition: NvInfer.h:8041
void setSwigluParamBeta(float beta) noexcept
Set the SwiGLU parameter beta.
Definition: NvInfer.h:8029
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:7780
void setSwigluParams(float limit, float alpha, float beta) noexcept
Set the SwiGLU parameters.
Definition: NvInfer.h:7963
void setQuantizationBlockShape(Dims const &blockShape) noexcept
Set the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7906
void setInput(int32_t index, ITensor &tensor) noexcept
Set the input of the MoE layer.
Definition: NvInfer.h:8058
float getSwigluParamAlpha() const noexcept
Get the SwiGLU parameter alpha.
Definition: NvInfer.h:8015
void setSwigluParamAlpha(float alpha) noexcept
Set the SwiGLU parameter alpha.
Definition: NvInfer.h:8003
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6171
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6208
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6182
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6194
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6253
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6271
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6218
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6265
virtual ~INMSLayer() noexcept=0
A network definition for input to the builder.
Definition: NvInfer.h:8106
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:8334
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:8397
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:8823
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:8593
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:8177
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:8278
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:9490
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:9125
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8684
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:8944
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:8753
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:9023
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:8837
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:8922
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:8498
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:8468
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:8560
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:9248
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:8904
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:9151
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:9054
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:8225
TRT_NODISCARD INormalizationLayer * addNormalizationV2(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9812
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:8259
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:8799
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:9676
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:8440
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:8203
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:8875
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:9069
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9225
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:9736
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9399
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:9551
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:9436
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:9319
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:8452
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:8863
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:9292
IDynamicQuantizeLayer * addDynamicQuantizeV2(ITensor &input, Dims const &blockShape, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:9343
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:8524
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:8383
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:9377
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:8768
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:9717
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:9108
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:9268
TRT_DEPRECATED INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9468
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:8426
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:9818
IKVCacheUpdateLayer * addKVCacheUpdate(ITensor &cache, ITensor &update, ITensor &writeIndices, KVCacheMode cacheMode) noexcept
Add a KVCacheUpdate layer to the network.
Definition: NvInfer.h:9610
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:8892
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:8414
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:8304
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:8780
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:8738
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:8625
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8700
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:8361
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:8724
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9210
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:8964
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9419
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:8644
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:8853
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:8609
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9704
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9691
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:9576
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:8986
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:9040
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:9786
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:8665
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:8317
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:8193
TRT_DEPRECATED IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:9520
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:9359
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:8159
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:9167
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:8482
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:9765
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:9191
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:9664
IMoELayer * addMoE(ITensor &hiddenStates, ITensor &selectedExpertsForTokens, ITensor &scoresForSelectedExperts) noexcept
Add a MoE (Mixture of Experts) layer to the network.
Definition: NvInfer.h:9632
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:8239
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3601
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3625
virtual ~INonZeroLayer() noexcept=0
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3613
A normalization layer in a network definition.
Definition: NvInfer.h:6364
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6383
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6403
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6373
virtual ~INormalizationLayer() noexcept=0
TRT_NODISCARD bool isV2() const noexcept
Returns true if this layer was created through addNormalizationV2().
Definition: NvInfer.h:6445
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6451
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6434
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6393
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6424
A OneHot layer in a network definition.
Definition: NvInfer.h:5978
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5999
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5985
virtual ~IOneHotLayer() noexcept=0
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5993
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2792
Layer that represents a padding operation.
Definition: NvInfer.h:2786
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2835
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2797
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:2823
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2809
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2841
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3826
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3828
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:2479
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2492
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2486
virtual ~IPluginV2Layer() noexcept=0
Layer type for V3 plugins.
Definition: NvInfer.h:2508
virtual ~IPluginV3Layer() noexcept=0
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2515
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2521
A Pooling layer in a network definition.
Definition: NvInfer.h:1229
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1248
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1381
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1357
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1301
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1329
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1238
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1394
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1370
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1404
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:1290
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1447
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1276
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1418
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1428
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1459
virtual ~IPoolingLayer() noexcept=0
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1347
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1319
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1263
A Quantize layer in a network definition.
Definition: NvInfer.h:5343
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5404
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5377
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5364
virtual ~IQuantizeLayer() noexcept=0
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5388
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5353
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5416
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3652
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3654
virtual ~IRaggedSoftMaxLayer() noexcept=0
A recurrence layer in a network definition.
Definition: NvInfer.h:4536
virtual ~IRecurrenceLayer() noexcept=0
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2704
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2751
virtual ~IReduceLayer() noexcept=0
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2711
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2721
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2741
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2731
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2767
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2761
A resize layer in a network definition.
Definition: NvInfer.h:4005
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4166
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4190
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:4084
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4025
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4222
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4065
virtual ~IResizeLayer() noexcept=0
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4232
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4176
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4106
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4141
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4245
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4096
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4035
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4200
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4255
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4151
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6290
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6323
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6310
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6339
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6333
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6300
virtual ~IReverseSequenceLayer() noexcept=0
Layer that implements Rotary Position Embedding (RoPE) (https://arxiv.org/abs/2104....
Definition: NvInfer.h:7395
TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
Get the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7435
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:7402
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:7424
apiv::VRotaryEmbeddingLayer * mImpl
Definition: NvInfer.h:7457
TRT_NODISCARD bool getInterleaved() const noexcept
Get whether the input is in interleaved format. The default value is false.
Definition: NvInfer.h:7413
A Scale layer in a network definition.
Definition: NvInfer.h:1629
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1686
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1706
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1676
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1696
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1646
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1656
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1742
virtual ~IScaleLayer() noexcept=0
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1666
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1636
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1721
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5903
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5910
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5944
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5930
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5938
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5920
virtual ~IScatterLayer() noexcept=0
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4854
virtual ~ISelectLayer() noexcept=0
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3317
virtual ~IShapeLayer() noexcept=0
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3319
Layer type for shuffling data.
Definition: NvInfer.h:2876
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3034
virtual ~IShuffleLayer() noexcept=0
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2887
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:2987
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:2940
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:2927
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2899
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:2999
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3028
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3015
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3130
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3199
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3298
virtual ~ISliceLayer() noexcept=0
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3170
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3277
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3141
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3156
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3224
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3185
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3234
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3214
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3292
A Softmax layer in a network definition.
Definition: NvInfer.h:1775
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:1797
virtual ~ISoftMaxLayer() noexcept=0
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:1807
Layer that represents a squeeze operation, removing unit dimensions of the first input tensor on a se...
Definition: NvInfer.h:6470
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6490
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:301
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:366
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:345
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:271
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:413
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:392
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:407
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:314
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:10106
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:10172
virtual ~ITimingCache() noexcept=0
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:10143
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:10189
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:10211
apiv::VTimingCache * mImpl
Definition: NvInfer.h:10217
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:10153
Layer that represents a TopK reduction.
Definition: NvInfer.h:3359
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3390
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3414
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3376
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3473
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3366
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3455
virtual ~ITopKLayer() noexcept=0
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3404
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3424
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3467
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4661
virtual ~ITripLimitLayer() noexcept=0
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4666
Layer that represents an unary operation.
Definition: NvInfer.h:2591
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2600
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2616
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2610
virtual ~IUnaryLayer() noexcept=0
Layer that represents an unsqueeze operation, which reshapes the first input tensor by inserting unit...
Definition: NvInfer.h:6505
virtual ~IUnsqueezeLayer() noexcept=0
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6523
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:10450
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:11826
The TensorRT API version 1 namespace.
Definition: NvInferPluginBase.h:29
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:3035
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3916
@ 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:10230
AttentionIOForm
Enumerates the layout of the input/output tensors in an Attention layer.
Definition: NvInfer.h:6733
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:1586
@ 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:9841
@ kNONE
Tensor is not an input or output.
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10343
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6541
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6102
@ 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
ComputeCapability
Describes compute capability that an engine will be built for.
Definition: NvInfer.h:10392
@ kSM120
Target NVIDIA Blackwell GPU architecture (SM 12.0).
@ kSM121
Target NVIDIA GB10 GPU (SM 12.1).
@ kSM75
Target NVIDIA Turing GPU architecture (SM 7.5).
@ kSM80
Target NVIDIA Ampere GPU architecture (SM 8.0).
@ kCURRENT
Use the compute capability of the current GPU in the environment.
@ kSM89
Target NVIDIA Ada Lovelace GPU architecture (SM 8.9).
@ kSM86
Target NVIDIA Ampere GPU architecture (SM 8.6).
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2544
@ 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:4919
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:3943
@ 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:6705
@ 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:763
@ 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:4301
@ 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:11497
PreviewFeature
Define preview features.
Definition: NvInfer.h:10309
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10420
@ 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:9871
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:3046
@ 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:2285
@ 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:7622
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:3047
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11508
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2196
@ 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:2674
@ kALL_TO_ALL
All-to-all exchange.
@ kREDUCE_SCATTER
Reduce scatter.
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3840
@ 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:9881
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ 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:3331
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2646
@ kAVG
Average of the elements.
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5829
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3486
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3865
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4273
@ 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:7469
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1200
@ 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:10533
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6673
Represents a permutation of dimensions.
Definition: NvInfer.h:2853
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:10066
Definition: NvInfer.h:10080
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:10082
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:10084

  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