TensorRT 10.9.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};
5975
5988{
5989public:
5996 {
5997 mImpl->setInterpolationMode(mode);
5998 }
5999
6008 {
6009 return mImpl->getInterpolationMode();
6010 }
6011
6017 void setAlignCorners(bool alignCorners) noexcept
6018 {
6019 mImpl->setAlignCorners(alignCorners);
6020 }
6021
6029 bool getAlignCorners() const noexcept
6030 {
6031 return mImpl->getAlignCorners();
6032 }
6033
6041 bool setSampleMode(SampleMode mode) noexcept
6042 {
6043 return mImpl->setSampleMode(mode);
6044 }
6045
6053 SampleMode getSampleMode() const noexcept
6054 {
6055 return mImpl->getSampleMode();
6056 }
6057
6058protected:
6059 apiv::VGridSampleLayer* mImpl;
6060 virtual ~IGridSampleLayer() noexcept = default;
6061}; // class IGridSampleLayer
6062
6070enum class BoundingBoxFormat : int32_t
6071{
6073 kCORNER_PAIRS = 0,
6075 kCENTER_SIZES = 1
6076};
6077
6083template <>
6084constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6085{
6086 return 2;
6087}
6088
6135class INMSLayer : public ILayer
6136{
6137public:
6148 {
6149 mImpl->setBoundingBoxFormat(fmt);
6150 }
6151
6160 {
6161 return mImpl->getBoundingBoxFormat();
6162 }
6163
6173 void setTopKBoxLimit(int32_t limit) noexcept
6174 {
6175 mImpl->setTopKBoxLimit(limit);
6176 }
6177
6183 int32_t getTopKBoxLimit() const noexcept
6184 {
6185 return mImpl->getTopKBoxLimit();
6186 }
6187
6206 using ILayer::setInput;
6207
6208protected:
6209 apiv::VNMSLayer* mImpl;
6210 virtual ~INMSLayer() noexcept = default;
6211}; // class INMSLayer
6212
6226{
6227public:
6236 void setBatchAxis(int32_t batchAxis) noexcept
6237 {
6238 mImpl->setBatchAxis(batchAxis);
6239 }
6240
6246 int32_t getBatchAxis() const noexcept
6247 {
6248 return mImpl->getBatchAxis();
6249 }
6250
6259 void setSequenceAxis(int32_t sequenceAxis) noexcept
6260 {
6261 mImpl->setSequenceAxis(sequenceAxis);
6262 }
6263
6269 int32_t getSequenceAxis() const noexcept
6270 {
6271 return mImpl->getSequenceAxis();
6272 }
6273
6274protected:
6275 apiv::VReverseSequenceLayer* mImpl;
6276 virtual ~IReverseSequenceLayer() noexcept = default;
6277}; // class IReverseSequenceLayer
6278
6298{
6299public:
6307 void setEpsilon(float eps) noexcept
6308 {
6309 return mImpl->setEpsilon(eps);
6310 }
6311
6317 float getEpsilon() const noexcept
6318 {
6319 return mImpl->getEpsilon();
6320 }
6321
6327 void setAxes(uint32_t axesMask) noexcept
6328 {
6329 return mImpl->setAxes(axesMask);
6330 }
6331
6337 uint32_t getAxes() const noexcept
6338 {
6339 return mImpl->getAxes();
6340 }
6341
6358 void setNbGroups(int64_t nbGroups) noexcept
6359 {
6360 return mImpl->setNbGroups(nbGroups);
6361 }
6362
6368 int64_t getNbGroups() const noexcept
6369 {
6370 return mImpl->getNbGroups();
6371 }
6372
6394 void setComputePrecision(DataType type) noexcept
6395 {
6396 return mImpl->setComputePrecision(type);
6397 }
6398
6405 {
6406 return mImpl->getComputePrecision();
6407 }
6408
6409protected:
6410 apiv::VNormalizationLayer* mImpl;
6411 virtual ~INormalizationLayer() noexcept = default;
6412};
6413
6414
6423class ISqueezeLayer : public ILayer
6424{
6425public:
6438 using ILayer::setInput;
6439
6440protected:
6441 apiv::VSqueezeLayer* mImpl;
6442 virtual ~ISqueezeLayer() noexcept = default;
6443};
6444
6453{
6454public:
6467 using ILayer::setInput;
6468
6469protected:
6470 apiv::VUnsqueezeLayer* mImpl;
6471 virtual ~IUnsqueezeLayer() noexcept = default;
6472};
6473
6485enum class CumulativeOperation : int32_t
6486{
6487 kSUM = 0,
6488};
6489
6490namespace impl
6491{
6492
6498template <>
6500{
6501 static constexpr int32_t kVALUE = 1;
6502};
6503
6504} // namespace impl
6505
6534{
6535public:
6546 {
6547 return mImpl->setOperation(op);
6548 }
6549
6558 {
6559 return mImpl->getOperation();
6560 }
6561
6569 void setExclusive(bool exclusive) noexcept
6570 {
6571 mImpl->setExclusive(exclusive);
6572 }
6573
6581 bool getExclusive() const noexcept
6582 {
6583 return mImpl->getExclusive();
6584 }
6585
6593 void setReverse(bool reverse) noexcept
6594 {
6595 mImpl->setReverse(reverse);
6596 }
6597
6605 bool getReverse() const noexcept
6606 {
6607 return mImpl->getReverse();
6608 }
6609
6610protected:
6611 apiv::VCumulativeLayer* mImpl;
6612 virtual ~ICumulativeLayer() noexcept = default;
6613};
6614
6633{
6634public:
6635 virtual ~INetworkDefinition() noexcept = default;
6636
6673 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6674 {
6675 return mImpl->addInput(name, type, dimensions);
6676 }
6677
6687 void markOutput(ITensor& tensor) noexcept
6688 {
6689 mImpl->markOutput(tensor);
6690 }
6691
6705 bool markDebug(ITensor& tensor) noexcept
6706 {
6707 return mImpl->markDebug(tensor);
6708 }
6709
6721 bool unmarkDebug(ITensor& tensor) noexcept
6722 {
6723 return mImpl->unmarkDebug(tensor);
6724 }
6725
6731 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6732 {
6733 return mImpl->isDebugTensor(tensor);
6734 }
6735
6752 {
6753 return mImpl->addActivation(input, type);
6754 }
6755
6770 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6771 {
6772 return mImpl->addLRN(input, window, alpha, beta, k);
6773 }
6774
6796 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6797 {
6798 return mImpl->addScale(input, mode, shift, scale, power);
6799 }
6800
6810 {
6811 return mImpl->addSoftMax(input);
6812 }
6813
6826 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6827 {
6828 return mImpl->addConcatenation(inputs, nbInputs);
6829 }
6830
6854 {
6855 return mImpl->addElementWise(input1, input2, op);
6856 }
6857
6875 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6876 {
6877 return mImpl->addUnary(input, operation);
6878 }
6879
6890 {
6891 return mImpl->addShuffle(input);
6892 }
6893
6906 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6907 {
6908 return mImpl->addOneHot(indices, values, depth, axis);
6909 }
6910
6918 int32_t getNbLayers() const noexcept
6919 {
6920 return mImpl->getNbLayers();
6921 }
6922
6932 ILayer* getLayer(int32_t index) const noexcept
6933 {
6934 return mImpl->getLayer(index);
6935 }
6936
6944 int32_t getNbInputs() const noexcept
6945 {
6946 return mImpl->getNbInputs();
6947 }
6948
6960 ITensor* getInput(int32_t index) const noexcept
6961 {
6962 return mImpl->getInput(index);
6963 }
6964
6974 int32_t getNbOutputs() const noexcept
6975 {
6976 return mImpl->getNbOutputs();
6977 }
6978
6990 ITensor* getOutput(int32_t index) const noexcept
6991 {
6992 return mImpl->getOutput(index);
6993 }
6994
7017 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7018 {
7019 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7020 }
7021
7049 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7050 {
7051 return mImpl->addTopK(input, op, k, reduceAxes);
7052 }
7053
7065 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7066 {
7067 return mImpl->addGather(data, indices, axis);
7068 }
7069
7081 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7082 {
7083 return mImpl->addGatherV2(data, indices, mode);
7084 }
7085
7101 {
7102 return mImpl->addRaggedSoftMax(input, bounds);
7103 }
7104
7122 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7123 {
7124 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7125 }
7126
7137 {
7138 return mImpl->addNonZero(input);
7139 }
7140
7160 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7161 {
7162 return mImpl->addConstant(dimensions, weights);
7163 }
7164
7175 {
7176 return mImpl->addIdentity(input);
7177 }
7178
7189 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7190 {
7191 return mImpl->addCast(input, toType);
7192 }
7193
7204 void removeTensor(ITensor& tensor) noexcept
7205 {
7206 mImpl->removeTensor(tensor);
7207 }
7208
7216 void unmarkOutput(ITensor& tensor) noexcept
7217 {
7218 mImpl->unmarkOutput(tensor);
7219 }
7220
7237 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7238 {
7239 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7240 }
7241
7255 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
7256 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
7257 {
7258 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
7259 }
7260
7275 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7276 {
7277 return mImpl->addSlice(input, start, size, stride);
7278 }
7279
7299 void setName(char const* name) noexcept
7300 {
7301 mImpl->setName(name);
7302 }
7303
7313 char const* getName() const noexcept
7314 {
7315 return mImpl->getName();
7316 }
7317
7329 IShapeLayer* addShape(ITensor& input) noexcept
7330 {
7331 return mImpl->addShape(input);
7332 }
7333
7344 {
7345 return mImpl->hasImplicitBatchDimension();
7346 }
7347
7354 {
7355 return mImpl->getFlags();
7356 }
7357
7365 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
7366 {
7367 return mImpl->getFlag(networkDefinitionCreationFlag);
7368 }
7369
7382 bool markOutputForShapes(ITensor& tensor) noexcept
7383 {
7384 return mImpl->markOutputForShapes(tensor);
7385 }
7386
7394 bool unmarkOutputForShapes(ITensor& tensor) noexcept
7395 {
7396 return mImpl->unmarkOutputForShapes(tensor);
7397 }
7398
7413 {
7414 return mImpl->addParametricReLU(input, slope);
7415 }
7416
7435 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7436 {
7437 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7438 }
7439
7454 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7455 {
7456 return mImpl->addPoolingNd(input, type, windowSize);
7457 }
7458
7473 //
7477 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7478 {
7479 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7480 }
7481
7514 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7515 {
7516 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7517 }
7518
7531 {
7532 return mImpl->addResize(input);
7533 }
7534
7544 ILoop* addLoop() noexcept
7545 {
7546 return mImpl->addLoop();
7547 }
7548
7560 {
7561 return mImpl->addIfConditional();
7562 }
7563
7598 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7599 {
7600 return mImpl->addSelect(condition, thenInput, elseInput);
7601 }
7602
7615 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7616 {
7617 return mImpl->addAssertion(condition, message);
7618 }
7619
7640 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7641 {
7642 return mImpl->addFill(dimensions, op);
7643 }
7644
7666 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7667 {
7668 return mImpl->addFillV2(dimensions, op, outputType);
7669 }
7670
7682 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7683 {
7684 return mImpl->addPaddingNd(input, prePadding, postPadding);
7685 }
7686
7706 bool setWeightsName(Weights weights, char const* name) noexcept
7707 {
7708 return mImpl->setWeightsName(weights, name);
7709 }
7710
7722 //
7725 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7726 {
7727 mImpl->setErrorRecorder(recorder);
7728 }
7729
7741 {
7742 return mImpl->getErrorRecorder();
7743 }
7744
7762 {
7763 return mImpl->addDequantize(input, scale);
7764 }
7765
7783 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7784 {
7785 return mImpl->addDequantizeV2(input, scale, outputType);
7786 }
7787
7803 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7804 {
7805 return mImpl->addScatter(data, indices, updates, mode);
7806 }
7807
7825 {
7826 return mImpl->addQuantize(input, scale);
7827 }
7828
7846 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7847 {
7848 return mImpl->addQuantizeV2(input, scale, outputType);
7849 }
7850
7872 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
7873 {
7874 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
7875 }
7876
7887 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7888 {
7889 return mImpl->addEinsum(inputs, nbInputs, equation);
7890 }
7891
7906 {
7907 return mImpl->addGridSample(input, grid);
7908 }
7909
7923 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7924 {
7925 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7926 }
7927
7941 {
7942 return mImpl->addReverseSequence(input, sequenceLens);
7943 }
7944
7966 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
7967 {
7968 return mImpl->addNormalization(input, scale, bias, axesMask);
7969 }
7970
7988 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
7989 {
7990 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
7991 }
7992
7999 virtual IBuilder& getBuilder() const noexcept
8000 {
8001 return mImpl->getBuilder();
8002 }
8003
8012 bool markWeightsRefittable(char const* name) noexcept
8013 {
8014 return mImpl->markWeightsRefittable(name);
8015 }
8016
8024 bool unmarkWeightsRefittable(char const* name) noexcept
8025 {
8026 return mImpl->unmarkWeightsRefittable(name);
8027 }
8028
8037 bool areWeightsMarkedRefittable(char const* name) const noexcept
8038 {
8039 return mImpl->areWeightsMarkedRefittable(name);
8040 }
8041
8056 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8057 {
8058 return mImpl->addSqueeze(input, axes);
8059 }
8060
8078 {
8079 return mImpl->addUnsqueeze(input, axes);
8080 }
8081
8082protected:
8083 apiv::VNetworkDefinition* mImpl;
8084};
8085
8093enum class CalibrationAlgoType : int32_t
8094{
8099};
8100
8106template <>
8107constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8108{
8109 return 4;
8110}
8111
8126{
8127public:
8135 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
8136
8151 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8152
8167 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8168
8177 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8178
8184 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8185
8186 ~IInt8Calibrator() noexcept override = default;
8187};
8188
8189namespace v_1_0
8190{
8192{
8193public:
8197 InterfaceInfo getInterfaceInfo() const noexcept override
8198 {
8199 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
8200 }
8201
8206 {
8208 }
8209
8210 ~IInt8EntropyCalibrator() noexcept override = default;
8211};
8212} // namespace v_1_0
8213
8228
8229namespace v_1_0
8230{
8232{
8233public:
8237 InterfaceInfo getInterfaceInfo() const noexcept override
8238 {
8239 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
8240 }
8241
8246 {
8248 }
8249
8250 ~IInt8EntropyCalibrator2() noexcept override = default;
8251};
8252} // namespace v_1_0
8253
8268
8269namespace v_1_0
8270{
8272{
8273public:
8277 InterfaceInfo getInterfaceInfo() const noexcept override
8278 {
8279 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
8280 }
8281
8286 {
8288 }
8289
8290 ~IInt8MinMaxCalibrator() noexcept override = default;
8291};
8292} // namespace v_1_0
8293
8307
8308namespace v_1_0
8309{
8311{
8312public:
8316 InterfaceInfo getInterfaceInfo() const noexcept override
8317 {
8318 return InterfaceInfo{"IInt8Calibrator", 1, 0};
8319 }
8320
8325 {
8327 }
8328
8335 virtual double getQuantile() const noexcept = 0;
8336
8343 virtual double getRegressionCutoff() const noexcept = 0;
8344
8357 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
8358
8367 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
8368
8369 ~IInt8LegacyCalibrator() noexcept override = default;
8370};
8371} // namespace v_1_0
8372
8387
8401{
8402public:
8408 DataType getDataType() const noexcept
8409 {
8410 return mImpl->getDataType();
8411 }
8412
8419 Dims getStrides() const noexcept
8420 {
8421 return mImpl->getStrides();
8422 }
8423
8429 int64_t getVectorizedDim() const noexcept
8430 {
8431 return mImpl->getVectorizedDim();
8432 }
8433
8440 int64_t getComponentsPerElement() const noexcept
8441 {
8442 return mImpl->getComponentsPerElement();
8443 }
8444
8445protected:
8446 virtual ~IAlgorithmIOInfo() noexcept = default;
8447 apiv::VAlgorithmIOInfo* mImpl;
8448};
8449
8464{
8465public:
8469 int64_t getImplementation() const noexcept
8470 {
8471 return mImpl->getImplementation();
8472 }
8473
8477 int64_t getTactic() const noexcept
8478 {
8479 return mImpl->getTactic();
8480 }
8481
8482protected:
8483 virtual ~IAlgorithmVariant() noexcept = default;
8484 apiv::VAlgorithmVariant* mImpl;
8485};
8486
8498{
8499public:
8505 char const* getName() const noexcept
8506 {
8507 return mImpl->getName();
8508 }
8509
8517 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
8518 {
8519 return mImpl->getDimensions(index, select);
8520 }
8521
8525 int32_t getNbInputs() const noexcept
8526 {
8527 return mImpl->getNbInputs();
8528 }
8529
8533 int32_t getNbOutputs() const noexcept
8534 {
8535 return mImpl->getNbOutputs();
8536 }
8537
8538protected:
8539 virtual ~IAlgorithmContext() noexcept = default;
8540 apiv::VAlgorithmContext* mImpl;
8541};
8542
8557{
8558public:
8563 {
8564 return mImpl->getAlgorithmVariant();
8565 }
8566
8570 float getTimingMSec() const noexcept
8571 {
8572 return mImpl->getTimingMSec();
8573 }
8574
8578 std::size_t getWorkspaceSize() const noexcept
8579 {
8580 return mImpl->getWorkspaceSize();
8581 }
8582
8592 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8593 {
8594 return mImpl->getAlgorithmIOInfoByIndex(index);
8595 }
8596
8597protected:
8598 virtual ~IAlgorithm() noexcept = default;
8599 apiv::VAlgorithm* mImpl;
8600}; // IAlgorithm
8601
8602namespace v_1_0
8603{
8605{
8606public:
8610 InterfaceInfo getInterfaceInfo() const noexcept override
8611 {
8612 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8613 }
8628 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8629 int32_t nbChoices, int32_t* selection) noexcept = 0;
8630
8641 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8642 int32_t nbAlgorithms) noexcept = 0;
8643
8644 virtual ~IAlgorithmSelector() noexcept = default;
8645};
8646} // namespace v_1_0
8647
8661
8668using QuantizationFlags = uint32_t;
8669
8679enum class QuantizationFlag : int32_t
8680{
8685};
8686
8692template <>
8693constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8694{
8695 return 1;
8696}
8697
8715enum class RuntimePlatform : int32_t
8716{
8719 kSAME_AS_BUILD = 0,
8720
8723 kWINDOWS_AMD64 = 1,
8724};
8725
8726namespace impl
8727{
8733template <>
8735{
8736 static constexpr int32_t kVALUE = 2;
8737};
8738} // namespace impl
8739
8746using BuilderFlags = uint32_t;
8747
8755enum class BuilderFlag : int32_t
8756{
8758 kFP16 = 0,
8759
8761 kINT8 = 1,
8762
8764 kDEBUG = 2,
8765
8767 kGPU_FALLBACK = 3,
8768
8770 kREFIT = 4,
8771
8774
8778 kTF32 = 6,
8779
8781 kSPARSE_WEIGHTS = 7,
8782
8789 kSAFETY_SCOPE = 8,
8790
8793
8797
8803
8806
8813
8819
8825 kFP8 = 15,
8826
8830
8833 kBF16 = 17,
8834
8840
8842 kSTRIP_PLAN = 19,
8843
8846
8853 kREFIT_IDENTICAL = 20,
8854
8880 kWEIGHT_STREAMING = 21,
8881
8883 kINT4 = 22,
8884
8889 kREFIT_INDIVIDUAL = 23,
8890
8899 kSTRICT_NANS = 24,
8900
8902 kMONITOR_MEMORY = 25,
8903
8905 kFP4 = 26,
8906
8909};
8910
8916template <>
8917constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8918{
8919 return 28;
8920}
8921
8922namespace v_1_0
8923{
8937{
8938 uint8_t data[16];
8939};
8940
8949{
8951 uint64_t tacticHash;
8955 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
8956};
8957} // namespace v_1_0
8958
8972class ITimingCache : public INoCopy
8973{
8974public:
8975 virtual ~ITimingCache() noexcept = default;
8976
8986 nvinfer1::IHostMemory* serialize() const noexcept
8987 {
8988 return mImpl->serialize();
8989 }
8990
9010 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
9011 {
9012 return mImpl->combine(inputCache, ignoreMismatch);
9013 }
9014
9020 bool reset() noexcept
9021 {
9022 return mImpl->reset();
9023 }
9024
9039 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
9040 {
9041 return mImpl->queryKeys(keyBuffer, capacity);
9042 }
9043
9056 TimingCacheValue query(TimingCacheKey const& key) const noexcept
9057 {
9058 return mImpl->query(key);
9059 }
9060
9078 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
9079 {
9080 return mImpl->update(key, value);
9081 }
9082
9083protected:
9084 apiv::VTimingCache* mImpl;
9085};
9086
9094enum class MemoryPoolType : int32_t
9095{
9102 kWORKSPACE = 0,
9103
9111
9117 kDLA_LOCAL_DRAM = 2,
9118
9124 kDLA_GLOBAL_DRAM = 3,
9125
9133 kTACTIC_DRAM = 4,
9134
9148};
9149
9155template <>
9156constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9157{
9158 return 6;
9159}
9160
9169enum class PreviewFeature : int32_t
9170{
9177
9182};
9183
9184namespace impl
9185{
9191template <>
9193{
9194 static constexpr int32_t kVALUE = 2;
9195};
9196} // namespace impl
9197
9206enum class HardwareCompatibilityLevel : int32_t
9207{
9210 kNONE = 0,
9211
9223 kAMPERE_PLUS = 1,
9224
9234};
9235
9236namespace impl
9237{
9243template <>
9245{
9246 static constexpr int32_t kVALUE = 3;
9247};
9248} // namespace impl
9249
9258enum class TilingOptimizationLevel : int32_t
9259{
9261 kNONE = 0,
9262
9264 kFAST = 1,
9265
9268 kMODERATE = 2,
9269
9271 kFULL = 3
9272
9273};
9274
9275namespace impl
9276{
9282template <>
9284{
9285 static constexpr int32_t kVALUE = 4;
9286};
9287} // namespace impl
9288
9289namespace v_1_0
9290{
9292{
9293public:
9294 IProgressMonitor() = default;
9295 virtual ~IProgressMonitor() noexcept = default;
9296
9300 InterfaceInfo getInterfaceInfo() const noexcept override
9301 {
9302 return InterfaceInfo{"IProgressMonitor", 1, 0};
9303 }
9304
9324 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
9325
9338 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
9339
9351 virtual void phaseFinish(char const* phaseName) noexcept = 0;
9352
9353}; // class IProgressMonitor
9354} // namespace v_1_0
9355
9376
9385{
9386public:
9387 virtual ~IBuilderConfig() noexcept = default;
9388
9397 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
9398 {
9399 mImpl->setAvgTimingIterations(avgTiming);
9400 }
9401
9409 int32_t getAvgTimingIterations() const noexcept
9410 {
9411 return mImpl->getAvgTimingIterations();
9412 }
9413
9422 void setEngineCapability(EngineCapability capability) noexcept
9423 {
9424 mImpl->setEngineCapability(capability);
9425 }
9426
9435 {
9436 return mImpl->getEngineCapability();
9437 }
9438
9447 {
9448 mImpl->setInt8Calibrator(calibrator);
9449 }
9450
9457 {
9458 return mImpl->getInt8Calibrator();
9459 }
9460
9473 void setFlags(BuilderFlags builderFlags) noexcept
9474 {
9475 mImpl->setFlags(builderFlags);
9476 }
9477
9485 BuilderFlags getFlags() const noexcept
9486 {
9487 return mImpl->getFlags();
9488 }
9489
9497 void clearFlag(BuilderFlag builderFlag) noexcept
9498 {
9499 mImpl->clearFlag(builderFlag);
9500 }
9501
9509 void setFlag(BuilderFlag builderFlag) noexcept
9510 {
9511 mImpl->setFlag(builderFlag);
9512 }
9513
9521 bool getFlag(BuilderFlag builderFlag) const noexcept
9522 {
9523 return mImpl->getFlag(builderFlag);
9524 }
9525
9538 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
9539 {
9540 mImpl->setDeviceType(layer, deviceType);
9541 }
9542
9548 DeviceType getDeviceType(ILayer const* layer) const noexcept
9549 {
9550 return mImpl->getDeviceType(layer);
9551 }
9552
9560 bool isDeviceTypeSet(ILayer const* layer) const noexcept
9561 {
9562 return mImpl->isDeviceTypeSet(layer);
9563 }
9564
9570 void resetDeviceType(ILayer const* layer) noexcept
9571 {
9572 mImpl->resetDeviceType(layer);
9573 }
9574
9580 bool canRunOnDLA(ILayer const* layer) const noexcept
9581 {
9582 return mImpl->canRunOnDLA(layer);
9583 }
9584
9596 void setDLACore(int32_t dlaCore) noexcept
9597 {
9598 mImpl->setDLACore(dlaCore);
9599 }
9600
9606 int32_t getDLACore() const noexcept
9607 {
9608 return mImpl->getDLACore();
9609 }
9610
9617 void setDefaultDeviceType(DeviceType deviceType) noexcept
9618 {
9619 mImpl->setDefaultDeviceType(deviceType);
9620 }
9621
9628 {
9629 return mImpl->getDefaultDeviceType();
9630 }
9631
9637 void reset() noexcept
9638 {
9639 mImpl->reset();
9640 }
9641
9649 void setProfileStream(const cudaStream_t stream) noexcept
9650 {
9651 return mImpl->setProfileStream(stream);
9652 }
9653
9661 cudaStream_t getProfileStream() const noexcept
9662 {
9663 return mImpl->getProfileStream();
9664 }
9665
9678 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
9679 {
9680 return mImpl->addOptimizationProfile(profile);
9681 }
9682
9691 int32_t getNbOptimizationProfiles() const noexcept
9692 {
9693 return mImpl->getNbOptimizationProfiles();
9694 }
9695
9704 {
9705 mImpl->setProfilingVerbosity(verbosity);
9706 }
9707
9717 {
9718 return mImpl->getProfilingVerbosity();
9719 }
9720
9729 {
9730 mImpl->setAlgorithmSelector(selector);
9731 }
9732
9739 {
9740 return mImpl->getAlgorithmSelector();
9741 }
9742
9757 {
9758 return mImpl->setCalibrationProfile(profile);
9759 }
9760
9769 {
9770 return mImpl->getCalibrationProfile();
9771 }
9772
9786 {
9787 mImpl->setQuantizationFlags(flags);
9788 }
9789
9798 {
9799 return mImpl->getQuantizationFlags();
9800 }
9801
9810 {
9811 mImpl->clearQuantizationFlag(flag);
9812 }
9813
9822 {
9823 mImpl->setQuantizationFlag(flag);
9824 }
9825
9833 bool getQuantizationFlag(QuantizationFlag flag) const noexcept
9834 {
9835 return mImpl->getQuantizationFlag(flag);
9836 }
9837
9855 bool setTacticSources(TacticSources tacticSources) noexcept
9856 {
9857 return mImpl->setTacticSources(tacticSources);
9858 }
9859
9871 {
9872 return mImpl->getTacticSources();
9873 }
9874
9889 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9890 {
9891 return mImpl->createTimingCache(blob, size);
9892 }
9893
9912 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9913 {
9914 return mImpl->setTimingCache(cache, ignoreMismatch);
9915 }
9916
9923 {
9924 return mImpl->getTimingCache();
9925 }
9926
9954 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9955 {
9956 mImpl->setMemoryPoolLimit(pool, poolSize);
9957 }
9958
9973 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9974 {
9975 return mImpl->getMemoryPoolLimit(pool);
9976 }
9977
9991 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9992 {
9993 mImpl->setPreviewFeature(feature, enable);
9994 }
9995
10005 bool getPreviewFeature(PreviewFeature feature) const noexcept
10006 {
10007 return mImpl->getPreviewFeature(feature);
10008 }
10009
10038 void setBuilderOptimizationLevel(int32_t level) noexcept
10039 {
10040 mImpl->setBuilderOptimizationLevel(level);
10041 }
10042
10051 {
10052 return mImpl->getBuilderOptimizationLevel();
10053 }
10054
10067 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
10068 {
10069 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
10070 }
10071
10081 {
10082 return mImpl->getHardwareCompatibilityLevel();
10083 }
10084
10093 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
10094 {
10095 mImpl->setPluginsToSerialize(paths, nbPaths);
10096 }
10097
10106 char const* getPluginToSerialize(int32_t index) const noexcept
10107 {
10108 return mImpl->getPluginToSerialize(index);
10109 }
10110
10116 int32_t getNbPluginsToSerialize() const noexcept
10117 {
10118 return mImpl->getNbPluginsToSerialize();
10119 }
10120
10145 void setMaxAuxStreams(int32_t nbStreams) noexcept
10146 {
10147 mImpl->setMaxAuxStreams(nbStreams);
10148 }
10149
10155 int32_t getMaxAuxStreams() const noexcept
10156 {
10157 return mImpl->getMaxAuxStreams();
10158 }
10159
10171 void setProgressMonitor(IProgressMonitor* monitor) noexcept
10172 {
10173 return mImpl->setProgressMonitor(monitor);
10174 }
10175
10182 {
10183 return mImpl->getProgressMonitor();
10184 }
10185
10197 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
10198 {
10199 mImpl->setRuntimePlatform(runtimePlatform);
10200 }
10201
10210 {
10211 return mImpl->getRuntimePlatform();
10212 }
10213
10221 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10222 {
10223 mImpl->setMaxNbTactics(maxNbTactics);
10224 }
10225
10233 int32_t getMaxNbTactics() const noexcept
10234 {
10235 return mImpl->getMaxNbTactics();
10236 }
10237
10250 {
10251 return mImpl->setTilingOptimizationLevel(level);
10252 }
10253
10262 {
10263 return mImpl->getTilingOptimizationLevel();
10264 }
10265
10277 bool setL2LimitForTiling(int64_t size) noexcept
10278 {
10279 return mImpl->setL2LimitForTiling(size);
10280 }
10281
10289 int64_t getL2LimitForTiling() const noexcept
10290 {
10291 return mImpl->getL2LimitForTiling();
10292 }
10293
10294protected:
10295 apiv::VBuilderConfig* mImpl;
10296};
10297
10306
10316{
10321
10326 kSTRONGLY_TYPED = 1,
10331
10336};
10337
10343template <>
10344constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
10345{
10346 return 4;
10347}
10348
10356class IBuilder : public INoCopy
10357{
10358public:
10359 virtual ~IBuilder() noexcept = default;
10360
10366 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
10367 {
10368 return mImpl->platformHasFastFp16();
10369 }
10370
10377 {
10378 return mImpl->platformHasFastInt8();
10379 }
10380
10388 int32_t getMaxDLABatchSize() const noexcept
10389 {
10390 return mImpl->getMaxDLABatchSize();
10391 }
10392
10396 int32_t getNbDLACores() const noexcept
10397 {
10398 return mImpl->getNbDLACores();
10399 }
10400
10414 void setGpuAllocator(IGpuAllocator* allocator) noexcept
10415 {
10416 mImpl->setGpuAllocator(allocator);
10417 }
10418
10425 {
10426 return mImpl->createBuilderConfig();
10427 }
10428
10447 {
10448 return mImpl->createNetworkV2(flags);
10449 }
10450
10462 {
10463 return mImpl->createOptimizationProfile();
10464 }
10465
10480 void setErrorRecorder(IErrorRecorder* recorder) noexcept
10481 {
10482 mImpl->setErrorRecorder(recorder);
10483 }
10484
10496 {
10497 return mImpl->getErrorRecorder();
10498 }
10499
10503 void reset() noexcept
10504 {
10505 mImpl->reset();
10506 }
10507
10513 TRT_DEPRECATED bool platformHasTf32() const noexcept
10514 {
10515 return mImpl->platformHasTf32();
10516 }
10517
10533 {
10534 return mImpl->buildSerializedNetwork(network, config);
10535 }
10536
10553 {
10554 return mImpl->buildEngineWithConfig(network, config);
10555 }
10556
10574 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
10575 {
10576 return mImpl->isNetworkSupported(network, config);
10577 }
10578
10584 ILogger* getLogger() const noexcept
10585 {
10586 return mImpl->getLogger();
10587 }
10588
10600 bool setMaxThreads(int32_t maxThreads) noexcept
10601 {
10602 return mImpl->setMaxThreads(maxThreads);
10603 }
10604
10614 int32_t getMaxThreads() const noexcept
10615 {
10616 return mImpl->getMaxThreads();
10617 }
10618
10625 {
10626 return mImpl->getPluginRegistry();
10627 }
10628
10629protected:
10630 apiv::VBuilder* mImpl;
10631};
10632
10633} // namespace nvinfer1
10634
10639extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
10640
10641namespace nvinfer1
10642{
10643namespace
10644{
10645
10653inline IBuilder* createInferBuilder(ILogger& logger) noexcept
10654{
10655 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
10656}
10657
10658} // namespace
10659
10673 nvinfer1::EngineCapability capability) noexcept;
10674
10675namespace safe
10676{
10678class IPluginRegistry;
10679} // namespace safe
10680
10688extern "C" TENSORRTAPI nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
10689 nvinfer1::EngineCapability capability) noexcept;
10690
10691} // namespace nvinfer1
10692
10693#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:91
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:45
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:46
Definition: NvInferRuntimeBase.h:204
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:207
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:8498
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:8533
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:8525
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:8505
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:8517
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:8557
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:8578
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8570
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:8592
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:8562
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:8401
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:8429
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:8419
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:8408
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:8440
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:8464
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:8477
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:8469
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:9385
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9954
void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9821
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9889
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9991
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:9728
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:9446
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10005
void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:9809
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:10050
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9855
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:10093
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10249
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:10277
bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9833
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:9456
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9973
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:9606
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:10116
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:9538
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:9422
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10155
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:9521
void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:9785
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10221
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:10289
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:10171
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9703
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:9691
QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:9797
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9922
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:9637
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9912
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:10106
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:9434
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:10209
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:9627
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:10197
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10233
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:9485
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:9473
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9870
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:9570
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:9596
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:10080
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:9497
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:9678
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:10181
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:10295
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:9768
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:9409
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:9617
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:9509
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:9756
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:9548
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:9580
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9661
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:10067
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:10261
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10145
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:9716
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:9560
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:10038
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:9649
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:9738
Builds an engine from a network definition.
Definition: NvInfer.h:10357
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:10388
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:10396
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:10495
apiv::VBuilder * mImpl
Definition: NvInfer.h:10630
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:10584
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:10574
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:10614
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:10624
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:10376
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:10461
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:10414
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:10446
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:10424
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:10503
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:10600
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:10480
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10532
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:10513
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:10552
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:6534
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6545
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6593
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6611
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6581
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6605
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6569
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6557
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:5988
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5995
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6041
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6017
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6059
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6053
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6007
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6029
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:8126
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:6136
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6173
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6147
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6159
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6209
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6183
A network definition for input to the builder.
Definition: NvInfer.h:6633
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6826
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6889
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:7966
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7299
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6705
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6770
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7049
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:7988
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7615
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:7434
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7189
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:7513
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7313
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:7412
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6990
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6960
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7783
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:7394
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7666
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7544
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:7871
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6751
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7640
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7275
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7824
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:7999
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7923
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6932
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7365
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7559
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7740
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8056
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7940
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6944
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7353
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7846
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7016
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6875
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7905
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7204
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8037
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7598
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:7803
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6918
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7343
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8083
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:7382
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6906
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6796
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:7255
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7216
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7174
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7081
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6853
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7160
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7725
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7454
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7100
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7329
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:7065
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8024
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8012
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:7476
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7530
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8077
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7121
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6809
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6731
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6721
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7887
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6687
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:7237
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:7682
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7136
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7761
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6974
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7706
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:6298
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6317
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6337
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6307
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6404
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6410
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6368
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6327
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6394
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6358
A OneHot layer in a network definition.
Definition: NvInfer.h:5952
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:133
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:6226
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6259
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6246
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6275
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6269
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6236
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:6424
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6441
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:8973
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:9039
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:9010
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:9056
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:9078
apiv::VTimingCache * mImpl
Definition: NvInfer.h:9084
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:9020
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:6453
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6470
An Interface class for version control.
Definition: NvInferRuntimeBase.h:264
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:229
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:8605
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:8610
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:401
Definition: NvInferRuntime.h:1610
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8245
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8237
Definition: NvInfer.h:8192
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8205
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8197
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:8311
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8324
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8316
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:8272
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8285
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8277
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:9292
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:10653
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:9095
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:8716
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8668
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9207
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6486
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6071
@ 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:8917
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:118
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8107
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:10305
PreviewFeature
Define preview features.
Definition: NvInfer.h:9170
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9259
@ 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:133
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8746
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:8094
@ 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:8693
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:10316
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:8680
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:8756
@ 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.
@ kREJECT_EMPTY_ALGORITHMS
Fail if IAlgorithmSelector::selectAlgorithms returns an empty set of algorithms.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3512
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9156
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:10344
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:6084
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:9375
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:118
The key to retrieve timing cache entries.
Definition: NvInfer.h:8937
Definition: NvInfer.h:8949
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:8951
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:8953

  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