TensorRT 10.14.1
NvInfer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_H
19#define NV_INFER_H
20
21#include "NvInferLegacyDims.h"
22#include "NvInferRuntime.h" // IWYU pragma: export
23
35
41
47namespace nvinfer1
48{
49
57enum class LayerType : int32_t
58{
59 kCONVOLUTION = 0,
60 kCAST = 1,
61 kACTIVATION = 2,
62 kPOOLING = 3,
63 kLRN = 4,
64 kSCALE = 5,
65 kSOFTMAX = 6,
66 kDECONVOLUTION = 7,
67 kCONCATENATION = 8,
68 kELEMENTWISE = 9,
69 kPLUGIN = 10,
70 kUNARY = 11,
71 kPADDING = 12,
72 kSHUFFLE = 13,
73 kREDUCE = 14,
74 kTOPK = 15,
75 kGATHER = 16,
76 kMATRIX_MULTIPLY = 17,
77 kRAGGED_SOFTMAX = 18,
78 kCONSTANT = 19,
79 kIDENTITY = 20,
80 kPLUGIN_V2 = 21,
81 kSLICE = 22,
82 kSHAPE = 23,
83 kPARAMETRIC_RELU = 24,
84 kRESIZE = 25,
85 kTRIP_LIMIT = 26,
86 kRECURRENCE = 27,
87 kITERATOR = 28,
88 kLOOP_OUTPUT = 29,
89 kSELECT = 30,
90 kFILL = 31,
91 kQUANTIZE = 32,
92 kDEQUANTIZE = 33,
93 kCONDITION = 34,
96 kSCATTER = 37,
97 kEINSUM = 38,
98 kASSERTION = 39,
99 kONE_HOT = 40,
100 kNON_ZERO = 41,
101 kGRID_SAMPLE = 42,
102 kNMS = 43,
103 kREVERSE_SEQUENCE = 44,
104 kNORMALIZATION = 45,
105 kPLUGIN_V3 = 46,
106 kSQUEEZE = 47,
107 kUNSQUEEZE = 48,
108 kCUMULATIVE = 49,
109 kDYNAMIC_QUANTIZE = 50,
110 kATTENTION_INPUT = 51,
111 kATTENTION_OUTPUT = 52,
112};
113
119template <>
120constexpr inline int32_t EnumMax<LayerType>() noexcept
121{
122 return 53;
123}
124
131using TensorFormats = uint32_t;
132
138enum class ActivationType : int32_t
139{
140 kRELU = 0,
141 kSIGMOID = 1,
142 kTANH = 2,
143 kLEAKY_RELU = 3,
144 kELU = 4,
145 kSELU = 5,
146 kSOFTSIGN = 6,
147 kSOFTPLUS = 7,
148 kCLIP = 8,
149 kHARD_SIGMOID = 9,
150 kSCALED_TANH = 10,
151 kTHRESHOLDED_RELU = 11,
152 kGELU_ERF = 12,
153 kGELU_TANH = 13
154};
155
156
157namespace impl
158{
164template <>
166{
167 static constexpr int32_t kVALUE = 14;
168};
169} // namespace impl
170
185class ITensor : public INoCopy
186{
187public:
203 void setName(char const* name) noexcept
204 {
205 mImpl->setName(name);
206 }
207
215 char const* getName() const noexcept
216 {
217 return mImpl->getName();
218 }
219
234 void setDimensions(Dims const& dimensions) noexcept
235 {
236 mImpl->setDimensions(dimensions);
237 }
238
248 Dims getDimensions() const noexcept
249 {
250 return mImpl->getDimensions();
251 }
252
284 TRT_DEPRECATED void setType(DataType type) noexcept
285 {
286 mImpl->setType(type);
287 }
288
299 DataType getType() const noexcept
300 {
301 return mImpl->getType();
302 }
303
316 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
317 {
318 return mImpl->setDynamicRange(min, max);
319 }
320
324 bool isNetworkInput() const noexcept
325 {
326 return mImpl->isNetworkInput();
327 }
328
332 bool isNetworkOutput() const noexcept
333 {
334 return mImpl->isNetworkOutput();
335 }
336
349 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
350 {
351 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
352 }
353
364 {
365 return mImpl->getBroadcastAcrossBatch();
366 }
367
376 {
377 return mImpl->getLocation();
378 }
379
395 {
396 mImpl->setLocation(location);
397 }
398
406 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
407 {
408 return mImpl->dynamicRangeIsSet();
409 }
410
414 void resetDynamicRange() noexcept
415 {
416 mImpl->resetDynamicRange();
417 }
418
424 float getDynamicRangeMin() const noexcept
425 {
426 return mImpl->getDynamicRangeMin();
427 }
428
434 float getDynamicRangeMax() const noexcept
435 {
436 return mImpl->getDynamicRangeMax();
437 }
438
456 void setAllowedFormats(TensorFormats formats) noexcept
457 {
458 mImpl->setAllowedFormats(formats);
459 }
460
470 {
471 return mImpl->getAllowedFormats();
472 }
473
500 bool isShapeTensor() const noexcept
501 {
502 return mImpl->isShapeTensor();
503 }
504
521 bool isExecutionTensor() const noexcept
522 {
523 return mImpl->isExecutionTensor();
524 }
525
547 void setDimensionName(int32_t index, char const* name) noexcept
548 {
549 mImpl->setDimensionName(index, name);
550 }
551
562 char const* getDimensionName(int32_t index) const noexcept
563 {
564 return mImpl->getDimensionName(index);
565 }
566
567protected:
568 apiv::VTensor* mImpl;
569 virtual ~ITensor() noexcept = default;
570};
571
579class ILayer : public INoCopy
580{
581public:
587 LayerType getType() const noexcept
588 {
589 return mLayer->getType();
590 }
591
601 void setName(char const* name) noexcept
602 {
603 mLayer->setName(name);
604 }
605
611 char const* getName() const noexcept
612 {
613 return mLayer->getName();
614 }
615
619 int32_t getNbInputs() const noexcept
620 {
621 return mLayer->getNbInputs();
622 }
623
632 ITensor* getInput(int32_t index) const noexcept
633 {
634 return mLayer->getInput(index);
635 }
636
640 int32_t getNbOutputs() const noexcept
641 {
642 return mLayer->getNbOutputs();
643 }
644
650 ITensor* getOutput(int32_t index) const noexcept
651 {
652 return mLayer->getOutput(index);
653 }
654
667 void setInput(int32_t index, ITensor& tensor) noexcept
668 {
669 return mLayer->setInput(index, tensor);
670 }
671
700 TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
701 {
702 mLayer->setPrecision(dataType);
703 }
704
712 DataType getPrecision() const noexcept
713 {
714 return mLayer->getPrecision();
715 }
716
726 TRT_DEPRECATED bool precisionIsSet() const noexcept
727 {
728 return mLayer->precisionIsSet();
729 }
730
739 {
740 mLayer->resetPrecision();
741 }
742
788 TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
789 {
790 mLayer->setOutputType(index, dataType);
791 }
792
803 DataType getOutputType(int32_t index) const noexcept
804 {
805 return mLayer->getOutputType(index);
806 }
807
819 TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
820 {
821 return mLayer->outputTypeIsSet(index);
822 }
823
833 TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
834 {
835 return mLayer->resetOutputType(index);
836 }
837
851 void setMetadata(char const* metadata) noexcept
852 {
853 mLayer->setMetadata(metadata);
854 }
855
864 char const* getMetadata() const noexcept
865 {
866 return mLayer->getMetadata();
867 }
868
869protected:
870 virtual ~ILayer() noexcept = default;
871 apiv::VLayer* mLayer;
872};
873
1030enum class PaddingMode : int32_t
1031{
1033 kEXPLICIT_ROUND_UP = 1,
1034 kSAME_UPPER = 2,
1035 kSAME_LOWER = 3,
1036};
1037
1038namespace impl
1039{
1045template <>
1047{
1048 static constexpr int32_t kVALUE = 4;
1049};
1050} // namespace impl
1051
1065{
1066public:
1074 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1075 {
1076 mImpl->setNbOutputMaps(nbOutputMaps);
1077 }
1078
1084 int64_t getNbOutputMaps() const noexcept
1085 {
1086 return mImpl->getNbOutputMaps();
1087 }
1088
1104 void setNbGroups(int64_t nbGroups) noexcept
1105 {
1106 mImpl->setNbGroups(nbGroups);
1107 }
1108
1114 int64_t getNbGroups() const noexcept
1115 {
1116 return mImpl->getNbGroups();
1117 }
1118
1128 void setKernelWeights(Weights weights) noexcept
1129 {
1130 mImpl->setKernelWeights(weights);
1131 }
1132
1138 Weights getKernelWeights() const noexcept
1139 {
1140 return mImpl->getKernelWeights();
1141 }
1142
1153 void setBiasWeights(Weights weights) noexcept
1154 {
1155 mImpl->setBiasWeights(weights);
1156 }
1157
1163 Weights getBiasWeights() const noexcept
1164 {
1165 return mImpl->getBiasWeights();
1166 }
1167
1180 void setPrePadding(Dims const& padding) noexcept
1181 {
1182 mImpl->setPrePadding(padding);
1183 }
1184
1190 Dims getPrePadding() const noexcept
1191 {
1192 return mImpl->getPrePadding();
1193 }
1194
1207 void setPostPadding(Dims const& padding) noexcept
1208 {
1209 mImpl->setPostPadding(padding);
1210 }
1211
1217 Dims getPostPadding() const noexcept
1218 {
1219 return mImpl->getPostPadding();
1220 }
1221
1231 void setPaddingMode(PaddingMode paddingMode) noexcept
1232 {
1233 mImpl->setPaddingMode(paddingMode);
1234 }
1235
1244 {
1245 return mImpl->getPaddingMode();
1246 }
1247
1256 void setKernelSizeNd(Dims const& kernelSize) noexcept
1257 {
1258 mImpl->setKernelSizeNd(kernelSize);
1259 }
1260
1266 Dims getKernelSizeNd() const noexcept
1267 {
1268 return mImpl->getKernelSizeNd();
1269 }
1270
1281 void setStrideNd(Dims const& stride) noexcept
1282 {
1283 mImpl->setStrideNd(stride);
1284 }
1285
1291 Dims getStrideNd() const noexcept
1292 {
1293 return mImpl->getStrideNd();
1294 }
1295
1309 void setPaddingNd(Dims const& padding) noexcept
1310 {
1311 mImpl->setPaddingNd(padding);
1312 }
1313
1321 Dims getPaddingNd() const noexcept
1322 {
1323 return mImpl->getPaddingNd();
1324 }
1325
1335 void setDilationNd(Dims const& dilation) noexcept
1336 {
1337 mImpl->setDilationNd(dilation);
1338 }
1339
1345 Dims getDilationNd() const noexcept
1346 {
1347 return mImpl->getDilationNd();
1348 }
1349
1364 using ILayer::setInput;
1365
1366protected:
1367 virtual ~IConvolutionLayer() noexcept = default;
1368 apiv::VConvolutionLayer* mImpl;
1369};
1370
1385{
1386public:
1395 {
1396 mImpl->setActivationType(type);
1397 }
1398
1405 {
1406 return mImpl->getActivationType();
1407 }
1408
1419 void setAlpha(float alpha) noexcept
1420 {
1421 mImpl->setAlpha(alpha);
1422 }
1423
1433 void setBeta(float beta) noexcept
1434 {
1435 mImpl->setBeta(beta);
1436 }
1437
1442 float getAlpha() const noexcept
1443 {
1444 return mImpl->getAlpha();
1445 }
1446
1451 float getBeta() const noexcept
1452 {
1453 return mImpl->getBeta();
1454 }
1455
1456protected:
1457 virtual ~IActivationLayer() noexcept = default;
1458 apiv::VActivationLayer* mImpl;
1459};
1460
1466enum class PoolingType : int32_t
1467{
1468 kMAX = 0,
1469 kAVERAGE = 1,
1471};
1472
1473namespace impl
1474{
1480template <>
1482{
1483 static constexpr int32_t kVALUE = 3;
1484};
1485} // namespace impl
1486
1498class IPoolingLayer : public ILayer
1499{
1500public:
1508 void setPoolingType(PoolingType type) noexcept
1509 {
1510 mImpl->setPoolingType(type);
1511 }
1512
1519 {
1520 return mImpl->getPoolingType();
1521 }
1522
1533 void setBlendFactor(float blendFactor) noexcept
1534 {
1535 mImpl->setBlendFactor(blendFactor);
1536 }
1537
1546 float getBlendFactor() const noexcept
1547 {
1548 return mImpl->getBlendFactor();
1549 }
1550
1560 void setAverageCountExcludesPadding(bool exclusive) noexcept
1561 {
1562 mImpl->setAverageCountExcludesPadding(exclusive);
1563 }
1564
1572 {
1573 return mImpl->getAverageCountExcludesPadding();
1574 }
1575
1589 void setPrePadding(Dims const& padding) noexcept
1590 {
1591 mImpl->setPrePadding(padding);
1592 }
1593
1599 Dims getPrePadding() const noexcept
1600 {
1601 return mImpl->getPrePadding();
1602 }
1603
1617 void setPostPadding(Dims const& padding) noexcept
1618 {
1619 mImpl->setPostPadding(padding);
1620 }
1621
1627 Dims getPostPadding() const noexcept
1628 {
1629 return mImpl->getPostPadding();
1630 }
1631
1640 void setPaddingMode(PaddingMode paddingMode) noexcept
1641 {
1642 mImpl->setPaddingMode(paddingMode);
1643 }
1644
1652 {
1653 return mImpl->getPaddingMode();
1654 }
1655
1664 void setWindowSizeNd(Dims const& windowSize) noexcept
1665 {
1666 mImpl->setWindowSizeNd(windowSize);
1667 }
1668
1674 Dims getWindowSizeNd() const noexcept
1675 {
1676 return mImpl->getWindowSizeNd();
1677 }
1678
1689 void setStrideNd(Dims const& stride) noexcept
1690 {
1691 mImpl->setStrideNd(stride);
1692 }
1693
1699 Dims getStrideNd() const noexcept
1700 {
1701 return mImpl->getStrideNd();
1702 }
1703
1718 void setPaddingNd(Dims const& padding) noexcept
1719 {
1720 mImpl->setPaddingNd(padding);
1721 }
1722
1730 Dims getPaddingNd() const noexcept
1731 {
1732 return mImpl->getPaddingNd();
1733 }
1734
1735protected:
1736 virtual ~IPoolingLayer() noexcept = default;
1737 apiv::VPoolingLayer* mImpl;
1738};
1739
1749class ILRNLayer : public ILayer
1750{
1751public:
1761 void setWindowSize(int64_t windowSize) noexcept
1762 {
1763 mImpl->setWindowSize(windowSize);
1764 }
1765
1771 int64_t getWindowSize() const noexcept
1772 {
1773 return mImpl->getWindowSize();
1774 }
1775
1783 void setAlpha(float alpha) noexcept
1784 {
1785 mImpl->setAlpha(alpha);
1786 }
1787
1793 float getAlpha() const noexcept
1794 {
1795 return mImpl->getAlpha();
1796 }
1797
1805 void setBeta(float beta) noexcept
1806 {
1807 mImpl->setBeta(beta);
1808 }
1809
1815 float getBeta() const noexcept
1816 {
1817 return mImpl->getBeta();
1818 }
1819
1827 void setK(float k) noexcept
1828 {
1829 mImpl->setK(k);
1830 }
1831
1837 float getK() const noexcept
1838 {
1839 return mImpl->getK();
1840 }
1841
1842protected:
1843 virtual ~ILRNLayer() noexcept = default;
1844 apiv::VLRNLayer* mImpl;
1845};
1846
1852enum class ScaleMode : int32_t
1853{
1854 kUNIFORM = 0,
1855 kCHANNEL = 1,
1856 kELEMENTWISE = 2
1857};
1858
1864template <>
1865constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1866{
1867 return 3;
1868}
1869
1895class IScaleLayer : public ILayer
1896{
1897public:
1903 void setMode(ScaleMode mode) noexcept
1904 {
1905 mImpl->setMode(mode);
1906 }
1907
1913 ScaleMode getMode() const noexcept
1914 {
1915 return mImpl->getMode();
1916 }
1917
1923 void setShift(Weights shift) noexcept
1924 {
1925 mImpl->setShift(shift);
1926 }
1927
1933 Weights getShift() const noexcept
1934 {
1935 return mImpl->getShift();
1936 }
1937
1943 void setScale(Weights scale) noexcept
1944 {
1945 mImpl->setScale(scale);
1946 }
1947
1953 Weights getScale() const noexcept
1954 {
1955 return mImpl->getScale();
1956 }
1957
1963 void setPower(Weights power) noexcept
1964 {
1965 mImpl->setPower(power);
1966 }
1967
1973 Weights getPower() const noexcept
1974 {
1975 return mImpl->getPower();
1976 }
1977
1988 int32_t getChannelAxis() const noexcept
1989 {
1990 return mImpl->getChannelAxis();
1991 }
1992
2009 void setChannelAxis(int32_t channelAxis) noexcept
2010 {
2011 mImpl->setChannelAxis(channelAxis);
2012 }
2013
2014protected:
2015 virtual ~IScaleLayer() noexcept = default;
2016 apiv::VScaleLayer* mImpl;
2017};
2018
2039class ISoftMaxLayer : public ILayer
2040{
2041public:
2062 void setAxes(uint32_t axes) noexcept
2063 {
2064 mImpl->setAxes(axes);
2065 }
2066
2072 uint32_t getAxes() const noexcept
2073 {
2074 return mImpl->getAxes();
2075 }
2076
2077protected:
2078 virtual ~ISoftMaxLayer() noexcept = default;
2079 apiv::VSoftMaxLayer* mImpl;
2080};
2081
2095{
2096public:
2108 void setAxis(int32_t axis) noexcept
2109 {
2110 mImpl->setAxis(axis);
2111 }
2112
2118 int32_t getAxis() const noexcept
2119 {
2120 return mImpl->getAxis();
2121 }
2122
2123protected:
2124 virtual ~IConcatenationLayer() noexcept = default;
2125 apiv::VConcatenationLayer* mImpl;
2126};
2127
2136{
2137public:
2145 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2146 {
2147 mImpl->setNbOutputMaps(nbOutputMaps);
2148 }
2149
2155 int64_t getNbOutputMaps() const noexcept
2156 {
2157 return mImpl->getNbOutputMaps();
2158 }
2159
2175 void setNbGroups(int64_t nbGroups) noexcept
2176 {
2177 mImpl->setNbGroups(nbGroups);
2178 }
2179
2185 int64_t getNbGroups() const noexcept
2186 {
2187 return mImpl->getNbGroups();
2188 }
2189
2199 void setKernelWeights(Weights weights) noexcept
2200 {
2201 mImpl->setKernelWeights(weights);
2202 }
2203
2209 Weights getKernelWeights() const noexcept
2210 {
2211 return mImpl->getKernelWeights();
2212 }
2213
2224 void setBiasWeights(Weights weights) noexcept
2225 {
2226 mImpl->setBiasWeights(weights);
2227 }
2228
2234 Weights getBiasWeights() const noexcept
2235 {
2236 return mImpl->getBiasWeights();
2237 }
2238
2251 void setPrePadding(Dims const& padding) noexcept
2252 {
2253 mImpl->setPrePadding(padding);
2254 }
2255
2261 Dims getPrePadding() const noexcept
2262 {
2263 return mImpl->getPrePadding();
2264 }
2265
2278 void setPostPadding(Dims const& padding) noexcept
2279 {
2280 mImpl->setPostPadding(padding);
2281 }
2282
2288 Dims getPostPadding() const noexcept
2289 {
2290 return mImpl->getPostPadding();
2291 }
2292
2302 void setPaddingMode(PaddingMode paddingMode) noexcept
2303 {
2304 mImpl->setPaddingMode(paddingMode);
2305 }
2306
2315 {
2316 return mImpl->getPaddingMode();
2317 }
2318
2329 void setKernelSizeNd(Dims const& kernelSize) noexcept
2330 {
2331 mImpl->setKernelSizeNd(kernelSize);
2332 }
2333
2339 Dims getKernelSizeNd() const noexcept
2340 {
2341 return mImpl->getKernelSizeNd();
2342 }
2343
2356 void setStrideNd(Dims const& stride) noexcept
2357 {
2358 mImpl->setStrideNd(stride);
2359 }
2360
2366 Dims getStrideNd() const noexcept
2367 {
2368 return mImpl->getStrideNd();
2369 }
2370
2384 void setPaddingNd(Dims const& padding) noexcept
2385 {
2386 mImpl->setPaddingNd(padding);
2387 }
2388
2396 Dims getPaddingNd() const noexcept
2397 {
2398 return mImpl->getPaddingNd();
2399 }
2400
2413 using ILayer::setInput;
2414
2422 void setDilationNd(Dims const& dilation) noexcept
2423 {
2424 mImpl->setDilationNd(dilation);
2425 }
2426
2432 Dims getDilationNd() const noexcept
2433 {
2434 return mImpl->getDilationNd();
2435 }
2436
2437protected:
2438 virtual ~IDeconvolutionLayer() noexcept = default;
2439 apiv::VDeconvolutionLayer* mImpl;
2440};
2441
2454enum class ElementWiseOperation : int32_t
2455{
2456 kSUM = 0,
2457 kPROD = 1,
2458 kMAX = 2,
2459 kMIN = 3,
2460 kSUB = 4,
2461 kDIV = 5,
2462 kPOW = 6,
2463 kFLOOR_DIV = 7,
2464 kAND = 8,
2465 kOR = 9,
2466 kXOR = 10,
2467 kEQUAL = 11,
2468 kGREATER = 12,
2469 kLESS = 13
2470};
2471
2472namespace impl
2473{
2479template <>
2481{
2482 static constexpr int32_t kVALUE = 14;
2483};
2484} // namespace impl
2485
2506{
2507public:
2518 {
2519 return mImpl->setOperation(op);
2520 }
2521
2530 {
2531 return mImpl->getOperation();
2532 }
2533
2534protected:
2535 apiv::VElementWiseLayer* mImpl;
2536 virtual ~IElementWiseLayer() noexcept = default;
2537};
2538
2544enum class GatherMode : int32_t
2545{
2546 kDEFAULT = 0,
2547 kELEMENT = 1,
2548 kND = 2
2549};
2550
2556template <>
2557constexpr inline int32_t EnumMax<GatherMode>() noexcept
2558{
2559 return 3;
2560}
2561
2638class IGatherLayer : public ILayer
2639{
2640public:
2650 void setGatherAxis(int32_t axis) noexcept
2651 {
2652 mImpl->setGatherAxis(axis);
2653 }
2654
2662 int32_t getGatherAxis() const noexcept
2663 {
2664 return mImpl->getGatherAxis();
2665 }
2666
2685 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2686 {
2687 mImpl->setNbElementWiseDims(elementWiseDims);
2688 }
2689
2695 int32_t getNbElementWiseDims() const noexcept
2696 {
2697 return mImpl->getNbElementWiseDims();
2698 }
2699
2705 void setMode(GatherMode mode) noexcept
2706 {
2707 mImpl->setMode(mode);
2708 }
2709
2715 GatherMode getMode() const noexcept
2716 {
2717 return mImpl->getMode();
2718 }
2719
2720protected:
2721 apiv::VGatherLayer* mImpl;
2722 virtual ~IGatherLayer() noexcept = default;
2723};
2724
2737{
2738public:
2745 {
2746 return mImpl->getPlugin();
2747 }
2748
2749protected:
2750 apiv::VPluginV2Layer* mImpl;
2751 virtual ~IPluginV2Layer() noexcept = default;
2752};
2753
2764{
2765public:
2772 {
2773 return mImpl->getPlugin();
2774 }
2775
2776protected:
2777 apiv::VPluginV3Layer* mImpl;
2778 virtual ~IPluginV3Layer() noexcept = default;
2779};
2780
2797enum class UnaryOperation : int32_t
2798{
2799 kEXP = 0,
2800 kLOG = 1,
2801 kSQRT = 2,
2802 kRECIP = 3,
2803 kABS = 4,
2804 kNEG = 5,
2805 kSIN = 6,
2806 kCOS = 7,
2807 kTAN = 8,
2808 kSINH = 9,
2809 kCOSH = 10,
2810 kASIN = 11,
2811 kACOS = 12,
2812 kATAN = 13,
2813 kASINH = 14,
2814 kACOSH = 15,
2815 kATANH = 16,
2816 kCEIL = 17,
2817 kFLOOR = 18,
2818 kERF = 19,
2819 kNOT = 20,
2820 kSIGN = 21,
2821 kROUND = 22,
2822 kISINF = 23,
2823 kISNAN = 24,
2824};
2825
2831template <>
2832constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2833{
2834 return 25;
2835}
2836
2844class IUnaryLayer : public ILayer
2845{
2846public:
2855 {
2856 mImpl->setOperation(op);
2857 }
2858
2865 {
2866 return mImpl->getOperation();
2867 }
2868
2869protected:
2870 apiv::VUnaryLayer* mImpl;
2871 virtual ~IUnaryLayer() noexcept = default;
2872};
2873
2892enum class ReduceOperation : int32_t
2893{
2894 kSUM = 0,
2895 kPROD = 1,
2896 kMAX = 2,
2897 kMIN = 3,
2898 kAVG = 4
2899};
2900
2906template <>
2907constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2908{
2909 return 5;
2910}
2911
2919class IReduceLayer : public ILayer
2920{
2921public:
2928 {
2929 mImpl->setOperation(op);
2930 }
2931
2938 {
2939 return mImpl->getOperation();
2940 }
2941
2947 void setReduceAxes(uint32_t reduceAxes) noexcept
2948 {
2949 mImpl->setReduceAxes(reduceAxes);
2950 }
2951
2957 uint32_t getReduceAxes() const noexcept
2958 {
2959 return mImpl->getReduceAxes();
2960 }
2961
2967 void setKeepDimensions(bool keepDimensions) noexcept
2968 {
2969 mImpl->setKeepDimensions(keepDimensions);
2970 }
2971
2977 bool getKeepDimensions() const noexcept
2978 {
2979 return mImpl->getKeepDimensions();
2980 }
2981
2982protected:
2983 apiv::VReduceLayer* mImpl;
2984 virtual ~IReduceLayer() noexcept = default;
2985};
2986
2999class IPaddingLayer : public ILayer
3000{
3001public:
3011 void setPrePaddingNd(Dims const& padding) noexcept
3012 {
3013 mImpl->setPrePaddingNd(padding);
3014 }
3015
3023 Dims getPrePaddingNd() const noexcept
3024 {
3025 return mImpl->getPrePaddingNd();
3026 }
3027
3037 void setPostPaddingNd(Dims const& padding) noexcept
3038 {
3039 mImpl->setPostPaddingNd(padding);
3040 }
3041
3049 Dims getPostPaddingNd() const noexcept
3050 {
3051 return mImpl->getPostPaddingNd();
3052 }
3053
3054protected:
3055 apiv::VPaddingLayer* mImpl;
3056 virtual ~IPaddingLayer() noexcept = default;
3057};
3058
3065{
3072 int32_t order[Dims::MAX_DIMS];
3073};
3074
3087class IShuffleLayer : public ILayer
3088{
3089public:
3099 void setFirstTranspose(Permutation permutation) noexcept
3100 {
3101 mImpl->setFirstTranspose(permutation);
3102 }
3103
3112 {
3113 return mImpl->getFirstTranspose();
3114 }
3115
3139 void setReshapeDimensions(Dims const& dimensions) noexcept
3140 {
3141 mImpl->setReshapeDimensions(dimensions);
3142 }
3143
3153 {
3154 return mImpl->getReshapeDimensions();
3155 }
3156
3162 //
3185 using ILayer::setInput;
3186
3199 void setSecondTranspose(Permutation permutation) noexcept
3200 {
3201 mImpl->setSecondTranspose(permutation);
3202 }
3203
3212 {
3213 return mImpl->getSecondTranspose();
3214 }
3215
3227 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3228 {
3229 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3230 }
3231
3240 bool getZeroIsPlaceholder() const noexcept
3241 {
3242 return mImpl->getZeroIsPlaceholder();
3243 }
3244
3245protected:
3246 apiv::VShuffleLayer* mImpl;
3247 virtual ~IShuffleLayer() noexcept = default;
3248};
3249
3255enum class SampleMode : int32_t
3256{
3257 kSTRICT_BOUNDS = 0,
3258 kWRAP = 1,
3259 kCLAMP = 2,
3260 kFILL = 3,
3261 kREFLECT = 4,
3264};
3265
3271template <>
3272constexpr inline int32_t EnumMax<SampleMode>() noexcept
3273{
3274 return 5;
3275}
3276
3339class ISliceLayer : public ILayer
3340{
3341public:
3351 void setStart(Dims const& start) noexcept
3352 {
3353 mImpl->setStart(start);
3354 }
3355
3366 Dims getStart() const noexcept
3367 {
3368 return mImpl->getStart();
3369 }
3370
3380 void setSize(Dims const& size) noexcept
3381 {
3382 return mImpl->setSize(size);
3383 }
3384
3395 Dims getSize() const noexcept
3396 {
3397 return mImpl->getSize();
3398 }
3399
3409 void setStride(Dims const& stride) noexcept
3410 {
3411 mImpl->setStride(stride);
3412 }
3413
3424 Dims getStride() const noexcept
3425 {
3426 return mImpl->getStride();
3427 }
3428
3434 void setMode(SampleMode mode) noexcept
3435 {
3436 mImpl->setMode(mode);
3437 }
3438
3444 SampleMode getMode() const noexcept
3445 {
3446 return mImpl->getMode();
3447 }
3448
3476 using ILayer::setInput;
3477
3487 void setAxes(Dims const& axes) noexcept
3488 {
3489 mImpl->setAxes(axes);
3490 }
3491
3502 Dims getAxes() const noexcept
3503 {
3504 return mImpl->getAxes();
3505 }
3506
3507protected:
3508 apiv::VSliceLayer* mImpl;
3509 virtual ~ISliceLayer() noexcept = default;
3510};
3511
3524class IShapeLayer : public ILayer
3525{
3526protected:
3527 apiv::VShapeLayer* mImpl;
3528 virtual ~IShapeLayer() noexcept = default;
3529};
3530
3536enum class TopKOperation : int32_t
3537{
3538 kMAX = 0,
3539 kMIN = 1,
3540};
3541
3547template <>
3548constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3549{
3550 return 2;
3551}
3552
3564class ITopKLayer : public ILayer
3565{
3566public:
3572 void setOperation(TopKOperation op) noexcept
3573 {
3574 mImpl->setOperation(op);
3575 }
3576
3583 {
3584 return mImpl->getOperation();
3585 }
3586
3596 void setK(int32_t k) noexcept
3597 {
3598 mImpl->setK(k);
3599 }
3600
3610 int32_t getK() const noexcept
3611 {
3612 return mImpl->getK();
3613 }
3614
3620 void setReduceAxes(uint32_t reduceAxes) noexcept
3621 {
3622 mImpl->setReduceAxes(reduceAxes);
3623 }
3624
3630 uint32_t getReduceAxes() const noexcept
3631 {
3632 return mImpl->getReduceAxes();
3633 }
3634
3649 using ILayer::setInput;
3650
3661 bool setIndicesType(DataType type) noexcept
3662 {
3663 return mImpl->setIndicesType(type);
3664 }
3665
3673 DataType getIndicesType() const noexcept
3674 {
3675 return mImpl->getIndicesType();
3676 }
3677
3678protected:
3679 apiv::VTopKLayer* mImpl;
3680 virtual ~ITopKLayer() noexcept = default;
3681};
3682
3689enum class MatrixOperation : int32_t
3690{
3694 kNONE = 0,
3695
3697 kTRANSPOSE = 1,
3698
3709 kVECTOR = 2,
3710};
3711
3717template <>
3718constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3719{
3720 return 3;
3721}
3722
3749{
3750public:
3759 void setOperation(int32_t index, MatrixOperation op) noexcept
3760 {
3761 mImpl->setOperation(index, op);
3762 }
3763
3771 MatrixOperation getOperation(int32_t index) const noexcept
3772 {
3773 return mImpl->getOperation(index);
3774 }
3775
3776protected:
3777 apiv::VMatrixMultiplyLayer* mImpl;
3778 virtual ~IMatrixMultiplyLayer() noexcept = default;
3779};
3780
3802class INonZeroLayer : public ILayer
3803{
3804public:
3815 bool setIndicesType(DataType type) noexcept
3816 {
3817 return mImpl->setIndicesType(type);
3818 }
3819
3827 DataType getIndicesType() const noexcept
3828 {
3829 return mImpl->getIndicesType();
3830 }
3831
3832protected:
3833 virtual ~INonZeroLayer() noexcept = default;
3834 apiv::VNonZeroLayer* mImpl;
3835};
3836
3852{
3853protected:
3854 apiv::VRaggedSoftMaxLayer* mImpl;
3855 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3856};
3857
3902{
3903protected:
3904 apiv::VIdentityLayer* mImpl;
3905 virtual ~IIdentityLayer() noexcept = default;
3906};
3907
3914class ICastLayer : public ILayer
3915{
3916public:
3924 void setToType(DataType toType) noexcept
3925 {
3926 mImpl->setToType(toType);
3927 }
3928
3935 DataType getToType() const noexcept
3936 {
3937 return mImpl->getToType();
3938 }
3939
3940protected:
3941 apiv::VCastLayer* mImpl;
3942 virtual ~ICastLayer() noexcept = default;
3943};
3944
3954{
3955public:
3964 void setWeights(Weights weights) noexcept
3965 {
3966 mImpl->setWeights(weights);
3967 }
3968
3974 Weights getWeights() const noexcept
3975 {
3976 return mImpl->getWeights();
3977 }
3978
3986 void setDimensions(Dims const& dimensions) noexcept
3987 {
3988 mImpl->setDimensions(dimensions);
3989 }
3990
3998 Dims getDimensions() const noexcept
3999 {
4000 return mImpl->getDimensions();
4001 }
4002
4003protected:
4004 apiv::VConstantLayer* mImpl;
4005 virtual ~IConstantLayer() noexcept = default;
4006};
4007
4018{
4019protected:
4020 apiv::VParametricReLULayer* mImpl;
4021 virtual ~IParametricReLULayer() noexcept = default;
4022};
4023
4029enum class InterpolationMode : int32_t
4030{
4031 kNEAREST = 0,
4032 kLINEAR = 1,
4033 kCUBIC = 2
4034};
4035
4036namespace impl
4037{
4043template <>
4045{
4046 static constexpr int32_t kVALUE = 3;
4047};
4048} // namespace impl
4049
4058{
4071 kALIGN_CORNERS = 0,
4072
4079 kASYMMETRIC = 1,
4080
4087 kHALF_PIXEL = 2,
4088};
4089
4090namespace impl
4091{
4097template <>
4099{
4100 static constexpr int32_t kVALUE = 3;
4101};
4102} // namespace impl
4103
4111enum class ResizeSelector : int32_t
4112{
4114 kFORMULA = 0,
4115
4117 kUPPER = 1,
4118};
4119
4120namespace impl
4121{
4127template <>
4129{
4130 static constexpr int32_t kVALUE = 2;
4131};
4132} // namespace impl
4133
4141enum class ResizeRoundMode : int32_t
4142{
4144 kHALF_UP = 0,
4145
4147 kHALF_DOWN = 1,
4148
4150 kFLOOR = 2,
4151
4153 kCEIL = 3,
4154};
4155
4156namespace impl
4157{
4163template <>
4165{
4166 static constexpr int32_t kVALUE = 4;
4167};
4168} // namespace impl
4169
4206class IResizeLayer : public ILayer
4207{
4208public:
4227 void setOutputDimensions(Dims const& dimensions) noexcept
4228 {
4229 return mImpl->setOutputDimensions(dimensions);
4230 }
4231
4237 Dims getOutputDimensions() const noexcept
4238 {
4239 return mImpl->getOutputDimensions();
4240 }
4241
4267 void setScales(float const* scales, int32_t nbScales) noexcept
4268 {
4269 mImpl->setScales(scales, nbScales);
4270 }
4271
4286 int32_t getScales(int32_t size, float* scales) const noexcept
4287 {
4288 return mImpl->getScales(size, scales);
4289 }
4290
4298 void setResizeMode(InterpolationMode interpolationMode) noexcept
4299 {
4300 mImpl->setResizeMode(interpolationMode);
4301 }
4302
4309 {
4310 return mImpl->getResizeMode();
4311 }
4312
4332 using ILayer::setInput;
4333
4344 {
4345 mImpl->setCoordinateTransformation(coordTransform);
4346 }
4347
4354 {
4355 return mImpl->getCoordinateTransformation();
4356 }
4357
4369 {
4370 mImpl->setSelectorForSinglePixel(selector);
4371 }
4372
4379 {
4380 return mImpl->getSelectorForSinglePixel();
4381 }
4382
4393 {
4394 mImpl->setNearestRounding(value);
4395 }
4396
4403 {
4404 return mImpl->getNearestRounding();
4405 }
4406
4424 void setCubicCoeff(float A) noexcept
4425 {
4426 mImpl->setCubicCoeff(A);
4427 }
4428
4434 float getCubicCoeff() const noexcept
4435 {
4436 return mImpl->getCubicCoeff();
4437 }
4438
4447 void setExcludeOutside(bool excludeFlag) noexcept
4448 {
4449 mImpl->setExcludeOutside(excludeFlag);
4450 }
4451
4457 bool getExcludeOutside() const noexcept
4458 {
4459 return mImpl->getExcludeOutside();
4460 }
4461
4462protected:
4463 virtual ~IResizeLayer() noexcept = default;
4464 apiv::VResizeLayer* mImpl;
4465};
4466
4472enum class LoopOutput : int32_t
4473{
4475 kLAST_VALUE = 0,
4476
4478 kCONCATENATE = 1,
4479
4481 kREVERSE = 2
4482};
4483
4489template <>
4490constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4491{
4492 return 3;
4493}
4494
4500enum class TripLimit : int32_t
4501{
4502
4503 kCOUNT = 0,
4504 kWHILE = 1
4505};
4506
4512template <>
4513constexpr inline int32_t EnumMax<TripLimit>() noexcept
4514{
4515 return 2;
4516}
4517
4518class ILoop;
4519
4534{
4535public:
4539 ILoop* getLoop() const noexcept
4540 {
4541 return mBoundary->getLoop();
4542 }
4543
4544protected:
4545 virtual ~ILoopBoundaryLayer() noexcept = default;
4546 apiv::VLoopBoundaryLayer* mBoundary;
4547};
4548
4557{
4558public:
4563 {
4564 return mBoundary->getConditional();
4565 }
4566
4567protected:
4568 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4569 apiv::VConditionalBoundaryLayer* mBoundary;
4570};
4571
4578{
4579public:
4580protected:
4581 virtual ~IConditionLayer() noexcept = default;
4582 apiv::VConditionLayer* mImpl;
4583};
4584
4595{
4596public:
4597protected:
4598 virtual ~IIfConditionalOutputLayer() noexcept = default;
4599 apiv::VConditionalOutputLayer* mImpl;
4600};
4601
4608{
4609public:
4610protected:
4611 virtual ~IIfConditionalInputLayer() noexcept = default;
4612 apiv::VConditionalInputLayer* mImpl;
4613};
4614
4640{
4641public:
4652 {
4653 return mImpl->setCondition(condition);
4654 }
4655
4669 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4670 {
4671 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4672 }
4673
4682 {
4683 return mImpl->addInput(input);
4684 }
4685
4696 void setName(char const* name) noexcept
4697 {
4698 mImpl->setName(name);
4699 }
4700
4706 char const* getName() const noexcept
4707 {
4708 return mImpl->getName();
4709 }
4710
4711protected:
4712 virtual ~IIfConditional() noexcept = default;
4713 apiv::VIfConditional* mImpl;
4714};
4715
4724{
4725public:
4731 //
4744 using ILayer::setInput;
4745
4746protected:
4747 virtual ~IRecurrenceLayer() noexcept = default;
4748 apiv::VRecurrenceLayer* mImpl;
4749};
4750
4771{
4772public:
4776 LoopOutput getLoopOutput() const noexcept
4777 {
4778 return mImpl->getLoopOutput();
4779 }
4780
4793 void setAxis(int32_t axis) noexcept
4794 {
4795 mImpl->setAxis(axis);
4796 }
4797
4801 int32_t getAxis() const noexcept
4802 {
4803 return mImpl->getAxis();
4804 }
4805
4811 //
4826 using ILayer::setInput;
4827
4828protected:
4829 virtual ~ILoopOutputLayer() noexcept = default;
4830 apiv::VLoopOutputLayer* mImpl;
4831};
4832
4845{
4846public:
4850 TripLimit getTripLimit() const noexcept
4851 {
4852 return mImpl->getTripLimit();
4853 }
4854
4855protected:
4856 virtual ~ITripLimitLayer() noexcept = default;
4857 apiv::VTripLimitLayer* mImpl;
4858};
4859
4871{
4872public:
4876 void setAxis(int32_t axis) noexcept
4877 {
4878 mImpl->setAxis(axis);
4879 }
4880
4884 int32_t getAxis() const noexcept
4885 {
4886 return mImpl->getAxis();
4887 }
4888
4898 void setReverse(bool reverse) noexcept
4899 {
4900 mImpl->setReverse(reverse);
4901 }
4902
4908 bool getReverse() const noexcept
4909 {
4910 return mImpl->getReverse();
4911 }
4912
4913protected:
4914 virtual ~IIteratorLayer() noexcept = default;
4915 apiv::VIteratorLayer* mImpl;
4916};
4917
4928class ILoop : public INoCopy
4929{
4930public:
4937 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4938 {
4939 return mImpl->addRecurrence(initialValue);
4940 }
4941
4959 {
4960 return mImpl->addTripLimit(tensor, limit);
4961 }
4962
4971 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4972 {
4973 return mImpl->addIterator(tensor, axis, reverse);
4974 }
4975
4984 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4985 {
4986 return mImpl->addLoopOutput(tensor, outputKind, axis);
4987 }
4988
4999 void setName(char const* name) noexcept
5000 {
5001 mImpl->setName(name);
5002 }
5003
5009 char const* getName() const noexcept
5010 {
5011 return mImpl->getName();
5012 }
5013
5014protected:
5015 virtual ~ILoop() noexcept = default;
5016 apiv::VLoop* mImpl;
5017};
5018
5031class ISelectLayer : public ILayer
5032{
5033protected:
5034 virtual ~ISelectLayer() noexcept = default;
5035 apiv::VSelectLayer* mImpl;
5036};
5037
5054{
5055public:
5064 void setMessage(char const* message) noexcept
5065 {
5066 mImpl->setMessage(message);
5067 }
5068
5074 char const* getMessage() const noexcept
5075 {
5076 return mImpl->getMessage();
5077 }
5078
5079protected:
5080 virtual ~IAssertionLayer() noexcept = default;
5081
5082 apiv::VAssertionLayer* mImpl;
5083};
5084
5092enum class FillOperation : int32_t
5093{
5109 kLINSPACE = 0,
5110
5112 kRANDOM_UNIFORM = 1,
5113
5115 kRANDOM_NORMAL = 2
5116};
5117
5123template <>
5124constexpr inline int32_t EnumMax<FillOperation>() noexcept
5125{
5126 return 3;
5127}
5128
5164class IFillLayer : public ILayer
5165{
5166public:
5175 //
5176 void setDimensions(Dims const& dimensions) noexcept
5177 {
5178 mImpl->setDimensions(dimensions);
5179 }
5180
5191 Dims getDimensions() const noexcept
5192 {
5193 return mImpl->getDimensions();
5194 }
5195
5201 void setOperation(FillOperation op) noexcept
5202 {
5203 mImpl->setOperation(op);
5204 }
5205
5212 {
5213 return mImpl->getOperation();
5214 }
5215
5229 //
5230 void setAlpha(double alpha) noexcept
5231 {
5232 mImpl->setAlpha(alpha);
5233 }
5234
5245 double getAlpha() const noexcept
5246 {
5247 return mImpl->getAlpha();
5248 }
5249
5264 void setBeta(double beta) noexcept
5265 {
5266 mImpl->setBeta(beta);
5267 }
5268
5279 double getBeta() const noexcept
5280 {
5281 return mImpl->getBeta();
5282 }
5283
5324 using ILayer::setInput;
5325
5339 //
5340 void setAlphaInt64(int64_t alpha) noexcept
5341 {
5342 mImpl->setAlphaInt64(alpha);
5343 }
5344
5355 int64_t getAlphaInt64() const noexcept
5356 {
5357 return mImpl->getAlphaInt64();
5358 }
5359
5374 void setBetaInt64(int64_t beta) noexcept
5375 {
5376 mImpl->setBetaInt64(beta);
5377 }
5378
5389 int64_t getBetaInt64() const noexcept
5390 {
5391 return mImpl->getBetaInt64();
5392 }
5393
5397 bool isAlphaBetaInt64() const noexcept
5398 {
5399 return mImpl->isAlphaBetaInt64();
5400 }
5401
5414 void setToType(DataType toType) noexcept
5415 {
5416 mImpl->setToType(toType);
5417 }
5418
5426 DataType getToType() const noexcept
5427 {
5428 return mImpl->getToType();
5429 }
5430
5431protected:
5432 virtual ~IFillLayer() noexcept = default;
5433 apiv::VFillLayer* mImpl;
5434};
5435
5511{
5512public:
5521 int32_t getAxis() const noexcept
5522 {
5523 return mImpl->getAxis();
5524 }
5532 void setAxis(int32_t axis) noexcept
5533 {
5534 mImpl->setAxis(axis);
5535 }
5536
5548 void setToType(DataType toType) noexcept
5549 {
5550 mImpl->setToType(toType);
5551 }
5552
5560 DataType getToType() const noexcept
5561 {
5562 return mImpl->getToType();
5563 }
5564
5565protected:
5566 virtual ~IQuantizeLayer() noexcept = default;
5567 apiv::VQuantizeLayer* mImpl;
5568};
5569
5639{
5640public:
5649 int32_t getAxis() const noexcept
5650 {
5651 return mImpl->getAxis();
5652 }
5660 void setAxis(int32_t axis) noexcept
5661 {
5662 mImpl->setAxis(axis);
5663 }
5664
5676 void setToType(DataType toType) noexcept
5677 {
5678 mImpl->setToType(toType);
5679 }
5680
5688 DataType getToType() const noexcept
5689 {
5690 return mImpl->getToType();
5691 }
5692
5693protected:
5694 virtual ~IDequantizeLayer() noexcept = default;
5695 apiv::VDequantizeLayer* mImpl;
5696};
5697
5716{
5717public:
5729 using ILayer::setInput;
5730
5743 void setToType(DataType toType) noexcept
5744 {
5745 mImpl->setToType(toType);
5746 }
5747
5756 DataType getToType() const noexcept
5757 {
5758 return mImpl->getToType();
5759 }
5760
5769 void setScaleType(DataType scaleType) noexcept
5770 {
5771 mImpl->setScaleType(scaleType);
5772 }
5773
5782 DataType getScaleType() const noexcept
5783 {
5784 return mImpl->getScaleType();
5785 }
5786
5795 void setAxis(int32_t axis) noexcept
5796 {
5797 mImpl->setAxis(axis);
5798 }
5799
5805 int32_t getAxis() const noexcept
5806 {
5807 return mImpl->getAxis();
5808 }
5809
5818 void setBlockSize(int32_t size) noexcept
5819 {
5820 mImpl->setBlockSize(size);
5821 }
5822
5828 int32_t getBlockSize() const noexcept
5829 {
5830 return mImpl->getBlockSize();
5831 }
5832
5833protected:
5834 virtual ~IDynamicQuantizeLayer() noexcept = default;
5835 apiv::VDynamicQuantizeLayer* mImpl;
5836};
5837
5872class IEinsumLayer : public ILayer
5873{
5874public:
5884 bool setEquation(char const* equation) noexcept
5885 {
5886 return mImpl->setEquation(equation);
5887 }
5888
5894 char const* getEquation() const noexcept
5895 {
5896 return mImpl->getEquation();
5897 }
5898
5899protected:
5900 virtual ~IEinsumLayer() noexcept = default;
5901 apiv::VEinsumLayer* mImpl;
5902};
5903
5911enum class ScatterMode : int32_t
5912{
5913 kELEMENT = 0,
5914 kND = 1,
5915};
5916
5922template <>
5923constexpr inline int32_t EnumMax<ScatterMode>() noexcept
5924{
5925 return 2;
5926}
5927
5985class IScatterLayer : public ILayer
5986{
5987public:
5993 void setMode(ScatterMode mode) noexcept
5994 {
5995 mImpl->setMode(mode);
5996 }
5997
6003 ScatterMode getMode() const noexcept
6004 {
6005 return mImpl->getMode();
6006 }
6007
6013 void setAxis(int32_t axis) noexcept
6014 {
6015 mImpl->setAxis(axis);
6016 }
6017
6021 int32_t getAxis() const noexcept
6022 {
6023 return mImpl->getAxis();
6024 }
6025
6026protected:
6027 apiv::VScatterLayer* mImpl;
6028 virtual ~IScatterLayer() noexcept = default;
6029}; // class IScatterLayer
6030
6057class IOneHotLayer : public ILayer
6058{
6059public:
6065 void setAxis(int32_t axis) noexcept
6066 {
6067 mImpl->setAxis(axis);
6068 }
6069
6073 int32_t getAxis() const noexcept
6074 {
6075 return mImpl->getAxis();
6076 }
6077
6078protected:
6079 apiv::VOneHotLayer* mImpl;
6080 virtual ~IOneHotLayer() noexcept = default;
6081};
6082
6095{
6096public:
6103 {
6104 mImpl->setInterpolationMode(mode);
6105 }
6106
6115 {
6116 return mImpl->getInterpolationMode();
6117 }
6118
6124 void setAlignCorners(bool alignCorners) noexcept
6125 {
6126 mImpl->setAlignCorners(alignCorners);
6127 }
6128
6136 bool getAlignCorners() const noexcept
6137 {
6138 return mImpl->getAlignCorners();
6139 }
6140
6148 bool setSampleMode(SampleMode mode) noexcept
6149 {
6150 return mImpl->setSampleMode(mode);
6151 }
6152
6160 SampleMode getSampleMode() const noexcept
6161 {
6162 return mImpl->getSampleMode();
6163 }
6164
6165protected:
6166 apiv::VGridSampleLayer* mImpl;
6167 virtual ~IGridSampleLayer() noexcept = default;
6168}; // class IGridSampleLayer
6169
6177enum class BoundingBoxFormat : int32_t
6178{
6180 kCORNER_PAIRS = 0,
6182 kCENTER_SIZES = 1
6183};
6184
6190template <>
6191constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6192{
6193 return 2;
6194}
6195
6246class INMSLayer : public ILayer
6247{
6248public:
6259 {
6260 mImpl->setBoundingBoxFormat(fmt);
6261 }
6262
6271 {
6272 return mImpl->getBoundingBoxFormat();
6273 }
6274
6284 void setTopKBoxLimit(int32_t limit) noexcept
6285 {
6286 mImpl->setTopKBoxLimit(limit);
6287 }
6288
6294 int32_t getTopKBoxLimit() const noexcept
6295 {
6296 return mImpl->getTopKBoxLimit();
6297 }
6298
6317 using ILayer::setInput;
6318
6329 bool setIndicesType(DataType type) noexcept
6330 {
6331 return mImpl->setIndicesType(type);
6332 }
6333
6341 DataType getIndicesType() const noexcept
6342 {
6343 return mImpl->getIndicesType();
6344 }
6345
6346protected:
6347 apiv::VNMSLayer* mImpl;
6348 virtual ~INMSLayer() noexcept = default;
6349}; // class INMSLayer
6350
6364{
6365public:
6374 void setBatchAxis(int32_t batchAxis) noexcept
6375 {
6376 mImpl->setBatchAxis(batchAxis);
6377 }
6378
6384 int32_t getBatchAxis() const noexcept
6385 {
6386 return mImpl->getBatchAxis();
6387 }
6388
6397 void setSequenceAxis(int32_t sequenceAxis) noexcept
6398 {
6399 mImpl->setSequenceAxis(sequenceAxis);
6400 }
6401
6407 int32_t getSequenceAxis() const noexcept
6408 {
6409 return mImpl->getSequenceAxis();
6410 }
6411
6412protected:
6413 apiv::VReverseSequenceLayer* mImpl;
6414 virtual ~IReverseSequenceLayer() noexcept = default;
6415}; // class IReverseSequenceLayer
6416
6436{
6437public:
6445 void setEpsilon(float eps) noexcept
6446 {
6447 return mImpl->setEpsilon(eps);
6448 }
6449
6455 float getEpsilon() const noexcept
6456 {
6457 return mImpl->getEpsilon();
6458 }
6459
6465 void setAxes(uint32_t axesMask) noexcept
6466 {
6467 return mImpl->setAxes(axesMask);
6468 }
6469
6475 uint32_t getAxes() const noexcept
6476 {
6477 return mImpl->getAxes();
6478 }
6479
6496 void setNbGroups(int64_t nbGroups) noexcept
6497 {
6498 return mImpl->setNbGroups(nbGroups);
6499 }
6500
6506 int64_t getNbGroups() const noexcept
6507 {
6508 return mImpl->getNbGroups();
6509 }
6510
6532 void setComputePrecision(DataType type) noexcept
6533 {
6534 return mImpl->setComputePrecision(type);
6535 }
6536
6543 {
6544 return mImpl->getComputePrecision();
6545 }
6546
6547protected:
6548 apiv::VNormalizationLayer* mImpl;
6549 virtual ~INormalizationLayer() noexcept = default;
6550};
6551
6552
6561class ISqueezeLayer : public ILayer
6562{
6563public:
6576 using ILayer::setInput;
6577
6578protected:
6579 apiv::VSqueezeLayer* mImpl;
6580 virtual ~ISqueezeLayer() noexcept = default;
6581};
6582
6591{
6592public:
6605 using ILayer::setInput;
6606
6607protected:
6608 apiv::VUnsqueezeLayer* mImpl;
6609 virtual ~IUnsqueezeLayer() noexcept = default;
6610};
6611
6623enum class CumulativeOperation : int32_t
6624{
6625 kSUM = 0,
6626};
6627
6628namespace impl
6629{
6630
6636template <>
6638{
6639 static constexpr int32_t kVALUE = 1;
6640};
6641
6642} // namespace impl
6643
6672{
6673public:
6684 {
6685 return mImpl->setOperation(op);
6686 }
6687
6696 {
6697 return mImpl->getOperation();
6698 }
6699
6707 void setExclusive(bool exclusive) noexcept
6708 {
6709 mImpl->setExclusive(exclusive);
6710 }
6711
6719 bool getExclusive() const noexcept
6720 {
6721 return mImpl->getExclusive();
6722 }
6723
6731 void setReverse(bool reverse) noexcept
6732 {
6733 mImpl->setReverse(reverse);
6734 }
6735
6743 bool getReverse() const noexcept
6744 {
6745 return mImpl->getReverse();
6746 }
6747
6748protected:
6749 apiv::VCumulativeLayer* mImpl;
6750 virtual ~ICumulativeLayer() noexcept = default;
6751};
6752
6758enum class AttentionNormalizationOp : int32_t
6759{
6760 kNONE
6761 = 0,
6762 kSOFTMAX = 1,
6763};
6764
6765namespace impl
6766{
6772template <>
6774{
6775 static constexpr int32_t kVALUE = 2;
6776};
6777
6778} // namespace impl
6779
6790{
6791public:
6795 IAttention* getAttention() const noexcept
6796 {
6797 return mBoundary->getAttention();
6798 }
6799
6800protected:
6801 virtual ~IAttentionBoundaryLayer() noexcept = default;
6802 apiv::VAttentionBoundaryLayer* mBoundary;
6803};
6804
6816{
6817public:
6833 using ILayer::setInput;
6834
6835protected:
6836 virtual ~IAttentionInputLayer() noexcept = default;
6837 apiv::VAttentionInputLayer* mImpl;
6838};
6839
6851{
6852public:
6853protected:
6854 virtual ~IAttentionOutputLayer() noexcept = default;
6855 apiv::VAttentionOutputLayer* mImpl;
6856};
6857
6903class IAttention : public INoCopy
6904{
6905public:
6914 {
6915 return mImpl->setNormalizationOperation(op);
6916 }
6917
6926 {
6927 return mImpl->getNormalizationOperation();
6928 }
6929
6942 bool setMask(ITensor& mask) noexcept
6943 {
6944 return mImpl->setMask(mask);
6945 }
6946
6954 ITensor* getMask() noexcept
6955 {
6956 return mImpl->getMask();
6957 }
6958
6967 bool setCausal(bool isCausal) noexcept
6968 {
6969 return mImpl->setCausal(isCausal);
6970 }
6971
6979 bool getCausal() const noexcept
6980 {
6981 return mImpl->getCausal();
6982 }
6983
6991 bool setDecomposable(bool decomposable) noexcept
6992 {
6993 return mImpl->setDecomposable(decomposable);
6994 }
6995
7004 bool getDecomposable() const noexcept
7005 {
7006 return mImpl->getDecomposable();
7007 }
7008
7023 bool setInput(int32_t index, ITensor& input) noexcept
7024 {
7025 return mImpl->setInput(index, input);
7026 }
7027
7032 int32_t getNbInputs() const noexcept
7033 {
7034 return mImpl->getNbInputs();
7035 }
7036
7044 ITensor* getInput(int32_t index) const noexcept
7045 {
7046 return mImpl->getInput(index);
7047 }
7048
7052 int32_t getNbOutputs() const noexcept
7053 {
7054 return mImpl->getNbOutputs();
7055 }
7056
7064 ITensor* getOutput(int32_t index) const noexcept
7065 {
7066 return mImpl->getOutput(index);
7067 }
7068
7081 bool setName(char const* name) noexcept
7082 {
7083 return mImpl->setName(name);
7084 }
7085
7093 char const* getName() const noexcept
7094 {
7095 return mImpl->getName();
7096 }
7097
7110 {
7111 return mImpl->setNormalizationQuantizeScale(tensor);
7112 }
7113
7121 {
7122 return mImpl->getNormalizationQuantizeScale();
7123 }
7124
7134 {
7135 return mImpl->setNormalizationQuantizeToType(type);
7136 }
7137
7146 {
7147 return mImpl->getNormalizationQuantizeToType();
7148 }
7149
7150
7151protected:
7152 apiv::VAttention* mImpl;
7153 virtual ~IAttention() noexcept = default;
7154};
7155
7174{
7175public:
7176 virtual ~INetworkDefinition() noexcept = default;
7177
7213 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
7214 {
7215 return mImpl->addInput(name, type, dimensions);
7216 }
7217
7227 void markOutput(ITensor& tensor) noexcept
7228 {
7229 mImpl->markOutput(tensor);
7230 }
7231
7245 bool markDebug(ITensor& tensor) noexcept
7246 {
7247 return mImpl->markDebug(tensor);
7248 }
7249
7261 bool unmarkDebug(ITensor& tensor) noexcept
7262 {
7263 return mImpl->unmarkDebug(tensor);
7264 }
7265
7271 bool isDebugTensor(ITensor const& tensor) const noexcept
7272 {
7273 return mImpl->isDebugTensor(tensor);
7274 }
7275
7294 {
7295 return mImpl->markUnfusedTensorsAsDebugTensors();
7296 }
7297
7308 {
7309 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
7310 }
7311
7328 {
7329 return mImpl->addActivation(input, type);
7330 }
7331
7346 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
7347 {
7348 return mImpl->addLRN(input, window, alpha, beta, k);
7349 }
7350
7372 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
7373 {
7374 return mImpl->addScale(input, mode, shift, scale, power);
7375 }
7376
7386 {
7387 return mImpl->addSoftMax(input);
7388 }
7389
7402 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
7403 {
7404 return mImpl->addConcatenation(inputs, nbInputs);
7405 }
7406
7430 {
7431 return mImpl->addElementWise(input1, input2, op);
7432 }
7433
7451 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
7452 {
7453 return mImpl->addUnary(input, operation);
7454 }
7455
7466 {
7467 return mImpl->addShuffle(input);
7468 }
7469
7482 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
7483 {
7484 return mImpl->addOneHot(indices, values, depth, axis);
7485 }
7486
7494 int32_t getNbLayers() const noexcept
7495 {
7496 return mImpl->getNbLayers();
7497 }
7498
7508 ILayer* getLayer(int32_t index) const noexcept
7509 {
7510 return mImpl->getLayer(index);
7511 }
7512
7520 int32_t getNbInputs() const noexcept
7521 {
7522 return mImpl->getNbInputs();
7523 }
7524
7536 ITensor* getInput(int32_t index) const noexcept
7537 {
7538 return mImpl->getInput(index);
7539 }
7540
7550 int32_t getNbOutputs() const noexcept
7551 {
7552 return mImpl->getNbOutputs();
7553 }
7554
7566 ITensor* getOutput(int32_t index) const noexcept
7567 {
7568 return mImpl->getOutput(index);
7569 }
7570
7593 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7594 {
7595 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7596 }
7597
7629 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7630 {
7631 return mImpl->addTopK(input, op, k, reduceAxes);
7632 }
7633
7663 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
7664 {
7665 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
7666 }
7667
7679 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7680 {
7681 return mImpl->addGather(data, indices, axis);
7682 }
7683
7695 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7696 {
7697 return mImpl->addGatherV2(data, indices, mode);
7698 }
7699
7715 {
7716 return mImpl->addRaggedSoftMax(input, bounds);
7717 }
7718
7736 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
7737 {
7738 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
7739 }
7740
7755 {
7756 return mImpl->addNonZero(input);
7757 }
7758
7770 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
7771 {
7772 return mImpl->addNonZeroV2(input, indicesType);
7773 }
7774
7794 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
7795 {
7796 return mImpl->addConstant(dimensions, weights);
7797 }
7798
7809 {
7810 return mImpl->addIdentity(input);
7811 }
7812
7823 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
7824 {
7825 return mImpl->addCast(input, toType);
7826 }
7827
7838 void removeTensor(ITensor& tensor) noexcept
7839 {
7840 mImpl->removeTensor(tensor);
7841 }
7842
7850 void unmarkOutput(ITensor& tensor) noexcept
7851 {
7852 mImpl->unmarkOutput(tensor);
7853 }
7854
7871 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
7872 {
7873 return mImpl->addPluginV2(inputs, nbInputs, plugin);
7874 }
7875
7889 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
7890 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
7891 {
7892 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
7893 }
7894
7909 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
7910 {
7911 return mImpl->addSlice(input, start, size, stride);
7912 }
7913
7933 void setName(char const* name) noexcept
7934 {
7935 mImpl->setName(name);
7936 }
7937
7947 char const* getName() const noexcept
7948 {
7949 return mImpl->getName();
7950 }
7951
7963 IShapeLayer* addShape(ITensor& input) noexcept
7964 {
7965 return mImpl->addShape(input);
7966 }
7967
7978 {
7979 return mImpl->hasImplicitBatchDimension();
7980 }
7981
7988 {
7989 return mImpl->getFlags();
7990 }
7991
7999 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8000 {
8001 return mImpl->getFlag(networkDefinitionCreationFlag);
8002 }
8003
8016 bool markOutputForShapes(ITensor& tensor) noexcept
8017 {
8018 return mImpl->markOutputForShapes(tensor);
8019 }
8020
8028 bool unmarkOutputForShapes(ITensor& tensor) noexcept
8029 {
8030 return mImpl->unmarkOutputForShapes(tensor);
8031 }
8032
8047 {
8048 return mImpl->addParametricReLU(input, slope);
8049 }
8050
8069 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8070 {
8071 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8072 }
8073
8088 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
8089 {
8090 return mImpl->addPoolingNd(input, type, windowSize);
8091 }
8092
8107 //
8111 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8112 {
8113 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8114 }
8115
8148 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
8149 {
8150 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
8151 }
8152
8165 {
8166 return mImpl->addResize(input);
8167 }
8168
8178 ILoop* addLoop() noexcept
8179 {
8180 return mImpl->addLoop();
8181 }
8182
8194 {
8195 return mImpl->addIfConditional();
8196 }
8197
8232 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
8233 {
8234 return mImpl->addSelect(condition, thenInput, elseInput);
8235 }
8236
8249 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
8250 {
8251 return mImpl->addAssertion(condition, message);
8252 }
8253
8274 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
8275 {
8276 return mImpl->addFill(dimensions, op);
8277 }
8278
8300 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
8301 {
8302 return mImpl->addFillV2(dimensions, op, outputType);
8303 }
8304
8316 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
8317 {
8318 return mImpl->addPaddingNd(input, prePadding, postPadding);
8319 }
8320
8340 bool setWeightsName(Weights weights, char const* name) noexcept
8341 {
8342 return mImpl->setWeightsName(weights, name);
8343 }
8344
8356 //
8359 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8360 {
8361 mImpl->setErrorRecorder(recorder);
8362 }
8363
8375 {
8376 return mImpl->getErrorRecorder();
8377 }
8378
8396 {
8397 return mImpl->addDequantize(input, scale);
8398 }
8399
8418 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8419 {
8420 return mImpl->addDequantizeV2(input, scale, outputType);
8421 }
8422
8438 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
8439 {
8440 return mImpl->addScatter(data, indices, updates, mode);
8441 }
8442
8460 {
8461 return mImpl->addQuantize(input, scale);
8462 }
8463
8483 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8484 {
8485 return mImpl->addQuantizeV2(input, scale, outputType);
8486 }
8487
8511 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
8512 {
8513 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
8514 }
8515
8526 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
8527 {
8528 return mImpl->addEinsum(inputs, nbInputs, equation);
8529 }
8530
8545 {
8546 return mImpl->addGridSample(input, grid);
8547 }
8548
8566 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8567 {
8568 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8569 }
8570
8586 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
8587 {
8588 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
8589 }
8590
8604 {
8605 return mImpl->addReverseSequence(input, sequenceLens);
8606 }
8607
8629 INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8630 {
8631 return mImpl->addNormalization(input, scale, bias, axesMask);
8632 }
8633
8651 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8652 {
8653 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8654 }
8655
8679 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
8680 {
8681 return mImpl->addAttention(query, key, value, normOp, causal);
8682 }
8683
8690 virtual IBuilder& getBuilder() const noexcept
8691 {
8692 return mImpl->getBuilder();
8693 }
8694
8703 bool markWeightsRefittable(char const* name) noexcept
8704 {
8705 return mImpl->markWeightsRefittable(name);
8706 }
8707
8715 bool unmarkWeightsRefittable(char const* name) noexcept
8716 {
8717 return mImpl->unmarkWeightsRefittable(name);
8718 }
8719
8728 bool areWeightsMarkedRefittable(char const* name) const noexcept
8729 {
8730 return mImpl->areWeightsMarkedRefittable(name);
8731 }
8732
8747 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
8748 {
8749 return mImpl->addSqueeze(input, axes);
8750 }
8751
8769 {
8770 return mImpl->addUnsqueeze(input, axes);
8771 }
8772
8773protected:
8774 apiv::VNetworkDefinition* mImpl;
8775};
8776
8784enum class CalibrationAlgoType : int32_t
8785{
8790};
8791
8797template <>
8798constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
8799{
8800 return 4;
8801}
8802
8817{
8818public:
8826 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
8827
8842 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
8843
8858 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
8859
8868 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
8869
8875 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
8876
8877 ~IInt8Calibrator() noexcept override = default;
8878};
8879
8880namespace v_1_0
8881{
8883{
8884public:
8888 InterfaceInfo getInterfaceInfo() const noexcept override
8889 {
8890 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
8891 }
8892
8897 {
8899 }
8900
8901 ~IInt8EntropyCalibrator() noexcept override = default;
8902};
8903} // namespace v_1_0
8904
8919
8920namespace v_1_0
8921{
8923{
8924public:
8928 InterfaceInfo getInterfaceInfo() const noexcept override
8929 {
8930 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
8931 }
8932
8937 {
8939 }
8940
8941 ~IInt8EntropyCalibrator2() noexcept override = default;
8942};
8943} // namespace v_1_0
8944
8959
8960namespace v_1_0
8961{
8963{
8964public:
8968 InterfaceInfo getInterfaceInfo() const noexcept override
8969 {
8970 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
8971 }
8972
8977 {
8979 }
8980
8981 ~IInt8MinMaxCalibrator() noexcept override = default;
8982};
8983} // namespace v_1_0
8984
8998
8999namespace v_1_0
9000{
9002{
9003public:
9007 InterfaceInfo getInterfaceInfo() const noexcept override
9008 {
9009 return InterfaceInfo{"IInt8Calibrator", 1, 0};
9010 }
9011
9016 {
9018 }
9019
9026 virtual double getQuantile() const noexcept = 0;
9027
9034 virtual double getRegressionCutoff() const noexcept = 0;
9035
9048 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
9049
9058 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
9059
9060 ~IInt8LegacyCalibrator() noexcept override = default;
9061};
9062} // namespace v_1_0
9063
9078
9092{
9093public:
9099 DataType getDataType() const noexcept
9100 {
9101 return mImpl->getDataType();
9102 }
9103
9110 Dims getStrides() const noexcept
9111 {
9112 return mImpl->getStrides();
9113 }
9114
9120 int64_t getVectorizedDim() const noexcept
9121 {
9122 return mImpl->getVectorizedDim();
9123 }
9124
9131 int64_t getComponentsPerElement() const noexcept
9132 {
9133 return mImpl->getComponentsPerElement();
9134 }
9135
9136protected:
9137 virtual ~IAlgorithmIOInfo() noexcept = default;
9138 apiv::VAlgorithmIOInfo* mImpl;
9139};
9140
9155{
9156public:
9160 int64_t getImplementation() const noexcept
9161 {
9162 return mImpl->getImplementation();
9163 }
9164
9168 int64_t getTactic() const noexcept
9169 {
9170 return mImpl->getTactic();
9171 }
9172
9173protected:
9174 virtual ~IAlgorithmVariant() noexcept = default;
9175 apiv::VAlgorithmVariant* mImpl;
9176};
9177
9189{
9190public:
9196 char const* getName() const noexcept
9197 {
9198 return mImpl->getName();
9199 }
9200
9208 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
9209 {
9210 return mImpl->getDimensions(index, select);
9211 }
9212
9216 int32_t getNbInputs() const noexcept
9217 {
9218 return mImpl->getNbInputs();
9219 }
9220
9224 int32_t getNbOutputs() const noexcept
9225 {
9226 return mImpl->getNbOutputs();
9227 }
9228
9229protected:
9230 virtual ~IAlgorithmContext() noexcept = default;
9231 apiv::VAlgorithmContext* mImpl;
9232};
9233
9248{
9249public:
9254 {
9255 return mImpl->getAlgorithmVariant();
9256 }
9257
9261 float getTimingMSec() const noexcept
9262 {
9263 return mImpl->getTimingMSec();
9264 }
9265
9269 std::size_t getWorkspaceSize() const noexcept
9270 {
9271 return mImpl->getWorkspaceSize();
9272 }
9273
9283 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
9284 {
9285 return mImpl->getAlgorithmIOInfoByIndex(index);
9286 }
9287
9288protected:
9289 virtual ~IAlgorithm() noexcept = default;
9290 apiv::VAlgorithm* mImpl;
9291}; // IAlgorithm
9292
9293namespace v_1_0
9294{
9296{
9297public:
9301 InterfaceInfo getInterfaceInfo() const noexcept override
9302 {
9303 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
9304 }
9319 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
9320 int32_t nbChoices, int32_t* selection) noexcept = 0;
9321
9332 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
9333 int32_t nbAlgorithms) noexcept = 0;
9334
9335 virtual ~IAlgorithmSelector() noexcept = default;
9336};
9337} // namespace v_1_0
9338
9352
9359using QuantizationFlags = uint32_t;
9360
9370enum class QuantizationFlag : int32_t
9371{
9376};
9377
9383template <>
9384constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
9385{
9386 return 1;
9387}
9388
9406enum class RuntimePlatform : int32_t
9407{
9410 kSAME_AS_BUILD = 0,
9411
9414 kWINDOWS_AMD64 = 1,
9415
9416
9417};
9418
9419namespace impl
9420{
9426template <>
9428{
9429 static constexpr int32_t kVALUE = 2;
9430};
9431} // namespace impl
9432
9439using BuilderFlags = uint32_t;
9440
9448enum class BuilderFlag : int32_t
9449{
9453
9457
9459 kDEBUG = 2,
9460
9462 kGPU_FALLBACK = 3,
9463
9465 kREFIT = 4,
9466
9469
9473 kTF32 = 6,
9474
9476 kSPARSE_WEIGHTS = 7,
9477
9484 kSAFETY_SCOPE = 8,
9485
9489
9494
9500
9504
9511
9517
9525
9529
9534
9540
9542 kSTRIP_PLAN = 19,
9543
9546
9553 kREFIT_IDENTICAL = 20,
9554
9580 kWEIGHT_STREAMING = 21,
9581
9585
9590 kREFIT_INDIVIDUAL = 23,
9591
9600 kSTRICT_NANS = 24,
9601
9603 kMONITOR_MEMORY = 25,
9604
9608
9611
9623
9624#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
9631 kREQUIRE_USER_ALLOCATION = 29,
9632#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
9633
9634};
9635
9641template <>
9642constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
9643{
9644#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
9645 return 30;
9646#else
9647 return 29;
9648#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
9649}
9650
9651namespace v_1_0
9652{
9666{
9667 uint8_t data[16];
9668};
9669
9678{
9680 uint64_t tacticHash;
9684 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
9685};
9686} // namespace v_1_0
9687
9701class ITimingCache : public INoCopy
9702{
9703public:
9704 virtual ~ITimingCache() noexcept = default;
9705
9715 nvinfer1::IHostMemory* serialize() const noexcept
9716 {
9717 return mImpl->serialize();
9718 }
9719
9739 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
9740 {
9741 return mImpl->combine(inputCache, ignoreMismatch);
9742 }
9743
9749 bool reset() noexcept
9750 {
9751 return mImpl->reset();
9752 }
9753
9768 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
9769 {
9770 return mImpl->queryKeys(keyBuffer, capacity);
9771 }
9772
9785 TimingCacheValue query(TimingCacheKey const& key) const noexcept
9786 {
9787 return mImpl->query(key);
9788 }
9789
9807 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
9808 {
9809 return mImpl->update(key, value);
9810 }
9811
9812protected:
9813 apiv::VTimingCache* mImpl;
9814};
9815
9823enum class MemoryPoolType : int32_t
9824{
9831 kWORKSPACE = 0,
9832
9840
9846 kDLA_LOCAL_DRAM = 2,
9847
9853 kDLA_GLOBAL_DRAM = 3,
9854
9862 kTACTIC_DRAM = 4,
9863
9877};
9878
9884template <>
9885constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
9886{
9887 return 6;
9888}
9889
9898enum class PreviewFeature : int32_t
9899{
9906
9911
9918};
9919
9920namespace impl
9921{
9927template <>
9929{
9930 static constexpr int32_t kVALUE = 3;
9931};
9932} // namespace impl
9933
9942enum class HardwareCompatibilityLevel : int32_t
9943{
9946 kNONE = 0,
9947
9959 kAMPERE_PLUS = 1,
9960
9970};
9971
9972namespace impl
9973{
9979template <>
9981{
9982 static constexpr int32_t kVALUE = 3;
9983};
9984} // namespace impl
9985
9986
9995enum class TilingOptimizationLevel : int32_t
9996{
9998 kNONE = 0,
9999
10001 kFAST = 1,
10002
10005 kMODERATE = 2,
10006
10008 kFULL = 3
10009
10010};
10011
10012namespace impl
10013{
10019template <>
10021{
10022 static constexpr int32_t kVALUE = 4;
10023};
10024} // namespace impl
10025
10026namespace v_1_0
10027{
10029{
10030public:
10031 IProgressMonitor() = default;
10032 virtual ~IProgressMonitor() noexcept = default;
10033
10037 InterfaceInfo getInterfaceInfo() const noexcept override
10038 {
10039 return InterfaceInfo{"IProgressMonitor", 1, 0};
10040 }
10041
10061 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10062
10075 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10076
10088 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10089
10090}; // class IProgressMonitor
10091} // namespace v_1_0
10092
10113
10122{
10123public:
10124 virtual ~IBuilderConfig() noexcept = default;
10125
10134 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10135 {
10136 mImpl->setAvgTimingIterations(avgTiming);
10137 }
10138
10146 int32_t getAvgTimingIterations() const noexcept
10147 {
10148 return mImpl->getAvgTimingIterations();
10149 }
10150
10159 void setEngineCapability(EngineCapability capability) noexcept
10160 {
10161 mImpl->setEngineCapability(capability);
10162 }
10163
10172 {
10173 return mImpl->getEngineCapability();
10174 }
10175
10184 {
10185 mImpl->setInt8Calibrator(calibrator);
10186 }
10187
10194 {
10195 return mImpl->getInt8Calibrator();
10196 }
10197
10210 void setFlags(BuilderFlags builderFlags) noexcept
10211 {
10212 mImpl->setFlags(builderFlags);
10213 }
10214
10222 BuilderFlags getFlags() const noexcept
10223 {
10224 return mImpl->getFlags();
10225 }
10226
10234 void clearFlag(BuilderFlag builderFlag) noexcept
10235 {
10236 mImpl->clearFlag(builderFlag);
10237 }
10238
10246 void setFlag(BuilderFlag builderFlag) noexcept
10247 {
10248 mImpl->setFlag(builderFlag);
10249 }
10250
10258 bool getFlag(BuilderFlag builderFlag) const noexcept
10259 {
10260 return mImpl->getFlag(builderFlag);
10261 }
10262
10275 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10276 {
10277 mImpl->setDeviceType(layer, deviceType);
10278 }
10279
10285 DeviceType getDeviceType(ILayer const* layer) const noexcept
10286 {
10287 return mImpl->getDeviceType(layer);
10288 }
10289
10297 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10298 {
10299 return mImpl->isDeviceTypeSet(layer);
10300 }
10301
10307 void resetDeviceType(ILayer const* layer) noexcept
10308 {
10309 mImpl->resetDeviceType(layer);
10310 }
10311
10317 bool canRunOnDLA(ILayer const* layer) const noexcept
10318 {
10319 return mImpl->canRunOnDLA(layer);
10320 }
10321
10333 void setDLACore(int32_t dlaCore) noexcept
10334 {
10335 mImpl->setDLACore(dlaCore);
10336 }
10337
10343 int32_t getDLACore() const noexcept
10344 {
10345 return mImpl->getDLACore();
10346 }
10347
10354 void setDefaultDeviceType(DeviceType deviceType) noexcept
10355 {
10356 mImpl->setDefaultDeviceType(deviceType);
10357 }
10358
10365 {
10366 return mImpl->getDefaultDeviceType();
10367 }
10368
10374 void reset() noexcept
10375 {
10376 mImpl->reset();
10377 }
10378
10386 void setProfileStream(const cudaStream_t stream) noexcept
10387 {
10388 return mImpl->setProfileStream(stream);
10389 }
10390
10398 cudaStream_t getProfileStream() const noexcept
10399 {
10400 return mImpl->getProfileStream();
10401 }
10402
10415 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10416 {
10417 return mImpl->addOptimizationProfile(profile);
10418 }
10419
10428 int32_t getNbOptimizationProfiles() const noexcept
10429 {
10430 return mImpl->getNbOptimizationProfiles();
10431 }
10432
10441 {
10442 mImpl->setProfilingVerbosity(verbosity);
10443 }
10444
10454 {
10455 return mImpl->getProfilingVerbosity();
10456 }
10457
10466 {
10467 mImpl->setAlgorithmSelector(selector);
10468 }
10469
10476 {
10477 return mImpl->getAlgorithmSelector();
10478 }
10479
10494 {
10495 return mImpl->setCalibrationProfile(profile);
10496 }
10497
10506 {
10507 return mImpl->getCalibrationProfile();
10508 }
10509
10525 {
10526 mImpl->setQuantizationFlags(flags);
10527 }
10528
10539 {
10540 return mImpl->getQuantizationFlags();
10541 }
10542
10553 {
10554 mImpl->clearQuantizationFlag(flag);
10555 }
10556
10567 {
10568 mImpl->setQuantizationFlag(flag);
10569 }
10570
10581 {
10582 return mImpl->getQuantizationFlag(flag);
10583 }
10584
10602 bool setTacticSources(TacticSources tacticSources) noexcept
10603 {
10604 return mImpl->setTacticSources(tacticSources);
10605 }
10606
10618 {
10619 return mImpl->getTacticSources();
10620 }
10621
10637 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
10638 {
10639 return mImpl->createTimingCache(blob, size);
10640 }
10641
10660 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
10661 {
10662 return mImpl->setTimingCache(cache, ignoreMismatch);
10663 }
10664
10671 {
10672 return mImpl->getTimingCache();
10673 }
10674
10702 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
10703 {
10704 mImpl->setMemoryPoolLimit(pool, poolSize);
10705 }
10706
10721 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
10722 {
10723 return mImpl->getMemoryPoolLimit(pool);
10724 }
10725
10739 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
10740 {
10741 mImpl->setPreviewFeature(feature, enable);
10742 }
10743
10753 bool getPreviewFeature(PreviewFeature feature) const noexcept
10754 {
10755 return mImpl->getPreviewFeature(feature);
10756 }
10757
10786 void setBuilderOptimizationLevel(int32_t level) noexcept
10787 {
10788 mImpl->setBuilderOptimizationLevel(level);
10789 }
10790
10799 {
10800 return mImpl->getBuilderOptimizationLevel();
10801 }
10802
10815 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
10816 {
10817 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
10818 }
10819
10829 {
10830 return mImpl->getHardwareCompatibilityLevel();
10831 }
10832
10841 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
10842 {
10843 mImpl->setPluginsToSerialize(paths, nbPaths);
10844 }
10845
10854 char const* getPluginToSerialize(int32_t index) const noexcept
10855 {
10856 return mImpl->getPluginToSerialize(index);
10857 }
10858
10864 int32_t getNbPluginsToSerialize() const noexcept
10865 {
10866 return mImpl->getNbPluginsToSerialize();
10867 }
10868
10893 void setMaxAuxStreams(int32_t nbStreams) noexcept
10894 {
10895 mImpl->setMaxAuxStreams(nbStreams);
10896 }
10897
10903 int32_t getMaxAuxStreams() const noexcept
10904 {
10905 return mImpl->getMaxAuxStreams();
10906 }
10907
10919 void setProgressMonitor(IProgressMonitor* monitor) noexcept
10920 {
10921 return mImpl->setProgressMonitor(monitor);
10922 }
10923
10930 {
10931 return mImpl->getProgressMonitor();
10932 }
10933
10945 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
10946 {
10947 mImpl->setRuntimePlatform(runtimePlatform);
10948 }
10949
10958 {
10959 return mImpl->getRuntimePlatform();
10960 }
10961
10969 void setMaxNbTactics(int32_t maxNbTactics) noexcept
10970 {
10971 mImpl->setMaxNbTactics(maxNbTactics);
10972 }
10973
10981 int32_t getMaxNbTactics() const noexcept
10982 {
10983 return mImpl->getMaxNbTactics();
10984 }
10985
10998 {
10999 return mImpl->setTilingOptimizationLevel(level);
11000 }
11001
11010 {
11011 return mImpl->getTilingOptimizationLevel();
11012 }
11013
11025 bool setL2LimitForTiling(int64_t size) noexcept
11026 {
11027 return mImpl->setL2LimitForTiling(size);
11028 }
11029
11037 int64_t getL2LimitForTiling() const noexcept
11038 {
11039 return mImpl->getL2LimitForTiling();
11040 }
11041
11051 bool setRemoteAutoTuningConfig(char const* config) noexcept
11052 {
11053 return mImpl->setRemoteAutoTuningConfig(config);
11054 }
11055
11061 char const* getRemoteAutoTuningConfig() const noexcept
11062 {
11063 return mImpl->getRemoteAutoTuningConfig();
11064 }
11065
11066protected:
11067 apiv::VBuilderConfig* mImpl;
11068};
11069
11078
11088{
11093
11098 kSTRONGLY_TYPED = 1,
11103
11108};
11109
11115template <>
11116constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
11117{
11118 return 4;
11119}
11120
11128class IBuilder : public INoCopy
11129{
11130public:
11131 virtual ~IBuilder() noexcept = default;
11132
11138 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
11139 {
11140 return mImpl->platformHasFastFp16();
11141 }
11142
11149 {
11150 return mImpl->platformHasFastInt8();
11151 }
11152
11160 int32_t getMaxDLABatchSize() const noexcept
11161 {
11162 return mImpl->getMaxDLABatchSize();
11163 }
11164
11168 int32_t getNbDLACores() const noexcept
11169 {
11170 return mImpl->getNbDLACores();
11171 }
11172
11186 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11187 {
11188 mImpl->setGpuAllocator(allocator);
11189 }
11190
11201 {
11202 return mImpl->createBuilderConfig();
11203 }
11204
11227 {
11228 return mImpl->createNetworkV2(flags);
11229 }
11230
11242 {
11243 return mImpl->createOptimizationProfile();
11244 }
11245
11260 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11261 {
11262 mImpl->setErrorRecorder(recorder);
11263 }
11264
11276 {
11277 return mImpl->getErrorRecorder();
11278 }
11279
11283 void reset() noexcept
11284 {
11285 mImpl->reset();
11286 }
11287
11293 TRT_DEPRECATED bool platformHasTf32() const noexcept
11294 {
11295 return mImpl->platformHasTf32();
11296 }
11297
11313 {
11314 return mImpl->buildSerializedNetwork(network, config);
11315 }
11316
11334 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11335 {
11336 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11337 }
11338
11358 INetworkDefinition& network, IBuilderConfig& config, IHostMemory*& kernelText) noexcept
11359 {
11360 return mImpl->buildSerializedNetworkWithKernelText(network, config, kernelText);
11361 }
11362
11379 {
11380 return mImpl->buildEngineWithConfig(network, config);
11381 }
11382
11400 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11401 {
11402 return mImpl->isNetworkSupported(network, config);
11403 }
11404
11410 ILogger* getLogger() const noexcept
11411 {
11412 return mImpl->getLogger();
11413 }
11414
11426 bool setMaxThreads(int32_t maxThreads) noexcept
11427 {
11428 return mImpl->setMaxThreads(maxThreads);
11429 }
11430
11440 int32_t getMaxThreads() const noexcept
11441 {
11442 return mImpl->getMaxThreads();
11443 }
11444
11451 {
11452 return mImpl->getPluginRegistry();
11453 }
11454
11455protected:
11456 apiv::VBuilder* mImpl;
11457};
11458
11459} // namespace nvinfer1
11460
11465extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11466
11467namespace nvinfer1
11468{
11469namespace
11470{
11471
11479inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11480{
11481 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11482}
11483
11484} // namespace
11485
11498 nvinfer1::EngineCapability capability) noexcept;
11499
11500namespace safe
11501{
11503class IPluginRegistry;
11504} // namespace safe
11505
11513extern "C" TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
11514 nvinfer1::EngineCapability capability) noexcept;
11515
11516} // namespace nvinfer1
11517
11518#endif // NV_INFER_H
#define TRT_DEPRECATED_API
Definition: NvInferRuntimeBase.h:44
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:69
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:101
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h:218
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:221
An Activation layer in a network definition.
Definition: NvInfer.h:1385
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1433
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1394
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1404
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1442
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1451
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1419
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:9189
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:9224
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:9216
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:9196
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:9208
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:9248
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:9269
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:9261
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:9283
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:9253
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:9092
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:9120
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:9110
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:9099
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:9131
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:9155
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:9168
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:9160
An assertion layer in a network.
Definition: NvInfer.h:5054
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:5064
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5074
virtual ~IAssertionLayer() noexcept=default
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6790
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6795
virtual ~IAttentionBoundaryLayer() noexcept=default
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6904
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:6954
bool setDecomposable(bool decomposable) noexcept
Set whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:6991
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7081
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7004
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7044
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7064
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7052
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7032
bool setCausal(bool isCausal) noexcept
Set whether the attention will run a causal inference. Cannot be used together with setMask().
Definition: NvInfer.h:6967
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:6913
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7093
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7133
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:6925
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7109
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7145
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7120
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7023
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:6942
bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:6979
apiv::VAttention * mImpl
Definition: NvInfer.h:7152
virtual ~IAttention() noexcept=default
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6816
virtual ~IAttentionInputLayer() noexcept=default
This layer represents an output of an IAttention.
Definition: NvInfer.h:6851
virtual ~IAttentionOutputLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10122
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:10702
TRT_DEPRECATED void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:10524
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:10637
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:10739
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:10465
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:10183
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:10753
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:10798
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:10602
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:10841
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:10997
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11025
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:10193
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:10721
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10343
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:10864
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10275
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10159
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10903
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10258
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:10969
TRT_DEPRECATED void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:10552
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11037
bool setRemoteAutoTuningConfig(char const *config) noexcept
Set a config string for remote auto tuning.
Definition: NvInfer.h:11051
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:10919
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10440
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10428
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:10670
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10374
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:10660
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:10854
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10171
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:10957
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10364
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:10945
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:10981
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10222
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10210
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:10617
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10307
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10333
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:10828
char const * getRemoteAutoTuningConfig() const noexcept
Get a config string for remote auto tuning.
Definition: NvInfer.h:11061
TRT_DEPRECATED QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:10538
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10234
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10415
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:10929
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11067
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:10505
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10146
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:10354
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10246
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:10493
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10285
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10317
TRT_DEPRECATED bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:10580
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10398
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:10815
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11009
TRT_DEPRECATED void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:10566
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:10893
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10453
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10297
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:10786
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10386
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:10475
Builds an engine from a network definition.
Definition: NvInfer.h:11129
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:11160
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11168
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11275
apiv::VBuilder * mImpl
Definition: NvInfer.h:11456
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11410
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:11400
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11440
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11450
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:11148
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11241
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11186
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11226
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11200
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11283
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11426
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11260
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11312
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:11293
bool buildSerializedNetworkToStream(INetworkDefinition &network, IBuilderConfig &config, IStreamWriter &writer) noexcept
Builds and serializes a network into stream for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11333
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11378
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config, IHostMemory *&kernelText) noexcept
Extended form of buildSerializedNetwork that optionally permits getting the kernelText.
Definition: NvInfer.h:11357
A cast layer in a network.
Definition: NvInfer.h:3915
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3941
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3935
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3924
A concatenation layer in a network definition.
Definition: NvInfer.h:2095
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2108
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2118
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4578
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3954
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3964
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3974
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3986
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:4004
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:3998
A convolution layer in a network definition.
Definition: NvInfer.h:1065
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1190
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1163
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1231
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1335
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1321
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1291
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1138
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1281
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1345
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1084
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1128
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1217
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1114
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1243
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1104
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1074
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1153
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1266
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1309
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1180
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1207
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1256
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3197
Layer that represents a cumulative operation across a tensor.
Definition: NvInfer.h:6672
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6683
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6731
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6749
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6719
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6743
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6707
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6695
A deconvolution layer in a network definition.
Definition: NvInfer.h:2136
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2224
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2185
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2209
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2251
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2366
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2432
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2234
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2199
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2155
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2356
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2288
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2339
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2278
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2329
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2384
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2145
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2396
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2422
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2302
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2175
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2261
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2314
A Dequantize layer in a network definition.
Definition: NvInfer.h:5639
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5676
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5649
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5688
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5660
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5716
int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5805
int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5828
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5782
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5769
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5756
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5743
void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5795
void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5818
An Einsum layer in a network.
Definition: NvInfer.h:5873
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:5884
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5894
A elementwise layer in a network definition.
Definition: NvInfer.h:2506
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2535
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2529
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2517
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5165
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5397
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5211
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5201
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5426
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5340
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5374
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5264
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5355
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5389
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5245
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5176
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5230
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5414
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5191
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5279
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2639
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:2650
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2685
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2721
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2695
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2705
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2662
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2715
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:6095
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6102
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6148
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6124
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6166
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6160
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6114
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6136
virtual ~IGridSampleLayer() noexcept=default
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:142
A layer that represents the identity function.
Definition: NvInfer.h:3902
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3904
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4557
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4562
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4640
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4681
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4706
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4651
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4669
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4696
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4608
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4595
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:8817
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:4871
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4898
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4908
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4884
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4876
A LRN layer in a network definition.
Definition: NvInfer.h:1750
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1771
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1793
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1761
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1827
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1783
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1805
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1815
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1837
Base class for all layer classes in a network definition.
Definition: NvInfer.h:580
TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
Set the preferred or required computational precision of this layer in a weakly-typed network.
Definition: NvInfer.h:700
TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
Set the output type of this layer in a weakly-typed network.
Definition: NvInfer.h:788
TRT_DEPRECATED bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:726
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:851
TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:833
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:601
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:619
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:864
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:803
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:712
TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:819
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:611
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:640
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:650
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:667
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:632
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:587
TRT_DEPRECATED void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:738
virtual ~ILayer() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1588
This is a base class for Loop boundary layers.
Definition: NvInfer.h:4534
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4539
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4929
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:4999
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4958
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4971
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:4984
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:5009
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4937
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4771
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4801
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4776
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4793
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3749
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3777
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3771
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3759
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6247
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6284
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6258
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6270
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6329
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6347
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6294
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6341
A network definition for input to the builder.
Definition: NvInfer.h:7174
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:7402
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:7465
INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8629
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:7933
ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7663
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:7245
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:7346
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8651
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:8249
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7754
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:8068
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:7823
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:8147
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:7947
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:8046
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7566
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7536
TRT_DEPRECATED ITopKLayer * addTopK(ITensor &input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
Add a TopK layer to the network.
Definition: NvInfer.h:7629
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8418
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:8028
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:8300
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:8178
IDynamicQuantizeLayer * addDynamicQuantize(ITensor &input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:8510
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:7293
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:7327
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:8274
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:7909
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8459
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:8690
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7508
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:7271
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:7999
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:8193
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8374
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:8747
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8566
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8603
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7520
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:7987
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8483
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7592
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:7451
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:8544
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:7838
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:8728
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:8232
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:8438
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7494
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:7977
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:8774
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:8016
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:7482
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:7372
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:7889
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:7850
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:7808
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7695
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:7770
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:7429
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:7794
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8359
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:8088
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8586
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:7714
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:7963
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:7679
IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:8678
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8715
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:8703
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:8110
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:8164
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:8768
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:7735
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:7385
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:7261
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:8526
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:7227
TRT_DEPRECATED IPluginV2Layer * addPluginV2(ITensor *const *inputs, int32_t nbInputs, IPluginV2 &plugin) noexcept
Add a plugin layer to the network using the IPluginV2 interface.
Definition: NvInfer.h:7871
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:8316
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8395
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7550
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:8340
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:7307
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3803
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3827
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3815
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6436
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6455
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6475
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6445
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6542
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6548
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6506
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6465
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6532
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6496
A OneHot layer in a network definition.
Definition: NvInfer.h:6058
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6079
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:6065
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6073
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2675
Layer that represents a padding operation.
Definition: NvInfer.h:3000
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3049
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3011
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:3037
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3023
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3055
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4018
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:4020
virtual ~IParametricReLULayer() noexcept=default
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:139
Layer type for pluginV2.
Definition: NvInfer.h:2737
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2750
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2744
Layer type for V3 plugins.
Definition: NvInfer.h:2764
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2771
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2777
A Pooling layer in a network definition.
Definition: NvInfer.h:1499
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1518
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1651
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1627
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1571
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1599
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1508
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1664
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1640
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1674
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:1560
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1718
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1546
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1689
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1699
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1730
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1617
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1589
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1533
A Quantize layer in a network definition.
Definition: NvInfer.h:5511
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5548
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5532
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5521
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5560
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3852
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3854
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4724
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2920
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2967
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2927
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2937
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2957
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2947
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2983
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2977
A resize layer in a network definition.
Definition: NvInfer.h:4207
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4368
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4392
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:4286
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4227
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4424
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4267
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4434
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4378
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4308
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4343
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4447
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4298
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4237
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4402
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4457
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4353
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6364
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6397
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6384
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6413
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6407
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6374
virtual ~IReverseSequenceLayer() noexcept=default
A Scale layer in a network definition.
Definition: NvInfer.h:1896
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1953
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1973
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1943
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1963
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1913
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1923
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:2009
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1933
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1903
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1988
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:5986
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:5993
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:6027
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:6013
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:6021
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:6003
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:5032
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3525
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3527
Layer type for shuffling data.
Definition: NvInfer.h:3088
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3246
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3099
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3199
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3152
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3139
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3111
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3211
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3240
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3227
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3340
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3409
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3508
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3380
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3487
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3351
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3366
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3434
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3395
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3444
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3424
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3502
A Softmax layer in a network definition.
Definition: NvInfer.h:2040
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2062
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2072
virtual ~ISoftMaxLayer() noexcept=default
Layer that represents a squeeze operation, removing unit dimensions of the input tensor on a set of a...
Definition: NvInfer.h:6562
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6579
A tensor in a network definition.
Definition: NvInfer.h:186
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:456
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:375
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:234
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:414
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:203
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:521
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:406
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:215
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:500
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:434
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:324
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:349
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:316
TRT_DEPRECATED void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:284
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:363
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:332
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:299
apiv::VTensor * mImpl
Definition: NvInfer.h:568
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:424
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:547
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:562
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:394
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:248
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:469
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:9702
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:9768
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:9739
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:9785
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:9807
apiv::VTimingCache * mImpl
Definition: NvInfer.h:9813
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:9749
Layer that represents a TopK reduction.
Definition: NvInfer.h:3565
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3596
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3620
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3582
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3679
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3572
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3661
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3610
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3630
virtual ~ITopKLayer() noexcept=default
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3673
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4845
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4850
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2845
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2854
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2870
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2864
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the input tensor by inserting unit-lengt...
Definition: NvInfer.h:6591
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6608
An Interface class for version control.
Definition: NvInferRuntimeBase.h:278
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:243
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:124
Definition: NvInfer.h:9296
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:9301
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:415
Definition: NvInferRuntime.h:1656
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8936
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8928
Definition: NvInfer.h:8883
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8896
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8888
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:9002
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:9015
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:9007
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:8963
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:8976
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:8968
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:10029
virtual bool stepComplete(char const *phaseName, int32_t step) noexcept=0
Signal that a step of an optimizer phase has finished.
virtual ~IProgressMonitor() noexcept=default
virtual void phaseFinish(char const *phaseName) noexcept=0
Signal that a phase of the optimizer has finished.
virtual void phaseStart(char const *phaseName, char const *parentPhase, int32_t nbSteps) noexcept=0
Signal that a phase of the optimizer has started.
Definition: NvInferRuntime.h:666
IBuilder * createInferBuilder(ILogger &logger) noexcept
Create an instance of an IBuilder class.
Definition: NvInfer.h:11479
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:2961
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4112
@ kFORMULA
Use formula to map the original index.
@ kUPPER
Select the upper left pixel.
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
MemoryPoolType
The type for memory pools used by TensorRT.
Definition: NvInfer.h:9824
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1853
@ kUNIFORM
Identical coefficients across all elements of the tensor.
@ kCHANNEL
Per-channel coefficients.
RuntimePlatform
Describes the intended runtime platform (operating system and CPU architecture) for the execution of ...
Definition: NvInfer.h:9407
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:9359
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:9943
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6624
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6178
@ 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:9642
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:120
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:8798
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2798
@ kISINF
Return true if input value equals +/- infinity for floating-point data type.
@ kCOSH
Hyperbolic cosine.
@ kACOSH
Inverse hyperbolic cosine.
@ kERF
Gauss error function.
@ kISNAN
Return true if input value is a NaN for floating-point data type.
@ kACOS
Inverse cosine.
@ kABS
Absolute value.
@ kSINH
Hyperbolic sine.
@ kROUND
Round to nearest even for floating-point data type.
@ kATANH
Inverse hyperbolic tangent.
@ kASINH
Inverse hyperbolic sine.
@ kSIGN
Sign, If input > 0, output 1; if input < 0, output -1; if input == 0, output 0.
@ kEXP
Exponentiation.
@ kATAN
Inverse tangent.
constexpr int32_t EnumMax< ReduceOperation >() noexcept
Definition: NvInfer.h:2907
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4513
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:139
@ 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:5093
@ 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:4142
@ kHALF_UP
Round half up.
@ kHALF_DOWN
Round half down.
PaddingMode
Enumerates the modes of padding to perform in convolution, deconvolution and pooling layer,...
Definition: NvInfer.h:1031
@ kSAME_LOWER
Use SAME padding, with prePadding >= postPadding.
@ kEXPLICIT_ROUND_DOWN
Use explicit padding, rounding output size down.
@ kEXPLICIT_ROUND_UP
Use explicit padding, rounding output size up.
@ kSAME_UPPER
Use SAME padding, with prePadding <= postPadding.
TripLimit
Enum that describes kinds of trip limits.
Definition: NvInfer.h:4501
@ 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:11077
PreviewFeature
Define preview features.
Definition: NvInfer.h:9899
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:9996
@ kFAST
Use a fast algorithm and heuristic based strategy. Slightly increases engine build time.
@ kFULL
Increase search space even wider. Significantly increases engine build time.
constexpr int32_t EnumMax< GatherMode >() noexcept
Definition: NvInfer.h:2557
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:145
uint32_t BuilderFlags
Represents one or more BuilderFlag values using binary OR operations, e.g., 1U << BuilderFlag::kFP16 ...
Definition: NvInfer.h:9439
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1350
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1865
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:8785
@ kENTROPY_CALIBRATION_2
Entropy calibration.
@ kLEGACY_CALIBRATION
Legacy calibration.
@ kENTROPY_CALIBRATION
Legacy entropy calibration.
@ kMINMAX_CALIBRATION
Minmax calibration.
LayerType
The type values of layer classes.
Definition: NvInfer.h:58
@ kGRID_SAMPLE
Grid sample layer.
@ kRAGGED_SOFTMAX
Ragged softmax layer.
@ kDECONVOLUTION
Deconvolution layer.
@ kREDUCE
Reduce layer.
@ kASSERTION
Assertion layer.
@ kTOPK
TopK layer.
@ kRESIZE
Resize Layer.
@ kCAST
Cast layer.
@ kPADDING
Padding layer.
@ kSQUEEZE
Squeeze Layer.
@ kATTENTION_INPUT
Attention Input.
@ kMATRIX_MULTIPLY
Matrix multiply layer.
@ kCONDITION
Condition layer.
@ kCUMULATIVE
Cumulative layer.
@ kCONDITIONAL_INPUT
Conditional Input layer.
@ kIDENTITY
Identity layer.
@ kNORMALIZATION
Normalization layer.
@ kQUANTIZE
Quantize layer.
@ kSCATTER
Scatter layer.
@ kCONVOLUTION
Convolution layer.
@ kPARAMETRIC_RELU
Parametric ReLU layer.
@ kATTENTION_OUTPUT
Attention Output.
@ kUNSQUEEZE
Unsqueeze Layer.
@ kCONCATENATION
Concatenation layer.
@ kONE_HOT
OneHot layer.
@ kREVERSE_SEQUENCE
Reverse sequence layer.
@ kSLICE
Slice layer.
@ kEINSUM
Einsum layer.
@ kSOFTMAX
SoftMax layer.
@ kSHAPE
Shape layer.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kPLUGIN_V3
PluginV3 layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kDYNAMIC_QUANTIZE
Dynamic Quantize layer.
@ kGATHER
Gather layer.
@ kUNARY
UnaryOp operation Layer.
@ kACTIVATION
Activation layer.
@ kELEMENTWISE
Elementwise layer.
@ kSELECT
Select layer.
@ kPLUGIN_V2
PluginV2 layer.
@ kLOOP_OUTPUT
Loop output layer.
@ kCONDITIONAL_OUTPUT
Conditional Output layer.
@ kCONSTANT
Constant layer.
@ kNON_ZERO
NonZero layer.
@ kFILL
Fill layer.
@ kPLUGIN
Plugin layer.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Definition: NvInfer.h:9384
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3256
@ 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:2545
@ 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:131
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2973
NetworkDefinitionCreationFlag
List of immutable network properties expressed at network creation time. NetworkDefinitionCreationFla...
Definition: NvInfer.h:11088
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2455
@ 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:9371
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3272
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:4030
@ 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:9449
@ kWEIGHT_STREAMING
Enable weight streaming for the current engine.
@ kDEBUG
Enable debugging of layers via synchronizing after every layer.
@ kGPU_FALLBACK
Enable layers marked to execute on GPU if layer cannot execute on DLA.
@ kSPARSE_WEIGHTS
Allow the builder to examine weights and use optimized functions when weights have suitable sparsity.
@ kEDITABLE_TIMING_CACHE
Enable editable timing cache.
@ kSTRIP_PLAN
Strip the refittable weights from the engine plan file.
@ kMONITOR_MEMORY
Enable memory monitor during build time.
@ kDISABLE_TIMING_CACHE
Disable reuse of timing information across identical layers.
@ kREFIT
Enable building a refittable engine.
constexpr int32_t EnumMax< TopKOperation >() noexcept
Definition: NvInfer.h:3548
TENSORRTAPI nvinfer1::IPluginRegistry * getBuilderPluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Standard engine, or nullptr if no registry exists.
constexpr int32_t EnumMax< MemoryPoolType >() noexcept
Definition: NvInfer.h:9885
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3537
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2893
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4490
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:11116
TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry * getBuilderSafePluginRegistry(nvinfer1::EngineCapability capability) noexcept
Return the plugin registry for building a Safety engine, or nullptr if no registry exists.
ScatterMode
Control form of IScatterLayer.
Definition: NvInfer.h:5912
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3690
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:4058
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2832
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4473
@ 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:6191
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3718
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1467
@ 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:10112
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5124
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:204
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2635
AttentionNormalizationOp
Enumerates the operations that may be performed by the normalization in the attention subgraph.
Definition: NvInfer.h:6759
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:5923
Represents a permutation of dimensions.
Definition: NvInfer.h:3065
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeBase.h:128
The key to retrieve timing cache entries.
Definition: NvInfer.h:9666
Definition: NvInfer.h:9678
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:9680
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:9682

  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