TensorRT 10.0.1
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2024 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
32//
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};
107
113template <>
114constexpr inline int32_t EnumMax<LayerType>() noexcept
115{
116 return 47;
117}
118
125using TensorFormats = uint32_t;
126
132enum class ActivationType : int32_t
133{
134 kRELU = 0,
135 kSIGMOID = 1,
136 kTANH = 2,
137 kLEAKY_RELU = 3,
138 kELU = 4,
139 kSELU = 5,
140 kSOFTSIGN = 6,
141 kSOFTPLUS = 7,
142 kCLIP = 8,
143 kHARD_SIGMOID = 9,
144 kSCALED_TANH = 10,
145 kTHRESHOLDED_RELU = 11,
146 kGELU_ERF = 12,
147 kGELU_TANH = 13
148};
149
150namespace impl
151{
157template <>
159{
160 static constexpr int32_t kVALUE = 14;
161};
162} // namespace impl
163
180class ITensor : public INoCopy
181{
182public:
197 void setName(char const* name) noexcept
198 {
199 mImpl->setName(name);
200 }
201
209 char const* getName() const noexcept
210 {
211 return mImpl->getName();
212 }
213
228 void setDimensions(Dims const& dimensions) noexcept
229 {
230 mImpl->setDimensions(dimensions);
231 }
232
242 Dims getDimensions() const noexcept
243 {
244 return mImpl->getDimensions();
245 }
246
257 void setType(DataType type) noexcept
258 {
259 mImpl->setType(type);
260 }
261
269 DataType getType() const noexcept
270 {
271 return mImpl->getType();
272 }
273
284 bool setDynamicRange(float min, float max) noexcept
285 {
286 return mImpl->setDynamicRange(min, max);
287 }
288
292 bool isNetworkInput() const noexcept
293 {
294 return mImpl->isNetworkInput();
295 }
296
300 bool isNetworkOutput() const noexcept
301 {
302 return mImpl->isNetworkOutput();
303 }
304
317 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
318 {
319 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
320 }
321
332 {
333 return mImpl->getBroadcastAcrossBatch();
334 }
335
344 {
345 return mImpl->getLocation();
346 }
347
363 {
364 mImpl->setLocation(location);
365 }
366
372 bool dynamicRangeIsSet() const noexcept
373 {
374 return mImpl->dynamicRangeIsSet();
375 }
376
380 void resetDynamicRange() noexcept
381 {
382 mImpl->resetDynamicRange();
383 }
384
390 float getDynamicRangeMin() const noexcept
391 {
392 return mImpl->getDynamicRangeMin();
393 }
394
400 float getDynamicRangeMax() const noexcept
401 {
402 return mImpl->getDynamicRangeMax();
403 }
404
420 void setAllowedFormats(TensorFormats formats) noexcept
421 {
422 mImpl->setAllowedFormats(formats);
423 }
424
434 {
435 return mImpl->getAllowedFormats();
436 }
437
464 bool isShapeTensor() const noexcept
465 {
466 return mImpl->isShapeTensor();
467 }
468
485 bool isExecutionTensor() const noexcept
486 {
487 return mImpl->isExecutionTensor();
488 }
489
511 void setDimensionName(int32_t index, char const* name) noexcept
512 {
513 mImpl->setDimensionName(index, name);
514 }
515
526 char const* getDimensionName(int32_t index) const noexcept
527 {
528 return mImpl->getDimensionName(index);
529 }
530
531protected:
532 apiv::VTensor* mImpl;
533 virtual ~ITensor() noexcept = default;
534};
535
543class ILayer : public INoCopy
544{
545public:
551 LayerType getType() const noexcept
552 {
553 return mLayer->getType();
554 }
555
565 void setName(char const* name) noexcept
566 {
567 mLayer->setName(name);
568 }
569
575 char const* getName() const noexcept
576 {
577 return mLayer->getName();
578 }
579
583 int32_t getNbInputs() const noexcept
584 {
585 return mLayer->getNbInputs();
586 }
587
596 ITensor* getInput(int32_t index) const noexcept
597 {
598 return mLayer->getInput(index);
599 }
600
604 int32_t getNbOutputs() const noexcept
605 {
606 return mLayer->getNbOutputs();
607 }
608
614 ITensor* getOutput(int32_t index) const noexcept
615 {
616 return mLayer->getOutput(index);
617 }
618
631 void setInput(int32_t index, ITensor& tensor) noexcept
632 {
633 return mLayer->setInput(index, tensor);
634 }
635
663 void setPrecision(DataType dataType) noexcept
664 {
665 mLayer->setPrecision(dataType);
666 }
667
675 DataType getPrecision() const noexcept
676 {
677 return mLayer->getPrecision();
678 }
679
687 bool precisionIsSet() const noexcept
688 {
689 return mLayer->precisionIsSet();
690 }
691
697 void resetPrecision() noexcept
698 {
699 mLayer->resetPrecision();
700 }
701
744 void setOutputType(int32_t index, DataType dataType) noexcept
745 {
746 mLayer->setOutputType(index, dataType);
747 }
748
759 DataType getOutputType(int32_t index) const noexcept
760 {
761 return mLayer->getOutputType(index);
762 }
763
773 bool outputTypeIsSet(int32_t index) const noexcept
774 {
775 return mLayer->outputTypeIsSet(index);
776 }
777
785 void resetOutputType(int32_t index) noexcept
786 {
787 return mLayer->resetOutputType(index);
788 }
789
803 void setMetadata(char const* metadata) noexcept
804 {
805 mLayer->setMetadata(metadata);
806 }
807
816 char const* getMetadata() const noexcept
817 {
818 return mLayer->getMetadata();
819 }
820
821protected:
822 virtual ~ILayer() noexcept = default;
823 apiv::VLayer* mLayer;
824};
825
982enum class PaddingMode : int32_t
983{
986 kSAME_UPPER = 2,
987 kSAME_LOWER = 3,
988};
989
990namespace impl
991{
997template <>
999{
1000 static constexpr int32_t kVALUE = 4;
1001};
1002} // namespace impl
1003
1017{
1018public:
1026 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1027 {
1028 mImpl->setNbOutputMaps(nbOutputMaps);
1029 }
1030
1036 int64_t getNbOutputMaps() const noexcept
1037 {
1038 return mImpl->getNbOutputMaps();
1039 }
1040
1056 void setNbGroups(int64_t nbGroups) noexcept
1057 {
1058 mImpl->setNbGroups(nbGroups);
1059 }
1060
1066 int64_t getNbGroups() const noexcept
1067 {
1068 return mImpl->getNbGroups();
1069 }
1070
1080 void setKernelWeights(Weights weights) noexcept
1081 {
1082 mImpl->setKernelWeights(weights);
1083 }
1084
1090 Weights getKernelWeights() const noexcept
1091 {
1092 return mImpl->getKernelWeights();
1093 }
1094
1105 void setBiasWeights(Weights weights) noexcept
1106 {
1107 mImpl->setBiasWeights(weights);
1108 }
1109
1115 Weights getBiasWeights() const noexcept
1116 {
1117 return mImpl->getBiasWeights();
1118 }
1119
1132 void setPrePadding(Dims const& padding) noexcept
1133 {
1134 mImpl->setPrePadding(padding);
1135 }
1136
1142 Dims getPrePadding() const noexcept
1143 {
1144 return mImpl->getPrePadding();
1145 }
1146
1159 void setPostPadding(Dims const& padding) noexcept
1160 {
1161 mImpl->setPostPadding(padding);
1162 }
1163
1169 Dims getPostPadding() const noexcept
1170 {
1171 return mImpl->getPostPadding();
1172 }
1173
1183 void setPaddingMode(PaddingMode paddingMode) noexcept
1184 {
1185 mImpl->setPaddingMode(paddingMode);
1186 }
1187
1196 {
1197 return mImpl->getPaddingMode();
1198 }
1199
1208 void setKernelSizeNd(Dims const& kernelSize) noexcept
1209 {
1210 mImpl->setKernelSizeNd(kernelSize);
1211 }
1212
1218 Dims getKernelSizeNd() const noexcept
1219 {
1220 return mImpl->getKernelSizeNd();
1221 }
1222
1233 void setStrideNd(Dims const& stride) noexcept
1234 {
1235 mImpl->setStrideNd(stride);
1236 }
1237
1243 Dims getStrideNd() const noexcept
1244 {
1245 return mImpl->getStrideNd();
1246 }
1247
1261 void setPaddingNd(Dims const& padding) noexcept
1262 {
1263 mImpl->setPaddingNd(padding);
1264 }
1265
1273 Dims getPaddingNd() const noexcept
1274 {
1275 return mImpl->getPaddingNd();
1276 }
1277
1287 void setDilationNd(Dims const& dilation) noexcept
1288 {
1289 mImpl->setDilationNd(dilation);
1290 }
1291
1297 Dims getDilationNd() const noexcept
1298 {
1299 return mImpl->getDilationNd();
1300 }
1301
1316 using ILayer::setInput;
1317
1318protected:
1319 virtual ~IConvolutionLayer() noexcept = default;
1320 apiv::VConvolutionLayer* mImpl;
1321};
1322
1337{
1338public:
1347 {
1348 mImpl->setActivationType(type);
1349 }
1350
1357 {
1358 return mImpl->getActivationType();
1359 }
1360
1371 void setAlpha(float alpha) noexcept
1372 {
1373 mImpl->setAlpha(alpha);
1374 }
1375
1385 void setBeta(float beta) noexcept
1386 {
1387 mImpl->setBeta(beta);
1388 }
1389
1394 float getAlpha() const noexcept
1395 {
1396 return mImpl->getAlpha();
1397 }
1398
1403 float getBeta() const noexcept
1404 {
1405 return mImpl->getBeta();
1406 }
1407
1408protected:
1409 virtual ~IActivationLayer() noexcept = default;
1410 apiv::VActivationLayer* mImpl;
1411};
1412
1418enum class PoolingType : int32_t
1419{
1420 kMAX = 0,
1421 kAVERAGE = 1,
1423};
1424
1425namespace impl
1426{
1432template <>
1434{
1435 static constexpr int32_t kVALUE = 3;
1436};
1437} // namespace impl
1438
1450class IPoolingLayer : public ILayer
1451{
1452public:
1460 void setPoolingType(PoolingType type) noexcept
1461 {
1462 mImpl->setPoolingType(type);
1463 }
1464
1471 {
1472 return mImpl->getPoolingType();
1473 }
1474
1485 void setBlendFactor(float blendFactor) noexcept
1486 {
1487 mImpl->setBlendFactor(blendFactor);
1488 }
1489
1498 float getBlendFactor() const noexcept
1499 {
1500 return mImpl->getBlendFactor();
1501 }
1502
1512 void setAverageCountExcludesPadding(bool exclusive) noexcept
1513 {
1514 mImpl->setAverageCountExcludesPadding(exclusive);
1515 }
1516
1524 {
1525 return mImpl->getAverageCountExcludesPadding();
1526 }
1527
1541 void setPrePadding(Dims const& padding) noexcept
1542 {
1543 mImpl->setPrePadding(padding);
1544 }
1545
1551 Dims getPrePadding() const noexcept
1552 {
1553 return mImpl->getPrePadding();
1554 }
1555
1569 void setPostPadding(Dims const& padding) noexcept
1570 {
1571 mImpl->setPostPadding(padding);
1572 }
1573
1579 Dims getPostPadding() const noexcept
1580 {
1581 return mImpl->getPostPadding();
1582 }
1583
1592 void setPaddingMode(PaddingMode paddingMode) noexcept
1593 {
1594 mImpl->setPaddingMode(paddingMode);
1595 }
1596
1604 {
1605 return mImpl->getPaddingMode();
1606 }
1607
1616 void setWindowSizeNd(Dims const& windowSize) noexcept
1617 {
1618 mImpl->setWindowSizeNd(windowSize);
1619 }
1620
1626 Dims getWindowSizeNd() const noexcept
1627 {
1628 return mImpl->getWindowSizeNd();
1629 }
1630
1641 void setStrideNd(Dims const& stride) noexcept
1642 {
1643 mImpl->setStrideNd(stride);
1644 }
1645
1651 Dims getStrideNd() const noexcept
1652 {
1653 return mImpl->getStrideNd();
1654 }
1655
1670 void setPaddingNd(Dims const& padding) noexcept
1671 {
1672 mImpl->setPaddingNd(padding);
1673 }
1674
1682 Dims getPaddingNd() const noexcept
1683 {
1684 return mImpl->getPaddingNd();
1685 }
1686
1687protected:
1688 virtual ~IPoolingLayer() noexcept = default;
1689 apiv::VPoolingLayer* mImpl;
1690};
1691
1701class ILRNLayer : public ILayer
1702{
1703public:
1713 void setWindowSize(int64_t windowSize) noexcept
1714 {
1715 mImpl->setWindowSize(windowSize);
1716 }
1717
1723 int64_t getWindowSize() const noexcept
1724 {
1725 return mImpl->getWindowSize();
1726 }
1727
1735 void setAlpha(float alpha) noexcept
1736 {
1737 mImpl->setAlpha(alpha);
1738 }
1739
1745 float getAlpha() const noexcept
1746 {
1747 return mImpl->getAlpha();
1748 }
1749
1757 void setBeta(float beta) noexcept
1758 {
1759 mImpl->setBeta(beta);
1760 }
1761
1767 float getBeta() const noexcept
1768 {
1769 return mImpl->getBeta();
1770 }
1771
1779 void setK(float k) noexcept
1780 {
1781 mImpl->setK(k);
1782 }
1783
1789 float getK() const noexcept
1790 {
1791 return mImpl->getK();
1792 }
1793
1794protected:
1795 virtual ~ILRNLayer() noexcept = default;
1796 apiv::VLRNLayer* mImpl;
1797};
1798
1804enum class ScaleMode : int32_t
1805{
1806 kUNIFORM = 0,
1807 kCHANNEL = 1,
1808 kELEMENTWISE = 2
1809};
1810
1816template <>
1817constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1818{
1819 return 3;
1820}
1821
1847class IScaleLayer : public ILayer
1848{
1849public:
1855 void setMode(ScaleMode mode) noexcept
1856 {
1857 mImpl->setMode(mode);
1858 }
1859
1865 ScaleMode getMode() const noexcept
1866 {
1867 return mImpl->getMode();
1868 }
1869
1875 void setShift(Weights shift) noexcept
1876 {
1877 mImpl->setShift(shift);
1878 }
1879
1885 Weights getShift() const noexcept
1886 {
1887 return mImpl->getShift();
1888 }
1889
1895 void setScale(Weights scale) noexcept
1896 {
1897 mImpl->setScale(scale);
1898 }
1899
1905 Weights getScale() const noexcept
1906 {
1907 return mImpl->getScale();
1908 }
1909
1915 void setPower(Weights power) noexcept
1916 {
1917 mImpl->setPower(power);
1918 }
1919
1925 Weights getPower() const noexcept
1926 {
1927 return mImpl->getPower();
1928 }
1929
1940 int32_t getChannelAxis() const noexcept
1941 {
1942 return mImpl->getChannelAxis();
1943 }
1944
1961 void setChannelAxis(int32_t channelAxis) noexcept
1962 {
1963 mImpl->setChannelAxis(channelAxis);
1964 }
1965
1966protected:
1967 virtual ~IScaleLayer() noexcept = default;
1968 apiv::VScaleLayer* mImpl;
1969};
1970
1991class ISoftMaxLayer : public ILayer
1992{
1993public:
2014 void setAxes(uint32_t axes) noexcept
2015 {
2016 mImpl->setAxes(axes);
2017 }
2018
2024 uint32_t getAxes() const noexcept
2025 {
2026 return mImpl->getAxes();
2027 }
2028
2029protected:
2030 virtual ~ISoftMaxLayer() noexcept = default;
2031 apiv::VSoftMaxLayer* mImpl;
2032};
2033
2047{
2048public:
2060 void setAxis(int32_t axis) noexcept
2061 {
2062 mImpl->setAxis(axis);
2063 }
2064
2070 int32_t getAxis() const noexcept
2071 {
2072 return mImpl->getAxis();
2073 }
2074
2075protected:
2076 virtual ~IConcatenationLayer() noexcept = default;
2077 apiv::VConcatenationLayer* mImpl;
2078};
2079
2088{
2089public:
2097 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2098 {
2099 mImpl->setNbOutputMaps(nbOutputMaps);
2100 }
2101
2107 int64_t getNbOutputMaps() const noexcept
2108 {
2109 return mImpl->getNbOutputMaps();
2110 }
2111
2127 void setNbGroups(int64_t nbGroups) noexcept
2128 {
2129 mImpl->setNbGroups(nbGroups);
2130 }
2131
2137 int64_t getNbGroups() const noexcept
2138 {
2139 return mImpl->getNbGroups();
2140 }
2141
2151 void setKernelWeights(Weights weights) noexcept
2152 {
2153 mImpl->setKernelWeights(weights);
2154 }
2155
2161 Weights getKernelWeights() const noexcept
2162 {
2163 return mImpl->getKernelWeights();
2164 }
2165
2176 void setBiasWeights(Weights weights) noexcept
2177 {
2178 mImpl->setBiasWeights(weights);
2179 }
2180
2186 Weights getBiasWeights() const noexcept
2187 {
2188 return mImpl->getBiasWeights();
2189 }
2190
2204 void setPrePadding(Dims const& padding) noexcept
2205 {
2206 mImpl->setPrePadding(padding);
2207 }
2208
2214 Dims getPrePadding() const noexcept
2215 {
2216 return mImpl->getPrePadding();
2217 }
2218
2232 void setPostPadding(Dims const& padding) noexcept
2233 {
2234 mImpl->setPostPadding(padding);
2235 }
2236
2242 Dims getPostPadding() const noexcept
2243 {
2244 return mImpl->getPostPadding();
2245 }
2246
2256 void setPaddingMode(PaddingMode paddingMode) noexcept
2257 {
2258 mImpl->setPaddingMode(paddingMode);
2259 }
2260
2269 {
2270 return mImpl->getPaddingMode();
2271 }
2272
2283 void setKernelSizeNd(Dims const& kernelSize) noexcept
2284 {
2285 mImpl->setKernelSizeNd(kernelSize);
2286 }
2287
2293 Dims getKernelSizeNd() const noexcept
2294 {
2295 return mImpl->getKernelSizeNd();
2296 }
2297
2310 void setStrideNd(Dims const& stride) noexcept
2311 {
2312 mImpl->setStrideNd(stride);
2313 }
2314
2320 Dims getStrideNd() const noexcept
2321 {
2322 return mImpl->getStrideNd();
2323 }
2324
2338 void setPaddingNd(Dims const& padding) noexcept
2339 {
2340 mImpl->setPaddingNd(padding);
2341 }
2342
2350 Dims getPaddingNd() const noexcept
2351 {
2352 return mImpl->getPaddingNd();
2353 }
2354
2367 using ILayer::setInput;
2368
2376 void setDilationNd(Dims const& dilation) noexcept
2377 {
2378 mImpl->setDilationNd(dilation);
2379 }
2380
2386 Dims getDilationNd() const noexcept
2387 {
2388 return mImpl->getDilationNd();
2389 }
2390
2391protected:
2392 virtual ~IDeconvolutionLayer() noexcept = default;
2393 apiv::VDeconvolutionLayer* mImpl;
2394};
2395
2410enum class ElementWiseOperation : int32_t
2411{
2412 kSUM = 0,
2413 kPROD = 1,
2414 kMAX = 2,
2415 kMIN = 3,
2416 kSUB = 4,
2417 kDIV = 5,
2418 kPOW = 6,
2419 kFLOOR_DIV = 7,
2420 kAND = 8,
2421 kOR = 9,
2422 kXOR = 10,
2423 kEQUAL = 11,
2424 kGREATER = 12,
2425 kLESS = 13
2426};
2427
2428namespace impl
2429{
2435template <>
2437{
2438 static constexpr int32_t kVALUE = 14;
2439};
2440} // namespace impl
2441
2462{
2463public:
2474 {
2475 return mImpl->setOperation(op);
2476 }
2477
2486 {
2487 return mImpl->getOperation();
2488 }
2489
2490protected:
2491 apiv::VElementWiseLayer* mImpl;
2492 virtual ~IElementWiseLayer() noexcept = default;
2493};
2494
2500enum class GatherMode : int32_t
2501{
2502 kDEFAULT = 0,
2503 kELEMENT = 1,
2504 kND = 2
2505};
2506
2512template <>
2513constexpr inline int32_t EnumMax<GatherMode>() noexcept
2514{
2515 return 3;
2516}
2517
2595class IGatherLayer : public ILayer
2596{
2597public:
2607 void setGatherAxis(int32_t axis) noexcept
2608 {
2609 mImpl->setGatherAxis(axis);
2610 }
2611
2619 int32_t getGatherAxis() const noexcept
2620 {
2621 return mImpl->getGatherAxis();
2622 }
2623
2642 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2643 {
2644 mImpl->setNbElementWiseDims(elementWiseDims);
2645 }
2646
2652 int32_t getNbElementWiseDims() const noexcept
2653 {
2654 return mImpl->getNbElementWiseDims();
2655 }
2656
2662 void setMode(GatherMode mode) noexcept
2663 {
2664 mImpl->setMode(mode);
2665 }
2666
2672 GatherMode getMode() const noexcept
2673 {
2674 return mImpl->getMode();
2675 }
2676
2677protected:
2678 apiv::VGatherLayer* mImpl;
2679 virtual ~IGatherLayer() noexcept = default;
2680};
2681
2692{
2693public:
2700 {
2701 return mImpl->getPlugin();
2702 }
2703
2704protected:
2705 apiv::VPluginV2Layer* mImpl;
2706 virtual ~IPluginV2Layer() noexcept = default;
2707};
2708
2719{
2720public:
2727 {
2728 return mImpl->getPlugin();
2729 }
2730
2731protected:
2732 apiv::VPluginV3Layer* mImpl;
2733 virtual ~IPluginV3Layer() noexcept = default;
2734};
2735
2752enum class UnaryOperation : int32_t
2753{
2754 kEXP = 0,
2755 kLOG = 1,
2756 kSQRT = 2,
2757 kRECIP = 3,
2758 kABS = 4,
2759 kNEG = 5,
2760 kSIN = 6,
2761 kCOS = 7,
2762 kTAN = 8,
2763 kSINH = 9,
2764 kCOSH = 10,
2765 kASIN = 11,
2766 kACOS = 12,
2767 kATAN = 13,
2768 kASINH = 14,
2769 kACOSH = 15,
2770 kATANH = 16,
2771 kCEIL = 17,
2772 kFLOOR = 18,
2773 kERF = 19,
2774 kNOT = 20,
2775 kSIGN = 21,
2776 kROUND = 22,
2777 kISINF = 23,
2778};
2779
2785template <>
2786constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2787{
2788 return 24;
2789}
2790
2798class IUnaryLayer : public ILayer
2799{
2800public:
2809 {
2810 mImpl->setOperation(op);
2811 }
2812
2819 {
2820 return mImpl->getOperation();
2821 }
2822
2823protected:
2824 apiv::VUnaryLayer* mImpl;
2825 virtual ~IUnaryLayer() noexcept = default;
2826};
2827
2846enum class ReduceOperation : int32_t
2847{
2848 kSUM = 0,
2849 kPROD = 1,
2850 kMAX = 2,
2851 kMIN = 3,
2852 kAVG = 4
2853};
2854
2860template <>
2861constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2862{
2863 return 5;
2864}
2865
2873class IReduceLayer : public ILayer
2874{
2875public:
2882 {
2883 mImpl->setOperation(op);
2884 }
2885
2892 {
2893 return mImpl->getOperation();
2894 }
2895
2901 void setReduceAxes(uint32_t reduceAxes) noexcept
2902 {
2903 mImpl->setReduceAxes(reduceAxes);
2904 }
2905
2911 uint32_t getReduceAxes() const noexcept
2912 {
2913 return mImpl->getReduceAxes();
2914 }
2915
2921 void setKeepDimensions(bool keepDimensions) noexcept
2922 {
2923 mImpl->setKeepDimensions(keepDimensions);
2924 }
2925
2931 bool getKeepDimensions() const noexcept
2932 {
2933 return mImpl->getKeepDimensions();
2934 }
2935
2936protected:
2937 apiv::VReduceLayer* mImpl;
2938 virtual ~IReduceLayer() noexcept = default;
2939};
2940
2951class IPaddingLayer : public ILayer
2952{
2953public:
2963 void setPrePaddingNd(Dims const& padding) noexcept
2964 {
2965 mImpl->setPrePaddingNd(padding);
2966 }
2967
2975 Dims getPrePaddingNd() const noexcept
2976 {
2977 return mImpl->getPrePaddingNd();
2978 }
2979
2989 void setPostPaddingNd(Dims const& padding) noexcept
2990 {
2991 mImpl->setPostPaddingNd(padding);
2992 }
2993
3001 Dims getPostPaddingNd() const noexcept
3002 {
3003 return mImpl->getPostPaddingNd();
3004 }
3005
3006protected:
3007 apiv::VPaddingLayer* mImpl;
3008 virtual ~IPaddingLayer() noexcept = default;
3009};
3010
3017{
3024 int32_t order[Dims::MAX_DIMS];
3025};
3026
3039class IShuffleLayer : public ILayer
3040{
3041public:
3051 void setFirstTranspose(Permutation permutation) noexcept
3052 {
3053 mImpl->setFirstTranspose(permutation);
3054 }
3055
3064 {
3065 return mImpl->getFirstTranspose();
3066 }
3067
3088 void setReshapeDimensions(Dims const& dimensions) noexcept
3089 {
3090 mImpl->setReshapeDimensions(dimensions);
3091 }
3092
3102 {
3103 return mImpl->getReshapeDimensions();
3104 }
3105
3111 //
3134 using ILayer::setInput;
3135
3148 void setSecondTranspose(Permutation permutation) noexcept
3149 {
3150 mImpl->setSecondTranspose(permutation);
3151 }
3152
3161 {
3162 return mImpl->getSecondTranspose();
3163 }
3164
3176 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3177 {
3178 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3179 }
3180
3189 bool getZeroIsPlaceholder() const noexcept
3190 {
3191 return mImpl->getZeroIsPlaceholder();
3192 }
3193
3194protected:
3195 apiv::VShuffleLayer* mImpl;
3196 virtual ~IShuffleLayer() noexcept = default;
3197};
3198
3204enum class SampleMode : int32_t
3205{
3206 kSTRICT_BOUNDS = 0,
3207 kWRAP = 1,
3208 kCLAMP = 2,
3209 kFILL = 3,
3210 kREFLECT = 4,
3213};
3214
3220template <>
3221constexpr inline int32_t EnumMax<SampleMode>() noexcept
3222{
3223 return 5;
3224}
3225
3268class ISliceLayer : public ILayer
3269{
3270public:
3280 void setStart(Dims const& start) noexcept
3281 {
3282 mImpl->setStart(start);
3283 }
3284
3295 Dims getStart() const noexcept
3296 {
3297 return mImpl->getStart();
3298 }
3299
3309 void setSize(Dims const& size) noexcept
3310 {
3311 return mImpl->setSize(size);
3312 }
3313
3324 Dims getSize() const noexcept
3325 {
3326 return mImpl->getSize();
3327 }
3328
3338 void setStride(Dims const& stride) noexcept
3339 {
3340 mImpl->setStride(stride);
3341 }
3342
3353 Dims getStride() const noexcept
3354 {
3355 return mImpl->getStride();
3356 }
3357
3363 void setMode(SampleMode mode) noexcept
3364 {
3365 mImpl->setMode(mode);
3366 }
3367
3373 SampleMode getMode() const noexcept
3374 {
3375 return mImpl->getMode();
3376 }
3377
3401 using ILayer::setInput;
3402
3403protected:
3404 apiv::VSliceLayer* mImpl;
3405 virtual ~ISliceLayer() noexcept = default;
3406};
3407
3420class IShapeLayer : public ILayer
3421{
3422protected:
3423 apiv::VShapeLayer* mImpl;
3424 virtual ~IShapeLayer() noexcept = default;
3425};
3426
3432enum class TopKOperation : int32_t
3433{
3434 kMAX = 0,
3435 kMIN = 1,
3436};
3437
3443template <>
3444constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3445{
3446 return 2;
3447}
3448
3460class ITopKLayer : public ILayer
3461{
3462public:
3468 void setOperation(TopKOperation op) noexcept
3469 {
3470 mImpl->setOperation(op);
3471 }
3472
3479 {
3480 return mImpl->getOperation();
3481 }
3482
3492 void setK(int32_t k) noexcept
3493 {
3494 mImpl->setK(k);
3495 }
3496
3506 int32_t getK() const noexcept
3507 {
3508 return mImpl->getK();
3509 }
3510
3516 void setReduceAxes(uint32_t reduceAxes) noexcept
3517 {
3518 mImpl->setReduceAxes(reduceAxes);
3519 }
3520
3526 uint32_t getReduceAxes() const noexcept
3527 {
3528 return mImpl->getReduceAxes();
3529 }
3530
3545 using ILayer::setInput;
3546
3547protected:
3548 apiv::VTopKLayer* mImpl;
3549 virtual ~ITopKLayer() noexcept = default;
3550};
3551
3558enum class MatrixOperation : int32_t
3559{
3563 kNONE = 0,
3564
3566 kTRANSPOSE = 1,
3567
3578 kVECTOR = 2,
3579};
3580
3586template <>
3587constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3588{
3589 return 3;
3590}
3591
3618{
3619public:
3628 void setOperation(int32_t index, MatrixOperation op) noexcept
3629 {
3630 mImpl->setOperation(index, op);
3631 }
3632
3640 MatrixOperation getOperation(int32_t index) const noexcept
3641 {
3642 return mImpl->getOperation(index);
3643 }
3644
3645protected:
3646 apiv::VMatrixMultiplyLayer* mImpl;
3647 virtual ~IMatrixMultiplyLayer() noexcept = default;
3648};
3649
3671class INonZeroLayer : public ILayer
3672{
3673protected:
3674 virtual ~INonZeroLayer() noexcept = default;
3675 apiv::VNonZeroLayer* mImpl;
3676};
3677
3693{
3694protected:
3695 apiv::VRaggedSoftMaxLayer* mImpl;
3696 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3697};
3698
3726{
3727protected:
3728 apiv::VIdentityLayer* mImpl;
3729 virtual ~IIdentityLayer() noexcept = default;
3730};
3731
3738class ICastLayer : public ILayer
3739{
3740public:
3748 void setToType(DataType toType) noexcept
3749 {
3750 mImpl->setToType(toType);
3751 }
3752
3759 DataType getToType() const noexcept
3760 {
3761 return mImpl->getToType();
3762 }
3763
3764protected:
3765 apiv::VCastLayer* mImpl;
3766 virtual ~ICastLayer() noexcept = default;
3767};
3768
3778{
3779public:
3788 void setWeights(Weights weights) noexcept
3789 {
3790 mImpl->setWeights(weights);
3791 }
3792
3798 Weights getWeights() const noexcept
3799 {
3800 return mImpl->getWeights();
3801 }
3802
3810 void setDimensions(Dims const& dimensions) noexcept
3811 {
3812 mImpl->setDimensions(dimensions);
3813 }
3814
3822 Dims getDimensions() const noexcept
3823 {
3824 return mImpl->getDimensions();
3825 }
3826
3827protected:
3828 apiv::VConstantLayer* mImpl;
3829 virtual ~IConstantLayer() noexcept = default;
3830};
3831
3842{
3843protected:
3844 apiv::VParametricReLULayer* mImpl;
3845 virtual ~IParametricReLULayer() noexcept = default;
3846};
3847
3853enum class InterpolationMode : int32_t
3854{
3855 kNEAREST = 0,
3856 kLINEAR = 1,
3857 kCUBIC = 2
3858};
3859
3860namespace impl
3861{
3867template <>
3869{
3870 static constexpr int32_t kVALUE = 3;
3871};
3872} // namespace impl
3873
3882{
3895 kALIGN_CORNERS = 0,
3896
3903 kASYMMETRIC = 1,
3904
3911 kHALF_PIXEL = 2,
3912};
3913
3914namespace impl
3915{
3921template <>
3923{
3924 static constexpr int32_t kVALUE = 3;
3925};
3926} // namespace impl
3927
3935enum class ResizeSelector : int32_t
3936{
3938 kFORMULA = 0,
3939
3941 kUPPER = 1,
3942};
3943
3944namespace impl
3945{
3951template <>
3953{
3954 static constexpr int32_t kVALUE = 2;
3955};
3956} // namespace impl
3957
3965enum class ResizeRoundMode : int32_t
3966{
3968 kHALF_UP = 0,
3969
3971 kHALF_DOWN = 1,
3972
3974 kFLOOR = 2,
3975
3977 kCEIL = 3,
3978};
3979
3980namespace impl
3981{
3987template <>
3989{
3990 static constexpr int32_t kVALUE = 4;
3991};
3992} // namespace impl
3993
4030class IResizeLayer : public ILayer
4031{
4032public:
4051 void setOutputDimensions(Dims const& dimensions) noexcept
4052 {
4053 return mImpl->setOutputDimensions(dimensions);
4054 }
4055
4061 Dims getOutputDimensions() const noexcept
4062 {
4063 return mImpl->getOutputDimensions();
4064 }
4065
4091 void setScales(float const* scales, int32_t nbScales) noexcept
4092 {
4093 mImpl->setScales(scales, nbScales);
4094 }
4095
4110 int32_t getScales(int32_t size, float* scales) const noexcept
4111 {
4112 return mImpl->getScales(size, scales);
4113 }
4114
4122 void setResizeMode(InterpolationMode interpolationMode) noexcept
4123 {
4124 mImpl->setResizeMode(interpolationMode);
4125 }
4126
4133 {
4134 return mImpl->getResizeMode();
4135 }
4136
4156 using ILayer::setInput;
4157
4168 {
4169 mImpl->setCoordinateTransformation(coordTransform);
4170 }
4171
4178 {
4179 return mImpl->getCoordinateTransformation();
4180 }
4181
4193 {
4194 mImpl->setSelectorForSinglePixel(selector);
4195 }
4196
4203 {
4204 return mImpl->getSelectorForSinglePixel();
4205 }
4206
4217 {
4218 mImpl->setNearestRounding(value);
4219 }
4220
4227 {
4228 return mImpl->getNearestRounding();
4229 }
4230
4248 void setCubicCoeff(float A) noexcept
4249 {
4250 mImpl->setCubicCoeff(A);
4251 }
4252
4258 float getCubicCoeff() const noexcept
4259 {
4260 return mImpl->getCubicCoeff();
4261 }
4262
4271 void setExcludeOutside(bool excludeFlag) noexcept
4272 {
4273 mImpl->setExcludeOutside(excludeFlag);
4274 }
4275
4281 bool getExcludeOutside() const noexcept
4282 {
4283 return mImpl->getExcludeOutside();
4284 }
4285
4286protected:
4287 virtual ~IResizeLayer() noexcept = default;
4288 apiv::VResizeLayer* mImpl;
4289};
4290
4294enum class LoopOutput : int32_t
4295{
4297 kLAST_VALUE = 0,
4298
4300 kCONCATENATE = 1,
4301
4303 kREVERSE = 2
4304};
4305
4311template <>
4312constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4313{
4314 return 3;
4315}
4316
4320enum class TripLimit : int32_t
4321{
4322
4323 kCOUNT = 0,
4324 kWHILE = 1
4325};
4326
4332template <>
4333constexpr inline int32_t EnumMax<TripLimit>() noexcept
4334{
4335 return 2;
4336}
4337
4338class ILoop;
4339
4354{
4355public:
4359 ILoop* getLoop() const noexcept
4360 {
4361 return mBoundary->getLoop();
4362 }
4363
4364protected:
4365 virtual ~ILoopBoundaryLayer() noexcept = default;
4366 apiv::VLoopBoundaryLayer* mBoundary;
4367};
4368
4377{
4378public:
4383 {
4384 return mBoundary->getConditional();
4385 }
4386
4387protected:
4388 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4389 apiv::VConditionalBoundaryLayer* mBoundary;
4390};
4391
4398{
4399public:
4400protected:
4401 virtual ~IConditionLayer() noexcept = default;
4402 apiv::VConditionLayer* mImpl;
4403};
4404
4413{
4414public:
4415protected:
4416 virtual ~IIfConditionalOutputLayer() noexcept = default;
4417 apiv::VConditionalOutputLayer* mImpl;
4418};
4419
4426{
4427public:
4428protected:
4429 virtual ~IIfConditionalInputLayer() noexcept = default;
4430 apiv::VConditionalInputLayer* mImpl;
4431};
4432
4457{
4458public:
4469 {
4470 return mImpl->setCondition(condition);
4471 }
4472
4484 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4485 {
4486 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4487 }
4488
4497 {
4498 return mImpl->addInput(input);
4499 }
4500
4511 void setName(char const* name) noexcept
4512 {
4513 mImpl->setName(name);
4514 }
4515
4521 char const* getName() const noexcept
4522 {
4523 return mImpl->getName();
4524 }
4525
4526protected:
4527 virtual ~IIfConditional() noexcept = default;
4528 apiv::VIfConditional* mImpl;
4529};
4530
4539{
4540public:
4546 //
4559 using ILayer::setInput;
4560
4561protected:
4562 virtual ~IRecurrenceLayer() noexcept = default;
4563 apiv::VRecurrenceLayer* mImpl;
4564};
4565
4586{
4587public:
4591 LoopOutput getLoopOutput() const noexcept
4592 {
4593 return mImpl->getLoopOutput();
4594 }
4595
4608 void setAxis(int32_t axis) noexcept
4609 {
4610 mImpl->setAxis(axis);
4611 }
4612
4616 int32_t getAxis() const noexcept
4617 {
4618 return mImpl->getAxis();
4619 }
4620
4626 //
4641 using ILayer::setInput;
4642
4643protected:
4644 virtual ~ILoopOutputLayer() noexcept = default;
4645 apiv::VLoopOutputLayer* mImpl;
4646};
4647
4660{
4661public:
4665 TripLimit getTripLimit() const noexcept
4666 {
4667 return mImpl->getTripLimit();
4668 }
4669
4670protected:
4671 virtual ~ITripLimitLayer() noexcept = default;
4672 apiv::VTripLimitLayer* mImpl;
4673};
4674
4686{
4687public:
4691 void setAxis(int32_t axis) noexcept
4692 {
4693 mImpl->setAxis(axis);
4694 }
4695
4699 int32_t getAxis() const noexcept
4700 {
4701 return mImpl->getAxis();
4702 }
4703
4713 void setReverse(bool reverse) noexcept
4714 {
4715 mImpl->setReverse(reverse);
4716 }
4717
4723 bool getReverse() const noexcept
4724 {
4725 return mImpl->getReverse();
4726 }
4727
4728protected:
4729 virtual ~IIteratorLayer() noexcept = default;
4730 apiv::VIteratorLayer* mImpl;
4731};
4732
4742class ILoop : public INoCopy
4743{
4744public:
4751 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4752 {
4753 return mImpl->addRecurrence(initialValue);
4754 }
4755
4773 {
4774 return mImpl->addTripLimit(tensor, limit);
4775 }
4776
4785 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4786 {
4787 return mImpl->addIterator(tensor, axis, reverse);
4788 }
4789
4798 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4799 {
4800 return mImpl->addLoopOutput(tensor, outputKind, axis);
4801 }
4802
4813 void setName(char const* name) noexcept
4814 {
4815 mImpl->setName(name);
4816 }
4817
4823 char const* getName() const noexcept
4824 {
4825 return mImpl->getName();
4826 }
4827
4828protected:
4829 virtual ~ILoop() noexcept = default;
4830 apiv::VLoop* mImpl;
4831};
4832
4845class ISelectLayer : public ILayer
4846{
4847protected:
4848 virtual ~ISelectLayer() noexcept = default;
4849 apiv::VSelectLayer* mImpl;
4850};
4851
4868{
4869public:
4878 void setMessage(char const* message) noexcept
4879 {
4880 mImpl->setMessage(message);
4881 }
4882
4888 char const* getMessage() const noexcept
4889 {
4890 return mImpl->getMessage();
4891 }
4892
4893protected:
4894 virtual ~IAssertionLayer() noexcept = default;
4895
4896 apiv::VAssertionLayer* mImpl;
4897};
4898
4906enum class FillOperation : int32_t
4907{
4923 kLINSPACE = 0,
4924
4926 kRANDOM_UNIFORM = 1,
4927
4929 kRANDOM_NORMAL = 2
4930};
4931
4937template <>
4938constexpr inline int32_t EnumMax<FillOperation>() noexcept
4939{
4940 return 3;
4941}
4942
4978class IFillLayer : public ILayer
4979{
4980public:
4989 //
4990 void setDimensions(Dims const& dimensions) noexcept
4991 {
4992 mImpl->setDimensions(dimensions);
4993 }
4994
5005 Dims getDimensions() const noexcept
5006 {
5007 return mImpl->getDimensions();
5008 }
5009
5015 void setOperation(FillOperation op) noexcept
5016 {
5017 mImpl->setOperation(op);
5018 }
5019
5026 {
5027 return mImpl->getOperation();
5028 }
5029
5043 //
5044 void setAlpha(double alpha) noexcept
5045 {
5046 mImpl->setAlpha(alpha);
5047 }
5048
5059 double getAlpha() const noexcept
5060 {
5061 return mImpl->getAlpha();
5062 }
5063
5078 void setBeta(double beta) noexcept
5079 {
5080 mImpl->setBeta(beta);
5081 }
5082
5093 double getBeta() const noexcept
5094 {
5095 return mImpl->getBeta();
5096 }
5097
5138 using ILayer::setInput;
5139
5153 //
5154 void setAlphaInt64(int64_t alpha) noexcept
5155 {
5156 mImpl->setAlphaInt64(alpha);
5157 }
5158
5169 int64_t getAlphaInt64() const noexcept
5170 {
5171 return mImpl->getAlphaInt64();
5172 }
5173
5188 void setBetaInt64(int64_t beta) noexcept
5189 {
5190 mImpl->setBetaInt64(beta);
5191 }
5192
5203 int64_t getBetaInt64() const noexcept
5204 {
5205 return mImpl->getBetaInt64();
5206 }
5207
5211 bool isAlphaBetaInt64() const noexcept
5212 {
5213 return mImpl->isAlphaBetaInt64();
5214 }
5215
5228 void setToType(DataType toType) noexcept
5229 {
5230 mImpl->setToType(toType);
5231 }
5232
5240 DataType getToType() const noexcept
5241 {
5242 return mImpl->getToType();
5243 }
5244
5245protected:
5246 virtual ~IFillLayer() noexcept = default;
5247 apiv::VFillLayer* mImpl;
5248};
5249
5324{
5325public:
5334 int32_t getAxis() const noexcept
5335 {
5336 return mImpl->getAxis();
5337 }
5345 void setAxis(int32_t axis) noexcept
5346 {
5347 mImpl->setAxis(axis);
5348 }
5349
5361 void setToType(DataType toType) noexcept
5362 {
5363 mImpl->setToType(toType);
5364 }
5365
5373 DataType getToType() const noexcept
5374 {
5375 return mImpl->getToType();
5376 }
5377
5378protected:
5379 virtual ~IQuantizeLayer() noexcept = default;
5380 apiv::VQuantizeLayer* mImpl;
5381};
5382
5454{
5455public:
5464 int32_t getAxis() const noexcept
5465 {
5466 return mImpl->getAxis();
5467 }
5475 void setAxis(int32_t axis) noexcept
5476 {
5477 mImpl->setAxis(axis);
5478 }
5479
5491 void setToType(DataType toType) noexcept
5492 {
5493 mImpl->setToType(toType);
5494 }
5495
5503 DataType getToType() const noexcept
5504 {
5505 return mImpl->getToType();
5506 }
5507
5508protected:
5509 virtual ~IDequantizeLayer() noexcept = default;
5510 apiv::VDequantizeLayer* mImpl;
5511};
5512
5549class IEinsumLayer : public ILayer
5550{
5551public:
5561 bool setEquation(char const* equation) noexcept
5562 {
5563 return mImpl->setEquation(equation);
5564 }
5565
5571 char const* getEquation() const noexcept
5572 {
5573 return mImpl->getEquation();
5574 }
5575
5576protected:
5577 virtual ~IEinsumLayer() noexcept = default;
5578 apiv::VEinsumLayer* mImpl;
5579};
5580
5588enum class ScatterMode : int32_t
5589{
5590 kELEMENT = 0,
5591 kND = 1,
5592};
5593
5599template <>
5600constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5601{
5602 return 2;
5603}
5604
5661class IScatterLayer : public ILayer
5662{
5663public:
5669 void setMode(ScatterMode mode) noexcept
5670 {
5671 mImpl->setMode(mode);
5672 }
5673
5679 ScatterMode getMode() const noexcept
5680 {
5681 return mImpl->getMode();
5682 }
5683
5689 void setAxis(int32_t axis) noexcept
5690 {
5691 mImpl->setAxis(axis);
5692 }
5693
5697 int32_t getAxis() const noexcept
5698 {
5699 return mImpl->getAxis();
5700 }
5701
5702protected:
5703 apiv::VScatterLayer* mImpl;
5704 virtual ~IScatterLayer() noexcept = default;
5705}; // class IScatterLayer
5706
5733class IOneHotLayer : public ILayer
5734{
5735public:
5741 void setAxis(int32_t axis) noexcept
5742 {
5743 mImpl->setAxis(axis);
5744 }
5745
5749 int32_t getAxis() const noexcept
5750 {
5751 return mImpl->getAxis();
5752 }
5753
5754protected:
5755 apiv::VOneHotLayer* mImpl;
5756};
5757
5770{
5771public:
5778 {
5779 mImpl->setInterpolationMode(mode);
5780 }
5781
5790 {
5791 return mImpl->getInterpolationMode();
5792 }
5793
5799 void setAlignCorners(bool alignCorners) noexcept
5800 {
5801 mImpl->setAlignCorners(alignCorners);
5802 }
5803
5811 bool getAlignCorners() const noexcept
5812 {
5813 return mImpl->getAlignCorners();
5814 }
5815
5823 bool setSampleMode(SampleMode mode) noexcept
5824 {
5825 return mImpl->setSampleMode(mode);
5826 }
5827
5835 SampleMode getSampleMode() const noexcept
5836 {
5837 return mImpl->getSampleMode();
5838 }
5839
5840protected:
5841 apiv::VGridSampleLayer* mImpl;
5842 virtual ~IGridSampleLayer() noexcept = default;
5843}; // class IGridSampleLayer
5844
5852enum class BoundingBoxFormat : int32_t
5853{
5855 kCORNER_PAIRS = 0,
5857 kCENTER_SIZES = 1
5858};
5859
5865template <>
5866constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
5867{
5868 return 2;
5869}
5870
5917class INMSLayer : public ILayer
5918{
5919public:
5930 {
5931 mImpl->setBoundingBoxFormat(fmt);
5932 }
5933
5942 {
5943 return mImpl->getBoundingBoxFormat();
5944 }
5945
5955 void setTopKBoxLimit(int32_t limit) noexcept
5956 {
5957 mImpl->setTopKBoxLimit(limit);
5958 }
5959
5965 int32_t getTopKBoxLimit() const noexcept
5966 {
5967 return mImpl->getTopKBoxLimit();
5968 }
5969
5988 using ILayer::setInput;
5989
5990protected:
5991 apiv::VNMSLayer* mImpl;
5992 virtual ~INMSLayer() noexcept = default;
5993}; // class INMSLayer
5994
6008{
6009public:
6018 void setBatchAxis(int32_t batchAxis) noexcept
6019 {
6020 mImpl->setBatchAxis(batchAxis);
6021 }
6022
6028 int32_t getBatchAxis() const noexcept
6029 {
6030 return mImpl->getBatchAxis();
6031 }
6032
6041 void setSequenceAxis(int32_t sequenceAxis) noexcept
6042 {
6043 mImpl->setSequenceAxis(sequenceAxis);
6044 }
6045
6051 int32_t getSequenceAxis() const noexcept
6052 {
6053 return mImpl->getSequenceAxis();
6054 }
6055
6056protected:
6057 apiv::VReverseSequenceLayer* mImpl;
6058 virtual ~IReverseSequenceLayer() noexcept = default;
6059}; // class IReverseSequenceLayer
6060
6080{
6081public:
6089 void setEpsilon(float eps) noexcept
6090 {
6091 return mImpl->setEpsilon(eps);
6092 }
6093
6099 float getEpsilon() const noexcept
6100 {
6101 return mImpl->getEpsilon();
6102 }
6103
6109 void setAxes(uint32_t axesMask) noexcept
6110 {
6111 return mImpl->setAxes(axesMask);
6112 }
6113
6119 uint32_t getAxes() const noexcept
6120 {
6121 return mImpl->getAxes();
6122 }
6123
6140 void setNbGroups(int64_t nbGroups) noexcept
6141 {
6142 return mImpl->setNbGroups(nbGroups);
6143 }
6144
6150 int64_t getNbGroups() const noexcept
6151 {
6152 return mImpl->getNbGroups();
6153 }
6154
6175 void setComputePrecision(DataType type) noexcept
6176 {
6177 return mImpl->setComputePrecision(type);
6178 }
6179
6186 {
6187 return mImpl->getComputePrecision();
6188 }
6189
6190protected:
6191 apiv::VNormalizationLayer* mImpl;
6192 virtual ~INormalizationLayer() noexcept = default;
6193};
6194
6213{
6214public:
6215 virtual ~INetworkDefinition() noexcept = default;
6216
6253 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
6254 {
6255 return mImpl->addInput(name, type, dimensions);
6256 }
6257
6267 void markOutput(ITensor& tensor) noexcept
6268 {
6269 mImpl->markOutput(tensor);
6270 }
6271
6285 bool markDebug(ITensor& tensor) noexcept
6286 {
6287 return mImpl->markDebug(tensor);
6288 }
6289
6301 bool unmarkDebug(ITensor& tensor) noexcept
6302 {
6303 return mImpl->unmarkDebug(tensor);
6304 }
6305
6311 bool isDebugTensor(nvinfer1::ITensor const& tensor) const noexcept
6312 {
6313 return mImpl->isDebugTensor(tensor);
6314 }
6315
6332 {
6333 return mImpl->addActivation(input, type);
6334 }
6335
6350 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
6351 {
6352 return mImpl->addLRN(input, window, alpha, beta, k);
6353 }
6354
6376 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
6377 {
6378 return mImpl->addScale(input, mode, shift, scale, power);
6379 }
6380
6390 {
6391 return mImpl->addSoftMax(input);
6392 }
6393
6406 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
6407 {
6408 return mImpl->addConcatenation(inputs, nbInputs);
6409 }
6410
6434 {
6435 return mImpl->addElementWise(input1, input2, op);
6436 }
6437
6455 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
6456 {
6457 return mImpl->addUnary(input, operation);
6458 }
6459
6470 {
6471 return mImpl->addShuffle(input);
6472 }
6473
6486 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
6487 {
6488 return mImpl->addOneHot(indices, values, depth, axis);
6489 }
6490
6498 int32_t getNbLayers() const noexcept
6499 {
6500 return mImpl->getNbLayers();
6501 }
6502
6512 ILayer* getLayer(int32_t index) const noexcept
6513 {
6514 return mImpl->getLayer(index);
6515 }
6516
6524 int32_t getNbInputs() const noexcept
6525 {
6526 return mImpl->getNbInputs();
6527 }
6528
6540 ITensor* getInput(int32_t index) const noexcept
6541 {
6542 return mImpl->getInput(index);
6543 }
6544
6554 int32_t getNbOutputs() const noexcept
6555 {
6556 return mImpl->getNbOutputs();
6557 }
6558
6570 ITensor* getOutput(int32_t index) const noexcept
6571 {
6572 return mImpl->getOutput(index);
6573 }
6574
6597 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
6598 {
6599 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
6600 }
6601
6629 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
6630 {
6631 return mImpl->addTopK(input, op, k, reduceAxes);
6632 }
6633
6645 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
6646 {
6647 return mImpl->addGather(data, indices, axis);
6648 }
6649
6661 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
6662 {
6663 return mImpl->addGatherV2(data, indices, mode);
6664 }
6665
6681 {
6682 return mImpl->addRaggedSoftMax(input, bounds);
6683 }
6684
6702 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
6703 {
6704 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
6705 }
6706
6717 {
6718 return mImpl->addNonZero(input);
6719 }
6720
6740 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
6741 {
6742 return mImpl->addConstant(dimensions, weights);
6743 }
6744
6755 {
6756 return mImpl->addIdentity(input);
6757 }
6758
6769 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
6770 {
6771 return mImpl->addCast(input, toType);
6772 }
6773
6784 void removeTensor(ITensor& tensor) noexcept
6785 {
6786 mImpl->removeTensor(tensor);
6787 }
6788
6796 void unmarkOutput(ITensor& tensor) noexcept
6797 {
6798 mImpl->unmarkOutput(tensor);
6799 }
6800
6815 IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
6816 {
6817 return mImpl->addPluginV2(inputs, nbInputs, plugin);
6818 }
6819
6833 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
6834 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
6835 {
6836 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
6837 }
6838
6853 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
6854 {
6855 return mImpl->addSlice(input, start, size, stride);
6856 }
6857
6877 void setName(char const* name) noexcept
6878 {
6879 mImpl->setName(name);
6880 }
6881
6891 char const* getName() const noexcept
6892 {
6893 return mImpl->getName();
6894 }
6895
6907 IShapeLayer* addShape(ITensor& input) noexcept
6908 {
6909 return mImpl->addShape(input);
6910 }
6911
6922 {
6923 return mImpl->hasImplicitBatchDimension();
6924 }
6925
6932 {
6933 return mImpl->getFlags();
6934 }
6935
6943 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
6944 {
6945 return mImpl->getFlag(networkDefinitionCreationFlag);
6946 }
6947
6960 bool markOutputForShapes(ITensor& tensor) noexcept
6961 {
6962 return mImpl->markOutputForShapes(tensor);
6963 }
6964
6972 bool unmarkOutputForShapes(ITensor& tensor) noexcept
6973 {
6974 return mImpl->unmarkOutputForShapes(tensor);
6975 }
6976
6991 {
6992 return mImpl->addParametricReLU(input, slope);
6993 }
6994
7013 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7014 {
7015 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7016 }
7017
7032 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
7033 {
7034 return mImpl->addPoolingNd(input, type, windowSize);
7035 }
7036
7051 //
7055 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
7056 {
7057 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
7058 }
7059
7092 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
7093 {
7094 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
7095 }
7096
7109 {
7110 return mImpl->addResize(input);
7111 }
7112
7122 ILoop* addLoop() noexcept
7123 {
7124 return mImpl->addLoop();
7125 }
7126
7138 {
7139 return mImpl->addIfConditional();
7140 }
7141
7176 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
7177 {
7178 return mImpl->addSelect(condition, thenInput, elseInput);
7179 }
7180
7193 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
7194 {
7195 return mImpl->addAssertion(condition, message);
7196 }
7197
7218 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
7219 {
7220 return mImpl->addFill(dimensions, op);
7221 }
7222
7244 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
7245 {
7246 return mImpl->addFillV2(dimensions, op, outputType);
7247 }
7248
7260 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
7261 {
7262 return mImpl->addPaddingNd(input, prePadding, postPadding);
7263 }
7264
7284 bool setWeightsName(Weights weights, char const* name) noexcept
7285 {
7286 return mImpl->setWeightsName(weights, name);
7287 }
7288
7300 //
7303 void setErrorRecorder(IErrorRecorder* recorder) noexcept
7304 {
7305 mImpl->setErrorRecorder(recorder);
7306 }
7307
7319 {
7320 return mImpl->getErrorRecorder();
7321 }
7322
7340 {
7341 return mImpl->addDequantize(input, scale);
7342 }
7343
7360 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7361 {
7362 return mImpl->addDequantizeV2(input, scale, outputType);
7363 }
7364
7380 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
7381 {
7382 return mImpl->addScatter(data, indices, updates, mode);
7383 }
7384
7402 {
7403 return mImpl->addQuantize(input, scale);
7404 }
7405
7422 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
7423 {
7424 return mImpl->addQuantizeV2(input, scale, outputType);
7425 }
7426
7437 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
7438 {
7439 return mImpl->addEinsum(inputs, nbInputs, equation);
7440 }
7441
7456 {
7457 return mImpl->addGridSample(input, grid);
7458 }
7459
7473 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
7474 {
7475 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
7476 }
7477
7491 {
7492 return mImpl->addReverseSequence(input, sequenceLens);
7493 }
7494
7516 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
7517 {
7518 return mImpl->addNormalization(input, scale, bias, axesMask);
7519 }
7520
7527 virtual IBuilder& getBuilder() const noexcept
7528 {
7529 return mImpl->getBuilder();
7530 }
7531
7532protected:
7533 apiv::VNetworkDefinition* mImpl;
7534};
7535
7541enum class CalibrationAlgoType : int32_t
7542{
7547};
7548
7554template <>
7555constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
7556{
7557 return 4;
7558}
7559
7572{
7573public:
7581 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
7582
7597 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
7598
7613 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
7614
7623 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
7624
7630 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
7631
7632 ~IInt8Calibrator() noexcept override = default;
7633};
7634
7635namespace v_1_0
7636{
7638{
7639public:
7643 InterfaceInfo getInterfaceInfo() const noexcept override
7644 {
7645 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
7646 }
7647
7652 {
7654 }
7655
7656 ~IInt8EntropyCalibrator() noexcept override = default;
7657};
7658} // namespace v_1_0
7659
7672
7673namespace v_1_0
7674{
7676{
7677public:
7681 InterfaceInfo getInterfaceInfo() const noexcept override
7682 {
7683 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
7684 }
7685
7690 {
7692 }
7693
7694 ~IInt8EntropyCalibrator2() noexcept override = default;
7695};
7696} // namespace v_1_0
7697
7710
7711namespace v_1_0
7712{
7714{
7715public:
7719 InterfaceInfo getInterfaceInfo() const noexcept override
7720 {
7721 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
7722 }
7723
7728 {
7730 }
7731
7732 ~IInt8MinMaxCalibrator() noexcept override = default;
7733};
7734} // namespace v_1_0
7735
7747
7748namespace v_1_0
7749{
7751{
7752public:
7756 InterfaceInfo getInterfaceInfo() const noexcept override
7757 {
7758 return InterfaceInfo{"IInt8Calibrator", 1, 0};
7759 }
7760
7765 {
7767 }
7768
7775 virtual double getQuantile() const noexcept = 0;
7776
7783 virtual double getRegressionCutoff() const noexcept = 0;
7784
7797 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
7798
7807 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
7808
7809 ~IInt8LegacyCalibrator() noexcept override = default;
7810};
7811} // namespace v_1_0
7812
7825
7837{
7838public:
7844 DataType getDataType() const noexcept
7845 {
7846 return mImpl->getDataType();
7847 }
7848
7855 Dims getStrides() const noexcept
7856 {
7857 return mImpl->getStrides();
7858 }
7859
7865 int64_t getVectorizedDim() const noexcept
7866 {
7867 return mImpl->getVectorizedDim();
7868 }
7869
7876 int64_t getComponentsPerElement() const noexcept
7877 {
7878 return mImpl->getComponentsPerElement();
7879 }
7880
7881protected:
7882 virtual ~IAlgorithmIOInfo() noexcept = default;
7883 apiv::VAlgorithmIOInfo* mImpl;
7884};
7885
7898{
7899public:
7903 int64_t getImplementation() const noexcept
7904 {
7905 return mImpl->getImplementation();
7906 }
7907
7911 int64_t getTactic() const noexcept
7912 {
7913 return mImpl->getTactic();
7914 }
7915
7916protected:
7917 virtual ~IAlgorithmVariant() noexcept = default;
7918 apiv::VAlgorithmVariant* mImpl;
7919};
7920
7930{
7931public:
7937 char const* getName() const noexcept
7938 {
7939 return mImpl->getName();
7940 }
7941
7949 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
7950 {
7951 return mImpl->getDimensions(index, select);
7952 }
7953
7957 int32_t getNbInputs() const noexcept
7958 {
7959 return mImpl->getNbInputs();
7960 }
7961
7965 int32_t getNbOutputs() const noexcept
7966 {
7967 return mImpl->getNbOutputs();
7968 }
7969
7970protected:
7971 virtual ~IAlgorithmContext() noexcept = default;
7972 apiv::VAlgorithmContext* mImpl;
7973};
7974
7986class IAlgorithm : public INoCopy
7987{
7988public:
7993 {
7994 return mImpl->getAlgorithmVariant();
7995 }
7996
8000 float getTimingMSec() const noexcept
8001 {
8002 return mImpl->getTimingMSec();
8003 }
8004
8008 std::size_t getWorkspaceSize() const noexcept
8009 {
8010 return mImpl->getWorkspaceSize();
8011 }
8012
8022 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
8023 {
8024 return mImpl->getAlgorithmIOInfoByIndex(index);
8025 }
8026
8027protected:
8028 virtual ~IAlgorithm() noexcept = default;
8029 apiv::VAlgorithm* mImpl;
8030}; // IAlgorithm
8031
8032namespace v_1_0
8033{
8035{
8036public:
8040 InterfaceInfo getInterfaceInfo() const noexcept override
8041 {
8042 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
8043 }
8058 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
8059 int32_t nbChoices, int32_t* selection) noexcept = 0;
8060
8071 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
8072 int32_t nbAlgorithms) noexcept = 0;
8073
8074 virtual ~IAlgorithmSelector() noexcept = default;
8075};
8076} // namespace v_1_0
8077
8089
8096using QuantizationFlags = uint32_t;
8097
8105enum class QuantizationFlag : int32_t
8106{
8111};
8112
8118template <>
8119constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
8120{
8121 return 1;
8122}
8123
8130using BuilderFlags = uint32_t;
8131
8139enum class BuilderFlag : int32_t
8140{
8142 kFP16 = 0,
8143
8145 kINT8 = 1,
8146
8148 kDEBUG = 2,
8149
8151 kGPU_FALLBACK = 3,
8152
8154 kREFIT = 4,
8155
8158
8162 kTF32 = 6,
8163
8165 kSPARSE_WEIGHTS = 7,
8166
8173 kSAFETY_SCOPE = 8,
8174
8177
8181
8185 kDIRECT_IO = 11,
8186
8189
8196
8202
8208 kFP8 = 15,
8209
8213
8216 kBF16 = 17,
8217
8223
8225 kSTRIP_PLAN = 19,
8226
8229
8236 kREFIT_IDENTICAL = 20,
8237
8263 kWEIGHT_STREAMING = 21,
8264};
8265
8271template <>
8272constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
8273{
8274 return 22;
8275}
8276
8287class ITimingCache : public INoCopy
8288{
8289public:
8290 virtual ~ITimingCache() noexcept = default;
8291
8301 nvinfer1::IHostMemory* serialize() const noexcept
8302 {
8303 return mImpl->serialize();
8304 }
8305
8325 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
8326 {
8327 return mImpl->combine(inputCache, ignoreMismatch);
8328 }
8329
8335 bool reset() noexcept
8336 {
8337 return mImpl->reset();
8338 }
8339
8340protected:
8341 apiv::VTimingCache* mImpl;
8342};
8343
8351enum class MemoryPoolType : int32_t
8352{
8359 kWORKSPACE = 0,
8360
8368
8374 kDLA_LOCAL_DRAM = 2,
8375
8381 kDLA_GLOBAL_DRAM = 3,
8382
8390 kTACTIC_DRAM = 4,
8391
8405};
8406
8412template <>
8413constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
8414{
8415 return 6;
8416}
8417
8426enum class PreviewFeature : int32_t
8427{
8434};
8435namespace impl
8436{
8442template <>
8444{
8445 static constexpr int32_t kVALUE = 1;
8446};
8447} // namespace impl
8448
8459enum class HardwareCompatibilityLevel : int32_t
8460{
8463 kNONE = 0,
8464
8474 kAMPERE_PLUS = 1,
8475};
8476
8477namespace impl
8478{
8484template <>
8486{
8487 static constexpr int32_t kVALUE = 2;
8488};
8489} // namespace impl
8490
8491namespace v_1_0
8492{
8494{
8495public:
8496 IProgressMonitor() = default;
8497 virtual ~IProgressMonitor() noexcept = default;
8498
8502 InterfaceInfo getInterfaceInfo() const noexcept override
8503 {
8504 return InterfaceInfo{"IProgressMonitor", 1, 0};
8505 }
8506
8526 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
8527
8540 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
8541
8553 virtual void phaseFinish(char const* phaseName) noexcept = 0;
8554
8555}; // class IProgressMonitor
8556} // namespace v_1_0
8557
8578
8587{
8588public:
8589 virtual ~IBuilderConfig() noexcept = default;
8590
8599 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
8600 {
8601 mImpl->setAvgTimingIterations(avgTiming);
8602 }
8603
8611 int32_t getAvgTimingIterations() const noexcept
8612 {
8613 return mImpl->getAvgTimingIterations();
8614 }
8615
8624 void setEngineCapability(EngineCapability capability) noexcept
8625 {
8626 mImpl->setEngineCapability(capability);
8627 }
8628
8637 {
8638 return mImpl->getEngineCapability();
8639 }
8640
8646 void setInt8Calibrator(IInt8Calibrator* calibrator) noexcept
8647 {
8648 mImpl->setInt8Calibrator(calibrator);
8649 }
8650
8655 {
8656 return mImpl->getInt8Calibrator();
8657 }
8658
8671 void setFlags(BuilderFlags builderFlags) noexcept
8672 {
8673 mImpl->setFlags(builderFlags);
8674 }
8675
8683 BuilderFlags getFlags() const noexcept
8684 {
8685 return mImpl->getFlags();
8686 }
8687
8695 void clearFlag(BuilderFlag builderFlag) noexcept
8696 {
8697 mImpl->clearFlag(builderFlag);
8698 }
8699
8707 void setFlag(BuilderFlag builderFlag) noexcept
8708 {
8709 mImpl->setFlag(builderFlag);
8710 }
8711
8719 bool getFlag(BuilderFlag builderFlag) const noexcept
8720 {
8721 return mImpl->getFlag(builderFlag);
8722 }
8723
8736 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
8737 {
8738 mImpl->setDeviceType(layer, deviceType);
8739 }
8740
8746 DeviceType getDeviceType(ILayer const* layer) const noexcept
8747 {
8748 return mImpl->getDeviceType(layer);
8749 }
8750
8758 bool isDeviceTypeSet(ILayer const* layer) const noexcept
8759 {
8760 return mImpl->isDeviceTypeSet(layer);
8761 }
8762
8768 void resetDeviceType(ILayer const* layer) noexcept
8769 {
8770 mImpl->resetDeviceType(layer);
8771 }
8772
8778 bool canRunOnDLA(ILayer const* layer) const noexcept
8779 {
8780 return mImpl->canRunOnDLA(layer);
8781 }
8782
8794 void setDLACore(int32_t dlaCore) noexcept
8795 {
8796 mImpl->setDLACore(dlaCore);
8797 }
8798
8804 int32_t getDLACore() const noexcept
8805 {
8806 return mImpl->getDLACore();
8807 }
8808
8815 void setDefaultDeviceType(DeviceType deviceType) noexcept
8816 {
8817 mImpl->setDefaultDeviceType(deviceType);
8818 }
8819
8826 {
8827 return mImpl->getDefaultDeviceType();
8828 }
8829
8835 void reset() noexcept
8836 {
8837 mImpl->reset();
8838 }
8839
8847 void setProfileStream(const cudaStream_t stream) noexcept
8848 {
8849 return mImpl->setProfileStream(stream);
8850 }
8851
8859 cudaStream_t getProfileStream() const noexcept
8860 {
8861 return mImpl->getProfileStream();
8862 }
8863
8876 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
8877 {
8878 return mImpl->addOptimizationProfile(profile);
8879 }
8880
8889 int32_t getNbOptimizationProfiles() const noexcept
8890 {
8891 return mImpl->getNbOptimizationProfiles();
8892 }
8893
8902 {
8903 mImpl->setProfilingVerbosity(verbosity);
8904 }
8905
8915 {
8916 return mImpl->getProfilingVerbosity();
8917 }
8918
8924 {
8925 mImpl->setAlgorithmSelector(selector);
8926 }
8927
8932 {
8933 return mImpl->getAlgorithmSelector();
8934 }
8935
8947 bool setCalibrationProfile(IOptimizationProfile const* profile) noexcept
8948 {
8949 return mImpl->setCalibrationProfile(profile);
8950 }
8951
8958 {
8959 return mImpl->getCalibrationProfile();
8960 }
8961
8975 {
8976 mImpl->setQuantizationFlags(flags);
8977 }
8978
8987 {
8988 return mImpl->getQuantizationFlags();
8989 }
8990
8999 {
9000 mImpl->clearQuantizationFlag(flag);
9001 }
9002
9011 {
9012 mImpl->setQuantizationFlag(flag);
9013 }
9014
9022 bool getQuantizationFlag(QuantizationFlag flag) const noexcept
9023 {
9024 return mImpl->getQuantizationFlag(flag);
9025 }
9026
9044 bool setTacticSources(TacticSources tacticSources) noexcept
9045 {
9046 return mImpl->setTacticSources(tacticSources);
9047 }
9048
9060 {
9061 return mImpl->getTacticSources();
9062 }
9063
9078 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
9079 {
9080 return mImpl->createTimingCache(blob, size);
9081 }
9082
9101 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
9102 {
9103 return mImpl->setTimingCache(cache, ignoreMismatch);
9104 }
9105
9112 {
9113 return mImpl->getTimingCache();
9114 }
9115
9143 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
9144 {
9145 mImpl->setMemoryPoolLimit(pool, poolSize);
9146 }
9147
9162 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
9163 {
9164 return mImpl->getMemoryPoolLimit(pool);
9165 }
9166
9180 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
9181 {
9182 mImpl->setPreviewFeature(feature, enable);
9183 }
9184
9194 bool getPreviewFeature(PreviewFeature feature) const noexcept
9195 {
9196 return mImpl->getPreviewFeature(feature);
9197 }
9198
9227 void setBuilderOptimizationLevel(int32_t level) noexcept
9228 {
9229 mImpl->setBuilderOptimizationLevel(level);
9230 }
9231
9240 {
9241 return mImpl->getBuilderOptimizationLevel();
9242 }
9243
9256 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
9257 {
9258 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
9259 }
9260
9270 {
9271 return mImpl->getHardwareCompatibilityLevel();
9272 }
9273
9282 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
9283 {
9284 mImpl->setPluginsToSerialize(paths, nbPaths);
9285 }
9286
9295 char const* getPluginToSerialize(int32_t index) const noexcept
9296 {
9297 return mImpl->getPluginToSerialize(index);
9298 }
9299
9305 int32_t getNbPluginsToSerialize() const noexcept
9306 {
9307 return mImpl->getNbPluginsToSerialize();
9308 }
9309
9334 void setMaxAuxStreams(int32_t nbStreams) noexcept
9335 {
9336 mImpl->setMaxAuxStreams(nbStreams);
9337 }
9338
9344 int32_t getMaxAuxStreams() const noexcept
9345 {
9346 return mImpl->getMaxAuxStreams();
9347 }
9348
9360 void setProgressMonitor(IProgressMonitor* monitor) noexcept
9361 {
9362 return mImpl->setProgressMonitor(monitor);
9363 }
9364
9371 {
9372 return mImpl->getProgressMonitor();
9373 }
9374
9375protected:
9376 apiv::VBuilderConfig* mImpl;
9377};
9378
9387
9397{
9402
9407 kSTRONGLY_TYPED = 1,
9408};
9409
9415template <>
9416constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
9417{
9418 return 2;
9419}
9420
9428class IBuilder : public INoCopy
9429{
9430public:
9431 virtual ~IBuilder() noexcept = default;
9432
9436 bool platformHasFastFp16() const noexcept
9437 {
9438 return mImpl->platformHasFastFp16();
9439 }
9440
9444 bool platformHasFastInt8() const noexcept
9445 {
9446 return mImpl->platformHasFastInt8();
9447 }
9448
9456 int32_t getMaxDLABatchSize() const noexcept
9457 {
9458 return mImpl->getMaxDLABatchSize();
9459 }
9460
9464 int32_t getNbDLACores() const noexcept
9465 {
9466 return mImpl->getNbDLACores();
9467 }
9468
9481 void setGpuAllocator(IGpuAllocator* allocator) noexcept
9482 {
9483 mImpl->setGpuAllocator(allocator);
9484 }
9485
9492 {
9493 return mImpl->createBuilderConfig();
9494 }
9495
9514 {
9515 return mImpl->createNetworkV2(flags);
9516 }
9517
9529 {
9530 return mImpl->createOptimizationProfile();
9531 }
9532
9547 void setErrorRecorder(IErrorRecorder* recorder) noexcept
9548 {
9549 mImpl->setErrorRecorder(recorder);
9550 }
9551
9563 {
9564 return mImpl->getErrorRecorder();
9565 }
9566
9570 void reset() noexcept
9571 {
9572 mImpl->reset();
9573 }
9574
9578 bool platformHasTf32() const noexcept
9579 {
9580 return mImpl->platformHasTf32();
9581 }
9582
9598 {
9599 return mImpl->buildSerializedNetwork(network, config);
9600 }
9601
9619 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
9620 {
9621 return mImpl->isNetworkSupported(network, config);
9622 }
9623
9629 ILogger* getLogger() const noexcept
9630 {
9631 return mImpl->getLogger();
9632 }
9633
9645 bool setMaxThreads(int32_t maxThreads) noexcept
9646 {
9647 return mImpl->setMaxThreads(maxThreads);
9648 }
9649
9659 int32_t getMaxThreads() const noexcept
9660 {
9661 return mImpl->getMaxThreads();
9662 }
9663
9670 {
9671 return mImpl->getPluginRegistry();
9672 }
9673
9674protected:
9675 apiv::VBuilder* mImpl;
9676};
9677
9678} // namespace nvinfer1
9679
9684extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
9685
9686namespace nvinfer1
9687{
9688namespace
9689{
9690
9698inline IBuilder* createInferBuilder(ILogger& logger) noexcept
9699{
9700 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
9701}
9702
9703} // namespace
9704
9718 nvinfer1::EngineCapability capability) noexcept;
9719
9720namespace safe
9721{
9723class IPluginRegistry;
9724} // namespace safe
9725
9734 nvinfer1::EngineCapability capability) noexcept;
9735
9736} // namespace nvinfer1
9737
9738#endif // NV_INFER_H
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:59
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:93
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:45
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:46
Definition: NvInferRuntimeBase.h:201
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:204
An Activation layer in a network definition.
Definition: NvInfer.h:1337
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1385
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1346
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1356
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1394
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1403
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1371
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:7930
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:7965
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:7957
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:7937
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:7949
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:7987
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:8008
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:8000
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:8022
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:7992
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:7837
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:7865
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:7855
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:7844
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:7876
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:7898
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:7911
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:7903
An assertion layer in a network.
Definition: NvInfer.h:4868
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:4878
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:4888
virtual ~IAssertionLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:8587
IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:8957
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:9143
void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:9010
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:9078
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:9180
void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:8646
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:9194
void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:8998
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:9239
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:9044
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:9282
bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:9022
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:9162
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:8804
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:9305
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:8736
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:8624
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9344
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:8719
void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:8974
bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:8947
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:9360
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8901
IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:8931
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:8889
QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:8986
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:9111
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:8835
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:9101
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:9295
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:8636
void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:8923
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:8825
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:8683
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:8671
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:9059
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:8768
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:8794
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:9269
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:8695
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:8876
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:9370
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:9376
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:8611
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:8815
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:8707
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:8746
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:8778
cudaStream_t getProfileStream() const noexcept
Get the cuda stream that is used to profile this network.
Definition: NvInfer.h:8859
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:9256
IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:8654
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:9334
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:8914
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:8758
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:9227
void setProfileStream(const cudaStream_t stream) noexcept
Set the cuda stream that is used to profile this network.
Definition: NvInfer.h:8847
Builds an engine from a network definition.
Definition: NvInfer.h:9429
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:9456
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:9464
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:9562
apiv::VBuilder * mImpl
Definition: NvInfer.h:9675
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:9629
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:9619
bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:9578
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:9659
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:9669
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:9528
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:9481
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:9513
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:9491
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:9570
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:9645
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:9547
bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:9444
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:9597
virtual ~IBuilder() noexcept=default
A cast layer in a network.
Definition: NvInfer.h:3739
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3765
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3759
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3748
A concatenation layer in a network definition.
Definition: NvInfer.h:2047
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2060
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2070
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4398
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3778
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3788
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3798
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3810
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:3828
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3822
A convolution layer in a network definition.
Definition: NvInfer.h:1017
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1142
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1115
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1183
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1287
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1273
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1243
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1090
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1233
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1297
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1036
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1080
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1169
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1066
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1195
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1056
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1026
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1105
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1218
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1261
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1132
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1159
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1208
A deconvolution layer in a network definition.
Definition: NvInfer.h:2088
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2176
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2137
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2161
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2204
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2320
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2386
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2186
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2151
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2107
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2310
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2242
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2293
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2232
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2283
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2338
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2097
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2350
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2376
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2256
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2127
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2214
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2268
A Dequantize layer in a network definition.
Definition: NvInfer.h:5454
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5491
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5464
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5503
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5475
An Einsum layer in a network.
Definition: NvInfer.h:5550
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:5561
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5571
A elementwise layer in a network definition.
Definition: NvInfer.h:2462
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2491
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2485
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2473
Generate a tensor according to a specified mode.
Definition: NvInfer.h:4979
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5211
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5025
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5015
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5240
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5154
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5188
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5078
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5169
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5203
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5059
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:4990
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5044
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5228
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5005
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5093
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2596
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:2607
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2642
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2678
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2652
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2662
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2619
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2672
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:5770
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:5777
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:5823
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:5799
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:5841
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:5835
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:5789
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:5811
virtual ~IGridSampleLayer() noexcept=default
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:139
A layer that represents the identity function.
Definition: NvInfer.h:3726
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3728
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4377
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4382
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4457
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4496
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4521
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4468
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4484
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4511
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4426
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4413
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:7572
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:4686
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4713
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4723
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4699
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4691
A LRN layer in a network definition.
Definition: NvInfer.h:1702
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1723
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1745
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1713
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1779
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1735
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1757
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1767
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1789
Base class for all layer classes in a network definition.
Definition: NvInfer.h:544
bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:687
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:803
void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:663
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:565
void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:697
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:583
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:816
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:759
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:675
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:575
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:604
bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:773
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:614
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:631
void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:785
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:596
void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:744
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:551
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeBase.h:682
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4354
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4359
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4743
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4813
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4772
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4785
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:4798
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:4823
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4751
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4586
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4616
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4591
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4608
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3618
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3646
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3640
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3628
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:5918
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:5955
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:5929
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:5941
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:5991
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:5965
A network definition for input to the builder.
Definition: NvInfer.h:6213
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:6815
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:6406
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:6469
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:7516
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:6877
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:6285
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:6350
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:6629
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:7193
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:7012
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:6769
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:7091
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:6891
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:6990
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:6570
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:6540
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7360
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:6972
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7244
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:7122
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:6331
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:7218
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:6853
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7401
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:7527
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:7473
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:6512
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:6943
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:7137
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:7318
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:7490
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:6524
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:6931
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:7422
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:6596
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:6455
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:7455
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:6784
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:7176
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:7380
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:6498
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:6921
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:7533
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:6960
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:6486
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:6376
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:6833
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:6796
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:6754
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:6661
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:6433
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:6740
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:7303
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:7032
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:6680
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:6907
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:6645
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:7054
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:7108
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:6701
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:6389
bool isDebugTensor(nvinfer1::ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:6311
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:6301
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:7437
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:6267
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:7260
INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:6716
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:7339
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:6554
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:7284
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:48
Definition: NvInfer.h:3672
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6080
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6099
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6119
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6089
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6185
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6191
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6150
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6109
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6175
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6140
A OneHot layer in a network definition.
Definition: NvInfer.h:5734
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:5755
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:5741
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:5749
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2080
Layer that represents a padding operation.
Definition: NvInfer.h:2952
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3001
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2963
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:2989
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:2975
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3007
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:3842
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:3844
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:128
Layer type for pluginV2.
Definition: NvInfer.h:2692
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2705
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2699
Layer type for V3 plugins.
Definition: NvInfer.h:2719
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2726
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2732
A Pooling layer in a network definition.
Definition: NvInfer.h:1451
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1470
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1603
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1579
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1523
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1551
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1460
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1616
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1592
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1626
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:1512
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1670
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1498
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1641
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1651
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1682
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1569
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1541
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1485
A Quantize layer in a network definition.
Definition: NvInfer.h:5324
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5361
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5345
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5334
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5373
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3693
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3695
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4539
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2874
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2921
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2881
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2891
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2911
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2901
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2937
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2931
A resize layer in a network definition.
Definition: NvInfer.h:4031
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4192
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4216
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:4110
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4051
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4248
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4091
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4258
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4202
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4132
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4167
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4271
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4122
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4061
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4226
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4281
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4177
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6008
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6041
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6028
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6057
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6051
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6018
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1848
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1905
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1925
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1895
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1915
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1865
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1875
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:1961
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1885
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1855
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1940
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5662
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5669
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:5703
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:5689
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:5697
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:5679
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:4846
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3421
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3423
Layer type for shuffling data.
Definition: NvInfer.h:3040
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3195
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3051
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3148
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3101
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3088
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3063
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3160
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3189
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3176
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3269
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3338
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3404
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3309
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3280
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3295
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3363
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3324
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3373
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3353
A Softmax layer in a network definition.
Definition: NvInfer.h:1992
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2014
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2024
virtual ~ISoftMaxLayer() noexcept=default
A tensor in a network definition.
Definition: NvInfer.h:181
bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:284
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for this tensor. By default all formats are allowed. Shape tensors (for which isS...
Definition: NvInfer.h:420
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:343
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:228
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:380
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:197
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:485
void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:257
bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:372
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:209
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:464
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:400
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:292
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:317
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:331
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:300
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:269
apiv::VTensor * mImpl
Definition: NvInfer.h:532
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:390
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:511
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:526
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:362
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:242
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:433
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:8288
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:8325
virtual ~ITimingCache() noexcept=default
apiv::VTimingCache * mImpl
Definition: NvInfer.h:8341
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:8335
Layer that represents a TopK reduction.
Definition: NvInfer.h:3461
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3492
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3516
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3478
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3548
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3468
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3506
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3526
virtual ~ITopKLayer() noexcept=default
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4660
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4665
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2799
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2808
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2824
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2818
virtual ~IUnaryLayer() noexcept=default
An Interface class for version control.
Definition: NvInferRuntimeBase.h:399
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:364
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:121
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferSafeRuntime.h:830
Definition: NvInfer.h:8035
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:8040
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:856
Definition: NvInferRuntimeBase.h:468
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7689
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7681
Definition: NvInfer.h:7638
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7651
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7643
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:7751
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7764
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7756
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:7714
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:7727
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:7719
Definition: NvInferRuntime.h:687
Definition: NvInfer.h:8494
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:9698
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:2297
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:3936
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:73
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:8352
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1805
@ kUNIFORM
Identical coefficients across all elements of the tensor.
@ kCHANNEL
Per-channel coefficients.
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:8096
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:8460
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:5853
@ 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:8272
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:114
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:7555
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2753
@ kISINF
Return true if input value equals +/- infinity for floating-point data type.
@ kCOSH
Hyperbolic cosine.
@ kACOSH
Inverse hyperbolic cosine.
@ kERF
Gauss error function.
@ 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:2861
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4333
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:133
@ 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:4907
@ 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:3966
@ 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:983
@ 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
Definition: NvInfer.h:4321
@ 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:9386
PreviewFeature
Define preview features.
Definition: NvInfer.h:8427
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2513
DataType
The type of weights and tensors.
Definition: NvInferRuntimeBase.h:135
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:8130
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1257
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1817
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:7542
@ 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.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition 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.
@ 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.
@ 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:8119
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3205
@ 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:2501
@ 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:125
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2309
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:9397
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2411
@ 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:8106
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3221
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:3854
@ 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:8140
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kFP16
Enable FP16 layer selection, with FP32 fallback.
@ kINT8
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ 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:3444
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:8413
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3433
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2847
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4312
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:9416
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5589
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3559
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:3882
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2786
LoopOutput
Definition: NvInfer.h:4295
@ 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:5866
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3587
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1419
@ 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:8577
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:4938
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:201
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2040
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5600
Represents a permutation of dimensions.
Definition: NvInfer.h:3017
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:120

  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