TensorRT for RTX 1.5.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h" // IWYU pragma: export
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110 kATTENTION_INPUT = 51,
111 kATTENTION_OUTPUT = 52,
112 kROTARY_EMBEDDING = 53,
113 kKVCACHE_UPDATE = 54,
114 kMOE = 55,
115 kDIST_COLLECTIVE = 56,
116};
117
123template <>
125{
126 static constexpr int32_t kVALUE = 57;
127};
128
135using TensorFormats = uint32_t;
136
142enum class ActivationType : int32_t
143{
144 kRELU = 0,
145 kSIGMOID = 1,
146 kTANH = 2,
147 kLEAKY_RELU = 3,
148 kELU = 4,
149 kSELU = 5,
150 kSOFTSIGN = 6,
151 kSOFTPLUS = 7,
152 kCLIP = 8,
153 kHARD_SIGMOID = 9,
154 kSCALED_TANH = 10,
155 kTHRESHOLDED_RELU = 11,
156 kGELU_ERF = 12,
157 kGELU_TANH = 13
158};
159
165template <>
167{
168 static constexpr int32_t kVALUE = 14;
169};
170
185class ITensor : public INoCopy
186{
187public:
203 void setName(char const* name) noexcept
204 {
205 mImpl->setName(name);
206 }
207
215 char const* getName() const noexcept
216 {
217 return mImpl->getName();
218 }
219
234 void setDimensions(Dims const& dimensions) noexcept
235 {
236 mImpl->setDimensions(dimensions);
237 }
238
248 Dims getDimensions() const noexcept
249 {
250 return mImpl->getDimensions();
251 }
252
253
263 DataType getType() const noexcept
264 {
265 return mImpl->getType();
266 }
267
271 bool isNetworkInput() const noexcept
272 {
273 return mImpl->isNetworkInput();
274 }
275
279 bool isNetworkOutput() const noexcept
280 {
281 return mImpl->isNetworkOutput();
282 }
283
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
1419 void setStrideNd(Dims const& stride) noexcept
1420 {
1421 mImpl->setStrideNd(stride);
1422 }
1423
1429 Dims getStrideNd() const noexcept
1430 {
1431 return mImpl->getStrideNd();
1432 }
1433
1448 void setPaddingNd(Dims const& padding) noexcept
1449 {
1450 mImpl->setPaddingNd(padding);
1451 }
1452
1460 Dims getPaddingNd() const noexcept
1461 {
1462 return mImpl->getPaddingNd();
1463 }
1464
1465protected:
1466 virtual ~IPoolingLayer() noexcept = 0;
1467 apiv::VPoolingLayer* mImpl;
1468};
1469
1470inline IPoolingLayer::~IPoolingLayer() noexcept = default;
1471
1481class ILRNLayer : public ILayer
1482{
1483public:
1493 void setWindowSize(int64_t windowSize) noexcept
1494 {
1495 mImpl->setWindowSize(windowSize);
1496 }
1497
1503 int64_t getWindowSize() const noexcept
1504 {
1505 return mImpl->getWindowSize();
1506 }
1507
1515 void setAlpha(float alpha) noexcept
1516 {
1517 mImpl->setAlpha(alpha);
1518 }
1519
1525 float getAlpha() const noexcept
1526 {
1527 return mImpl->getAlpha();
1528 }
1529
1537 void setBeta(float beta) noexcept
1538 {
1539 mImpl->setBeta(beta);
1540 }
1541
1547 float getBeta() const noexcept
1548 {
1549 return mImpl->getBeta();
1550 }
1551
1559 void setK(float k) noexcept
1560 {
1561 mImpl->setK(k);
1562 }
1563
1569 float getK() const noexcept
1570 {
1571 return mImpl->getK();
1572 }
1573
1574protected:
1575 virtual ~ILRNLayer() noexcept = 0;
1576 apiv::VLRNLayer* mImpl;
1577};
1578
1579inline ILRNLayer::~ILRNLayer() noexcept = default;
1580
1586enum class ScaleMode : int32_t
1587{
1588 kUNIFORM = 0,
1589 kCHANNEL = 1,
1590 kELEMENTWISE = 2
1591};
1592
1598template <>
1600{
1601 static constexpr int32_t kVALUE = 3;
1602};
1603
1629class IScaleLayer : public ILayer
1630{
1631public:
1637 void setMode(ScaleMode mode) noexcept
1638 {
1639 mImpl->setMode(mode);
1640 }
1641
1647 ScaleMode getMode() const noexcept
1648 {
1649 return mImpl->getMode();
1650 }
1651
1657 void setShift(Weights shift) noexcept
1658 {
1659 mImpl->setShift(shift);
1660 }
1661
1667 Weights getShift() const noexcept
1668 {
1669 return mImpl->getShift();
1670 }
1671
1677 void setScale(Weights scale) noexcept
1678 {
1679 mImpl->setScale(scale);
1680 }
1681
1687 Weights getScale() const noexcept
1688 {
1689 return mImpl->getScale();
1690 }
1691
1697 void setPower(Weights power) noexcept
1698 {
1699 mImpl->setPower(power);
1700 }
1701
1707 Weights getPower() const noexcept
1708 {
1709 return mImpl->getPower();
1710 }
1711
1722 int32_t getChannelAxis() const noexcept
1723 {
1724 return mImpl->getChannelAxis();
1725 }
1726
1743 void setChannelAxis(int32_t channelAxis) noexcept
1744 {
1745 mImpl->setChannelAxis(channelAxis);
1746 }
1747
1748protected:
1749 virtual ~IScaleLayer() noexcept = 0;
1750 apiv::VScaleLayer* mImpl;
1751};
1752
1753inline IScaleLayer::~IScaleLayer() noexcept = default;
1754
1775class ISoftMaxLayer : public ILayer
1776{
1777public:
1798 void setAxes(uint32_t axes) noexcept
1799 {
1800 mImpl->setAxes(axes);
1801 }
1802
1808 uint32_t getAxes() const noexcept
1809 {
1810 return mImpl->getAxes();
1811 }
1812
1813protected:
1814 virtual ~ISoftMaxLayer() noexcept = 0;
1815 apiv::VSoftMaxLayer* mImpl;
1816};
1817
1818inline ISoftMaxLayer::~ISoftMaxLayer() noexcept = default;
1819
1833{
1834public:
1846 void setAxis(int32_t axis) noexcept
1847 {
1848 mImpl->setAxis(axis);
1849 }
1850
1856 int32_t getAxis() const noexcept
1857 {
1858 return mImpl->getAxis();
1859 }
1860
1861protected:
1862 virtual ~IConcatenationLayer() noexcept = 0;
1863 apiv::VConcatenationLayer* mImpl;
1864};
1865
1866inline IConcatenationLayer::~IConcatenationLayer() noexcept = default;
1867
1876{
1877public:
1885 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1886 {
1887 mImpl->setNbOutputMaps(nbOutputMaps);
1888 }
1889
1895 int64_t getNbOutputMaps() const noexcept
1896 {
1897 return mImpl->getNbOutputMaps();
1898 }
1899
1915 void setNbGroups(int64_t nbGroups) noexcept
1916 {
1917 mImpl->setNbGroups(nbGroups);
1918 }
1919
1925 int64_t getNbGroups() const noexcept
1926 {
1927 return mImpl->getNbGroups();
1928 }
1929
1939 void setKernelWeights(Weights weights) noexcept
1940 {
1941 mImpl->setKernelWeights(weights);
1942 }
1943
1949 Weights getKernelWeights() const noexcept
1950 {
1951 return mImpl->getKernelWeights();
1952 }
1953
1964 void setBiasWeights(Weights weights) noexcept
1965 {
1966 mImpl->setBiasWeights(weights);
1967 }
1968
1974 Weights getBiasWeights() const noexcept
1975 {
1976 return mImpl->getBiasWeights();
1977 }
1978
1991 void setPrePadding(Dims const& padding) noexcept
1992 {
1993 mImpl->setPrePadding(padding);
1994 }
1995
2001 Dims getPrePadding() const noexcept
2002 {
2003 return mImpl->getPrePadding();
2004 }
2005
2018 void setPostPadding(Dims const& padding) noexcept
2019 {
2020 mImpl->setPostPadding(padding);
2021 }
2022
2028 Dims getPostPadding() const noexcept
2029 {
2030 return mImpl->getPostPadding();
2031 }
2032
2042 void setPaddingMode(PaddingMode paddingMode) noexcept
2043 {
2044 mImpl->setPaddingMode(paddingMode);
2045 }
2046
2055 {
2056 return mImpl->getPaddingMode();
2057 }
2058
2069 void setKernelSizeNd(Dims const& kernelSize) noexcept
2070 {
2071 mImpl->setKernelSizeNd(kernelSize);
2072 }
2073
2079 Dims getKernelSizeNd() const noexcept
2080 {
2081 return mImpl->getKernelSizeNd();
2082 }
2083
2096 void setStrideNd(Dims const& stride) noexcept
2097 {
2098 mImpl->setStrideNd(stride);
2099 }
2100
2106 Dims getStrideNd() const noexcept
2107 {
2108 return mImpl->getStrideNd();
2109 }
2110
2124 void setPaddingNd(Dims const& padding) noexcept
2125 {
2126 mImpl->setPaddingNd(padding);
2127 }
2128
2136 Dims getPaddingNd() const noexcept
2137 {
2138 return mImpl->getPaddingNd();
2139 }
2140
2153 using ILayer::setInput;
2154
2162 void setDilationNd(Dims const& dilation) noexcept
2163 {
2164 mImpl->setDilationNd(dilation);
2165 }
2166
2172 Dims getDilationNd() const noexcept
2173 {
2174 return mImpl->getDilationNd();
2175 }
2176
2177protected:
2178 virtual ~IDeconvolutionLayer() noexcept = 0;
2179 apiv::VDeconvolutionLayer* mImpl;
2180};
2181
2182inline IDeconvolutionLayer::~IDeconvolutionLayer() noexcept = default;
2183
2196enum class ElementWiseOperation : int32_t
2197{
2198 kSUM = 0,
2199 kPROD = 1,
2200 kMAX = 2,
2201 kMIN = 3,
2202 kSUB = 4,
2203 kDIV = 5,
2204 kPOW = 6,
2205 kFLOOR_DIV = 7,
2206 kAND = 8,
2207 kOR = 9,
2208 kXOR = 10,
2209 kEQUAL = 11,
2210 kGREATER = 12,
2211 kLESS = 13
2212};
2213
2219template <>
2221{
2222 static constexpr int32_t kVALUE = 14;
2223};
2224
2245{
2246public:
2257 {
2258 return mImpl->setOperation(op);
2259 }
2260
2269 {
2270 return mImpl->getOperation();
2271 }
2272
2273protected:
2274 apiv::VElementWiseLayer* mImpl;
2275 virtual ~IElementWiseLayer() noexcept = 0;
2276};
2277
2278inline IElementWiseLayer::~IElementWiseLayer() noexcept = default;
2279
2285enum class GatherMode : int32_t
2286{
2287 kDEFAULT = 0,
2288 kELEMENT = 1,
2289 kND = 2
2290};
2291
2297template <>
2299{
2300 static constexpr int32_t kVALUE = 3;
2301};
2302
2379class IGatherLayer : public ILayer
2380{
2381public:
2391 void setGatherAxis(int32_t axis) noexcept
2392 {
2393 mImpl->setGatherAxis(axis);
2394 }
2395
2403 int32_t getGatherAxis() const noexcept
2404 {
2405 return mImpl->getGatherAxis();
2406 }
2407
2426 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2427 {
2428 mImpl->setNbElementWiseDims(elementWiseDims);
2429 }
2430
2436 int32_t getNbElementWiseDims() const noexcept
2437 {
2438 return mImpl->getNbElementWiseDims();
2439 }
2440
2446 void setMode(GatherMode mode) noexcept
2447 {
2448 mImpl->setMode(mode);
2449 }
2450
2456 GatherMode getMode() const noexcept
2457 {
2458 return mImpl->getMode();
2459 }
2460
2461protected:
2462 apiv::VGatherLayer* mImpl;
2463 virtual ~IGatherLayer() noexcept = 0;
2464};
2465
2466inline IGatherLayer::~IGatherLayer() noexcept = default;
2467
2480{
2481public:
2488 {
2489 return mImpl->getPlugin();
2490 }
2491
2492protected:
2493 apiv::VPluginV2Layer* mImpl;
2494 virtual ~IPluginV2Layer() noexcept = 0;
2495};
2496
2497inline IPluginV2Layer::~IPluginV2Layer() noexcept = default;
2498
2509{
2510public:
2517 {
2518 return mImpl->getPlugin();
2519 }
2520
2521protected:
2522 apiv::VPluginV3Layer* mImpl;
2523 virtual ~IPluginV3Layer() noexcept = 0;
2524};
2525
2526inline IPluginV3Layer::~IPluginV3Layer() noexcept = default;
2527
2544enum class UnaryOperation : int32_t
2545{
2546 kEXP = 0,
2547 kLOG = 1,
2548 kSQRT = 2,
2549 kRECIP = 3,
2550 kABS = 4,
2551 kNEG = 5,
2552 kSIN = 6,
2553 kCOS = 7,
2554 kTAN = 8,
2555 kSINH = 9,
2556 kCOSH = 10,
2557 kASIN = 11,
2558 kACOS = 12,
2559 kATAN = 13,
2560 kASINH = 14,
2561 kACOSH = 15,
2562 kATANH = 16,
2563 kCEIL = 17,
2564 kFLOOR = 18,
2565 kERF = 19,
2566 kNOT = 20,
2567 kSIGN = 21,
2568 kROUND = 22,
2569 kISINF = 23,
2570 kISNAN = 24,
2571};
2572
2578template <>
2580{
2581 static constexpr int32_t kVALUE = 25;
2582};
2583
2591class IUnaryLayer : public ILayer
2592{
2593public:
2602 {
2603 mImpl->setOperation(op);
2604 }
2605
2612 {
2613 return mImpl->getOperation();
2614 }
2615
2616protected:
2617 apiv::VUnaryLayer* mImpl;
2618 virtual ~IUnaryLayer() noexcept = 0;
2619};
2620
2621inline IUnaryLayer::~IUnaryLayer() noexcept = default;
2622
2646enum class ReduceOperation : int32_t
2647{
2648 kSUM = 0,
2649 kPROD = 1,
2650 kMAX = 2,
2651 kMIN = 3,
2652 kAVG = 4,
2653 kNONE = 5,
2654};
2655
2661template <>
2663{
2664 static constexpr int32_t kVALUE = 6;
2665};
2666
2674enum class CollectiveOperation : int32_t
2675{
2676 kALL_REDUCE = 0,
2677 kALL_GATHER = 1,
2678 kBROADCAST = 2,
2679 kREDUCE = 3,
2680 kREDUCE_SCATTER = 4,
2681 kALL_TO_ALL = 5,
2682 kGATHER = 6,
2683 kSCATTER = 7,
2684};
2685
2691template <>
2693{
2694 static constexpr int32_t kVALUE = 8;
2695};
2696
2704class IReduceLayer : public ILayer
2705{
2706public:
2713 {
2714 mImpl->setOperation(op);
2715 }
2716
2723 {
2724 return mImpl->getOperation();
2725 }
2726
2732 void setReduceAxes(uint32_t reduceAxes) noexcept
2733 {
2734 mImpl->setReduceAxes(reduceAxes);
2735 }
2736
2742 uint32_t getReduceAxes() const noexcept
2743 {
2744 return mImpl->getReduceAxes();
2745 }
2746
2752 void setKeepDimensions(bool keepDimensions) noexcept
2753 {
2754 mImpl->setKeepDimensions(keepDimensions);
2755 }
2756
2762 bool getKeepDimensions() const noexcept
2763 {
2764 return mImpl->getKeepDimensions();
2765 }
2766
2767protected:
2768 apiv::VReduceLayer* mImpl;
2769 virtual ~IReduceLayer() noexcept = 0;
2770};
2771
2772inline IReduceLayer::~IReduceLayer() noexcept = default;
2773
2786class IPaddingLayer : public ILayer
2787{
2788public:
2798 void setPrePaddingNd(Dims const& padding) noexcept
2799 {
2800 mImpl->setPrePaddingNd(padding);
2801 }
2802
2810 Dims getPrePaddingNd() const noexcept
2811 {
2812 return mImpl->getPrePaddingNd();
2813 }
2814
2824 void setPostPaddingNd(Dims const& padding) noexcept
2825 {
2826 mImpl->setPostPaddingNd(padding);
2827 }
2828
2836 Dims getPostPaddingNd() const noexcept
2837 {
2838 return mImpl->getPostPaddingNd();
2839 }
2840
2841protected:
2842 apiv::VPaddingLayer* mImpl;
2843 virtual ~IPaddingLayer() noexcept = 0;
2844};
2845
2846inline IPaddingLayer::~IPaddingLayer() noexcept = default;
2847
2854{
2861 int32_t order[Dims::MAX_DIMS];
2862};
2863
2876class IShuffleLayer : public ILayer
2877{
2878public:
2888 void setFirstTranspose(Permutation permutation) noexcept
2889 {
2890 mImpl->setFirstTranspose(permutation);
2891 }
2892
2901 {
2902 return mImpl->getFirstTranspose();
2903 }
2904
2928 void setReshapeDimensions(Dims const& dimensions) noexcept
2929 {
2930 mImpl->setReshapeDimensions(dimensions);
2931 }
2932
2942 {
2943 return mImpl->getReshapeDimensions();
2944 }
2945
2951 //
2974 using ILayer::setInput;
2975
2988 void setSecondTranspose(Permutation permutation) noexcept
2989 {
2990 mImpl->setSecondTranspose(permutation);
2991 }
2992
3001 {
3002 return mImpl->getSecondTranspose();
3003 }
3004
3016 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3017 {
3018 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3019 }
3020
3029 bool getZeroIsPlaceholder() const noexcept
3030 {
3031 return mImpl->getZeroIsPlaceholder();
3032 }
3033
3034protected:
3035 apiv::VShuffleLayer* mImpl;
3036 virtual ~IShuffleLayer() noexcept = 0;
3037};
3038
3039inline IShuffleLayer::~IShuffleLayer() noexcept = default;
3040
3046enum class SampleMode : int32_t
3047{
3048 kSTRICT_BOUNDS = 0,
3049 kWRAP = 1,
3050 kCLAMP = 2,
3051 kFILL = 3,
3052 kREFLECT = 4,
3055};
3056
3062template <>
3064{
3065 static constexpr int32_t kVALUE = 5;
3066};
3067
3130class ISliceLayer : public ILayer
3131{
3132public:
3142 void setStart(Dims const& start) noexcept
3143 {
3144 mImpl->setStart(start);
3145 }
3146
3157 Dims getStart() const noexcept
3158 {
3159 return mImpl->getStart();
3160 }
3161
3171 void setSize(Dims const& size) noexcept
3172 {
3173 return mImpl->setSize(size);
3174 }
3175
3186 Dims getSize() const noexcept
3187 {
3188 return mImpl->getSize();
3189 }
3190
3200 void setStride(Dims const& stride) noexcept
3201 {
3202 mImpl->setStride(stride);
3203 }
3204
3215 Dims getStride() const noexcept
3216 {
3217 return mImpl->getStride();
3218 }
3219
3225 void setMode(SampleMode mode) noexcept
3226 {
3227 mImpl->setMode(mode);
3228 }
3229
3235 SampleMode getMode() const noexcept
3236 {
3237 return mImpl->getMode();
3238 }
3239
3267 using ILayer::setInput;
3268
3278 void setAxes(Dims const& axes) noexcept
3279 {
3280 mImpl->setAxes(axes);
3281 }
3282
3293 Dims getAxes() const noexcept
3294 {
3295 return mImpl->getAxes();
3296 }
3297
3298protected:
3299 apiv::VSliceLayer* mImpl;
3300 virtual ~ISliceLayer() noexcept = 0;
3301};
3302
3303inline ISliceLayer::~ISliceLayer() noexcept = default;
3304
3317class IShapeLayer : public ILayer
3318{
3319protected:
3320 apiv::VShapeLayer* mImpl;
3321 virtual ~IShapeLayer() noexcept = 0;
3322};
3323
3324inline IShapeLayer::~IShapeLayer() noexcept = default;
3325
3331enum class TopKOperation : int32_t
3332{
3333 kMAX = 0,
3334 kMIN = 1,
3335};
3336
3342template <>
3344{
3345 static constexpr int32_t kVALUE = 2;
3346};
3347
3359class ITopKLayer : public ILayer
3360{
3361public:
3367 void setOperation(TopKOperation op) noexcept
3368 {
3369 mImpl->setOperation(op);
3370 }
3371
3378 {
3379 return mImpl->getOperation();
3380 }
3381
3391 void setK(int32_t k) noexcept
3392 {
3393 mImpl->setK(k);
3394 }
3395
3405 int32_t getK() const noexcept
3406 {
3407 return mImpl->getK();
3408 }
3409
3415 void setReduceAxes(uint32_t reduceAxes) noexcept
3416 {
3417 mImpl->setReduceAxes(reduceAxes);
3418 }
3419
3425 uint32_t getReduceAxes() const noexcept
3426 {
3427 return mImpl->getReduceAxes();
3428 }
3429
3444 using ILayer::setInput;
3445
3456 bool setIndicesType(DataType type) noexcept
3457 {
3458 return mImpl->setIndicesType(type);
3459 }
3460
3468 DataType getIndicesType() const noexcept
3469 {
3470 return mImpl->getIndicesType();
3471 }
3472
3473protected:
3474 apiv::VTopKLayer* mImpl;
3475 virtual ~ITopKLayer() noexcept = 0;
3476};
3477
3478inline ITopKLayer::~ITopKLayer() noexcept = default;
3479
3486enum class MatrixOperation : int32_t
3487{
3491 kNONE = 0,
3492
3494 kTRANSPOSE = 1,
3495
3506 kVECTOR = 2,
3507};
3508
3514template <>
3516{
3517 static constexpr int32_t kVALUE = 3;
3518};
3519
3546{
3547public:
3556 void setOperation(int32_t index, MatrixOperation op) noexcept
3557 {
3558 mImpl->setOperation(index, op);
3559 }
3560
3568 MatrixOperation getOperation(int32_t index) const noexcept
3569 {
3570 return mImpl->getOperation(index);
3571 }
3572
3573protected:
3574 apiv::VMatrixMultiplyLayer* mImpl;
3575 virtual ~IMatrixMultiplyLayer() noexcept = 0;
3576};
3577
3578inline IMatrixMultiplyLayer::~IMatrixMultiplyLayer() noexcept = default;
3579
3601class INonZeroLayer : public ILayer
3602{
3603public:
3614 bool setIndicesType(DataType type) noexcept
3615 {
3616 return mImpl->setIndicesType(type);
3617 }
3618
3626 DataType getIndicesType() const noexcept
3627 {
3628 return mImpl->getIndicesType();
3629 }
3630
3631protected:
3632 virtual ~INonZeroLayer() noexcept = 0;
3633 apiv::VNonZeroLayer* mImpl;
3634};
3635
3636inline INonZeroLayer::~INonZeroLayer() noexcept = default;
3637
3653{
3654protected:
3655 apiv::VRaggedSoftMaxLayer* mImpl;
3656 virtual ~IRaggedSoftMaxLayer() noexcept = 0;
3657};
3658
3659inline IRaggedSoftMaxLayer::~IRaggedSoftMaxLayer() noexcept = default;
3660
3705{
3706protected:
3707 apiv::VIdentityLayer* mImpl;
3708 virtual ~IIdentityLayer() noexcept = 0;
3709};
3710
3711inline IIdentityLayer::~IIdentityLayer() noexcept = default;
3712
3719class ICastLayer : public ILayer
3720{
3721public:
3729 void setToType(DataType toType) noexcept
3730 {
3731 mImpl->setToType(toType);
3732 }
3733
3740 DataType getToType() const noexcept
3741 {
3742 return mImpl->getToType();
3743 }
3744
3745protected:
3746 apiv::VCastLayer* mImpl;
3747 virtual ~ICastLayer() noexcept = 0;
3748};
3749
3750inline ICastLayer::~ICastLayer() noexcept = default;
3751
3761{
3762public:
3771 void setWeights(Weights weights) noexcept
3772 {
3773 mImpl->setWeights(weights);
3774 }
3775
3781 Weights getWeights() const noexcept
3782 {
3783 return mImpl->getWeights();
3784 }
3785
3793 void setDimensions(Dims const& dimensions) noexcept
3794 {
3795 mImpl->setDimensions(dimensions);
3796 }
3797
3805 Dims getDimensions() const noexcept
3806 {
3807 return mImpl->getDimensions();
3808 }
3809
3810protected:
3811 apiv::VConstantLayer* mImpl;
3812 virtual ~IConstantLayer() noexcept = 0;
3813};
3814
3815inline IConstantLayer::~IConstantLayer() noexcept = default;
3816
3827{
3828protected:
3829 apiv::VParametricReLULayer* mImpl;
3830 virtual ~IParametricReLULayer() noexcept = 0;
3831};
3832
3833inline IParametricReLULayer::~IParametricReLULayer() noexcept = default;
3834
3840enum class InterpolationMode : int32_t
3841{
3842 kNEAREST = 0,
3843 kLINEAR = 1,
3844 kCUBIC = 2
3845};
3846
3852template <>
3854{
3855 static constexpr int32_t kVALUE = 3;
3856};
3857
3866{
3879 kALIGN_CORNERS = 0,
3880
3887 kASYMMETRIC = 1,
3888
3895 kHALF_PIXEL = 2,
3896};
3897
3903template <>
3905{
3906 static constexpr int32_t kVALUE = 3;
3907};
3908
3916enum class ResizeSelector : int32_t
3917{
3919 kFORMULA = 0,
3920
3922 kUPPER = 1,
3923};
3924
3930template <>
3932{
3933 static constexpr int32_t kVALUE = 2;
3934};
3935
3943enum class ResizeRoundMode : int32_t
3944{
3946 kHALF_UP = 0,
3947
3949 kHALF_DOWN = 1,
3950
3952 kFLOOR = 2,
3953
3955 kCEIL = 3,
3956};
3957
3963template <>
3965{
3966 static constexpr int32_t kVALUE = 4;
3967};
3968
4005class IResizeLayer : public ILayer
4006{
4007public:
4026 void setOutputDimensions(Dims const& dimensions) noexcept
4027 {
4028 return mImpl->setOutputDimensions(dimensions);
4029 }
4030
4036 Dims getOutputDimensions() const noexcept
4037 {
4038 return mImpl->getOutputDimensions();
4039 }
4040
4066 void setScales(float const* scales, int32_t nbScales) noexcept
4067 {
4068 mImpl->setScales(scales, nbScales);
4069 }
4070
4085 int32_t getScales(int32_t size, float* scales) const noexcept
4086 {
4087 return mImpl->getScales(size, scales);
4088 }
4089
4097 void setResizeMode(InterpolationMode interpolationMode) noexcept
4098 {
4099 mImpl->setResizeMode(interpolationMode);
4100 }
4101
4108 {
4109 return mImpl->getResizeMode();
4110 }
4111
4131 using ILayer::setInput;
4132
4143 {
4144 mImpl->setCoordinateTransformation(coordTransform);
4145 }
4146
4153 {
4154 return mImpl->getCoordinateTransformation();
4155 }
4156
4168 {
4169 mImpl->setSelectorForSinglePixel(selector);
4170 }
4171
4178 {
4179 return mImpl->getSelectorForSinglePixel();
4180 }
4181
4192 {
4193 mImpl->setNearestRounding(value);
4194 }
4195
4202 {
4203 return mImpl->getNearestRounding();
4204 }
4205
4223 void setCubicCoeff(float A) noexcept
4224 {
4225 mImpl->setCubicCoeff(A);
4226 }
4227
4233 float getCubicCoeff() const noexcept
4234 {
4235 return mImpl->getCubicCoeff();
4236 }
4237
4246 void setExcludeOutside(bool excludeFlag) noexcept
4247 {
4248 mImpl->setExcludeOutside(excludeFlag);
4249 }
4250
4256 bool getExcludeOutside() const noexcept
4257 {
4258 return mImpl->getExcludeOutside();
4259 }
4260
4261protected:
4262 virtual ~IResizeLayer() noexcept = 0;
4263 apiv::VResizeLayer* mImpl;
4264};
4265
4266inline IResizeLayer::~IResizeLayer() noexcept = default;
4267
4273enum class LoopOutput : int32_t
4274{
4276 kLAST_VALUE = 0,
4277
4279 kCONCATENATE = 1,
4280
4282 kREVERSE = 2
4283};
4284
4290template <>
4292{
4293 static constexpr int32_t kVALUE = 3;
4294};
4295
4301enum class TripLimit : int32_t
4302{
4303
4304 kCOUNT = 0,
4305 kWHILE = 1
4306};
4307
4313template <>
4315{
4316 static constexpr int32_t kVALUE = 2;
4317};
4318
4319class ILoop;
4320
4335{
4336public:
4340 ILoop* getLoop() const noexcept
4341 {
4342 return mBoundary->getLoop();
4343 }
4344
4345protected:
4346 virtual ~ILoopBoundaryLayer() noexcept = 0;
4347 apiv::VLoopBoundaryLayer* mBoundary;
4348};
4349
4350inline ILoopBoundaryLayer::~ILoopBoundaryLayer() noexcept = default;
4351
4360{
4361public:
4366 {
4367 return mBoundary->getConditional();
4368 }
4369
4370protected:
4371 virtual ~IIfConditionalBoundaryLayer() noexcept = 0;
4372 apiv::VConditionalBoundaryLayer* mBoundary;
4373};
4374
4375inline IIfConditionalBoundaryLayer::~IIfConditionalBoundaryLayer() noexcept = default;
4376
4383{
4384public:
4385protected:
4386 virtual ~IConditionLayer() noexcept = 0;
4387 apiv::VConditionLayer* mImpl;
4388};
4389
4390inline IConditionLayer::~IConditionLayer() noexcept = default;
4391
4402{
4403public:
4404protected:
4405 virtual ~IIfConditionalOutputLayer() noexcept = 0;
4406 apiv::VConditionalOutputLayer* mImpl;
4407};
4408
4409inline IIfConditionalOutputLayer::~IIfConditionalOutputLayer() noexcept = default;
4410
4417{
4418public:
4419protected:
4420 virtual ~IIfConditionalInputLayer() noexcept = 0;
4421 apiv::VConditionalInputLayer* mImpl;
4422};
4423
4424inline IIfConditionalInputLayer::~IIfConditionalInputLayer() noexcept = default;
4425
4451{
4452public:
4463 {
4464 return mImpl->setCondition(condition);
4465 }
4466
4480 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4481 {
4482 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4483 }
4484
4493 {
4494 return mImpl->addInput(input);
4495 }
4496
4507 void setName(char const* name) noexcept
4508 {
4509 mImpl->setName(name);
4510 }
4511
4517 char const* getName() const noexcept
4518 {
4519 return mImpl->getName();
4520 }
4521
4522protected:
4523 virtual ~IIfConditional() noexcept = 0;
4524 apiv::VIfConditional* mImpl;
4525};
4526
4527inline IIfConditional::~IIfConditional() noexcept = default;
4528
4537{
4538public:
4544 //
4557 using ILayer::setInput;
4558
4559protected:
4560 virtual ~IRecurrenceLayer() noexcept = 0;
4561 apiv::VRecurrenceLayer* mImpl;
4562};
4563
4564inline IRecurrenceLayer::~IRecurrenceLayer() noexcept = default;
4565
4586{
4587public:
4591 LoopOutput getLoopOutput() const noexcept
4592 {
4593 return mImpl->getLoopOutput();
4594 }
4595
4608 void setAxis(int32_t axis) noexcept
4609 {
4610 mImpl->setAxis(axis);
4611 }
4612
4616 int32_t getAxis() const noexcept
4617 {
4618 return mImpl->getAxis();
4619 }
4620
4626 //
4641 using ILayer::setInput;
4642
4643protected:
4644 virtual ~ILoopOutputLayer() noexcept = 0;
4645 apiv::VLoopOutputLayer* mImpl;
4646};
4647
4648inline ILoopOutputLayer::~ILoopOutputLayer() noexcept = default;
4649
4662{
4663public:
4667 TripLimit getTripLimit() const noexcept
4668 {
4669 return mImpl->getTripLimit();
4670 }
4671
4672protected:
4673 virtual ~ITripLimitLayer() noexcept = 0;
4674 apiv::VTripLimitLayer* mImpl;
4675};
4676
4677inline ITripLimitLayer::~ITripLimitLayer() noexcept = default;
4678
4690{
4691public:
4695 void setAxis(int32_t axis) noexcept
4696 {
4697 mImpl->setAxis(axis);
4698 }
4699
4703 int32_t getAxis() const noexcept
4704 {
4705 return mImpl->getAxis();
4706 }
4707
4717 void setReverse(bool reverse) noexcept
4718 {
4719 mImpl->setReverse(reverse);
4720 }
4721
4727 bool getReverse() const noexcept
4728 {
4729 return mImpl->getReverse();
4730 }
4731
4732protected:
4733 virtual ~IIteratorLayer() noexcept = 0;
4734 apiv::VIteratorLayer* mImpl;
4735};
4736
4737inline IIteratorLayer::~IIteratorLayer() noexcept = default;
4738
4749class ILoop : public INoCopy
4750{
4751public:
4758 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4759 {
4760 return mImpl->addRecurrence(initialValue);
4761 }
4762
4780 {
4781 return mImpl->addTripLimit(tensor, limit);
4782 }
4783
4792 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4793 {
4794 return mImpl->addIterator(tensor, axis, reverse);
4795 }
4796
4805 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4806 {
4807 return mImpl->addLoopOutput(tensor, outputKind, axis);
4808 }
4809
4820 void setName(char const* name) noexcept
4821 {
4822 mImpl->setName(name);
4823 }
4824
4830 char const* getName() const noexcept
4831 {
4832 return mImpl->getName();
4833 }
4834
4835protected:
4836 virtual ~ILoop() noexcept = 0;
4837 apiv::VLoop* mImpl;
4838};
4839
4840inline ILoop::~ILoop() noexcept = default;
4841
4854class ISelectLayer : public ILayer
4855{
4856protected:
4857 virtual ~ISelectLayer() noexcept = 0;
4858 apiv::VSelectLayer* mImpl;
4859};
4860
4861inline ISelectLayer::~ISelectLayer() noexcept = default;
4862
4879{
4880public:
4889 void setMessage(char const* message) noexcept
4890 {
4891 mImpl->setMessage(message);
4892 }
4893
4899 char const* getMessage() const noexcept
4900 {
4901 return mImpl->getMessage();
4902 }
4903
4904protected:
4905 virtual ~IAssertionLayer() noexcept = 0;
4906
4907 apiv::VAssertionLayer* mImpl;
4908};
4909
4910inline IAssertionLayer::~IAssertionLayer() noexcept = default;
4911
4919enum class FillOperation : int32_t
4920{
4937 kLINSPACE = 0,
4938
4941 kRANDOM_UNIFORM = 1,
4942
4945 kRANDOM_NORMAL = 2
4946};
4947
4953template <>
4955{
4956 static constexpr int32_t kVALUE = 3;
4957};
4958
4994class IFillLayer : public ILayer
4995{
4996public:
5005 //
5006 void setDimensions(Dims const& dimensions) noexcept
5007 {
5008 mImpl->setDimensions(dimensions);
5009 }
5010
5021 Dims getDimensions() const noexcept
5022 {
5023 return mImpl->getDimensions();
5024 }
5025
5031 void setOperation(FillOperation op) noexcept
5032 {
5033 mImpl->setOperation(op);
5034 }
5035
5042 {
5043 return mImpl->getOperation();
5044 }
5045
5059 //
5060 void setAlpha(double alpha) noexcept
5061 {
5062 mImpl->setAlpha(alpha);
5063 }
5064
5075 double getAlpha() const noexcept
5076 {
5077 return mImpl->getAlpha();
5078 }
5079
5094 void setBeta(double beta) noexcept
5095 {
5096 mImpl->setBeta(beta);
5097 }
5098
5109 double getBeta() const noexcept
5110 {
5111 return mImpl->getBeta();
5112 }
5113
5154 using ILayer::setInput;
5155
5169 //
5170 void setAlphaInt64(int64_t alpha) noexcept
5171 {
5172 mImpl->setAlphaInt64(alpha);
5173 }
5174
5185 int64_t getAlphaInt64() const noexcept
5186 {
5187 return mImpl->getAlphaInt64();
5188 }
5189
5204 void setBetaInt64(int64_t beta) noexcept
5205 {
5206 mImpl->setBetaInt64(beta);
5207 }
5208
5219 int64_t getBetaInt64() const noexcept
5220 {
5221 return mImpl->getBetaInt64();
5222 }
5223
5227 bool isAlphaBetaInt64() const noexcept
5228 {
5229 return mImpl->isAlphaBetaInt64();
5230 }
5231
5245 void setToType(DataType toType) noexcept
5246 {
5247 mImpl->setToType(toType);
5248 }
5249
5257 DataType getToType() const noexcept
5258 {
5259 return mImpl->getToType();
5260 }
5261
5262protected:
5263 virtual ~IFillLayer() noexcept = 0;
5264 apiv::VFillLayer* mImpl;
5265};
5266
5267inline IFillLayer::~IFillLayer() noexcept = default;
5268
5344{
5345public:
5354 int32_t getAxis() const noexcept
5355 {
5356 return mImpl->getAxis();
5357 }
5365 void setAxis(int32_t axis) noexcept
5366 {
5367 mImpl->setAxis(axis);
5368 }
5369
5378 bool setBlockShape(Dims const& blockShape) noexcept
5379 {
5380 return mImpl->setBlockShape(blockShape);
5381 }
5382
5390 {
5391 return mImpl->getBlockShape();
5392 }
5393
5405 void setToType(DataType toType) noexcept
5406 {
5407 mImpl->setToType(toType);
5408 }
5409
5417 DataType getToType() const noexcept
5418 {
5419 return mImpl->getToType();
5420 }
5421
5422protected:
5423 virtual ~IQuantizeLayer() noexcept = 0;
5424 apiv::VQuantizeLayer* mImpl;
5425};
5426
5427inline IQuantizeLayer::~IQuantizeLayer() noexcept = default;
5428
5498{
5499public:
5508 int32_t getAxis() const noexcept
5509 {
5510 return mImpl->getAxis();
5511 }
5519 void setAxis(int32_t axis) noexcept
5520 {
5521 mImpl->setAxis(axis);
5522 }
5523
5536 bool setBlockShape(Dims const& blockShape) noexcept
5537 {
5538 return mImpl->setBlockShape(blockShape);
5539 }
5540
5548 {
5549 return mImpl->getBlockShape();
5550 }
5551
5563 void setToType(DataType toType) noexcept
5564 {
5565 mImpl->setToType(toType);
5566 }
5567
5575 DataType getToType() const noexcept
5576 {
5577 return mImpl->getToType();
5578 }
5579
5580protected:
5581 virtual ~IDequantizeLayer() noexcept = 0;
5582 apiv::VDequantizeLayer* mImpl;
5583};
5584
5585inline IDequantizeLayer::~IDequantizeLayer() noexcept = default;
5586
5605{
5606public:
5618 using ILayer::setInput;
5619
5632 void setToType(DataType toType) noexcept
5633 {
5634 mImpl->setToType(toType);
5635 }
5636
5645 DataType getToType() const noexcept
5646 {
5647 return mImpl->getToType();
5648 }
5649
5658 void setScaleType(DataType scaleType) noexcept
5659 {
5660 mImpl->setScaleType(scaleType);
5661 }
5662
5671 DataType getScaleType() const noexcept
5672 {
5673 return mImpl->getScaleType();
5674 }
5675
5684 TRT_DEPRECATED void setAxis(int32_t axis) noexcept
5685 {
5686 mImpl->setAxis(axis);
5687 }
5688
5694 TRT_DEPRECATED int32_t getAxis() const noexcept
5695 {
5696 return mImpl->getAxis();
5697 }
5698
5707 TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
5708 {
5709 mImpl->setBlockSize(size);
5710 }
5711
5717 TRT_DEPRECATED int32_t getBlockSize() const noexcept
5718 {
5719 return mImpl->getBlockSize();
5720 }
5721
5730 void setBlockShape(Dims const& blockShape) noexcept
5731 {
5732 mImpl->setBlockShape(blockShape);
5733 }
5734
5742 Dims getBlockShape() const noexcept
5743 {
5744 return mImpl->getBlockShape();
5745 }
5746
5747protected:
5748 virtual ~IDynamicQuantizeLayer() noexcept = 0;
5749 apiv::VDynamicQuantizeLayer* mImpl;
5750};
5751
5752inline IDynamicQuantizeLayer::~IDynamicQuantizeLayer() noexcept = default;
5753
5788class IEinsumLayer : public ILayer
5789{
5790public:
5800 bool setEquation(char const* equation) noexcept
5801 {
5802 return mImpl->setEquation(equation);
5803 }
5804
5810 char const* getEquation() const noexcept
5811 {
5812 return mImpl->getEquation();
5813 }
5814
5815protected:
5816 virtual ~IEinsumLayer() noexcept = 0;
5817 apiv::VEinsumLayer* mImpl;
5818};
5819
5820inline IEinsumLayer::~IEinsumLayer() noexcept = default;
5821
5829enum class ScatterMode : int32_t
5830{
5831 kELEMENT = 0,
5832 kND = 1,
5833};
5834
5840template <>
5842{
5843 static constexpr int32_t kVALUE = 2;
5844};
5845
5903class IScatterLayer : public ILayer
5904{
5905public:
5911 void setMode(ScatterMode mode) noexcept
5912 {
5913 mImpl->setMode(mode);
5914 }
5915
5921 ScatterMode getMode() const noexcept
5922 {
5923 return mImpl->getMode();
5924 }
5925
5931 void setAxis(int32_t axis) noexcept
5932 {
5933 mImpl->setAxis(axis);
5934 }
5935
5939 int32_t getAxis() const noexcept
5940 {
5941 return mImpl->getAxis();
5942 }
5943
5944protected:
5945 apiv::VScatterLayer* mImpl;
5946 virtual ~IScatterLayer() noexcept = 0;
5947}; // class IScatterLayer
5948
5949inline IScatterLayer::~IScatterLayer() noexcept = default;
5950
5978class IOneHotLayer : public ILayer
5979{
5980public:
5986 void setAxis(int32_t axis) noexcept
5987 {
5988 mImpl->setAxis(axis);
5989 }
5990
5994 int32_t getAxis() const noexcept
5995 {
5996 return mImpl->getAxis();
5997 }
5998
5999protected:
6000 apiv::VOneHotLayer* mImpl;
6001 virtual ~IOneHotLayer() noexcept = 0;
6002};
6003
6004inline IOneHotLayer::~IOneHotLayer() noexcept = default;
6005
6018{
6019public:
6026 {
6027 mImpl->setInterpolationMode(mode);
6028 }
6029
6038 {
6039 return mImpl->getInterpolationMode();
6040 }
6041
6047 void setAlignCorners(bool alignCorners) noexcept
6048 {
6049 mImpl->setAlignCorners(alignCorners);
6050 }
6051
6059 bool getAlignCorners() const noexcept
6060 {
6061 return mImpl->getAlignCorners();
6062 }
6063
6071 bool setSampleMode(SampleMode mode) noexcept
6072 {
6073 return mImpl->setSampleMode(mode);
6074 }
6075
6083 SampleMode getSampleMode() const noexcept
6084 {
6085 return mImpl->getSampleMode();
6086 }
6087
6088protected:
6089 apiv::VGridSampleLayer* mImpl;
6090 virtual ~IGridSampleLayer() noexcept = 0;
6091}; // class IGridSampleLayer
6092
6093inline IGridSampleLayer::~IGridSampleLayer() noexcept = default;
6094
6102enum class BoundingBoxFormat : int32_t
6103{
6105 kCORNER_PAIRS = 0,
6107 kCENTER_SIZES = 1
6108};
6109
6115template <>
6117{
6118 static constexpr int32_t kVALUE = 2;
6119};
6120
6171class INMSLayer : public ILayer
6172{
6173public:
6184 {
6185 mImpl->setBoundingBoxFormat(fmt);
6186 }
6187
6196 {
6197 return mImpl->getBoundingBoxFormat();
6198 }
6199
6209 void setTopKBoxLimit(int32_t limit) noexcept
6210 {
6211 mImpl->setTopKBoxLimit(limit);
6212 }
6213
6219 int32_t getTopKBoxLimit() const noexcept
6220 {
6221 return mImpl->getTopKBoxLimit();
6222 }
6223
6242 using ILayer::setInput;
6243
6254 bool setIndicesType(DataType type) noexcept
6255 {
6256 return mImpl->setIndicesType(type);
6257 }
6258
6266 DataType getIndicesType() const noexcept
6267 {
6268 return mImpl->getIndicesType();
6269 }
6270
6271protected:
6272 apiv::VNMSLayer* mImpl;
6273 virtual ~INMSLayer() noexcept = 0;
6274}; // class INMSLayer
6275
6276inline INMSLayer::~INMSLayer() noexcept = default;
6277
6291{
6292public:
6301 void setBatchAxis(int32_t batchAxis) noexcept
6302 {
6303 mImpl->setBatchAxis(batchAxis);
6304 }
6305
6311 int32_t getBatchAxis() const noexcept
6312 {
6313 return mImpl->getBatchAxis();
6314 }
6315
6324 void setSequenceAxis(int32_t sequenceAxis) noexcept
6325 {
6326 mImpl->setSequenceAxis(sequenceAxis);
6327 }
6328
6334 int32_t getSequenceAxis() const noexcept
6335 {
6336 return mImpl->getSequenceAxis();
6337 }
6338
6339protected:
6340 apiv::VReverseSequenceLayer* mImpl;
6341 virtual ~IReverseSequenceLayer() noexcept = 0;
6342}; // class IReverseSequenceLayer
6343
6344inline IReverseSequenceLayer::~IReverseSequenceLayer() noexcept = default;
6345
6365{
6366public:
6374 void setEpsilon(float eps) noexcept
6375 {
6376 return mImpl->setEpsilon(eps);
6377 }
6378
6384 float getEpsilon() const noexcept
6385 {
6386 return mImpl->getEpsilon();
6387 }
6388
6394 void setAxes(uint32_t axesMask) noexcept
6395 {
6396 return mImpl->setAxes(axesMask);
6397 }
6398
6404 uint32_t getAxes() const noexcept
6405 {
6406 return mImpl->getAxes();
6407 }
6408
6425 void setNbGroups(int64_t nbGroups) noexcept
6426 {
6427 return mImpl->setNbGroups(nbGroups);
6428 }
6429
6435 int64_t getNbGroups() const noexcept
6436 {
6437 return mImpl->getNbGroups();
6438 }
6439
6440
6446 TRT_NODISCARD bool isV2() const noexcept
6447 {
6448 return mImpl->isV2();
6449 }
6450
6451protected:
6452 apiv::VNormalizationLayer* mImpl;
6453 virtual ~INormalizationLayer() noexcept = 0;
6454};
6455
6456inline INormalizationLayer::~INormalizationLayer() noexcept = default;
6457
6458
6467class ISqueezeLayer : public ILayer
6468{
6469public:
6482 using ILayer::setInput;
6483
6484protected:
6485 apiv::VSqueezeLayer* mImpl;
6486 virtual ~ISqueezeLayer() noexcept = 0;
6487};
6488
6489inline ISqueezeLayer::~ISqueezeLayer() noexcept = default;
6490
6500{
6501public:
6515 using ILayer::setInput;
6516
6517protected:
6518 apiv::VUnsqueezeLayer* mImpl;
6519 virtual ~IUnsqueezeLayer() noexcept = 0;
6520};
6521
6522inline IUnsqueezeLayer::~IUnsqueezeLayer() noexcept = default;
6523
6535enum class CumulativeOperation : int32_t
6536{
6537 kSUM = 0,
6538};
6539
6545template <>
6547{
6548 static constexpr int32_t kVALUE = 1;
6549};
6550
6579{
6580public:
6591 {
6592 return mImpl->setOperation(op);
6593 }
6594
6603 {
6604 return mImpl->getOperation();
6605 }
6606
6614 void setExclusive(bool exclusive) noexcept
6615 {
6616 mImpl->setExclusive(exclusive);
6617 }
6618
6626 bool getExclusive() const noexcept
6627 {
6628 return mImpl->getExclusive();
6629 }
6630
6638 void setReverse(bool reverse) noexcept
6639 {
6640 mImpl->setReverse(reverse);
6641 }
6642
6650 bool getReverse() const noexcept
6651 {
6652 return mImpl->getReverse();
6653 }
6654
6655protected:
6656 apiv::VCumulativeLayer* mImpl;
6657 virtual ~ICumulativeLayer() noexcept = 0;
6658};
6659
6660inline ICumulativeLayer::~ICumulativeLayer() noexcept = default;
6661
6667enum class AttentionNormalizationOp : int32_t
6668{
6669 kNONE
6670 = 0,
6671 kSOFTMAX = 1,
6672};
6673
6679template <>
6681{
6682 static constexpr int32_t kVALUE = 2;
6683};
6684
6699enum class CausalMaskKind : int32_t
6700{
6702 kNONE = 0,
6703
6705 kUPPER_LEFT = 1,
6706
6708 kLOWER_RIGHT = 2,
6709};
6710
6716template <>
6718{
6719 static constexpr int32_t kVALUE = 3;
6720};
6721
6727enum class AttentionIOForm : int32_t
6728{
6731 kPADDED_BHND = 0,
6734 kPACKED_NHD = 1,
6735};
6736
6742template <>
6744{
6745 static constexpr int32_t kVALUE = 2;
6746};
6747
6758{
6759public:
6763 IAttention* getAttention() const noexcept
6764 {
6765 return mBoundary->getAttention();
6766 }
6767
6768protected:
6769 virtual ~IAttentionBoundaryLayer() noexcept = 0;
6770 apiv::VAttentionBoundaryLayer* mBoundary;
6771};
6772
6773inline IAttentionBoundaryLayer::~IAttentionBoundaryLayer() noexcept = default;
6774
6786{
6787public:
6805 using ILayer::setInput;
6806
6807protected:
6808 virtual ~IAttentionInputLayer() noexcept = 0;
6809 apiv::VAttentionInputLayer* mImpl;
6810};
6811
6812inline IAttentionInputLayer::~IAttentionInputLayer() noexcept = default;
6813
6825{
6826public:
6827protected:
6828 virtual ~IAttentionOutputLayer() noexcept = 0;
6829 apiv::VAttentionOutputLayer* mImpl;
6830};
6831
6832inline IAttentionOutputLayer::~IAttentionOutputLayer() noexcept = default;
6833
6894class IAttention : public INoCopy
6895{
6896public:
6905 {
6906 return mImpl->setNormalizationOperation(op);
6907 }
6908
6917 {
6918 return mImpl->getNormalizationOperation();
6919 }
6920
6933 bool setMask(ITensor& mask) noexcept
6934 {
6935 return mImpl->setMask(mask);
6936 }
6937
6945 ITensor* getMask() noexcept
6946 {
6947 return mImpl->getMask();
6948 }
6949
6963 TRT_DEPRECATED bool setCausal(bool isCausal) noexcept
6964 {
6965 return mImpl->setCausal(isCausal);
6966 }
6967
6977 TRT_DEPRECATED bool getCausal() const noexcept
6978 {
6979 return mImpl->getCausal();
6980 }
6981
6997 bool setCausalKind(CausalMaskKind kind) noexcept
6998 {
6999 return mImpl->setCausalKind(kind);
7000 }
7001
7010 {
7011 return mImpl->getCausalKind();
7012 }
7013
7021 bool setDecomposable(bool decomposable) noexcept
7022 {
7023 return mImpl->setDecomposable(decomposable);
7024 }
7025
7034 bool getDecomposable() const noexcept
7035 {
7036 return mImpl->getDecomposable();
7037 }
7038
7053 bool setInput(int32_t index, ITensor& input) noexcept
7054 {
7055 return mImpl->setInput(index, input);
7056 }
7057
7062 int32_t getNbInputs() const noexcept
7063 {
7064 return mImpl->getNbInputs();
7065 }
7066
7074 ITensor* getInput(int32_t index) const noexcept
7075 {
7076 return mImpl->getInput(index);
7077 }
7078
7082 int32_t getNbOutputs() const noexcept
7083 {
7084 return mImpl->getNbOutputs();
7085 }
7086
7094 ITensor* getOutput(int32_t index) const noexcept
7095 {
7096 return mImpl->getOutput(index);
7097 }
7098
7111 bool setName(char const* name) noexcept
7112 {
7113 return mImpl->setName(name);
7114 }
7115
7123 char const* getName() const noexcept
7124 {
7125 return mImpl->getName();
7126 }
7127
7140 {
7141 return mImpl->setNormalizationQuantizeScale(tensor);
7142 }
7143
7151 {
7152 return mImpl->getNormalizationQuantizeScale();
7153 }
7154
7164 {
7165 return mImpl->setNormalizationQuantizeToType(type);
7166 }
7167
7176 {
7177 return mImpl->getNormalizationQuantizeToType();
7178 }
7179
7195 bool setMetadata(char const* metadata) noexcept
7196 {
7197 return mImpl->setMetadata(metadata);
7198 }
7199
7208 char const* getMetadata() const noexcept
7209 {
7210 return mImpl->getMetadata();
7211 }
7212
7224 bool setNbRanks(int32_t nbRanks) noexcept
7225 {
7226 return mImpl->setNbRanks(nbRanks);
7227 }
7228
7236 int32_t getNbRanks() const noexcept
7237 {
7238 return mImpl->getNbRanks();
7239 }
7240
7254 {
7255 return mImpl->setQueryForm(form);
7256 }
7257
7267 {
7268 return mImpl->getQueryForm();
7269 }
7270
7284 {
7285 return mImpl->setKeyValueForm(form);
7286 }
7287
7297 {
7298 return mImpl->getKeyValueForm();
7299 }
7300
7320 TRT_NODISCARD bool setQueryLengths(ITensor* lengths) noexcept
7321 {
7322 return mImpl->setQueryLengths(lengths);
7323 }
7324
7333 {
7334 return mImpl->getQueryLengths();
7335 }
7336
7360 {
7361 return mImpl->setKeyValueLengths(lengths);
7362 }
7363
7372 {
7373 return mImpl->getKeyValueLengths();
7374 }
7375
7376protected:
7377 apiv::VAttention* mImpl;
7378 virtual ~IAttention() noexcept = 0;
7379};
7380
7381inline IAttention::~IAttention() noexcept = default;
7382
7390{
7391public:
7397 void setInterleaved(bool interleaved) noexcept
7398 {
7399 mImpl->setInterleaved(interleaved);
7400 }
7401
7402
7408 TRT_NODISCARD bool getInterleaved() const noexcept
7409 {
7410 return mImpl->getInterleaved();
7411 }
7412
7413
7419 TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
7420 {
7421 return mImpl->setRotaryEmbeddingDim(rotaryEmbeddingDim);
7422 }
7423
7424
7430 TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
7431 {
7432 return mImpl->getRotaryEmbeddingDim();
7433 }
7434
7435
7449 using ILayer::setInput;
7450
7451protected:
7452 apiv::VRotaryEmbeddingLayer* mImpl;
7453 virtual ~IRotaryEmbeddingLayer() noexcept = 0;
7454};
7455
7456inline IRotaryEmbeddingLayer::~IRotaryEmbeddingLayer() noexcept = default;
7457
7463enum class KVCacheMode : int32_t
7464{
7465 kLINEAR = 0,
7466};
7467
7473template <>
7475{
7476 static constexpr int32_t kVALUE = 1;
7477};
7478
7499{
7500public:
7515 using ILayer::setInput;
7516
7524 bool setCacheMode(KVCacheMode cacheMode) noexcept
7525 {
7526 return mImpl->setCacheMode(cacheMode);
7527 }
7528
7534 KVCacheMode getCacheMode() const noexcept
7535 {
7536 return mImpl->getCacheMode();
7537 }
7538
7553 {
7554 return mImpl->setUpdateForm(form);
7555 }
7556
7566 {
7567 return mImpl->getUpdateForm();
7568 }
7569
7588 {
7589 return mImpl->setUpdateLengths(lengths);
7590 }
7591
7600 {
7601 return mImpl->getUpdateLengths();
7602 }
7603
7604protected:
7605 apiv::VKVCacheUpdateLayer* mImpl;
7606 virtual ~IKVCacheUpdateLayer() noexcept = 0;
7607};
7608
7609inline IKVCacheUpdateLayer::~IKVCacheUpdateLayer() noexcept = default;
7610
7616enum class MoEActType : int32_t
7617{
7618 kNONE = 0,
7619 kSILU = 1,
7620};
7621
7627template <>
7629{
7630 static constexpr int32_t kVALUE = 2;
7631};
7632
7633
7749class IMoELayer : public ILayer
7750{
7751public:
7763 void setGatedWeights(ITensor& fcGateWeights, ITensor& fcUpWeights, ITensor& fcDownWeights, MoEActType activationType) noexcept
7764 {
7765 mImpl->setGatedWeights(fcGateWeights, fcUpWeights, fcDownWeights, activationType);
7766 }
7767
7775 void setGatedBiases(ITensor& fcGateBiases, ITensor& fcUpBiases, ITensor& fcDownBiases) noexcept
7776 {
7777 mImpl->setGatedBiases(fcGateBiases, fcUpBiases, fcDownBiases);
7778 }
7779
7787 void setActivationType(MoEActType activationType) noexcept
7788 {
7789 mImpl->setActivationType(activationType);
7790 }
7791
7800 {
7801 return mImpl->getActivationType();
7802 }
7803
7825 void setQuantizationStatic(ITensor& fcDownActivationScale, DataType dataType) noexcept
7826 {
7827 mImpl->setQuantizationStatic(fcDownActivationScale, dataType);
7828 }
7829
7858 void setQuantizationDynamicDblQ(ITensor& fcDownActivationDblQScale, DataType dataType, Dims const& blockShape, DataType dynQOutputScaleType) noexcept
7859 {
7860 mImpl->setQuantizationDynamicDblQ(fcDownActivationDblQScale, dataType, blockShape, dynQOutputScaleType);
7861 }
7862
7874 {
7875 mImpl->setQuantizationToType(type);
7876 }
7877
7886 {
7887 return mImpl->getQuantizationToType();
7888 }
7889
7901 void setQuantizationBlockShape(Dims const& blockShape) noexcept
7902 {
7903 mImpl->setQuantizationBlockShape(blockShape);
7904 }
7905
7914 {
7915 return mImpl->getQuantizationBlockShape();
7916 }
7917
7926 {
7927 mImpl->setDynQOutputScaleType(type);
7928 }
7929
7938 {
7939 return mImpl->getDynQOutputScaleType();
7940 }
7941
7958 void setSwigluParams(float limit, float alpha, float beta) noexcept
7959 {
7960 mImpl->setSwigluParams(limit, alpha, beta);
7961 }
7962
7972 void setSwigluParamLimit(float limit) noexcept
7973 {
7974 mImpl->setSwigluParamLimit(limit);
7975 }
7976
7984 float getSwigluParamLimit() const noexcept
7985 {
7986 return mImpl->getSwigluParamLimit();
7987 }
7988
7998 void setSwigluParamAlpha(float alpha) noexcept
7999 {
8000 mImpl->setSwigluParamAlpha(alpha);
8001 }
8002
8010 float getSwigluParamAlpha() const noexcept
8011 {
8012 return mImpl->getSwigluParamAlpha();
8013 }
8014
8024 void setSwigluParamBeta(float beta) noexcept
8025 {
8026 mImpl->setSwigluParamBeta(beta);
8027 }
8028
8036 float getSwigluParamBeta() const noexcept
8037 {
8038 return mImpl->getSwigluParamBeta();
8039 }
8040
8053 void setInput(int32_t index, ITensor& tensor) noexcept
8054 {
8055 mImpl->setInput(index, tensor);
8056 }
8057
8058 using ILayer::setInput;
8059
8060protected:
8061 virtual ~IMoELayer() noexcept = 0;
8062 apiv::VMoELayer* mImpl;
8063};
8064
8065inline IMoELayer::~IMoELayer() noexcept = default;
8066
8075{
8076protected:
8077 virtual ~IDistCollectiveLayer() noexcept = 0;
8078 apiv::VDistCollectiveLayer* mImpl;
8079}; // class IDistCollectiveLayer
8080
8081inline IDistCollectiveLayer::~IDistCollectiveLayer() noexcept = default;
8082
8101{
8102public:
8103 virtual ~INetworkDefinition() noexcept = 0;
8104
8140 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
8141 {
8142 return mImpl->addInput(name, type, dimensions);
8143 }
8144
8154 void markOutput(ITensor& tensor) noexcept
8155 {
8156 mImpl->markOutput(tensor);
8157 }
8158
8172 bool markDebug(ITensor& tensor) noexcept
8173 {
8174 return mImpl->markDebug(tensor);
8175 }
8176
8188 bool unmarkDebug(ITensor& tensor) noexcept
8189 {
8190 return mImpl->unmarkDebug(tensor);
8191 }
8192
8198 bool isDebugTensor(ITensor const& tensor) const noexcept
8199 {
8200 return mImpl->isDebugTensor(tensor);
8201 }
8202
8221 {
8222 return mImpl->markUnfusedTensorsAsDebugTensors();
8223 }
8224
8235 {
8236 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
8237 }
8238
8255 {
8256 return mImpl->addActivation(input, type);
8257 }
8258
8273 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
8274 {
8275 return mImpl->addLRN(input, window, alpha, beta, k);
8276 }
8277
8299 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
8300 {
8301 return mImpl->addScale(input, mode, shift, scale, power);
8302 }
8303
8313 {
8314 return mImpl->addSoftMax(input);
8315 }
8316
8329 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
8330 {
8331 return mImpl->addConcatenation(inputs, nbInputs);
8332 }
8333
8357 {
8358 return mImpl->addElementWise(input1, input2, op);
8359 }
8360
8378 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
8379 {
8380 return mImpl->addUnary(input, operation);
8381 }
8382
8393 {
8394 return mImpl->addShuffle(input);
8395 }
8396
8409 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
8410 {
8411 return mImpl->addOneHot(indices, values, depth, axis);
8412 }
8413
8421 int32_t getNbLayers() const noexcept
8422 {
8423 return mImpl->getNbLayers();
8424 }
8425
8435 ILayer* getLayer(int32_t index) const noexcept
8436 {
8437 return mImpl->getLayer(index);
8438 }
8439
8447 int32_t getNbInputs() const noexcept
8448 {
8449 return mImpl->getNbInputs();
8450 }
8451
8463 ITensor* getInput(int32_t index) const noexcept
8464 {
8465 return mImpl->getInput(index);
8466 }
8467
8477 int32_t getNbOutputs() const noexcept
8478 {
8479 return mImpl->getNbOutputs();
8480 }
8481
8493 ITensor* getOutput(int32_t index) const noexcept
8494 {
8495 return mImpl->getOutput(index);
8496 }
8497
8520 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
8521 {
8522 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
8523 }
8524
8555 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
8556 {
8557 return mImpl->addTopK(input, op, k, reduceAxes);
8558 }
8559
8588 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
8589 {
8590 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
8591 }
8592
8604 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
8605 {
8606 return mImpl->addGather(data, indices, axis);
8607 }
8608
8620 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
8621 {
8622 return mImpl->addGatherV2(data, indices, mode);
8623 }
8624
8640 {
8641 return mImpl->addRaggedSoftMax(input, bounds);
8642 }
8643
8661 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
8662 {
8663 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
8664 }
8665
8680 {
8681 return mImpl->addNonZero(input);
8682 }
8683
8695 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
8696 {
8697 return mImpl->addNonZeroV2(input, indicesType);
8698 }
8699
8719 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
8720 {
8721 return mImpl->addConstant(dimensions, weights);
8722 }
8723
8734 {
8735 return mImpl->addIdentity(input);
8736 }
8737
8748 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
8749 {
8750 return mImpl->addCast(input, toType);
8751 }
8752
8763 void removeTensor(ITensor& tensor) noexcept
8764 {
8765 mImpl->removeTensor(tensor);
8766 }
8767
8775 void unmarkOutput(ITensor& tensor) noexcept
8776 {
8777 mImpl->unmarkOutput(tensor);
8778 }
8779
8794 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
8795 {
8796 return mImpl->addSlice(input, start, size, stride);
8797 }
8798
8818 void setName(char const* name) noexcept
8819 {
8820 mImpl->setName(name);
8821 }
8822
8832 char const* getName() const noexcept
8833 {
8834 return mImpl->getName();
8835 }
8836
8848 IShapeLayer* addShape(ITensor& input) noexcept
8849 {
8850 return mImpl->addShape(input);
8851 }
8852
8859 {
8860 return mImpl->getFlags();
8861 }
8862
8870 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8871 {
8872 return mImpl->getFlag(networkDefinitionCreationFlag);
8873 }
8874
8887 bool markOutputForShapes(ITensor& tensor) noexcept
8888 {
8889 return mImpl->markOutputForShapes(tensor);
8890 }
8891
8899 bool unmarkOutputForShapes(ITensor& tensor) noexcept
8900 {
8901 return mImpl->unmarkOutputForShapes(tensor);
8902 }
8903
8918 {
8919 return mImpl->addParametricReLU(input, slope);
8920 }
8921
8940 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8941 {
8942 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8943 }
8944
8959 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
8960 {
8961 return mImpl->addPoolingNd(input, type, windowSize);
8962 }
8963
8978 //
8982 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8983 {
8984 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8985 }
8986
9019 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
9020 {
9021 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
9022 }
9023
9036 {
9037 return mImpl->addResize(input);
9038 }
9039
9049 ILoop* addLoop() noexcept
9050 {
9051 return mImpl->addLoop();
9052 }
9053
9065 {
9066 return mImpl->addIfConditional();
9067 }
9068
9103 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
9104 {
9105 return mImpl->addSelect(condition, thenInput, elseInput);
9106 }
9107
9120 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
9121 {
9122 return mImpl->addAssertion(condition, message);
9123 }
9124
9146 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
9147 {
9148 return mImpl->addFillV2(dimensions, op, outputType);
9149 }
9150
9162 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
9163 {
9164 return mImpl->addPaddingNd(input, prePadding, postPadding);
9165 }
9166
9186 bool setWeightsName(Weights weights, char const* name) noexcept
9187 {
9188 return mImpl->setWeightsName(weights, name);
9189 }
9190
9202 //
9205 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9206 {
9207 mImpl->setErrorRecorder(recorder);
9208 }
9209
9221 {
9222 return mImpl->getErrorRecorder();
9223 }
9224
9243 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9244 {
9245 return mImpl->addDequantizeV2(input, scale, outputType);
9246 }
9247
9263 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
9264 {
9265 return mImpl->addScatter(data, indices, updates, mode);
9266 }
9267
9287 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
9288 {
9289 return mImpl->addQuantizeV2(input, scale, outputType);
9290 }
9291
9315 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
9316 {
9317 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
9318 }
9319
9339 ITensor& input, Dims const& blockShape, DataType outputType, DataType scaleType) noexcept
9340 {
9341 return mImpl->addDynamicQuantizeV2(input, blockShape, outputType, scaleType);
9342 }
9343
9354 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
9355 {
9356 return mImpl->addEinsum(inputs, nbInputs, equation);
9357 }
9358
9373 {
9374 return mImpl->addGridSample(input, grid);
9375 }
9376
9394 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
9395 {
9396 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
9397 }
9398
9414 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
9415 {
9416 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
9417 }
9418
9432 {
9433 return mImpl->addReverseSequence(input, sequenceLens);
9434 }
9435
9463 TRT_DEPRECATED INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9464 {
9465 return mImpl->addNormalization(input, scale, bias, axesMask);
9466 }
9467
9485 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
9486 {
9487 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
9488 }
9489
9516 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
9517 {
9518 return mImpl->addAttention(query, key, value, normOp, causal);
9519 }
9520
9546 CausalMaskKind causalKind) noexcept
9547 {
9548 return mImpl->addAttentionV2(query, key, value, normOp, causalKind);
9549 }
9550
9570 IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
9571 {
9572 return mImpl->addRotaryEmbedding(input, cosCache, sinCache, interleaved, rotaryEmbeddingDim);
9573 }
9574
9605 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept
9606 {
9607 return mImpl->addKVCacheUpdate(cache, update, writeIndices, cacheMode);
9608 }
9609
9626 IMoELayer* addMoE(ITensor& hiddenStates, ITensor& selectedExpertsForTokens, ITensor& scoresForSelectedExperts) noexcept
9627 {
9628 return mImpl->addMoE(hiddenStates, selectedExpertsForTokens, scoresForSelectedExperts);
9629 }
9630
9659 ReduceOperation reduceOp, int64_t root, int64_t* groups, int64_t groupSize) noexcept
9660 {
9661 return mImpl->addDistCollective(input, distCollectiveOp, reduceOp, root, groups, groupSize);
9662 }
9663
9670 virtual IBuilder& getBuilder() const noexcept
9671 {
9672 return mImpl->getBuilder();
9673 }
9674
9683 bool markWeightsRefittable(char const* name) noexcept
9684 {
9685 return mImpl->markWeightsRefittable(name);
9686 }
9687
9695 bool unmarkWeightsRefittable(char const* name) noexcept
9696 {
9697 return mImpl->unmarkWeightsRefittable(name);
9698 }
9699
9708 bool areWeightsMarkedRefittable(char const* name) const noexcept
9709 {
9710 return mImpl->areWeightsMarkedRefittable(name);
9711 }
9712
9727 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
9728 {
9729 return mImpl->addSqueeze(input, axes);
9730 }
9731
9749 {
9750 return mImpl->addUnsqueeze(input, axes);
9751 }
9752
9774 TRT_NODISCARD INormalizationLayer* addNormalizationV2(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9775 {
9776 return mImpl->addNormalizationV2(input, scale, bias, axesMask);
9777 }
9778
9779protected:
9780 apiv::VNetworkDefinition* mImpl;
9781};
9782
9783inline INetworkDefinition::~INetworkDefinition() noexcept = default;
9784
9802enum class RuntimePlatform : int32_t
9803{
9806 kSAME_AS_BUILD = 0,
9807
9810 kWINDOWS_AMD64 = 1,
9811
9812
9813};
9814
9820template <>
9822{
9823 static constexpr int32_t kVALUE = 2;
9824};
9825
9832using BuilderFlags = uint32_t;
9833
9841enum class BuilderFlag : int32_t
9842{
9843
9845 kDEBUG = 2,
9846
9848 kGPU_FALLBACK = 3,
9849
9851 kREFIT = 4,
9852
9855
9859 kTF32 = 6,
9860
9862 kSPARSE_WEIGHTS = 7,
9863
9876
9877
9883
9890
9896
9897
9901
9902
9908
9910 kSTRIP_PLAN = 18,
9911
9918 kREFIT_IDENTICAL = 19,
9919
9945 kWEIGHT_STREAMING = 20,
9946
9947
9952 kREFIT_INDIVIDUAL = 22,
9953
9962 kSTRICT_NANS = 23,
9963
9965 kMONITOR_MEMORY = 24,
9966
9967
9970
9982
9990
9991};
9992
9998template <>
10000{
10001 static constexpr int32_t kVALUE = 29;
10002};
10003
10004namespace v_1_0
10005{
10021{
10022 uint8_t data[16];
10023};
10024
10035{
10037 uint64_t tacticHash;
10041 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
10042};
10043} // namespace v_1_0
10044
10061{
10062public:
10063 virtual ~ITimingCache() noexcept = 0;
10064
10074 nvinfer1::IHostMemory* serialize() const noexcept
10075 {
10076 return mImpl->serialize();
10077 }
10078
10098 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
10099 {
10100 return mImpl->combine(inputCache, ignoreMismatch);
10101 }
10102
10108 bool reset() noexcept
10109 {
10110 return mImpl->reset();
10111 }
10112
10127 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
10128 {
10129 return mImpl->queryKeys(keyBuffer, capacity);
10130 }
10131
10144 TimingCacheValue query(TimingCacheKey const& key) const noexcept
10145 {
10146 return mImpl->query(key);
10147 }
10148
10166 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
10167 {
10168 return mImpl->update(key, value);
10169 }
10170
10171protected:
10172 apiv::VTimingCache* mImpl;
10173};
10174
10175inline ITimingCache::~ITimingCache() noexcept = default;
10176
10184enum class MemoryPoolType : int32_t
10185{
10191 kWORKSPACE = 0,
10192
10200
10206 kDLA_LOCAL_DRAM = 2,
10207
10213 kDLA_GLOBAL_DRAM = 3,
10214
10222 kTACTIC_DRAM = 4,
10223
10237};
10238
10244template <>
10246{
10247 static constexpr int32_t kVALUE = 6;
10248};
10249
10258enum class PreviewFeature : int32_t
10259{
10264
10271};
10272
10278template <>
10280{
10281 static constexpr int32_t kVALUE = 2;
10282};
10283
10292enum class HardwareCompatibilityLevel : int32_t
10293{
10296 kNONE = 0,
10297
10309 kAMPERE_PLUS = 1,
10310
10320};
10321
10327template <>
10329{
10330 static constexpr int32_t kVALUE = 3;
10331};
10332
10338enum class ComputeCapability : int32_t
10339{
10341 kNONE = 0,
10343 kCURRENT = 1,
10345 kSM75 = 75,
10347 kSM80 = 80,
10349 kSM86 = 86,
10351 kSM89 = 89,
10353 kSM120 = 120,
10355 kSM121 = 121,
10356};
10357
10366enum class TilingOptimizationLevel : int32_t
10367{
10369 kNONE = 0,
10370
10372 kFAST = 1,
10373
10376 kMODERATE = 2,
10377
10379 kFULL = 3
10380
10381};
10382
10388template <>
10390{
10391 static constexpr int32_t kVALUE = 4;
10392};
10393
10394namespace v_1_0
10395{
10397{
10398public:
10399 IProgressMonitor() = default;
10400 virtual ~IProgressMonitor() noexcept = default;
10401
10405 InterfaceInfo getInterfaceInfo() const noexcept override
10406 {
10407 return InterfaceInfo{"IProgressMonitor", 1, 0};
10408 }
10409
10429 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10430
10443 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10444
10456 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10457
10458}; // class IProgressMonitor
10459} // namespace v_1_0
10460
10481
10490{
10491public:
10492 virtual ~IBuilderConfig() noexcept = 0;
10493
10502 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10503 {
10504 mImpl->setAvgTimingIterations(avgTiming);
10505 }
10506
10514 int32_t getAvgTimingIterations() const noexcept
10515 {
10516 return mImpl->getAvgTimingIterations();
10517 }
10518
10527 void setEngineCapability(EngineCapability capability) noexcept
10528 {
10529 mImpl->setEngineCapability(capability);
10530 }
10531
10540 {
10541 return mImpl->getEngineCapability();
10542 }
10543
10556 void setFlags(BuilderFlags builderFlags) noexcept
10557 {
10558 mImpl->setFlags(builderFlags);
10559 }
10560
10568 BuilderFlags getFlags() const noexcept
10569 {
10570 return mImpl->getFlags();
10571 }
10572
10580 void clearFlag(BuilderFlag builderFlag) noexcept
10581 {
10582 mImpl->clearFlag(builderFlag);
10583 }
10584
10592 void setFlag(BuilderFlag builderFlag) noexcept
10593 {
10594 mImpl->setFlag(builderFlag);
10595 }
10596
10604 bool getFlag(BuilderFlag builderFlag) const noexcept
10605 {
10606 return mImpl->getFlag(builderFlag);
10607 }
10608
10621 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10622 {
10623 mImpl->setDeviceType(layer, deviceType);
10624 }
10625
10631 DeviceType getDeviceType(ILayer const* layer) const noexcept
10632 {
10633 return mImpl->getDeviceType(layer);
10634 }
10635
10643 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10644 {
10645 return mImpl->isDeviceTypeSet(layer);
10646 }
10647
10653 void resetDeviceType(ILayer const* layer) noexcept
10654 {
10655 mImpl->resetDeviceType(layer);
10656 }
10657
10663 bool canRunOnDLA(ILayer const* layer) const noexcept
10664 {
10665 return mImpl->canRunOnDLA(layer);
10666 }
10667
10679 void setDLACore(int32_t dlaCore) noexcept
10680 {
10681 mImpl->setDLACore(dlaCore);
10682 }
10683
10689 int32_t getDLACore() const noexcept
10690 {
10691 return mImpl->getDLACore();
10692 }
10693
10700 void setDefaultDeviceType(DeviceType deviceType) noexcept
10701 {
10702 mImpl->setDefaultDeviceType(deviceType);
10703 }
10704
10711 {
10712 return mImpl->getDefaultDeviceType();
10713 }
10714
10720 void reset() noexcept
10721 {
10722 mImpl->reset();
10723 }
10724
10732 void setProfileStream(const cudaStream_t stream) noexcept
10733 {
10734 return mImpl->setProfileStream(stream);
10735 }
10736
10744 cudaStream_t getProfileStream() const noexcept
10745 {
10746 return mImpl->getProfileStream();
10747 }
10748
10761 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10762 {
10763 return mImpl->addOptimizationProfile(profile);
10764 }
10765
10774 int32_t getNbOptimizationProfiles() const noexcept
10775 {
10776 return mImpl->getNbOptimizationProfiles();
10777 }
10778
10787 {
10788 mImpl->setProfilingVerbosity(verbosity);
10789 }
10790
10800 {
10801 return mImpl->getProfilingVerbosity();
10802 }
10803
10821 bool setTacticSources(TacticSources tacticSources) noexcept
10822 {
10823 return mImpl->setTacticSources(tacticSources);
10824 }
10825
10837 {
10838 return mImpl->getTacticSources();
10839 }
10840
10858 TRT_DEPRECATED nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
10859 {
10860 return mImpl->createTimingCache(blob, size);
10861 }
10862
10883 TRT_DEPRECATED bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
10884 {
10885 return mImpl->setTimingCache(cache, ignoreMismatch);
10886 }
10887
10896 {
10897 return mImpl->getTimingCache();
10898 }
10899
10927 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
10928 {
10929 mImpl->setMemoryPoolLimit(pool, poolSize);
10930 }
10931
10946 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
10947 {
10948 return mImpl->getMemoryPoolLimit(pool);
10949 }
10950
10964 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
10965 {
10966 mImpl->setPreviewFeature(feature, enable);
10967 }
10968
10978 bool getPreviewFeature(PreviewFeature feature) const noexcept
10979 {
10980 return mImpl->getPreviewFeature(feature);
10981 }
10982
11011 void setBuilderOptimizationLevel(int32_t level) noexcept
11012 {
11013 mImpl->setBuilderOptimizationLevel(level);
11014 }
11015
11024 {
11025 return mImpl->getBuilderOptimizationLevel();
11026 }
11027
11040 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
11041 {
11042 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
11043 }
11044
11054 {
11055 return mImpl->getHardwareCompatibilityLevel();
11056 }
11057
11066 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
11067 {
11068 mImpl->setPluginsToSerialize(paths, nbPaths);
11069 }
11070
11079 char const* getPluginToSerialize(int32_t index) const noexcept
11080 {
11081 return mImpl->getPluginToSerialize(index);
11082 }
11083
11089 int32_t getNbPluginsToSerialize() const noexcept
11090 {
11091 return mImpl->getNbPluginsToSerialize();
11092 }
11093
11120 bool setMaxAuxStreams(int32_t nbStreams) noexcept
11121 {
11122 return mImpl->setMaxAuxStreams(nbStreams);
11123 }
11124
11130 int32_t getMaxAuxStreams() const noexcept
11131 {
11132 return mImpl->getMaxAuxStreams();
11133 }
11134
11146 void setProgressMonitor(IProgressMonitor* monitor) noexcept
11147 {
11148 return mImpl->setProgressMonitor(monitor);
11149 }
11150
11157 {
11158 return mImpl->getProgressMonitor();
11159 }
11160
11172 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
11173 {
11174 mImpl->setRuntimePlatform(runtimePlatform);
11175 }
11176
11185 {
11186 return mImpl->getRuntimePlatform();
11187 }
11188
11196 void setMaxNbTactics(int32_t maxNbTactics) noexcept
11197 {
11198 mImpl->setMaxNbTactics(maxNbTactics);
11199 }
11200
11208 int32_t getMaxNbTactics() const noexcept
11209 {
11210 return mImpl->getMaxNbTactics();
11211 }
11212
11225 {
11226 return mImpl->setTilingOptimizationLevel(level);
11227 }
11228
11237 {
11238 return mImpl->getTilingOptimizationLevel();
11239 }
11240
11252 bool setL2LimitForTiling(int64_t size) noexcept
11253 {
11254 return mImpl->setL2LimitForTiling(size);
11255 }
11256
11264 int64_t getL2LimitForTiling() const noexcept
11265 {
11266 return mImpl->getL2LimitForTiling();
11267 }
11268
11283 bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
11284 {
11285 return mImpl->setNbComputeCapabilities(maxNbComputeCapabilities);
11286 }
11287
11295 int32_t getNbComputeCapabilities() const noexcept
11296 {
11297 return mImpl->getNbComputeCapabilities();
11298 }
11299
11313 bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
11314 {
11315 return mImpl->setComputeCapability(computeCapability, index);
11316 }
11317
11327 ComputeCapability getComputeCapability(int32_t index) const noexcept
11328 {
11329 return mImpl->getComputeCapability(index);
11330 }
11331
11332protected:
11333 apiv::VBuilderConfig* mImpl;
11334};
11335
11336inline IBuilderConfig::~IBuilderConfig() noexcept = default;
11337
11346
11356{
11365};
11366
11372template <>
11374{
11375 static constexpr int32_t kVALUE = 1;
11376};
11377
11385class IBuilder : public INoCopy
11386{
11387public:
11388 virtual ~IBuilder() noexcept = 0;
11389
11397 int32_t getMaxDLABatchSize() const noexcept
11398 {
11399 return mImpl->getMaxDLABatchSize();
11400 }
11401
11405 int32_t getNbDLACores() const noexcept
11406 {
11407 return mImpl->getNbDLACores();
11408 }
11409
11423 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11424 {
11425 mImpl->setGpuAllocator(allocator);
11426 }
11427
11438 {
11439 return mImpl->createBuilderConfig();
11440 }
11441
11464 {
11465 return mImpl->createNetworkV2(flags);
11466 }
11467
11479 {
11480 return mImpl->createOptimizationProfile();
11481 }
11482
11497 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11498 {
11499 mImpl->setErrorRecorder(recorder);
11500 }
11501
11513 {
11514 return mImpl->getErrorRecorder();
11515 }
11516
11520 void reset() noexcept
11521 {
11522 mImpl->reset();
11523 }
11524
11540 {
11541 return mImpl->buildSerializedNetwork(network, config);
11542 }
11543
11561 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11562 {
11563 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11564 }
11565
11566
11588 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11589 {
11590 return mImpl->isNetworkSupported(network, config);
11591 }
11592
11598 ILogger* getLogger() const noexcept
11599 {
11600 return mImpl->getLogger();
11601 }
11602
11614 bool setMaxThreads(int32_t maxThreads) noexcept
11615 {
11616 return mImpl->setMaxThreads(maxThreads);
11617 }
11618
11628 int32_t getMaxThreads() const noexcept
11629 {
11630 return mImpl->getMaxThreads();
11631 }
11632
11639 {
11640 return mImpl->getPluginRegistry();
11641 }
11642
11643protected:
11644 apiv::VBuilder* mImpl;
11645};
11646
11647inline IBuilder::~IBuilder() noexcept = default;
11648
11649} // namespace nvinfer1
11650
11655extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11656
11657namespace nvinfer1
11658{
11659namespace
11660{
11661
11669inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11670{
11671 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11672}
11673
11674} // namespace
11675
11688 nvinfer1::EngineCapability capability) noexcept;
11689
11699extern "C" TENSORRTAPI bool setInternalLibraryPath(AsciiChar const* path) noexcept;
11700
11701namespace safe
11702{
11704class IPluginRegistry;
11705} // namespace safe
11706
11707
11708} // namespace nvinfer1
11709
11710#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:222
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:225
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:4879
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4889
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4899
virtual ~IAssertionLayer() noexcept=0
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6758
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6763
virtual ~IAttentionBoundaryLayer() noexcept=0
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6895
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:6945
bool setMetadata(char const *metadata) noexcept
Set the metadata for IAttention.
Definition: NvInfer.h:7195
TRT_NODISCARD bool setQueryLengths(ITensor *lengths) noexcept
Set the query lengths tensor.
Definition: NvInfer.h:7320
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:7021
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7111
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7034
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7074
CausalMaskKind getCausalKind() const noexcept
Get the causal mask alignment orientation for the attention.
Definition: NvInfer.h:7009
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7094
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7082
bool setNbRanks(int32_t nbRanks) noexcept
Set the number of ranks for multi-device attention execution.
Definition: NvInfer.h:7224
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7062
TRT_NODISCARD bool setKeyValueLengths(ITensor *lengths) noexcept
Set the key-value lengths tensor.
Definition: NvInfer.h:7359
TRT_NODISCARD ITensor * getKeyValueLengths() const noexcept
Get the key-value lengths tensor.
Definition: NvInfer.h:7371
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6904
TRT_NODISCARD AttentionIOForm getKeyValueForm() const noexcept
Get the key-value form.
Definition: NvInfer.h:7296
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7123
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7163
int32_t getNbRanks() const noexcept
Get the number of ranks for multi-device execution.
Definition: NvInfer.h:7236
TRT_DEPRECATED bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:6977
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6916
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7139
bool setCausalKind(CausalMaskKind kind) noexcept
Set the causal mask alignment orientation for the attention.
Definition: NvInfer.h:6997
TRT_NODISCARD AttentionIOForm getQueryForm() const noexcept
Get the query form.
Definition: NvInfer.h:7266
char const * getMetadata() const noexcept
Get the metadata of IAttention.
Definition: NvInfer.h:7208
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7175
TRT_NODISCARD bool setQueryForm(AttentionIOForm form) noexcept
Set the query form.
Definition: NvInfer.h:7253
virtual ~IAttention() noexcept=0
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7150
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7053
TRT_NODISCARD ITensor * getQueryLengths() const noexcept
Get the query lengths tensor.
Definition: NvInfer.h:7332
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6933
TRT_NODISCARD bool setKeyValueForm(AttentionIOForm form) noexcept
Set the key-value form.
Definition: NvInfer.h:7283
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:6963
apiv::VAttention * mImpl
Definition: NvInfer.h:7377
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6786
virtual ~IAttentionInputLayer() noexcept=0
This layer represents an output of an IAttention.
Definition: NvInfer.h:6825
virtual ~IAttentionOutputLayer() noexcept=0
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10490
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:10927
bool setComputeCapability(ComputeCapability computeCapability, int32_t index) noexcept
Set one compute capability for runtime execution.
Definition: NvInfer.h:11313
bool setNbComputeCapabilities(int32_t maxNbComputeCapabilities) noexcept
Set the number of compute capabilities.
Definition: NvInfer.h:11283
TRT_DEPRECATED bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:10883
bool setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11120
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:10964
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10978
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:11023
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:10821
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:11066
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:11224
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11252
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:10946
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10689
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:11089
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10621
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10527
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:11130
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10604
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:11196
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11264
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:11146
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10786
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10774
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10720
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:11079
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10539
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:11184
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10710
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:11172
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:11208
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10568
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10556
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:10836
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10653
ComputeCapability getComputeCapability(int32_t index) const noexcept
Get one compute capability for runtime execution.
Definition: NvInfer.h:11327
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10679
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:11053
int32_t getNbComputeCapabilities() const noexcept
Get the number of compute capabilities.
Definition: NvInfer.h:11295
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10580
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10761
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:11156
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11333
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10514
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:10700
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10592
TRT_DEPRECATED nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:10858
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10631
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10663
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10744
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:11040
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11236
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10799
TRT_DEPRECATED nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:10895
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10643
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:11011
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10732
Builds an engine from a network definition.
Definition: NvInfer.h:11386
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11405
virtual ~IBuilder() noexcept=0
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11512
apiv::VBuilder * mImpl
Definition: NvInfer.h:11644
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11598
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:11588
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11628
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11638
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11478
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11423
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11463
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11437
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11520
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11614
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11497
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11539
bool buildSerializedNetworkToStream(INetworkDefinition &network, IBuilderConfig &config, IStreamWriter &writer) noexcept
Builds and serializes a network into stream for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11560
A cast layer in a network.
Definition: NvInfer.h:3720
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3746
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3740
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3729
virtual ~ICastLayer() noexcept=0
A concatenation layer in a network definition.
Definition: NvInfer.h:1833
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:1846
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:1856
virtual ~IConcatenationLayer() noexcept=0
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4383
virtual ~IConditionLayer() noexcept=0
Layer that represents a constant value.
Definition: NvInfer.h:3761
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3771
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3781
virtual ~IConstantLayer() noexcept=0
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3793
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3811
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3805
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:6579
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6590
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6638
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6656
virtual ~ICumulativeLayer() noexcept=0
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6626
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6650
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6614
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6602
A deconvolution layer in a network definition.
Definition: NvInfer.h:1876
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:1964
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:1925
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:1949
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:1991
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2106
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2172
virtual ~IDeconvolutionLayer() noexcept=0
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:1974
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:1939
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1895
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2096
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2028
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2079
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2018
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2069
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2124
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:1885
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2136
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2162
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2042
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:1915
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2001
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2054
A Dequantize layer in a network definition.
Definition: NvInfer.h:5498
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5547
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5563
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5508
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5536
virtual ~IDequantizeLayer() noexcept=0
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5575
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5519
Definition: NvInfer.h:8075
virtual ~IDistCollectiveLayer() noexcept=0
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5605
virtual ~IDynamicQuantizeLayer() noexcept=0
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5671
TRT_DEPRECATED void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5684
TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5707
Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5742
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5658
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5645
TRT_DEPRECATED int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5694
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5632
void setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5730
TRT_DEPRECATED int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5717
An Einsum layer in a network.
Definition: NvInfer.h:5789
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:5800
virtual ~IEinsumLayer() noexcept=0
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5810
A elementwise layer in a network definition.
Definition: NvInfer.h:2245
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2274
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2268
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2256
virtual ~IElementWiseLayer() noexcept=0
Generate a tensor according to a specified mode.
Definition: NvInfer.h:4995
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5227
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5041
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5031
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5257
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5170
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5204
virtual ~IFillLayer() noexcept=0
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5094
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5185
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5219
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5075
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5006
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5060
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5245
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5021
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5109
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2380
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:2391
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2426
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2462
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:2436
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2446
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2403
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2456
A GridSample layer in a network definition.
Definition: NvInfer.h:6018
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6025
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6071
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6047
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6089
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6083
virtual ~IGridSampleLayer() noexcept=0
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6037
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6059
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:139
A layer that represents the identity function.
Definition: NvInfer.h:3705
virtual ~IIdentityLayer() noexcept=0
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3707
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4360
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4365
virtual ~IIfConditionalBoundaryLayer() noexcept=0
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4451
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4492
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4517
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4462
virtual ~IIfConditional() noexcept=0
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4480
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4507
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4417
virtual ~IIfConditionalInputLayer() noexcept=0
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4402
virtual ~IIfConditionalOutputLayer() noexcept=0
A layer to do iterations.
Definition: NvInfer.h:4690
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4717
virtual ~IIteratorLayer() noexcept=0
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4727
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4703
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4695
Layer that represents a KVCacheUpdate operation.
Definition: NvInfer.h:7499
bool setCacheMode(KVCacheMode cacheMode) noexcept
Set the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7524
TRT_NODISCARD ITensor * getUpdateLengths() const noexcept
Get the update lengths tensor.
Definition: NvInfer.h:7599
virtual ~IKVCacheUpdateLayer() noexcept=0
TRT_NODISCARD AttentionIOForm getUpdateForm() const noexcept
Get the update form.
Definition: NvInfer.h:7565
TRT_NODISCARD bool setUpdateLengths(ITensor *lengths) noexcept
Set the update lengths tensor.
Definition: NvInfer.h:7587
TRT_NODISCARD bool setUpdateForm(AttentionIOForm form) noexcept
Set the update form.
Definition: NvInfer.h:7552
KVCacheMode getCacheMode() const noexcept
Get the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7534
apiv::VKVCacheUpdateLayer * mImpl
Definition: NvInfer.h:7605
A LRN layer in a network definition.
Definition: NvInfer.h:1482
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1503
virtual ~ILRNLayer() noexcept=0
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1525
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1493
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1559
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1515
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1537
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1547
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1569
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:4335
virtual ~ILoopBoundaryLayer() noexcept=0
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4340
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4750
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4820
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4779
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4792
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:4805
virtual ~ILoop() noexcept=0
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4830
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4758
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4586
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4616
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4591
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:4608
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3546
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3574
virtual ~IMatrixMultiplyLayer() noexcept=0
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3568
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3556
A MoE layer in a network definition. Mixture of Experts (MoE) is a collection of experts with each ex...
Definition: NvInfer.h:7750
void setSwigluParamLimit(float limit) noexcept
Set the SwiGLU parameter limit.
Definition: NvInfer.h:7972
void setDynQOutputScaleType(DataType type) noexcept
Set the dynamic quantization output scale type.
Definition: NvInfer.h:7925
MoEActType getActivationType() const noexcept
Get the activation type for the MoE layer.
Definition: NvInfer.h:7799
void setQuantizationToType(DataType type) noexcept
Set the data type the mul output is quantized to.
Definition: NvInfer.h:7873
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:7858
void setQuantizationStatic(ITensor &fcDownActivationScale, DataType dataType) noexcept
Configure static quantization after the mul op.
Definition: NvInfer.h:7825
float getSwigluParamLimit() const noexcept
Get the SwiGLU parameter limit.
Definition: NvInfer.h:7984
DataType getQuantizationToType() const noexcept
Get the data type the mul in MoE layer is quantized to.
Definition: NvInfer.h:7885
DataType getDynQOutputScaleType() const noexcept
Get the dynamic quantization output scale type.
Definition: NvInfer.h:7937
virtual ~IMoELayer() noexcept=0
void setActivationType(MoEActType activationType) noexcept
Set the activation type for the MoE layer.
Definition: NvInfer.h:7787
Dims getQuantizationBlockShape() const noexcept
Get the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7913
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:7763
float getSwigluParamBeta() const noexcept
Get the SwiGLU parameter beta.
Definition: NvInfer.h:8036
void setSwigluParamBeta(float beta) noexcept
Set the SwiGLU parameter beta.
Definition: NvInfer.h:8024
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:7775
void setSwigluParams(float limit, float alpha, float beta) noexcept
Set the SwiGLU parameters.
Definition: NvInfer.h:7958
void setQuantizationBlockShape(Dims const &blockShape) noexcept
Set the block shape for the quantization of the Mul output.
Definition: NvInfer.h:7901
void setInput(int32_t index, ITensor &tensor) noexcept
Set the input of the MoE layer.
Definition: NvInfer.h:8053
float getSwigluParamAlpha() const noexcept
Get the SwiGLU parameter alpha.
Definition: NvInfer.h:8010
void setSwigluParamAlpha(float alpha) noexcept
Set the SwiGLU parameter alpha.
Definition: NvInfer.h:7998
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6172
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6209
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6183
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6195
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6254
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6272
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6219
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6266
virtual ~INMSLayer() noexcept=0
A network definition for input to the builder.
Definition: NvInfer.h:8101
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:8329
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:8392
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:8818
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:8588
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:8172
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:8273
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:9485
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:9120
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8679
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:8939
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:8748
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:9018
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:8832
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:8917
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:8493
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:8463
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:8555
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:9243
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:8899
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:9146
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:9049
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:8220
TRT_NODISCARD INormalizationLayer * addNormalizationV2(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9774
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:8254
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:8794
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:9670
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:8435
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:8198
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:8870
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:9064
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9220
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:9727
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9394
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:9545
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:9431
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:9314
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:8447
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:8858
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:9287
IDynamicQuantizeLayer * addDynamicQuantizeV2(ITensor &input, Dims const &blockShape, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:9338
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:8519
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:8378
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:9372
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:8763
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:9708
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:9103
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:9263
TRT_DEPRECATED INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9463
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:8421
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:9780
IKVCacheUpdateLayer * addKVCacheUpdate(ITensor &cache, ITensor &update, ITensor &writeIndices, KVCacheMode cacheMode) noexcept
Add a KVCacheUpdate layer to the network.
Definition: NvInfer.h:9604
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:8887
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:8409
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:8299
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:8775
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:8733
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:8620
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8695
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:8356
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:8719
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9205
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:8959
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:9414
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:8639
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:8848
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:8604
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9695
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9683
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:9570
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:8981
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:9035
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:9748
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:8660
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:8312
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:8188
TRT_DEPRECATED IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:9515
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:9354
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:8154
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:9162
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:8477
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:9186
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:9658
IMoELayer * addMoE(ITensor &hiddenStates, ITensor &selectedExpertsForTokens, ITensor &scoresForSelectedExperts) noexcept
Add a MoE (Mixture of Experts) layer to the network.
Definition: NvInfer.h:9626
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:8234
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3602
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3626
virtual ~INonZeroLayer() noexcept=0
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3614
A normalization layer in a network definition.
Definition: NvInfer.h:6365
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6384
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6404
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6374
virtual ~INormalizationLayer() noexcept=0
TRT_NODISCARD bool isV2() const noexcept
Returns true if this layer was created through addNormalizationV2().
Definition: NvInfer.h:6446
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6452
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6435
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6394
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6425
A OneHot layer in a network definition.
Definition: NvInfer.h:5979
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6000
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5986
virtual ~IOneHotLayer() noexcept=0
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5994
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2665
Layer that represents a padding operation.
Definition: NvInfer.h:2787
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:2836
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2798
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:2824
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2810
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:2842
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3827
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3829
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:2480
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2493
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2487
virtual ~IPluginV2Layer() noexcept=0
Layer type for V3 plugins.
Definition: NvInfer.h:2509
virtual ~IPluginV3Layer() noexcept=0
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2516
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2522
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:1448
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:1419
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1429
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1460
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:5344
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5405
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5378
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5365
virtual ~IQuantizeLayer() noexcept=0
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5389
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5354
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5417
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3653
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3655
virtual ~IRaggedSoftMaxLayer() noexcept=0
A recurrence layer in a network definition.
Definition: NvInfer.h:4537
virtual ~IRecurrenceLayer() noexcept=0
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2705
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2752
virtual ~IReduceLayer() noexcept=0
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2712
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2722
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2742
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2732
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2768
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2762
A resize layer in a network definition.
Definition: NvInfer.h:4006
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4167
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4191
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:4085
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4026
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4223
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4066
virtual ~IResizeLayer() noexcept=0
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4233
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4177
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4107
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4142
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4246
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4097
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4036
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4201
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4256
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4152
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6291
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6324
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6311
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6340
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6334
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6301
virtual ~IReverseSequenceLayer() noexcept=0
Layer that implements Rotary Position Embedding (RoPE) (https://arxiv.org/abs/2104....
Definition: NvInfer.h:7390
TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
Get the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7430
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:7397
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:7419
apiv::VRotaryEmbeddingLayer * mImpl
Definition: NvInfer.h:7452
TRT_NODISCARD bool getInterleaved() const noexcept
Get whether the input is in interleaved format. The default value is false.
Definition: NvInfer.h:7408
A Scale layer in a network definition.
Definition: NvInfer.h:1630
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1687
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1707
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1677
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1697
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1647
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1657
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1743
virtual ~IScaleLayer() noexcept=0
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1667
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1637
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1722
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5904
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5911
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5945
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5931
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5939
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5921
virtual ~IScatterLayer() noexcept=0
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4855
virtual ~ISelectLayer() noexcept=0
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3318
virtual ~IShapeLayer() noexcept=0
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3320
Layer type for shuffling data.
Definition: NvInfer.h:2877
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3035
virtual ~IShuffleLayer() noexcept=0
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:2888
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:2988
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:2941
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:2928
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:2900
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3000
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3029
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3016
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3131
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3200
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3299
virtual ~ISliceLayer() noexcept=0
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3171
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3278
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3142
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3157
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3225
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3186
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3235
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3215
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3293
A Softmax layer in a network definition.
Definition: NvInfer.h:1776
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:1798
virtual ~ISoftMaxLayer() noexcept=0
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:1808
Layer that represents a squeeze operation, removing unit dimensions of the first input tensor on a se...
Definition: NvInfer.h:6468
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6485
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:10061
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:10127
virtual ~ITimingCache() noexcept=0
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:10098
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:10144
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:10166
apiv::VTimingCache * mImpl
Definition: NvInfer.h:10172
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:10108
Layer that represents a TopK reduction.
Definition: NvInfer.h:3360
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3391
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3415
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3377
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3474
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3367
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3456
virtual ~ITopKLayer() noexcept=0
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3405
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3425
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3468
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4662
virtual ~ITripLimitLayer() noexcept=0
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4667
Layer that represents an unary operation.
Definition: NvInfer.h:2592
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2601
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2617
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2611
virtual ~IUnaryLayer() noexcept=0
Layer that represents an unsqueeze operation, which reshapes the first input tensor by inserting unit...
Definition: NvInfer.h:6500
virtual ~IUnsqueezeLayer() noexcept=0
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6518
An Interface class for version control.
Definition: NvInferRuntimeBase.h:282
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:247
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:121
Definition: NvInferRuntimeBase.h:419
Definition: NvInferRuntime.h:1652
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1575
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:10397
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:643
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:11669
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:2870
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3917
@ 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:10185
AttentionIOForm
Enumerates the layout of the input/output tensors in an Attention layer.
Definition: NvInfer.h:6728
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:1587
@ 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:9803
@ 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:10293
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6536
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6103
@ 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:10339
@ 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:2545
@ 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:4920
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:3944
@ 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:6700
@ 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:4302
@ 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:11345
PreviewFeature
Define preview features.
Definition: NvInfer.h:10259
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10367
@ 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:149
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kDEBUG...
Definition: NvInfer.h:9832
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1341
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:3047
@ 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:2286
@ 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:7617
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:2882
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11356
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2197
@ 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:2675
@ kALL_TO_ALL
All-to-all exchange.
@ kREDUCE_SCATTER
Reduce scatter.
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3841
@ kNEAREST
ND (0 < N <= 8) nearest neighbor resizing.
@ kCUBIC
Supports bicubic (2D) interpolation.
@ kLINEAR
Supports linear (1D), bilinear (2D), and trilinear (3D) interpolation.
BuilderFlag
List of valid modes that the builder can enable when creating an engine from a network definition.
Definition: NvInfer.h:9842
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ kMONITOR_MEMORY
Enable memory monitor during build time.
@ kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
@ kREFIT
Enable building a refittable engine.
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:3332
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2647
@ kAVG
Average of the elements.
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5830
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3487
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3866
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4274
@ 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:7464
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:10480
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6668
Represents a permutation of dimensions.
Definition: NvInfer.h:2854
Declaration of EnumMaxImpl struct to store the exclusive upper bound of an enumeration type.
Definition: NvInferRuntimeBase.h:131
The key to retrieve timing cache entries.
Definition: NvInfer.h:10021
Definition: NvInfer.h:10035
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:10037
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:10039

  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