TensorRT 10.10.0
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h"
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110};
111
117template <>
118constexpr inline int32_t EnumMax<LayerType>() noexcept
119{
120 return 51;
121}
122
129using TensorFormats = uint32_t;
130
136enum class ActivationType : int32_t
137{
138 kRELU = 0,
139 kSIGMOID = 1,
140 kTANH = 2,
141 kLEAKY_RELU = 3,
142 kELU = 4,
143 kSELU = 5,
144 kSOFTSIGN = 6,
145 kSOFTPLUS = 7,
146 kCLIP = 8,
147 kHARD_SIGMOID = 9,
148 kSCALED_TANH = 10,
149 kTHRESHOLDED_RELU = 11,
150 kGELU_ERF = 12,
151 kGELU_TANH = 13
152};
153
154namespace impl
155{
161template <>
163{
164 static constexpr int32_t kVALUE = 14;
165};
166} // namespace impl
167
184class ITensor : public INoCopy
185{
186public:
202 void setName(char const* name) noexcept
203 {
204 mImpl->setName(name);
205 }
206
214 char const* getName() const noexcept
215 {
216 return mImpl->getName();
217 }
218
233 void setDimensions(Dims const& dimensions) noexcept
234 {
235 mImpl->setDimensions(dimensions);
236 }
237
247 Dims getDimensions() const noexcept
248 {
249 return mImpl->getDimensions();
250 }
251
262 void setType(DataType type) noexcept
263 {
264 mImpl->setType(type);
265 }
266
274 DataType getType() const noexcept
275 {
276 return mImpl->getType();
277 }
278
291 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
292 {
293 return mImpl->setDynamicRange(min, max);
294 }
295
299 bool isNetworkInput() const noexcept
300 {
301 return mImpl->isNetworkInput();
302 }
303
307 bool isNetworkOutput() const noexcept
308 {
309 return mImpl->isNetworkOutput();
310 }
311
324 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
325 {
326 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
327 }
328
339 {
340 return mImpl->getBroadcastAcrossBatch();
341 }
342
351 {
352 return mImpl->getLocation();
353 }
354
370 {
371 mImpl->setLocation(location);
372 }
373
381 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
382 {
383 return mImpl->dynamicRangeIsSet();
384 }
385
389 void resetDynamicRange() noexcept
390 {
391 mImpl->resetDynamicRange();
392 }
393
399 float getDynamicRangeMin() const noexcept
400 {
401 return mImpl->getDynamicRangeMin();
402 }
403
409 float getDynamicRangeMax() const noexcept
410 {
411 return mImpl->getDynamicRangeMax();
412 }
413
431 void setAllowedFormats(TensorFormats formats) noexcept
432 {
433 mImpl->setAllowedFormats(formats);
434 }
435
445 {
446 return mImpl->getAllowedFormats();
447 }
448
475 bool isShapeTensor() const noexcept
476 {
477 return mImpl->isShapeTensor();
478 }
479
496 bool isExecutionTensor() const noexcept
497 {
498 return mImpl->isExecutionTensor();
499 }
500
522 void setDimensionName(int32_t index, char const* name) noexcept
523 {
524 mImpl->setDimensionName(index, name);
525 }
526
537 char const* getDimensionName(int32_t index) const noexcept
538 {
539 return mImpl->getDimensionName(index);
540 }
541
542protected:
543 apiv::VTensor* mImpl;
544 virtual ~ITensor() noexcept = default;
545};
546
554class ILayer : public INoCopy
555{
556public:
562 LayerType getType() const noexcept
563 {
564 return mLayer->getType();
565 }
566
576 void setName(char const* name) noexcept
577 {
578 mLayer->setName(name);
579 }
580
586 char const* getName() const noexcept
587 {
588 return mLayer->getName();
589 }
590
594 int32_t getNbInputs() const noexcept
595 {
596 return mLayer->getNbInputs();
597 }
598
607 ITensor* getInput(int32_t index) const noexcept
608 {
609 return mLayer->getInput(index);
610 }
611
615 int32_t getNbOutputs() const noexcept
616 {
617 return mLayer->getNbOutputs();
618 }
619
625 ITensor* getOutput(int32_t index) const noexcept
626 {
627 return mLayer->getOutput(index);
628 }
629
642 void setInput(int32_t index, ITensor& tensor) noexcept
643 {
644 return mLayer->setInput(index, tensor);
645 }
646
673 void setPrecision(DataType dataType) noexcept
674 {
675 mLayer->setPrecision(dataType);
676 }
677
685 DataType getPrecision() const noexcept
686 {
687 return mLayer->getPrecision();
688 }
689
697 bool precisionIsSet() const noexcept
698 {
699 return mLayer->precisionIsSet();
700 }
701
707 void resetPrecision() noexcept
708 {
709 mLayer->resetPrecision();
710 }
711
754 void setOutputType(int32_t index, DataType dataType) noexcept
755 {
756 mLayer->setOutputType(index, dataType);
757 }
758
769 DataType getOutputType(int32_t index) const noexcept
770 {
771 return mLayer->getOutputType(index);
772 }
773
783 bool outputTypeIsSet(int32_t index) const noexcept
784 {
785 return mLayer->outputTypeIsSet(index);
786 }
787
795 void resetOutputType(int32_t index) noexcept
796 {
797 return mLayer->resetOutputType(index);
798 }
799
813 void setMetadata(char const* metadata) noexcept
814 {
815 mLayer->setMetadata(metadata);
816 }
817
826 char const* getMetadata() const noexcept
827 {
828 return mLayer->getMetadata();
829 }
830
831protected:
832 virtual ~ILayer() noexcept = default;
833 apiv::VLayer* mLayer;
834};
835
992enum class PaddingMode : int32_t
993{
996 kSAME_UPPER = 2,
997 kSAME_LOWER = 3,
998};
999
1000namespace impl
1001{
1007template <>
1009{
1010 static constexpr int32_t kVALUE = 4;
1011};
1012} // namespace impl
1013
1027{
1028public:
1036 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1037 {
1038 mImpl->setNbOutputMaps(nbOutputMaps);
1039 }
1040
1046 int64_t getNbOutputMaps() const noexcept
1047 {
1048 return mImpl->getNbOutputMaps();
1049 }
1050
1066 void setNbGroups(int64_t nbGroups) noexcept
1067 {
1068 mImpl->setNbGroups(nbGroups);
1069 }
1070
1076 int64_t getNbGroups() const noexcept
1077 {
1078 return mImpl->getNbGroups();
1079 }
1080
1090 void setKernelWeights(Weights weights) noexcept
1091 {
1092 mImpl->setKernelWeights(weights);
1093 }
1094
1100 Weights getKernelWeights() const noexcept
1101 {
1102 return mImpl->getKernelWeights();
1103 }
1104
1115 void setBiasWeights(Weights weights) noexcept
1116 {
1117 mImpl->setBiasWeights(weights);
1118 }
1119
1125 Weights getBiasWeights() const noexcept
1126 {
1127 return mImpl->getBiasWeights();
1128 }
1129
1142 void setPrePadding(Dims const& padding) noexcept
1143 {
1144 mImpl->setPrePadding(padding);
1145 }
1146
1152 Dims getPrePadding() const noexcept
1153 {
1154 return mImpl->getPrePadding();
1155 }
1156
1169 void setPostPadding(Dims const& padding) noexcept
1170 {
1171 mImpl->setPostPadding(padding);
1172 }
1173
1179 Dims getPostPadding() const noexcept
1180 {
1181 return mImpl->getPostPadding();
1182 }
1183
1193 void setPaddingMode(PaddingMode paddingMode) noexcept
1194 {
1195 mImpl->setPaddingMode(paddingMode);
1196 }
1197
1206 {
1207 return mImpl->getPaddingMode();
1208 }
1209
1218 void setKernelSizeNd(Dims const& kernelSize) noexcept
1219 {
1220 mImpl->setKernelSizeNd(kernelSize);
1221 }
1222
1228 Dims getKernelSizeNd() const noexcept
1229 {
1230 return mImpl->getKernelSizeNd();
1231 }
1232
1243 void setStrideNd(Dims const& stride) noexcept
1244 {
1245 mImpl->setStrideNd(stride);
1246 }
1247
1253 Dims getStrideNd() const noexcept
1254 {
1255 return mImpl->getStrideNd();
1256 }
1257
1271 void setPaddingNd(Dims const& padding) noexcept
1272 {
1273 mImpl->setPaddingNd(padding);
1274 }
1275
1283 Dims getPaddingNd() const noexcept
1284 {
1285 return mImpl->getPaddingNd();
1286 }
1287
1297 void setDilationNd(Dims const& dilation) noexcept
1298 {
1299 mImpl->setDilationNd(dilation);
1300 }
1301
1307 Dims getDilationNd() const noexcept
1308 {
1309 return mImpl->getDilationNd();
1310 }
1311
1326 using ILayer::setInput;
1327
1328protected:
1329 virtual ~IConvolutionLayer() noexcept = default;
1330 apiv::VConvolutionLayer* mImpl;
1331};
1332
1347{
1348public:
1357 {
1358 mImpl->setActivationType(type);
1359 }
1360
1367 {
1368 return mImpl->getActivationType();
1369 }
1370
1381 void setAlpha(float alpha) noexcept
1382 {
1383 mImpl->setAlpha(alpha);
1384 }
1385
1395 void setBeta(float beta) noexcept
1396 {
1397 mImpl->setBeta(beta);
1398 }
1399
1404 float getAlpha() const noexcept
1405 {
1406 return mImpl->getAlpha();
1407 }
1408
1413 float getBeta() const noexcept
1414 {
1415 return mImpl->getBeta();
1416 }
1417
1418protected:
1419 virtual ~IActivationLayer() noexcept = default;
1420 apiv::VActivationLayer* mImpl;
1421};
1422
1428enum class PoolingType : int32_t
1429{
1430 kMAX = 0,
1431 kAVERAGE = 1,
1433};
1434
1435namespace impl
1436{
1442template <>
1444{
1445 static constexpr int32_t kVALUE = 3;
1446};
1447} // namespace impl
1448
1460class IPoolingLayer : public ILayer
1461{
1462public:
1470 void setPoolingType(PoolingType type) noexcept
1471 {
1472 mImpl->setPoolingType(type);
1473 }
1474
1481 {
1482 return mImpl->getPoolingType();
1483 }
1484
1495 void setBlendFactor(float blendFactor) noexcept
1496 {
1497 mImpl->setBlendFactor(blendFactor);
1498 }
1499
1508 float getBlendFactor() const noexcept
1509 {
1510 return mImpl->getBlendFactor();
1511 }
1512
1522 void setAverageCountExcludesPadding(bool exclusive) noexcept
1523 {
1524 mImpl->setAverageCountExcludesPadding(exclusive);
1525 }
1526
1534 {
1535 return mImpl->getAverageCountExcludesPadding();
1536 }
1537
1551 void setPrePadding(Dims const& padding) noexcept
1552 {
1553 mImpl->setPrePadding(padding);
1554 }
1555
1561 Dims getPrePadding() const noexcept
1562 {
1563 return mImpl->getPrePadding();
1564 }
1565
1579 void setPostPadding(Dims const& padding) noexcept
1580 {
1581 mImpl->setPostPadding(padding);
1582 }
1583
1589 Dims getPostPadding() const noexcept
1590 {
1591 return mImpl->getPostPadding();
1592 }
1593
1602 void setPaddingMode(PaddingMode paddingMode) noexcept
1603 {
1604 mImpl->setPaddingMode(paddingMode);
1605 }
1606
1614 {
1615 return mImpl->getPaddingMode();
1616 }
1617
1626 void setWindowSizeNd(Dims const& windowSize) noexcept
1627 {
1628 mImpl->setWindowSizeNd(windowSize);
1629 }
1630
1636 Dims getWindowSizeNd() const noexcept
1637 {
1638 return mImpl->getWindowSizeNd();
1639 }
1640
1651 void setStrideNd(Dims const& stride) noexcept
1652 {
1653 mImpl->setStrideNd(stride);
1654 }
1655
1661 Dims getStrideNd() const noexcept
1662 {
1663 return mImpl->getStrideNd();
1664 }
1665
1680 void setPaddingNd(Dims const& padding) noexcept
1681 {
1682 mImpl->setPaddingNd(padding);
1683 }
1684
1692 Dims getPaddingNd() const noexcept
1693 {
1694 return mImpl->getPaddingNd();
1695 }
1696
1697protected:
1698 virtual ~IPoolingLayer() noexcept = default;
1699 apiv::VPoolingLayer* mImpl;
1700};
1701
1711class ILRNLayer : public ILayer
1712{
1713public:
1723 void setWindowSize(int64_t windowSize) noexcept
1724 {
1725 mImpl->setWindowSize(windowSize);
1726 }
1727
1733 int64_t getWindowSize() const noexcept
1734 {
1735 return mImpl->getWindowSize();
1736 }
1737
1745 void setAlpha(float alpha) noexcept
1746 {
1747 mImpl->setAlpha(alpha);
1748 }
1749
1755 float getAlpha() const noexcept
1756 {
1757 return mImpl->getAlpha();
1758 }
1759
1767 void setBeta(float beta) noexcept
1768 {
1769 mImpl->setBeta(beta);
1770 }
1771
1777 float getBeta() const noexcept
1778 {
1779 return mImpl->getBeta();
1780 }
1781
1789 void setK(float k) noexcept
1790 {
1791 mImpl->setK(k);
1792 }
1793
1799 float getK() const noexcept
1800 {
1801 return mImpl->getK();
1802 }
1803
1804protected:
1805 virtual ~ILRNLayer() noexcept = default;
1806 apiv::VLRNLayer* mImpl;
1807};
1808
1814enum class ScaleMode : int32_t
1815{
1816 kUNIFORM = 0,
1817 kCHANNEL = 1,
1818 kELEMENTWISE = 2
1819};
1820
1826template <>
1827constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1828{
1829 return 3;
1830}
1831
1857class IScaleLayer : public ILayer
1858{
1859public:
1865 void setMode(ScaleMode mode) noexcept
1866 {
1867 mImpl->setMode(mode);
1868 }
1869
1875 ScaleMode getMode() const noexcept
1876 {
1877 return mImpl->getMode();
1878 }
1879
1885 void setShift(Weights shift) noexcept
1886 {
1887 mImpl->setShift(shift);
1888 }
1889
1895 Weights getShift() const noexcept
1896 {
1897 return mImpl->getShift();
1898 }
1899
1905 void setScale(Weights scale) noexcept
1906 {
1907 mImpl->setScale(scale);
1908 }
1909
1915 Weights getScale() const noexcept
1916 {
1917 return mImpl->getScale();
1918 }
1919
1925 void setPower(Weights power) noexcept
1926 {
1927 mImpl->setPower(power);
1928 }
1929
1935 Weights getPower() const noexcept
1936 {
1937 return mImpl->getPower();
1938 }
1939
1950 int32_t getChannelAxis() const noexcept
1951 {
1952 return mImpl->getChannelAxis();
1953 }
1954
1971 void setChannelAxis(int32_t channelAxis) noexcept
1972 {
1973 mImpl->setChannelAxis(channelAxis);
1974 }
1975
1976protected:
1977 virtual ~IScaleLayer() noexcept = default;
1978 apiv::VScaleLayer* mImpl;
1979};
1980
2001class ISoftMaxLayer : public ILayer
2002{
2003public:
2024 void setAxes(uint32_t axes) noexcept
2025 {
2026 mImpl->setAxes(axes);
2027 }
2028
2034 uint32_t getAxes() const noexcept
2035 {
2036 return mImpl->getAxes();
2037 }
2038
2039protected:
2040 virtual ~ISoftMaxLayer() noexcept = default;
2041 apiv::VSoftMaxLayer* mImpl;
2042};
2043
2057{
2058public:
2070 void setAxis(int32_t axis) noexcept
2071 {
2072 mImpl->setAxis(axis);
2073 }
2074
2080 int32_t getAxis() const noexcept
2081 {
2082 return mImpl->getAxis();
2083 }
2084
2085protected:
2086 virtual ~IConcatenationLayer() noexcept = default;
2087 apiv::VConcatenationLayer* mImpl;
2088};
2089
2098{
2099public:
2107 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2108 {
2109 mImpl->setNbOutputMaps(nbOutputMaps);
2110 }
2111
2117 int64_t getNbOutputMaps() const noexcept
2118 {
2119 return mImpl->getNbOutputMaps();
2120 }
2121
2137 void setNbGroups(int64_t nbGroups) noexcept
2138 {
2139 mImpl->setNbGroups(nbGroups);
2140 }
2141
2147 int64_t getNbGroups() const noexcept
2148 {
2149 return mImpl->getNbGroups();
2150 }
2151
2161 void setKernelWeights(Weights weights) noexcept
2162 {
2163 mImpl->setKernelWeights(weights);
2164 }
2165
2171 Weights getKernelWeights() const noexcept
2172 {
2173 return mImpl->getKernelWeights();
2174 }
2175
2186 void setBiasWeights(Weights weights) noexcept
2187 {
2188 mImpl->setBiasWeights(weights);
2189 }
2190
2196 Weights getBiasWeights() const noexcept
2197 {
2198 return mImpl->getBiasWeights();
2199 }
2200
2213 void setPrePadding(Dims const& padding) noexcept
2214 {
2215 mImpl->setPrePadding(padding);
2216 }
2217
2223 Dims getPrePadding() const noexcept
2224 {
2225 return mImpl->getPrePadding();
2226 }
2227
2240 void setPostPadding(Dims const& padding) noexcept
2241 {
2242 mImpl->setPostPadding(padding);
2243 }
2244
2250 Dims getPostPadding() const noexcept
2251 {
2252 return mImpl->getPostPadding();
2253 }
2254
2264 void setPaddingMode(PaddingMode paddingMode) noexcept
2265 {
2266 mImpl->setPaddingMode(paddingMode);
2267 }
2268
2277 {
2278 return mImpl->getPaddingMode();
2279 }
2280
2291 void setKernelSizeNd(Dims const& kernelSize) noexcept
2292 {
2293 mImpl->setKernelSizeNd(kernelSize);
2294 }
2295
2301 Dims getKernelSizeNd() const noexcept
2302 {
2303 return mImpl->getKernelSizeNd();
2304 }
2305
2318 void setStrideNd(Dims const& stride) noexcept
2319 {
2320 mImpl->setStrideNd(stride);
2321 }
2322
2328 Dims getStrideNd() const noexcept
2329 {
2330 return mImpl->getStrideNd();
2331 }
2332
2346 void setPaddingNd(Dims const& padding) noexcept
2347 {
2348 mImpl->setPaddingNd(padding);
2349 }
2350
2358 Dims getPaddingNd() const noexcept
2359 {
2360 return mImpl->getPaddingNd();
2361 }
2362
2375 using ILayer::setInput;
2376
2384 void setDilationNd(Dims const& dilation) noexcept
2385 {
2386 mImpl->setDilationNd(dilation);
2387 }
2388
2394 Dims getDilationNd() const noexcept
2395 {
2396 return mImpl->getDilationNd();
2397 }
2398
2399protected:
2400 virtual ~IDeconvolutionLayer() noexcept = default;
2401 apiv::VDeconvolutionLayer* mImpl;
2402};
2403
2418enum class ElementWiseOperation : int32_t
2419{
2420 kSUM = 0,
2421 kPROD = 1,
2422 kMAX = 2,
2423 kMIN = 3,
2424 kSUB = 4,
2425 kDIV = 5,
2426 kPOW = 6,
2427 kFLOOR_DIV = 7,
2428 kAND = 8,
2429 kOR = 9,
2430 kXOR = 10,
2431 kEQUAL = 11,
2432 kGREATER = 12,
2433 kLESS = 13
2434};
2435
2436namespace impl
2437{
2443template <>
2445{
2446 static constexpr int32_t kVALUE = 14;
2447};
2448} // namespace impl
2449
2470{
2471public:
2482 {
2483 return mImpl->setOperation(op);
2484 }
2485
2494 {
2495 return mImpl->getOperation();
2496 }
2497
2498protected:
2499 apiv::VElementWiseLayer* mImpl;
2500 virtual ~IElementWiseLayer() noexcept = default;
2501};
2502
2508enum class GatherMode : int32_t
2509{
2510 kDEFAULT = 0,
2511 kELEMENT = 1,
2512 kND = 2
2513};
2514
2520template <>
2521constexpr inline int32_t EnumMax<GatherMode>() noexcept
2522{
2523 return 3;
2524}
2525
2602class IGatherLayer : public ILayer
2603{
2604public:
2614 void setGatherAxis(int32_t axis) noexcept
2615 {
2616 mImpl->setGatherAxis(axis);
2617 }
2618
2626 int32_t getGatherAxis() const noexcept
2627 {
2628 return mImpl->getGatherAxis();
2629 }
2630
2649 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2650 {
2651 mImpl->setNbElementWiseDims(elementWiseDims);
2652 }
2653
2659 int32_t getNbElementWiseDims() const noexcept
2660 {
2661 return mImpl->getNbElementWiseDims();
2662 }
2663
2669 void setMode(GatherMode mode) noexcept
2670 {
2671 mImpl->setMode(mode);
2672 }
2673
2679 GatherMode getMode() const noexcept
2680 {
2681 return mImpl->getMode();
2682 }
2683
2684protected:
2685 apiv::VGatherLayer* mImpl;
2686 virtual ~IGatherLayer() noexcept = default;
2687};
2688
2701{
2702public:
2709 {
2710 return mImpl->getPlugin();
2711 }
2712
2713protected:
2714 apiv::VPluginV2Layer* mImpl;
2715 virtual ~IPluginV2Layer() noexcept = default;
2716};
2717
2728{
2729public:
2736 {
2737 return mImpl->getPlugin();
2738 }
2739
2740protected:
2741 apiv::VPluginV3Layer* mImpl;
2742 virtual ~IPluginV3Layer() noexcept = default;
2743};
2744
2761enum class UnaryOperation : int32_t
2762{
2763 kEXP = 0,
2764 kLOG = 1,
2765 kSQRT = 2,
2766 kRECIP = 3,
2767 kABS = 4,
2768 kNEG = 5,
2769 kSIN = 6,
2770 kCOS = 7,
2771 kTAN = 8,
2772 kSINH = 9,
2773 kCOSH = 10,
2774 kASIN = 11,
2775 kACOS = 12,
2776 kATAN = 13,
2777 kASINH = 14,
2778 kACOSH = 15,
2779 kATANH = 16,
2780 kCEIL = 17,
2781 kFLOOR = 18,
2782 kERF = 19,
2783 kNOT = 20,
2784 kSIGN = 21,
2785 kROUND = 22,
2786 kISINF = 23,
2787 kISNAN = 24,
2788};
2789
2795template <>
2796constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2797{
2798 return 25;
2799}
2800
2808class IUnaryLayer : public ILayer
2809{
2810public:
2819 {
2820 mImpl->setOperation(op);
2821 }
2822
2829 {
2830 return mImpl->getOperation();
2831 }
2832
2833protected:
2834 apiv::VUnaryLayer* mImpl;
2835 virtual ~IUnaryLayer() noexcept = default;
2836};
2837
2856enum class ReduceOperation : int32_t
2857{
2858 kSUM = 0,
2859 kPROD = 1,
2860 kMAX = 2,
2861 kMIN = 3,
2862 kAVG = 4
2863};
2864
2870template <>
2871constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2872{
2873 return 5;
2874}
2875
2883class IReduceLayer : public ILayer
2884{
2885public:
2892 {
2893 mImpl->setOperation(op);
2894 }
2895
2902 {
2903 return mImpl->getOperation();
2904 }
2905
2911 void setReduceAxes(uint32_t reduceAxes) noexcept
2912 {
2913 mImpl->setReduceAxes(reduceAxes);
2914 }
2915
2921 uint32_t getReduceAxes() const noexcept
2922 {
2923 return mImpl->getReduceAxes();
2924 }
2925
2931 void setKeepDimensions(bool keepDimensions) noexcept
2932 {
2933 mImpl->setKeepDimensions(keepDimensions);
2934 }
2935
2941 bool getKeepDimensions() const noexcept
2942 {
2943 return mImpl->getKeepDimensions();
2944 }
2945
2946protected:
2947 apiv::VReduceLayer* mImpl;
2948 virtual ~IReduceLayer() noexcept = default;
2949};
2950
2963class IPaddingLayer : public ILayer
2964{
2965public:
2975 void setPrePaddingNd(Dims const& padding) noexcept
2976 {
2977 mImpl->setPrePaddingNd(padding);
2978 }
2979
2987 Dims getPrePaddingNd() const noexcept
2988 {
2989 return mImpl->getPrePaddingNd();
2990 }
2991
3001 void setPostPaddingNd(Dims const& padding) noexcept
3002 {
3003 mImpl->setPostPaddingNd(padding);
3004 }
3005
3013 Dims getPostPaddingNd() const noexcept
3014 {
3015 return mImpl->getPostPaddingNd();
3016 }
3017
3018protected:
3019 apiv::VPaddingLayer* mImpl;
3020 virtual ~IPaddingLayer() noexcept = default;
3021};
3022
3029{
3036 int32_t order[Dims::MAX_DIMS];
3037};
3038
3051class IShuffleLayer : public ILayer
3052{
3053public:
3063 void setFirstTranspose(Permutation permutation) noexcept
3064 {
3065 mImpl->setFirstTranspose(permutation);
3066 }
3067
3076 {
3077 return mImpl->getFirstTranspose();
3078 }
3079
3103 void setReshapeDimensions(Dims const& dimensions) noexcept
3104 {
3105 mImpl->setReshapeDimensions(dimensions);
3106 }
3107
3117 {
3118 return mImpl->getReshapeDimensions();
3119 }
3120
3126 //
3149 using ILayer::setInput;
3150
3163 void setSecondTranspose(Permutation permutation) noexcept
3164 {
3165 mImpl->setSecondTranspose(permutation);
3166 }
3167
3176 {
3177 return mImpl->getSecondTranspose();
3178 }
3179
3191 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3192 {
3193 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3194 }
3195
3204 bool getZeroIsPlaceholder() const noexcept
3205 {
3206 return mImpl->getZeroIsPlaceholder();
3207 }
3208
3209protected:
3210 apiv::VShuffleLayer* mImpl;
3211 virtual ~IShuffleLayer() noexcept = default;
3212};
3213
3219enum class SampleMode : int32_t
3220{
3221 kSTRICT_BOUNDS = 0,
3222 kWRAP = 1,
3223 kCLAMP = 2,
3224 kFILL = 3,
3225 kREFLECT = 4,
3228};
3229
3235template <>
3236constexpr inline int32_t EnumMax<SampleMode>() noexcept
3237{
3238 return 5;
3239}
3240
3303class ISliceLayer : public ILayer
3304{
3305public:
3315 void setStart(Dims const& start) noexcept
3316 {
3317 mImpl->setStart(start);
3318 }
3319
3330 Dims getStart() const noexcept
3331 {
3332 return mImpl->getStart();
3333 }
3334
3344 void setSize(Dims const& size) noexcept
3345 {
3346 return mImpl->setSize(size);
3347 }
3348
3359 Dims getSize() const noexcept
3360 {
3361 return mImpl->getSize();
3362 }
3363
3373 void setStride(Dims const& stride) noexcept
3374 {
3375 mImpl->setStride(stride);
3376 }
3377
3388 Dims getStride() const noexcept
3389 {
3390 return mImpl->getStride();
3391 }
3392
3398 void setMode(SampleMode mode) noexcept
3399 {
3400 mImpl->setMode(mode);
3401 }
3402
3408 SampleMode getMode() const noexcept
3409 {
3410 return mImpl->getMode();
3411 }
3412
3440 using ILayer::setInput;
3441
3451 void setAxes(Dims const& axes) noexcept
3452 {
3453 mImpl->setAxes(axes);
3454 }
3455
3466 Dims getAxes() const noexcept
3467 {
3468 return mImpl->getAxes();
3469 }
3470
3471protected:
3472 apiv::VSliceLayer* mImpl;
3473 virtual ~ISliceLayer() noexcept = default;
3474};
3475
3488class IShapeLayer : public ILayer
3489{
3490protected:
3491 apiv::VShapeLayer* mImpl;
3492 virtual ~IShapeLayer() noexcept = default;
3493};
3494
3500enum class TopKOperation : int32_t
3501{
3502 kMAX = 0,
3503 kMIN = 1,
3504};
3505
3511template <>
3512constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3513{
3514 return 2;
3515}
3516
3528class ITopKLayer : public ILayer
3529{
3530public:
3536 void setOperation(TopKOperation op) noexcept
3537 {
3538 mImpl->setOperation(op);
3539 }
3540
3547 {
3548 return mImpl->getOperation();
3549 }
3550
3560 void setK(int32_t k) noexcept
3561 {
3562 mImpl->setK(k);
3563 }
3564
3574 int32_t getK() const noexcept
3575 {
3576 return mImpl->getK();
3577 }
3578
3584 void setReduceAxes(uint32_t reduceAxes) noexcept
3585 {
3586 mImpl->setReduceAxes(reduceAxes);
3587 }
3588
3594 uint32_t getReduceAxes() const noexcept
3595 {
3596 return mImpl->getReduceAxes();
3597 }
3598
3613 using ILayer::setInput;
3614
3615protected:
3616 apiv::VTopKLayer* mImpl;
3617 virtual ~ITopKLayer() noexcept = default;
3618};
3619
3626enum class MatrixOperation : int32_t
3627{
3631 kNONE = 0,
3632
3634 kTRANSPOSE = 1,
3635
3646 kVECTOR = 2,
3647};
3648
3654template <>
3655constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3656{
3657 return 3;
3658}
3659
3686{
3687public:
3696 void setOperation(int32_t index, MatrixOperation op) noexcept
3697 {
3698 mImpl->setOperation(index, op);
3699 }
3700
3708 MatrixOperation getOperation(int32_t index) const noexcept
3709 {
3710 return mImpl->getOperation(index);
3711 }
3712
3713protected:
3714 apiv::VMatrixMultiplyLayer* mImpl;
3715 virtual ~IMatrixMultiplyLayer() noexcept = default;
3716};
3717
3739class INonZeroLayer : public ILayer
3740{
3741protected:
3742 virtual ~INonZeroLayer() noexcept = default;
3743 apiv::VNonZeroLayer* mImpl;
3744};
3745
3761{
3762protected:
3763 apiv::VRaggedSoftMaxLayer* mImpl;
3764 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3765};
3766
3794{
3795protected:
3796 apiv::VIdentityLayer* mImpl;
3797 virtual ~IIdentityLayer() noexcept = default;
3798};
3799
3806class ICastLayer : public ILayer
3807{
3808public:
3816 void setToType(DataType toType) noexcept
3817 {
3818 mImpl->setToType(toType);
3819 }
3820
3827 DataType getToType() const noexcept
3828 {
3829 return mImpl->getToType();
3830 }
3831
3832protected:
3833 apiv::VCastLayer* mImpl;
3834 virtual ~ICastLayer() noexcept = default;
3835};
3836
3846{
3847public:
3856 void setWeights(Weights weights) noexcept
3857 {
3858 mImpl->setWeights(weights);
3859 }
3860
3866 Weights getWeights() const noexcept
3867 {
3868 return mImpl->getWeights();
3869 }
3870
3878 void setDimensions(Dims const& dimensions) noexcept
3879 {
3880 mImpl->setDimensions(dimensions);
3881 }
3882
3890 Dims getDimensions() const noexcept
3891 {
3892 return mImpl->getDimensions();
3893 }
3894
3895protected:
3896 apiv::VConstantLayer* mImpl;
3897 virtual ~IConstantLayer() noexcept = default;
3898};
3899
3910{
3911protected:
3912 apiv::VParametricReLULayer* mImpl;
3913 virtual ~IParametricReLULayer() noexcept = default;
3914};
3915
3921enum class InterpolationMode : int32_t
3922{
3923 kNEAREST = 0,
3924 kLINEAR = 1,
3925 kCUBIC = 2
3926};
3927
3928namespace impl
3929{
3935template <>
3937{
3938 static constexpr int32_t kVALUE = 3;
3939};
3940} // namespace impl
3941
3950{
3963 kALIGN_CORNERS = 0,
3964
3971 kASYMMETRIC = 1,
3972
3979 kHALF_PIXEL = 2,
3980};
3981
3982namespace impl
3983{
3989template <>
3991{
3992 static constexpr int32_t kVALUE = 3;
3993};
3994} // namespace impl
3995
4003enum class ResizeSelector : int32_t
4004{
4006 kFORMULA = 0,
4007
4009 kUPPER = 1,
4010};
4011
4012namespace impl
4013{
4019template <>
4021{
4022 static constexpr int32_t kVALUE = 2;
4023};
4024} // namespace impl
4025
4033enum class ResizeRoundMode : int32_t
4034{
4036 kHALF_UP = 0,
4037
4039 kHALF_DOWN = 1,
4040
4042 kFLOOR = 2,
4043
4045 kCEIL = 3,
4046};
4047
4048namespace impl
4049{
4055template <>
4057{
4058 static constexpr int32_t kVALUE = 4;
4059};
4060} // namespace impl
4061
4098class IResizeLayer : public ILayer
4099{
4100public:
4119 void setOutputDimensions(Dims const& dimensions) noexcept
4120 {
4121 return mImpl->setOutputDimensions(dimensions);
4122 }
4123
4129 Dims getOutputDimensions() const noexcept
4130 {
4131 return mImpl->getOutputDimensions();
4132 }
4133
4159 void setScales(float const* scales, int32_t nbScales) noexcept
4160 {
4161 mImpl->setScales(scales, nbScales);
4162 }
4163
4178 int32_t getScales(int32_t size, float* scales) const noexcept
4179 {
4180 return mImpl->getScales(size, scales);
4181 }
4182
4190 void setResizeMode(InterpolationMode interpolationMode) noexcept
4191 {
4192 mImpl->setResizeMode(interpolationMode);
4193 }
4194
4201 {
4202 return mImpl->getResizeMode();
4203 }
4204
4224 using ILayer::setInput;
4225
4236 {
4237 mImpl->setCoordinateTransformation(coordTransform);
4238 }
4239
4246 {
4247 return mImpl->getCoordinateTransformation();
4248 }
4249
4261 {
4262 mImpl->setSelectorForSinglePixel(selector);
4263 }
4264
4271 {
4272 return mImpl->getSelectorForSinglePixel();
4273 }
4274
4285 {
4286 mImpl->setNearestRounding(value);
4287 }
4288
4295 {
4296 return mImpl->getNearestRounding();
4297 }
4298
4316 void setCubicCoeff(float A) noexcept
4317 {
4318 mImpl->setCubicCoeff(A);
4319 }
4320
4326 float getCubicCoeff() const noexcept
4327 {
4328 return mImpl->getCubicCoeff();
4329 }
4330
4339 void setExcludeOutside(bool excludeFlag) noexcept
4340 {
4341 mImpl->setExcludeOutside(excludeFlag);
4342 }
4343
4349 bool getExcludeOutside() const noexcept
4350 {
4351 return mImpl->getExcludeOutside();
4352 }
4353
4354protected:
4355 virtual ~IResizeLayer() noexcept = default;
4356 apiv::VResizeLayer* mImpl;
4357};
4358
4364enum class LoopOutput : int32_t
4365{
4367 kLAST_VALUE = 0,
4368
4370 kCONCATENATE = 1,
4371
4373 kREVERSE = 2
4374};
4375
4381template <>
4382constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4383{
4384 return 3;
4385}
4386
4392enum class TripLimit : int32_t
4393{
4394
4395 kCOUNT = 0,
4396 kWHILE = 1
4397};
4398
4404template <>
4405constexpr inline int32_t EnumMax<TripLimit>() noexcept
4406{
4407 return 2;
4408}
4409
4410class ILoop;
4411
4426{
4427public:
4431 ILoop* getLoop() const noexcept
4432 {
4433 return mBoundary->getLoop();
4434 }
4435
4436protected:
4437 virtual ~ILoopBoundaryLayer() noexcept = default;
4438 apiv::VLoopBoundaryLayer* mBoundary;
4439};
4440
4449{
4450public:
4455 {
4456 return mBoundary->getConditional();
4457 }
4458
4459protected:
4460 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4461 apiv::VConditionalBoundaryLayer* mBoundary;
4462};
4463
4470{
4471public:
4472protected:
4473 virtual ~IConditionLayer() noexcept = default;
4474 apiv::VConditionLayer* mImpl;
4475};
4476
4487{
4488public:
4489protected:
4490 virtual ~IIfConditionalOutputLayer() noexcept = default;
4491 apiv::VConditionalOutputLayer* mImpl;
4492};
4493
4500{
4501public:
4502protected:
4503 virtual ~IIfConditionalInputLayer() noexcept = default;
4504 apiv::VConditionalInputLayer* mImpl;
4505};
4506
4531{
4532public:
4543 {
4544 return mImpl->setCondition(condition);
4545 }
4546
4560 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4561 {
4562 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4563 }
4564
4573 {
4574 return mImpl->addInput(input);
4575 }
4576
4587 void setName(char const* name) noexcept
4588 {
4589 mImpl->setName(name);
4590 }
4591
4597 char const* getName() const noexcept
4598 {
4599 return mImpl->getName();
4600 }
4601
4602protected:
4603 virtual ~IIfConditional() noexcept = default;
4604 apiv::VIfConditional* mImpl;
4605};
4606
4615{
4616public:
4622 //
4635 using ILayer::setInput;
4636
4637protected:
4638 virtual ~IRecurrenceLayer() noexcept = default;
4639 apiv::VRecurrenceLayer* mImpl;
4640};
4641
4662{
4663public:
4667 LoopOutput getLoopOutput() const noexcept
4668 {
4669 return mImpl->getLoopOutput();
4670 }
4671
4684 void setAxis(int32_t axis) noexcept
4685 {
4686 mImpl->setAxis(axis);
4687 }
4688
4692 int32_t getAxis() const noexcept
4693 {
4694 return mImpl->getAxis();
4695 }
4696
4702 //
4717 using ILayer::setInput;
4718
4719protected:
4720 virtual ~ILoopOutputLayer() noexcept = default;
4721 apiv::VLoopOutputLayer* mImpl;
4722};
4723
4736{
4737public:
4741 TripLimit getTripLimit() const noexcept
4742 {
4743 return mImpl->getTripLimit();
4744 }
4745
4746protected:
4747 virtual ~ITripLimitLayer() noexcept = default;
4748 apiv::VTripLimitLayer* mImpl;
4749};
4750
4762{
4763public:
4767 void setAxis(int32_t axis) noexcept
4768 {
4769 mImpl->setAxis(axis);
4770 }
4771
4775 int32_t getAxis() const noexcept
4776 {
4777 return mImpl->getAxis();
4778 }
4779
4789 void setReverse(bool reverse) noexcept
4790 {
4791 mImpl->setReverse(reverse);
4792 }
4793
4799 bool getReverse() const noexcept
4800 {
4801 return mImpl->getReverse();
4802 }
4803
4804protected:
4805 virtual ~IIteratorLayer() noexcept = default;
4806 apiv::VIteratorLayer* mImpl;
4807};
4808
4818class ILoop : public INoCopy
4819{
4820public:
4827 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4828 {
4829 return mImpl->addRecurrence(initialValue);
4830 }
4831
4849 {
4850 return mImpl->addTripLimit(tensor, limit);
4851 }
4852
4861 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4862 {
4863 return mImpl->addIterator(tensor, axis, reverse);
4864 }
4865
4874 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4875 {
4876 return mImpl->addLoopOutput(tensor, outputKind, axis);
4877 }
4878
4889 void setName(char const* name) noexcept
4890 {
4891 mImpl->setName(name);
4892 }
4893
4899 char const* getName() const noexcept
4900 {
4901 return mImpl->getName();
4902 }
4903
4904protected:
4905 virtual ~ILoop() noexcept = default;
4906 apiv::VLoop* mImpl;
4907};
4908
4921class ISelectLayer : public ILayer
4922{
4923protected:
4924 virtual ~ISelectLayer() noexcept = default;
4925 apiv::VSelectLayer* mImpl;
4926};
4927
4944{
4945public:
4954 void setMessage(char const* message) noexcept
4955 {
4956 mImpl->setMessage(message);
4957 }
4958
4964 char const* getMessage() const noexcept
4965 {
4966 return mImpl->getMessage();
4967 }
4968
4969protected:
4970 virtual ~IAssertionLayer() noexcept = default;
4971
4972 apiv::VAssertionLayer* mImpl;
4973};
4974
4982enum class FillOperation : int32_t
4983{
4999 kLINSPACE = 0,
5000
5002 kRANDOM_UNIFORM = 1,
5003
5005 kRANDOM_NORMAL = 2
5006};
5007
5013template <>
5014constexpr inline int32_t EnumMax<FillOperation>() noexcept
5015{
5016 return 3;
5017}
5018
5054class IFillLayer : public ILayer
5055{
5056public:
5065 //
5066 void setDimensions(Dims const& dimensions) noexcept
5067 {
5068 mImpl->setDimensions(dimensions);
5069 }
5070
5081 Dims getDimensions() const noexcept
5082 {
5083 return mImpl->getDimensions();
5084 }
5085
5091 void setOperation(FillOperation op) noexcept
5092 {
5093 mImpl->setOperation(op);
5094 }
5095
5102 {
5103 return mImpl->getOperation();
5104 }
5105
5119 //
5120 void setAlpha(double alpha) noexcept
5121 {
5122 mImpl->setAlpha(alpha);
5123 }
5124
5135 double getAlpha() const noexcept
5136 {
5137 return mImpl->getAlpha();
5138 }
5139
5154 void setBeta(double beta) noexcept
5155 {
5156 mImpl->setBeta(beta);
5157 }
5158
5169 double getBeta() const noexcept
5170 {
5171 return mImpl->getBeta();
5172 }
5173
5214 using ILayer::setInput;
5215
5229 //
5230 void setAlphaInt64(int64_t alpha) noexcept
5231 {
5232 mImpl->setAlphaInt64(alpha);
5233 }
5234
5245 int64_t getAlphaInt64() const noexcept
5246 {
5247 return mImpl->getAlphaInt64();
5248 }
5249
5264 void setBetaInt64(int64_t beta) noexcept
5265 {
5266 mImpl->setBetaInt64(beta);
5267 }
5268
5279 int64_t getBetaInt64() const noexcept
5280 {
5281 return mImpl->getBetaInt64();
5282 }
5283
5287 bool isAlphaBetaInt64() const noexcept
5288 {
5289 return mImpl->isAlphaBetaInt64();
5290 }
5291
5304 void setToType(DataType toType) noexcept
5305 {
5306 mImpl->setToType(toType);
5307 }
5308
5316 DataType getToType() const noexcept
5317 {
5318 return mImpl->getToType();
5319 }
5320
5321protected:
5322 virtual ~IFillLayer() noexcept = default;
5323 apiv::VFillLayer* mImpl;
5324};
5325
5401{
5402public:
5411 int32_t getAxis() const noexcept
5412 {
5413 return mImpl->getAxis();
5414 }
5422 void setAxis(int32_t axis) noexcept
5423 {
5424 mImpl->setAxis(axis);
5425 }
5426
5438 void setToType(DataType toType) noexcept
5439 {
5440 mImpl->setToType(toType);
5441 }
5442
5450 DataType getToType() const noexcept
5451 {
5452 return mImpl->getToType();
5453 }
5454
5455protected:
5456 virtual ~IQuantizeLayer() noexcept = default;
5457 apiv::VQuantizeLayer* mImpl;
5458};
5459
5532{
5533public:
5542 int32_t getAxis() const noexcept
5543 {
5544 return mImpl->getAxis();
5545 }
5553 void setAxis(int32_t axis) noexcept
5554 {
5555 mImpl->setAxis(axis);
5556 }
5557
5569 void setToType(DataType toType) noexcept
5570 {
5571 mImpl->setToType(toType);
5572 }
5573
5581 DataType getToType() const noexcept
5582 {
5583 return mImpl->getToType();
5584 }
5585
5586protected:
5587 virtual ~IDequantizeLayer() noexcept = default;
5588 apiv::VDequantizeLayer* mImpl;
5589};
5590
5609{
5610public:
5622 using ILayer::setInput;
5623
5636 void setToType(DataType toType) noexcept
5637 {
5638 mImpl->setToType(toType);
5639 }
5640
5649 DataType getToType() const noexcept
5650 {
5651 return mImpl->getToType();
5652 }
5653
5661 void setScaleType(DataType scaleType) noexcept
5662 {
5663 mImpl->setScaleType(scaleType);
5664 }
5665
5674 DataType getScaleType() const noexcept
5675 {
5676 return mImpl->getScaleType();
5677 }
5678
5687 void setAxis(int32_t axis) noexcept
5688 {
5689 mImpl->setAxis(axis);
5690 }
5691
5697 int32_t getAxis() const noexcept
5698 {
5699 return mImpl->getAxis();
5700 }
5701
5710 void setBlockSize(int32_t size) noexcept
5711 {
5712 mImpl->setBlockSize(size);
5713 }
5714
5720 int32_t getBlockSize() const noexcept
5721 {
5722 return mImpl->getBlockSize();
5723 }
5724
5725protected:
5726 virtual ~IDynamicQuantizeLayer() noexcept = default;
5727 apiv::VDynamicQuantizeLayer* mImpl;
5728};
5729
5766class IEinsumLayer : public ILayer
5767{
5768public:
5778 bool setEquation(char const* equation) noexcept
5779 {
5780 return mImpl->setEquation(equation);
5781 }
5782
5788 char const* getEquation() const noexcept
5789 {
5790 return mImpl->getEquation();
5791 }
5792
5793protected:
5794 virtual ~IEinsumLayer() noexcept = default;
5795 apiv::VEinsumLayer* mImpl;
5796};
5797
5805enum class ScatterMode : int32_t
5806{
5807 kELEMENT = 0,
5808 kND = 1,
5809};
5810
5816template <>
5817constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5818{
5819 return 2;
5820}
5821
5879class IScatterLayer : public ILayer
5880{
5881public:
5887 void setMode(ScatterMode mode) noexcept
5888 {
5889 mImpl->setMode(mode);
5890 }
5891
5897 ScatterMode getMode() const noexcept
5898 {
5899 return mImpl->getMode();
5900 }
5901
5907 void setAxis(int32_t axis) noexcept
5908 {
5909 mImpl->setAxis(axis);
5910 }
5911
5915 int32_t getAxis() const noexcept
5916 {
5917 return mImpl->getAxis();
5918 }
5919
5920protected:
5921 apiv::VScatterLayer* mImpl;
5922 virtual ~IScatterLayer() noexcept = default;
5923}; // class IScatterLayer
5924
5951class IOneHotLayer : public ILayer
5952{
5953public:
5959 void setAxis(int32_t axis) noexcept
5960 {
5961 mImpl->setAxis(axis);
5962 }
5963
5967 int32_t getAxis() const noexcept
5968 {
5969 return mImpl->getAxis();
5970 }
5971
5972protected:
5973 apiv::VOneHotLayer* mImpl;
5974 virtual ~IOneHotLayer() noexcept = default;
5975};
5976
5989{
5990public:
5997 {
5998 mImpl->setInterpolationMode(mode);
5999 }
6000
6009 {
6010 return mImpl->getInterpolationMode();
6011 }
6012
6018 void setAlignCorners(bool alignCorners) noexcept
6019 {
6020 mImpl->setAlignCorners(alignCorners);
6021 }
6022
6030 bool getAlignCorners() const noexcept
6031 {
6032 return mImpl->getAlignCorners();
6033 }
6034
6042 bool setSampleMode(SampleMode mode) noexcept
6043 {
6044 return mImpl->setSampleMode(mode);
6045 }
6046
6054 SampleMode getSampleMode() const noexcept
6055 {
6056 return mImpl->getSampleMode();
6057 }
6058
6059protected:
6060 apiv::VGridSampleLayer* mImpl;
6061 virtual ~IGridSampleLayer() noexcept = default;
6062}; // class IGridSampleLayer
6063
6071enum class BoundingBoxFormat : int32_t
6072{
6074 kCORNER_PAIRS = 0,
6076 kCENTER_SIZES = 1
6077};
6078
6084template <>
6085constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6086{
6087 return 2;
6088}
6089
6136class INMSLayer : public ILayer
6137{
6138public:
6149 {
6150 mImpl->setBoundingBoxFormat(fmt);
6151 }
6152
6161 {
6162 return mImpl->getBoundingBoxFormat();
6163 }
6164
6174 void setTopKBoxLimit(int32_t limit) noexcept
6175 {
6176 mImpl->setTopKBoxLimit(limit);
6177 }
6178
6184 int32_t getTopKBoxLimit() const noexcept
6185 {
6186 return mImpl->getTopKBoxLimit();
6187 }
6188
6207 using ILayer::setInput;
6208
6209protected:
6210 apiv::VNMSLayer* mImpl;
6211 virtual ~INMSLayer() noexcept = default;
6212}; // class INMSLayer
6213
6227{
6228public:
6237 void setBatchAxis(int32_t batchAxis) noexcept
6238 {
6239 mImpl->setBatchAxis(batchAxis);
6240 }
6241
6247 int32_t getBatchAxis() const noexcept
6248 {
6249 return mImpl->getBatchAxis();
6250 }
6251
6260 void setSequenceAxis(int32_t sequenceAxis) noexcept
6261 {
6262 mImpl->setSequenceAxis(sequenceAxis);
6263 }
6264
6270 int32_t getSequenceAxis() const noexcept
6271 {
6272 return mImpl->getSequenceAxis();
6273 }
6274
6275protected:
6276 apiv::VReverseSequenceLayer* mImpl;
6277 virtual ~IReverseSequenceLayer() noexcept = default;
6278}; // class IReverseSequenceLayer
6279
6299{
6300public:
6308 void setEpsilon(float eps) noexcept
6309 {
6310 return mImpl->setEpsilon(eps);
6311 }
6312
6318 float getEpsilon() const noexcept
6319 {
6320 return mImpl->getEpsilon();
6321 }
6322
6328 void setAxes(uint32_t axesMask) noexcept
6329 {
6330 return mImpl->setAxes(axesMask);
6331 }
6332
6338 uint32_t getAxes() const noexcept
6339 {
6340 return mImpl->getAxes();
6341 }
6342
6359 void setNbGroups(int64_t nbGroups) noexcept
6360 {
6361 return mImpl->setNbGroups(nbGroups);
6362 }
6363
6369 int64_t getNbGroups() const noexcept
6370 {
6371 return mImpl->getNbGroups();
6372 }
6373
6395 void setComputePrecision(DataType type) noexcept
6396 {
6397 return mImpl->setComputePrecision(type);
6398 }
6399
6406 {
6407 return mImpl->getComputePrecision();
6408 }
6409
6410protected:
6411 apiv::VNormalizationLayer* mImpl;
6412 virtual ~INormalizationLayer() noexcept = default;
6413};
6414
6415
6424class ISqueezeLayer : public ILayer
6425{
6426public:
6439 using ILayer::setInput;
6440
6441protected:
6442 apiv::VSqueezeLayer* mImpl;
6443 virtual ~ISqueezeLayer() noexcept = default;
6444};
6445
6454{
6455public:
6468 using ILayer::setInput;
6469
6470protected:
6471 apiv::VUnsqueezeLayer* mImpl;
6472 virtual ~IUnsqueezeLayer() noexcept = default;
6473};
6474
6486enum class CumulativeOperation : int32_t
6487{
6488 kSUM = 0,
6489};
6490
6491namespace impl
6492{
6493
6499template <>
6501{
6502 static constexpr int32_t kVALUE = 1;
6503};
6504
6505} // namespace impl
6506
6535{
6536public:
6547 {
6548 return mImpl->setOperation(op);
6549 }
6550
6559 {
6560 return mImpl->getOperation();
6561 }
6562
6570 void setExclusive(bool exclusive) noexcept
6571 {
6572 mImpl->setExclusive(exclusive);
6573 }
6574
6582 bool getExclusive() const noexcept
6583 {
6584 return mImpl->getExclusive();
6585 }
6586
6594 void setReverse(bool reverse) noexcept
6595 {
6596 mImpl->setReverse(reverse);
6597 }
6598
6606 bool getReverse() const noexcept
6607 {
6608 return mImpl->getReverse();
6609 }
6610
6611protected:
6612 apiv::VCumulativeLayer* mImpl;
6613 virtual ~ICumulativeLayer() noexcept = default;
6614};
6615
6634{
6635public:
6636 virtual ~INetworkDefinition() noexcept = default;
6637
6674 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6675 {
6676 return mImpl->addInput(name, type, dimensions);
6677 }
6678
6688 void markOutput(ITensor& tensor) noexcept
6689 {
6690 mImpl->markOutput(tensor);
6691 }
6692
6706 bool markDebug(ITensor& tensor) noexcept
6707 {
6708 return mImpl->markDebug(tensor);
6709 }
6710
6722 bool unmarkDebug(ITensor& tensor) noexcept
6723 {
6724 return mImpl->unmarkDebug(tensor);
6725 }
6726
6732 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6733 {
6734 return mImpl->isDebugTensor(tensor);
6735 }
6736
6753 {
6754 return mImpl->addActivation(input, type);
6755 }
6756
6771 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6772 {
6773 return mImpl->addLRN(input, window, alpha, beta, k);
6774 }
6775
6797 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6798 {
6799 return mImpl->addScale(input, mode, shift, scale, power);
6800 }
6801
6811 {
6812 return mImpl->addSoftMax(input);
6813 }
6814
6827 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6828 {
6829 return mImpl->addConcatenation(inputs, nbInputs);
6830 }
6831
6855 {
6856 return mImpl->addElementWise(input1, input2, op);
6857 }
6858
6876 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6877 {
6878 return mImpl->addUnary(input, operation);
6879 }
6880
6891 {
6892 return mImpl->addShuffle(input);
6893 }
6894
6907 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6908 {
6909 return mImpl->addOneHot(indices, values, depth, axis);
6910 }
6911
6919 int32_t getNbLayers() const noexcept
6920 {
6921 return mImpl->getNbLayers();
6922 }
6923
6933 ILayer* getLayer(int32_t index) const noexcept
6934 {
6935 return mImpl->getLayer(index);
6936 }
6937
6945 int32_t getNbInputs() const noexcept
6946 {
6947 return mImpl->getNbInputs();
6948 }
6949
6961 ITensor* getInput(int32_t index) const noexcept
6962 {
6963 return mImpl->getInput(index);
6964 }
6965
6975 int32_t getNbOutputs() const noexcept
6976 {
6977 return mImpl->getNbOutputs();
6978 }
6979
6991 ITensor* getOutput(int32_t index) const noexcept
6992 {
6993 return mImpl->getOutput(index);
6994 }
6995
7018 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7019 {
7020 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7021 }
7022
7050 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7051 {
7052 return mImpl->addTopK(input, op, k, reduceAxes);
7053 }
7054
7066 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7067 {
7068 return mImpl->addGather(data, indices, axis);
7069 }
7070
7082 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7083 {
7084 return mImpl->addGatherV2(data, indices, mode);
7085 }
7086
7102 {
7103 return mImpl->addRaggedSoftMax(input, bounds);
7104 }
7105
7123 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7124 {
7125 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7126 }
7127
7138 {
7139 return mImpl->addNonZero(input);
7140 }
7141
7161 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7162 {
7163 return mImpl->addConstant(dimensions, weights);
7164 }
7165
7176 {
7177 return mImpl->addIdentity(input);
7178 }
7179
7190 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7191 {
7192 return mImpl->addCast(input, toType);
7193 }
7194
7205 void removeTensor(ITensor& tensor) noexcept
7206 {
7207 mImpl->removeTensor(tensor);
7208 }
7209
7217 void unmarkOutput(ITensor& tensor) noexcept
7218 {
7219 mImpl->unmarkOutput(tensor);
7220 }
7221
7238 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7239 {
7240 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7241 }
7242
7256 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
7257 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
7258 {
7259 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
7260 }
7261
7276 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7277 {
7278 return mImpl->addSlice(input, start, size, stride);
7279 }
7280
7300 void setName(char const* name) noexcept
7301 {
7302 mImpl->setName(name);
7303 }
7304
7314 char const* getName() const noexcept
7315 {
7316 return mImpl->getName();
7317 }
7318
7330 IShapeLayer* addShape(ITensor& input) noexcept
7331 {
7332 return mImpl->addShape(input);
7333 }
7334
7345 {
7346 return mImpl->hasImplicitBatchDimension();
7347 }
7348
7355 {
7356 return mImpl->getFlags();
7357 }
7358
7366 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7367 {
7368 return mImpl->getFlag(networkDefinitionCreationFlag);
7369 }
7370
7383 bool markOutputForShapes(ITensor& tensor) noexcept
7384 {
7385 return mImpl->markOutputForShapes(tensor);
7386 }
7387
7395 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7396 {
7397 return mImpl->unmarkOutputForShapes(tensor);
7398 }
7399
7414 {
7415 return mImpl->addParametricReLU(input, slope);
7416 }
7417
7436 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7437 {
7438 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7439 }
7440
7455 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7456 {
7457 return mImpl->addPoolingNd(input, type, windowSize);
7458 }
7459
7474 //
7478 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7479 {
7480 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7481 }
7482
7515 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7516 {
7517 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7518 }
7519
7532 {
7533 return mImpl->addResize(input);
7534 }
7535
7545 ILoop* addLoop() noexcept
7546 {
7547 return mImpl->addLoop();
7548 }
7549
7561 {
7562 return mImpl->addIfConditional();
7563 }
7564
7599 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7600 {
7601 return mImpl->addSelect(condition, thenInput, elseInput);
7602 }
7603
7616 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7617 {
7618 return mImpl->addAssertion(condition, message);
7619 }
7620
7641 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7642 {
7643 return mImpl->addFill(dimensions, op);
7644 }
7645
7667 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7668 {
7669 return mImpl->addFillV2(dimensions, op, outputType);
7670 }
7671
7683 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7684 {
7685 return mImpl->addPaddingNd(input, prePadding, postPadding);
7686 }
7687
7707 bool setWeightsName(Weights weights, char const* name) noexcept
7708 {
7709 return mImpl->setWeightsName(weights, name);
7710 }
7711
7723 //
7726 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7727 {
7728 mImpl->setErrorRecorder(recorder);
7729 }
7730
7742 {
7743 return mImpl->getErrorRecorder();
7744 }
7745
7763 {
7764 return mImpl->addDequantize(input, scale);
7765 }
7766
7784 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7785 {
7786 return mImpl->addDequantizeV2(input, scale, outputType);
7787 }
7788
7804 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7805 {
7806 return mImpl->addScatter(data, indices, updates, mode);
7807 }
7808
7826 {
7827 return mImpl->addQuantize(input, scale);
7828 }
7829
7847 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7848 {
7849 return mImpl->addQuantizeV2(input, scale, outputType);
7850 }
7851
7873 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
7874 {
7875 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
7876 }
7877
7888 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7889 {
7890 return mImpl->addEinsum(inputs, nbInputs, equation);
7891 }
7892
7907 {
7908 return mImpl->addGridSample(input, grid);
7909 }
7910
7924 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7925 {
7926 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7927 }
7928
7942 {
7943 return mImpl->addReverseSequence(input, sequenceLens);
7944 }
7945
7967 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
7968 {
7969 return mImpl->addNormalization(input, scale, bias, axesMask);
7970 }
7971
7989 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
7990 {
7991 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
7992 }
7993
8000 virtual IBuilder& getBuilder() const noexcept
8001 {
8002 return mImpl->getBuilder();
8003 }
8004
8013 bool markWeightsRefittable(char const* name) noexcept
8014 {
8015 return mImpl->markWeightsRefittable(name);
8016 }
8017
8025 bool unmarkWeightsRefittable(char const* name) noexcept
8026 {
8027 return mImpl->unmarkWeightsRefittable(name);
8028 }
8029
8038 bool areWeightsMarkedRefittable(char const* name) const noexcept
8039 {
8040 return mImpl->areWeightsMarkedRefittable(name);
8041 }
8042
8057 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8058 {
8059 return mImpl->addSqueeze(input, axes);
8060 }
8061
8079 {
8080 return mImpl->addUnsqueeze(input, axes);
8081 }
8082
8083protected:
8084 apiv::VNetworkDefinition* mImpl;
8085};
8086
8094enum class CalibrationAlgoType : int32_t
8095{
8100};
8101
8107template <>
8108constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8109{
8110 return 4;
8111}
8112
8127{
8128public:
8136 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
8137
8152 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8153
8168 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8169
8178 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8179
8185 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8186
8187 ~IInt8Calibrator() noexcept override = default;
8188};
8189
8190namespace v_1_0
8191{
8193{
8194public:
8198 InterfaceInfo getInterfaceInfo() const noexcept override
8199 {
8200 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
8201 }
8202
8207 {
8209 }
8210
8211 ~IInt8EntropyCalibrator() noexcept override = default;
8212};
8213} // namespace v_1_0
8214
8229
8230namespace v_1_0
8231{
8233{
8234public:
8238 InterfaceInfo getInterfaceInfo() const noexcept override
8239 {
8240 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
8241 }
8242
8247 {
8249 }
8250
8251 ~IInt8EntropyCalibrator2() noexcept override = default;
8252};
8253} // namespace v_1_0
8254
8269
8270namespace v_1_0
8271{
8273{
8274public:
8278 InterfaceInfo getInterfaceInfo() const noexcept override
8279 {
8280 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
8281 }
8282
8287 {
8289 }
8290
8291 ~IInt8MinMaxCalibrator() noexcept override = default;
8292};
8293} // namespace v_1_0
8294
8308
8309namespace v_1_0
8310{
8312{
8313public:
8317 InterfaceInfo getInterfaceInfo() const noexcept override
8318 {
8319 return InterfaceInfo{"IInt8Calibrator", 1, 0};
8320 }
8321
8326 {
8328 }
8329
8336 virtual double getQuantile() const noexcept = 0;
8337
8344 virtual double getRegressionCutoff() const noexcept = 0;
8345
8358 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8359
8368 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8369
8370 ~IInt8LegacyCalibrator() noexcept override = default;
8371};
8372} // namespace v_1_0
8373
8388
8402{
8403public:
8409 DataType getDataType() const noexcept
8410 {
8411 return mImpl->getDataType();
8412 }
8413
8420 Dims getStrides() const noexcept
8421 {
8422 return mImpl->getStrides();
8423 }
8424
8430 int64_t getVectorizedDim() const noexcept
8431 {
8432 return mImpl->getVectorizedDim();
8433 }
8434
8441 int64_t getComponentsPerElement() const noexcept
8442 {
8443 return mImpl->getComponentsPerElement();
8444 }
8445
8446protected:
8447 virtual ~IAlgorithmIOInfo() noexcept = default;
8448 apiv::VAlgorithmIOInfo* mImpl;
8449};
8450
8465{
8466public:
8470 int64_t getImplementation() const noexcept
8471 {
8472 return mImpl->getImplementation();
8473 }
8474
8478 int64_t getTactic() const noexcept
8479 {
8480 return mImpl->getTactic();
8481 }
8482
8483protected:
8484 virtual ~IAlgorithmVariant() noexcept = default;
8485 apiv::VAlgorithmVariant* mImpl;
8486};
8487
8499{
8500public:
8506 char const* getName() const noexcept
8507 {
8508 return mImpl->getName();
8509 }
8510
8518 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8519 {
8520 return mImpl->getDimensions(index, select);
8521 }
8522
8526 int32_t getNbInputs() const noexcept
8527 {
8528 return mImpl->getNbInputs();
8529 }
8530
8534 int32_t getNbOutputs() const noexcept
8535 {
8536 return mImpl->getNbOutputs();
8537 }
8538
8539protected:
8540 virtual ~IAlgorithmContext() noexcept = default;
8541 apiv::VAlgorithmContext* mImpl;
8542};
8543
8558{
8559public:
8564 {
8565 return mImpl->getAlgorithmVariant();
8566 }
8567
8571 float getTimingMSec() const noexcept
8572 {
8573 return mImpl->getTimingMSec();
8574 }
8575
8579 std::size_t getWorkspaceSize() const noexcept
8580 {
8581 return mImpl->getWorkspaceSize();
8582 }
8583
8593 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8594 {
8595 return mImpl->getAlgorithmIOInfoByIndex(index);
8596 }
8597
8598protected:
8599 virtual ~IAlgorithm() noexcept = default;
8600 apiv::VAlgorithm* mImpl;
8601}; // IAlgorithm
8602
8603namespace v_1_0
8604{
8606{
8607public:
8611 InterfaceInfo getInterfaceInfo() const noexcept override
8612 {
8613 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8614 }
8629 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8630 int32_t nbChoices, int32_t* selection) noexcept = 0;
8631
8642 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8643 int32_t nbAlgorithms) noexcept = 0;
8644
8645 virtual ~IAlgorithmSelector() noexcept = default;
8646};
8647} // namespace v_1_0
8648
8662
8669using QuantizationFlags = uint32_t;
8670
8680enum class QuantizationFlag : int32_t
8681{
8686};
8687
8693template <>
8694constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8695{
8696 return 1;
8697}
8698
8716enum class RuntimePlatform : int32_t
8717{
8720 kSAME_AS_BUILD = 0,
8721
8724 kWINDOWS_AMD64 = 1,
8725};
8726
8727namespace impl
8728{
8734template <>
8736{
8737 static constexpr int32_t kVALUE = 2;
8738};
8739} // namespace impl
8740
8747using BuilderFlags = uint32_t;
8748
8756enum class BuilderFlag : int32_t
8757{
8759 kFP16 = 0,
8760
8762 kINT8 = 1,
8763
8765 kDEBUG = 2,
8766
8768 kGPU_FALLBACK = 3,
8769
8771 kREFIT = 4,
8772
8775
8779 kTF32 = 6,
8780
8782 kSPARSE_WEIGHTS = 7,
8783
8790 kSAFETY_SCOPE = 8,
8791
8794
8798
8804
8808
8815
8821
8827 kFP8 = 15,
8828
8832
8835 kBF16 = 17,
8836
8842
8844 kSTRIP_PLAN = 19,
8845
8848
8855 kREFIT_IDENTICAL = 20,
8856
8882 kWEIGHT_STREAMING = 21,
8883
8885 kINT4 = 22,
8886
8891 kREFIT_INDIVIDUAL = 23,
8892
8901 kSTRICT_NANS = 24,
8902
8904 kMONITOR_MEMORY = 25,
8905
8907 kFP4 = 26,
8908
8911};
8912
8918template <>
8919constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8920{
8921 return 28;
8922}
8923
8924namespace v_1_0
8925{
8939{
8940 uint8_t data[16];
8941};
8942
8951{
8953 uint64_t tacticHash;
8957 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8958};
8959} // namespace v_1_0
8960
8974class ITimingCache : public INoCopy
8975{
8976public:
8977 virtual ~ITimingCache() noexcept = default;
8978
8988 nvinfer1::IHostMemory* serialize() const noexcept
8989 {
8990 return mImpl->serialize();
8991 }
8992
9012 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
9013 {
9014 return mImpl->combine(inputCache, ignoreMismatch);
9015 }
9016
9022 bool reset() noexcept
9023 {
9024 return mImpl->reset();
9025 }
9026
9041 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
9042 {
9043 return mImpl->queryKeys(keyBuffer, capacity);
9044 }
9045
9058 TimingCacheValue query(TimingCacheKey const& key) const noexcept
9059 {
9060 return mImpl->query(key);
9061 }
9062
9080 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
9081 {
9082 return mImpl->update(key, value);
9083 }
9084
9085protected:
9086 apiv::VTimingCache* mImpl;
9087};
9088
9096enum class MemoryPoolType : int32_t
9097{
9104 kWORKSPACE = 0,
9105
9113
9119 kDLA_LOCAL_DRAM = 2,
9120
9126 kDLA_GLOBAL_DRAM = 3,
9127
9135 kTACTIC_DRAM = 4,
9136
9150};
9151
9157template <>
9158constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9159{
9160 return 6;
9161}
9162
9171enum class PreviewFeature : int32_t
9172{
9179
9184
9191};
9192
9193namespace impl
9194{
9200template <>
9202{
9203 static constexpr int32_t kVALUE = 3;
9204};
9205} // namespace impl
9206
9215enum class HardwareCompatibilityLevel : int32_t
9216{
9219 kNONE = 0,
9220
9232 kAMPERE_PLUS = 1,
9233
9243};
9244
9245namespace impl
9246{
9252template <>
9254{
9255 static constexpr int32_t kVALUE = 3;
9256};
9257} // namespace impl
9258
9267enum class TilingOptimizationLevel : int32_t
9268{
9270 kNONE = 0,
9271
9273 kFAST = 1,
9274
9277 kMODERATE = 2,
9278
9280 kFULL = 3
9281
9282};
9283
9284namespace impl
9285{
9291template <>
9293{
9294 static constexpr int32_t kVALUE = 4;
9295};
9296} // namespace impl
9297
9298namespace v_1_0
9299{
9301{
9302public:
9303 IProgressMonitor() = default;
9304 virtual ~IProgressMonitor() noexcept = default;
9305
9309 InterfaceInfo getInterfaceInfo() const noexcept override
9310 {
9311 return InterfaceInfo{"IProgressMonitor", 1, 0};
9312 }
9313
9333 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9334
9347 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9348
9360 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9361
9362}; // class IProgressMonitor
9363} // namespace v_1_0
9364
9385
9394{
9395public:
9396 virtual ~IBuilderConfig() noexcept = default;
9397
9406 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9407 {
9408 mImpl->setAvgTimingIterations(avgTiming);
9409 }
9410
9418 int32_t getAvgTimingIterations() const noexcept
9419 {
9420 return mImpl->getAvgTimingIterations();
9421 }
9422
9431 void setEngineCapability(EngineCapability capability) noexcept
9432 {
9433 mImpl->setEngineCapability(capability);
9434 }
9435
9444 {
9445 return mImpl->getEngineCapability();
9446 }
9447
9456 {
9457 mImpl->setInt8Calibrator(calibrator);
9458 }
9459
9466 {
9467 return mImpl->getInt8Calibrator();
9468 }
9469
9482 void setFlags(BuilderFlags builderFlags) noexcept
9483 {
9484 mImpl->setFlags(builderFlags);
9485 }
9486
9494 BuilderFlags getFlags() const noexcept
9495 {
9496 return mImpl->getFlags();
9497 }
9498
9506 void clearFlag(BuilderFlag builderFlag) noexcept
9507 {
9508 mImpl->clearFlag(builderFlag);
9509 }
9510
9518 void setFlag(BuilderFlag builderFlag) noexcept
9519 {
9520 mImpl->setFlag(builderFlag);
9521 }
9522
9530 bool getFlag(BuilderFlag builderFlag) const noexcept
9531 {
9532 return mImpl->getFlag(builderFlag);
9533 }
9534
9547 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9548 {
9549 mImpl->setDeviceType(layer, deviceType);
9550 }
9551
9557 DeviceType getDeviceType(ILayer const* layer) const noexcept
9558 {
9559 return mImpl->getDeviceType(layer);
9560 }
9561
9569 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9570 {
9571 return mImpl->isDeviceTypeSet(layer);
9572 }
9573
9579 void resetDeviceType(ILayer const* layer) noexcept
9580 {
9581 mImpl->resetDeviceType(layer);
9582 }
9583
9589 bool canRunOnDLA(ILayer const* layer) const noexcept
9590 {
9591 return mImpl->canRunOnDLA(layer);
9592 }
9593
9605 void setDLACore(int32_t dlaCore) noexcept
9606 {
9607 mImpl->setDLACore(dlaCore);
9608 }
9609
9615 int32_t getDLACore() const noexcept
9616 {
9617 return mImpl->getDLACore();
9618 }
9619
9626 void setDefaultDeviceType(DeviceType deviceType) noexcept
9627 {
9628 mImpl->setDefaultDeviceType(deviceType);
9629 }
9630
9637 {
9638 return mImpl->getDefaultDeviceType();
9639 }
9640
9646 void reset() noexcept
9647 {
9648 mImpl->reset();
9649 }
9650
9658 void setProfileStream(const cudaStream_t stream) noexcept
9659 {
9660 return mImpl->setProfileStream(stream);
9661 }
9662
9670 cudaStream_t getProfileStream() const noexcept
9671 {
9672 return mImpl->getProfileStream();
9673 }
9674
9687 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9688 {
9689 return mImpl->addOptimizationProfile(profile);
9690 }
9691
9700 int32_t getNbOptimizationProfiles() const noexcept
9701 {
9702 return mImpl->getNbOptimizationProfiles();
9703 }
9704
9713 {
9714 mImpl->setProfilingVerbosity(verbosity);
9715 }
9716
9726 {
9727 return mImpl->getProfilingVerbosity();
9728 }
9729
9738 {
9739 mImpl->setAlgorithmSelector(selector);
9740 }
9741
9748 {
9749 return mImpl->getAlgorithmSelector();
9750 }
9751
9766 {
9767 return mImpl->setCalibrationProfile(profile);
9768 }
9769
9778 {
9779 return mImpl->getCalibrationProfile();
9780 }
9781
9797 {
9798 mImpl->setQuantizationFlags(flags);
9799 }
9800
9811 {
9812 return mImpl->getQuantizationFlags();
9813 }
9814
9825 {
9826 mImpl->clearQuantizationFlag(flag);
9827 }
9828
9839 {
9840 mImpl->setQuantizationFlag(flag);
9841 }
9842
9853 {
9854 return mImpl->getQuantizationFlag(flag);
9855 }
9856
9874 bool setTacticSources(TacticSources tacticSources) noexcept
9875 {
9876 return mImpl->setTacticSources(tacticSources);
9877 }
9878
9890 {
9891 return mImpl->getTacticSources();
9892 }
9893
9909 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9910 {
9911 return mImpl->createTimingCache(blob, size);
9912 }
9913
9932 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9933 {
9934 return mImpl->setTimingCache(cache, ignoreMismatch);
9935 }
9936
9943 {
9944 return mImpl->getTimingCache();
9945 }
9946
9974 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9975 {
9976 mImpl->setMemoryPoolLimit(pool, poolSize);
9977 }
9978
9993 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9994 {
9995 return mImpl->getMemoryPoolLimit(pool);
9996 }
9997
10011 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
10012 {
10013 mImpl->setPreviewFeature(feature, enable);
10014 }
10015
10025 bool getPreviewFeature(PreviewFeature feature) const noexcept
10026 {
10027 return mImpl->getPreviewFeature(feature);
10028 }
10029
10058 void setBuilderOptimizationLevel(int32_t level) noexcept
10059 {
10060 mImpl->setBuilderOptimizationLevel(level);
10061 }
10062
10071 {
10072 return mImpl->getBuilderOptimizationLevel();
10073 }
10074
10087 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
10088 {
10089 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
10090 }
10091
10101 {
10102 return mImpl->getHardwareCompatibilityLevel();
10103 }
10104
10113 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
10114 {
10115 mImpl->setPluginsToSerialize(paths, nbPaths);
10116 }
10117
10126 char const* getPluginToSerialize(int32_t index) const noexcept
10127 {
10128 return mImpl->getPluginToSerialize(index);
10129 }
10130
10136 int32_t getNbPluginsToSerialize() const noexcept
10137 {
10138 return mImpl->getNbPluginsToSerialize();
10139 }
10140
10165 void setMaxAuxStreams(int32_t nbStreams) noexcept
10166 {
10167 mImpl->setMaxAuxStreams(nbStreams);
10168 }
10169
10175 int32_t getMaxAuxStreams() const noexcept
10176 {
10177 return mImpl->getMaxAuxStreams();
10178 }
10179
10191 void setProgressMonitor(IProgressMonitor* monitor) noexcept
10192 {
10193 return mImpl->setProgressMonitor(monitor);
10194 }
10195
10202 {
10203 return mImpl->getProgressMonitor();
10204 }
10205
10217 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
10218 {
10219 mImpl->setRuntimePlatform(runtimePlatform);
10220 }
10221
10230 {
10231 return mImpl->getRuntimePlatform();
10232 }
10233
10241 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10242 {
10243 mImpl->setMaxNbTactics(maxNbTactics);
10244 }
10245
10253 int32_t getMaxNbTactics() const noexcept
10254 {
10255 return mImpl->getMaxNbTactics();
10256 }
10257
10270 {
10271 return mImpl->setTilingOptimizationLevel(level);
10272 }
10273
10282 {
10283 return mImpl->getTilingOptimizationLevel();
10284 }
10285
10297 bool setL2LimitForTiling(int64_t size) noexcept
10298 {
10299 return mImpl->setL2LimitForTiling(size);
10300 }
10301
10309 int64_t getL2LimitForTiling() const noexcept
10310 {
10311 return mImpl->getL2LimitForTiling();
10312 }
10313
10314protected:
10315 apiv::VBuilderConfig* mImpl;
10316};
10317
10326
10336{
10341
10346 kSTRONGLY_TYPED = 1,
10351
10356};
10357
10363template <>
10364constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10365{
10366 return 4;
10367}
10368
10376class IBuilder : public INoCopy
10377{
10378public:
10379 virtual ~IBuilder() noexcept = default;
10380
10386 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
10387 {
10388 return mImpl->platformHasFastFp16();
10389 }
10390
10397 {
10398 return mImpl->platformHasFastInt8();
10399 }
10400
10408 int32_t getMaxDLABatchSize() const noexcept
10409 {
10410 return mImpl->getMaxDLABatchSize();
10411 }
10412
10416 int32_t getNbDLACores() const noexcept
10417 {
10418 return mImpl->getNbDLACores();
10419 }
10420
10434 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10435 {
10436 mImpl->setGpuAllocator(allocator);
10437 }
10438
10449 {
10450 return mImpl->createBuilderConfig();
10451 }
10452
10475 {
10476 return mImpl->createNetworkV2(flags);
10477 }
10478
10490 {
10491 return mImpl->createOptimizationProfile();
10492 }
10493
10508 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10509 {
10510 mImpl->setErrorRecorder(recorder);
10511 }
10512
10524 {
10525 return mImpl->getErrorRecorder();
10526 }
10527
10531 void reset() noexcept
10532 {
10533 mImpl->reset();
10534 }
10535
10541 TRT_DEPRECATED bool platformHasTf32() const noexcept
10542 {
10543 return mImpl->platformHasTf32();
10544 }
10545
10561 {
10562 return mImpl->buildSerializedNetwork(network, config);
10563 }
10564
10581 {
10582 return mImpl->buildEngineWithConfig(network, config);
10583 }
10584
10602 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10603 {
10604 return mImpl->isNetworkSupported(network, config);
10605 }
10606
10612 ILogger* getLogger() const noexcept
10613 {
10614 return mImpl->getLogger();
10615 }
10616
10628 bool setMaxThreads(int32_t maxThreads) noexcept
10629 {
10630 return mImpl->setMaxThreads(maxThreads);
10631 }
10632
10642 int32_t getMaxThreads() const noexcept
10643 {
10644 return mImpl->getMaxThreads();
10645 }
10646
10653 {
10654 return mImpl->getPluginRegistry();
10655 }
10656
10657protected:
10658 apiv::VBuilder* mImpl;
10659};
10660
10661} // namespace nvinfer1
10662
10667extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10668
10669namespace nvinfer1
10670{
10671namespace
10672{
10673
10681inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10682{
10683 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10684}
10685
10686} // namespace
10687
10701 nvinfer1::EngineCapability capability) noexcept;
10702
10703namespace safe
10704{
10706class IPluginRegistry;
10707} // namespace safe
10708
10716extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
10717 nvinfer1::EngineCapability capability) noexcept;
10718
10719} // namespace nvinfer1
10720
10721#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:55
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:87
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:41
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:42
Definition: NvInferRuntimeBase.h:200
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:203
An Activation layer in a network definition.
Definition: NvInfer.h:1347
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1395
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1356
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1366
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1404
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1413
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1381
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:8499
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8534
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8526
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:8506
virtual ~IAlgorithmContext() noexcept=default
Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for input or output tensor.
Definition: NvInfer.h:8518
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8558
std::size_t getWorkspaceSize() const noexcept
The size of the GPU temporary memory in bytes which the algorithm uses at execution time.
Definition: NvInfer.h:8579
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8571
IAlgorithmIOInfo const * getAlgorithmIOInfoByIndex(int32_t index) const noexcept
Returns the format of an Algorithm input or output. Algorithm inputs are incrementally numbered first...
Definition: NvInfer.h:8593
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8563
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8402
virtual ~IAlgorithmIOInfo() noexcept=default
int64_t getVectorizedDim() const noexcept
Return the index of the vectorized dimension or -1 for non-vectorized formats.
Definition: NvInfer.h:8430
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8420
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8409
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8441
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8465
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8478
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8470
An assertion layer in a network.
Definition: NvInfer.h:4944
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4954
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4964
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:9394
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9974
TRT_DEPRECATED void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9796
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9909
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:10011
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9737
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:9455
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10025
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:10070
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9874
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:10113
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10269
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:10297
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:9465
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9993
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9615
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:10136
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9547
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9431
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10175
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9530
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10241
TRT_DEPRECATED void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9824
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:10309
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:10191
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9712
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9700
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9942
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9646
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9932
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:10126
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9443
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:10229
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9636
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:10217
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10253
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9494
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9482
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9889
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9579
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9605
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:10100
TRT_DEPRECATED QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9810
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9506
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9687
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:10201
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:10315
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9777
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9418
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:9626
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9518
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9765
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9557
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9589
TRT_DEPRECATED bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9852
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9670
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:10087
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:10281
TRT_DEPRECATED void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9838
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10165
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9725
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9569
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:10058
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9658
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9747
Builds an engine from a network definition.
Definition: NvInfer.h:10377
int32_t getMaxDLABatchSize() const noexcept
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combi...
Definition: NvInfer.h:10408
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10416
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10523
apiv::VBuilder * mImpl
Definition: NvInfer.h:10658
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10612
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:10602
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10642
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10652
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:10396
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10489
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10434
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10474
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10448
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10531
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10628
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10508
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10560
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:10541
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10580
A cast layer in a network.
Definition: NvInfer.h:3807
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3833
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3827
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3816
A concatenation layer in a network definition.
Definition: NvInfer.h:2057
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2070
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2080
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4470
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3846
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3856
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3866
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3878
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3896
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3890
A convolution layer in a network definition.
Definition: NvInfer.h:1027
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1152
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1125
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1193
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1297
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1283
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1253
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1100
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1243
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1307
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1046
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1090
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1179
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1076
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1205
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1066
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1036
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1115
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1228
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1271
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1142
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1169
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1218
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3004
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6535
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6546
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6594
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6612
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6582
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6606
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6570
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6558
A deconvolution layer in a network definition.
Definition: NvInfer.h:2098
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2186
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2147
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2171
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2213
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2328
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2394
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2196
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2161
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2117
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2318
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2250
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2301
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2240
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2291
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2346
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2107
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2358
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2384
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2264
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2137
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2223
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2276
A Dequantize layer in a network definition.
Definition: NvInfer.h:5532
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5569
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5542
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5581
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5553
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5609
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5697
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5720
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5674
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5661
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5649
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5636
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5687
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5710
An Einsum layer in a network.
Definition: NvInfer.h:5767
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:5778
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5788
A elementwise layer in a network definition.
Definition: NvInfer.h:2470
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2499
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2493
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2481
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5055
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5287
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5101
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5091
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5316
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5230
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5264
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5154
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5245
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5279
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5135
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5066
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5120
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5304
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5081
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5169
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2603
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:2614
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2649
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2685
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2659
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2669
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2626
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2679
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:5989
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5996
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6042
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6018
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6060
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6054
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6008
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6030
virtual ~IGridSampleLayer() noexcept=default
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:142
A layer that represents the identity function.
Definition: NvInfer.h:3794
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3796
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4449
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4454
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4531
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4572
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4597
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4542
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4560
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4587
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4500
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4487
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:8127
virtual TRT_DEPRECATED int32_t getBatchSize() const noexcept=0
Get the batch size used for calibration batches.
A layer to do iterations.
Definition: NvInfer.h:4762
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4789
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4799
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4775
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4767
A LRN layer in a network definition.
Definition: NvInfer.h:1712
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1733
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1755
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1723
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1789
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1745
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1767
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1777
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1799
Base class for all layer classes in a network definition.
Definition: NvInfer.h:555
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:697
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:813
void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:673
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:576
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:707
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:594
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:826
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:769
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:685
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:586
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:615
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:783
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:625
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:642
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:795
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:607
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:754
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:562
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1542
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4426
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4431
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4819
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4889
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4848
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4861
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:4874
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4899
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4827
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4662
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4692
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4667
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4684
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3686
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3714
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3708
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3696
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6137
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6174
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6148
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6160
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6210
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6184
A network definition for input to the builder.
Definition: NvInfer.h:6634
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6827
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6890
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:7967
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7300
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6706
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6771
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7050
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:7989
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7616
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:7435
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7190
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:7514
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7314
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7413
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6991
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6961
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7784
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7395
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7667
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7545
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:7872
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6752
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7641
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7276
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7825
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8000
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7924
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6933
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7366
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7560
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7741
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8057
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7941
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6945
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7354
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7847
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7017
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6876
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7906
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7205
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8038
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7599
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:7804
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6919
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7344
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8084
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7383
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6907
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6797
IPluginV3Layer * addPluginV3(ITensor *const *inputs, int32_t nbInputs, ITensor *const *shapeInputs, int32_t nbShapeInputs, IPluginV3 &plugin) noexcept
Add a plugin layer implementing the IPluginV3 interface to the network.
Definition: NvInfer.h:7256
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7217
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7175
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7082
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6854
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7161
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7726
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7455
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7101
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7330
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:7066
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8025
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8013
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:7477
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7531
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8078
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7122
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6810
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6732
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6722
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7888
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6688
TRT_DEPRECATED IPluginV2Layer * addPluginV2(ITensor *const *inputs, int32_t nbInputs, IPluginV2 &plugin) noexcept
Add a plugin layer to the network using the IPluginV2 interface.
Definition: NvInfer.h:7238
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:7683
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7137
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7762
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6975
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7707
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3740
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6299
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6318
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6338
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6308
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6405
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6411
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6369
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6328
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6395
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6359
A OneHot layer in a network definition.
Definition: NvInfer.h:5952
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5973
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5959
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5967
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2618
Layer that represents a padding operation.
Definition: NvInfer.h:2964
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3013
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2975
virtual ~IPaddingLayer() noexcept=default
void setPostPaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3001
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2987
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3019
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3910
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3912
virtual ~IParametricReLULayer() noexcept=default
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:2701
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2714
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2708
Layer type for V3 plugins.
Definition: NvInfer.h:2728
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2735
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2741
A Pooling layer in a network definition.
Definition: NvInfer.h:1461
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1480
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1613
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1589
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1533
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1561
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1470
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1626
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1602
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1636
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:1522
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1680
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1508
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1651
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1661
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1692
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1579
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1551
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1495
A Quantize layer in a network definition.
Definition: NvInfer.h:5401
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5438
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5422
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5411
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5450
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3761
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3763
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4615
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2884
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2931
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2891
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2901
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2921
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2911
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2947
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2941
A resize layer in a network definition.
Definition: NvInfer.h:4099
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4260
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4284
virtual ~IResizeLayer() noexcept=default
int32_t getScales(int32_t size, float *scales) const noexcept
Copies resize scales to scales[0, ..., nbScales-1], where nbScales is the number of scales that were ...
Definition: NvInfer.h:4178
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4119
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4316
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4159
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4326
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4270
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4200
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4235
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4339
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4190
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4129
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4294
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4349
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4245
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6227
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6260
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6247
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6276
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6270
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6237
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1858
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1915
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1935
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1905
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1925
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1875
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1885
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1971
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1895
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1865
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1950
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5880
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5887
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5921
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5907
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5915
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5897
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4922
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3489
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3491
Layer type for shuffling data.
Definition: NvInfer.h:3052
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3210
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3063
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3163
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3116
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3103
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3075
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3175
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3204
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3191
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3304
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3373
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3472
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3344
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3451
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3315
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3330
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3398
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3359
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3408
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3388
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3466
A Softmax layer in a network definition.
Definition: NvInfer.h:2002
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2024
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2034
virtual ~ISoftMaxLayer() noexcept=default
Layer that represents a squeeze operation, removing unit dimensions of the input tensor on a set of a...
Definition: NvInfer.h:6425
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6442
A tensor in a network definition.
Definition: NvInfer.h:185
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:431
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:350
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:233
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:389
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:202
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:496
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:262
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:381
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:214
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:475
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:409
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:299
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:324
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:291
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:338
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:307
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:274
apiv::VTensor * mImpl
Definition: NvInfer.h:543
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:399
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:522
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:537
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:369
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:247
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:444
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8975
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:9041
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:9012
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:9058
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:9080
apiv::VTimingCache * mImpl
Definition: NvInfer.h:9086
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:9022
Layer that represents a TopK reduction.
Definition: NvInfer.h:3529
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3560
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3584
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3546
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3616
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3536
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3574
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3594
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4736
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4741
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2809
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2818
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2834
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2828
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6454
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6471
An Interface class for version control.
Definition: NvInferRuntimeBase.h:260
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:225
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:8606
virtual int32_t selectAlgorithms(IAlgorithmContext const &context, IAlgorithm const *const *choices, int32_t nbChoices, int32_t *selection) noexcept=0
Select Algorithms for a layer from the given list of algorithm choices.
virtual void reportAlgorithms(IAlgorithmContext const *const *algoContexts, IAlgorithm const *const *algoChoices, int32_t nbAlgorithms) noexcept=0
Called by TensorRT to report choices it made.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8611
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:397
Definition: NvInferRuntime.h:1610
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8246
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8238
Definition: NvInfer.h:8193
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8206
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8198
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:8312
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8325
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8317
virtual double getQuantile() const noexcept=0
The quantile (between 0 and 1) that will be used to select the region maximum when the quantile metho...
Definition: NvInfer.h:8273
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8286
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8278
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:9301
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.
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:10681
The TensorRT API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2834
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4004
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:9097
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1815
@ 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:8717
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8669
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9216
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6487
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6072
@ kCENTER_SIZES
(x_center, y_center, width, height) where (x_center, y_center) is the center point of the box
@ kCORNER_PAIRS
(x1, y1, x2, y2) where (x1, y1) and (x2, y2) are any pair of diagonal corners
constexpr int32_t EnumMax< BuilderFlag >() noexcept
Definition: NvInfer.h:8919
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:118
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8108
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2762
@ kISINF
Return true if input value equals +/- infinity for floating-point data type.
@ kCOSH
Hyperbolic cosine.
@ kACOSH
Inverse hyperbolic cosine.
@ kERF
Gauss error function.
@ kISNAN
Return true if input value is a NaN for floating-point data type.
@ kACOS
Inverse cosine.
@ kABS
Absolute value.
@ kSINH
Hyperbolic sine.
@ kROUND
Round to nearest even for floating-point data type.
@ kATANH
Inverse hyperbolic tangent.
@ kASINH
Inverse hyperbolic sine.
@ kSIGN
Sign, If input > 0, output 1; if input < 0, output -1; if input == 0, output 0.
@ kEXP
Exponentiation.
@ kATAN
Inverse tangent.
constexpr int32_t EnumMax< ReduceOperation >() noexcept
Definition: NvInfer.h:2871
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4405
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:137
@ 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:4983
@ kRANDOM_UNIFORM
Randomly draw values from a uniform distribution.
@ kRANDOM_NORMAL
Randomly draw values from a normal distribution.
ResizeRoundMode
The rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4034
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
nvinfer1::safe::IPluginRegistry * getBuilderSafePluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Safety engine, or nullptr if no registry exists.
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:993
@ 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:4393
@ 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:10325
PreviewFeature
Define preview features.
Definition: NvInfer.h:9172
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9268
@ kFAST
Use a fast algorithm and heuristic based strategy. Slightly increases engine build time.
@ kFULL
Increase search space even wider. Significantly increases engine build time.
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2521
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:129
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8747
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1304
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1827
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:8095
@ kENTROPY_CALIBRATION_2
Entropy calibration.
@ kLEGACY_CALIBRATION
Legacy calibration.
@ kENTROPY_CALIBRATION
Legacy entropy calibration.
@ kMINMAX_CALIBRATION
Minmax calibration.
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.
@ 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.
@ kUNSQUEEZE
Unsqueeze Layer.
@ kCONCATENATION
Concatenation layer.
@ kONE_HOT
OneHot layer.
@ kREVERSE_SEQUENCE
Reverse sequence layer.
@ kSLICE
Slice layer.
@ kEINSUM
Einsum layer.
@ kSOFTMAX
SoftMax layer.
@ kSHAPE
Shape layer.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kPLUGIN_V3
PluginV3 layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kDYNAMIC_QUANTIZE
Dynamic Quantize layer.
@ kGATHER
Gather layer.
@ kUNARY
UnaryOp operation Layer.
@ kACTIVATION
Activation layer.
@ kELEMENTWISE
Elementwise layer.
@ kSELECT
Select layer.
@ kPLUGIN_V2
PluginV2 layer.
@ kLOOP_OUTPUT
Loop output layer.
@ kCONDITIONAL_OUTPUT
Conditional Output layer.
@ kCONSTANT
Constant layer.
@ kNON_ZERO
NonZero layer.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Definition: NvInfer.h:8694
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3220
@ 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:2509
@ kDEFAULT
Similar to ONNX Gather.
@ kELEMENT
Similar to ONNX GatherElements.
@ kND
Similar to ONNX GatherND.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e....
Definition: NvInfer.h:129
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2846
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:10336
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2419
@ 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.
QuantizationFlag
List of valid flags for quantizing the network to int8.
Definition: NvInfer.h:8681
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3236
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3922
@ 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:8757
@ 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.
@ kFP4
Enable plugins with FP4 input/output.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kFP16
Enable FP16 layer selection, with FP32 fallback.
@ kINT8
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ kINT4
Enable plugins with INT4 input/output.
@ 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.
@ kOBEY_PRECISION_CONSTRAINTS
Require that layers execute in specified precisions. Build fails otherwise.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3512
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9158
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3501
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2857
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4382
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:10364
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5806
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3627
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3950
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2796
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4365
@ kLAST_VALUE
Output value is value of tensor for last iteration.
@ kCONCATENATE
Output value is concatenation of values of tensor for each iteration, in forward order.
@ kREVERSE
Output value is concatenation of values of tensor for each iteration, in reverse order.
constexpr int32_t EnumMax< BoundingBoxFormat >() noexcept
Definition: NvInfer.h:6085
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3655
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1429
@ 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:9384
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5014
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:204
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2578
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5817
Represents a permutation of dimensions.
Definition: NvInfer.h:3029
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:114
The key to retrieve timing cache entries.
Definition: NvInfer.h:8939
Definition: NvInfer.h:8951
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8953
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8955

  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