TensorRT 10.15.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 kROTARY_EMBEDDING = 53,
113 kKVCACHE_UPDATE = 54,
114};
115
121template <>
122constexpr inline int32_t EnumMax<LayerType>() noexcept
123{
124 return 55;
125}
126
133using TensorFormats = uint32_t;
134
140enum class ActivationType : int32_t
141{
142 kRELU = 0,
143 kSIGMOID = 1,
144 kTANH = 2,
145 kLEAKY_RELU = 3,
146 kELU = 4,
147 kSELU = 5,
148 kSOFTSIGN = 6,
149 kSOFTPLUS = 7,
150 kCLIP = 8,
151 kHARD_SIGMOID = 9,
152 kSCALED_TANH = 10,
153 kTHRESHOLDED_RELU = 11,
154 kGELU_ERF = 12,
155 kGELU_TANH = 13
156};
157
158
159namespace impl
160{
166template <>
168{
169 static constexpr int32_t kVALUE = 14;
170};
171} // namespace impl
172
187class ITensor : public INoCopy
188{
189public:
205 void setName(char const* name) noexcept
206 {
207 mImpl->setName(name);
208 }
209
217 char const* getName() const noexcept
218 {
219 return mImpl->getName();
220 }
221
236 void setDimensions(Dims const& dimensions) noexcept
237 {
238 mImpl->setDimensions(dimensions);
239 }
240
250 Dims getDimensions() const noexcept
251 {
252 return mImpl->getDimensions();
253 }
254
286 TRT_DEPRECATED void setType(DataType type) noexcept
287 {
288 mImpl->setType(type);
289 }
290
301 DataType getType() const noexcept
302 {
303 return mImpl->getType();
304 }
305
318 TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
319 {
320 return mImpl->setDynamicRange(min, max);
321 }
322
326 bool isNetworkInput() const noexcept
327 {
328 return mImpl->isNetworkInput();
329 }
330
334 bool isNetworkOutput() const noexcept
335 {
336 return mImpl->isNetworkOutput();
337 }
338
351 TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
352 {
353 mImpl->setBroadcastAcrossBatch(broadcastAcrossBatch);
354 }
355
366 {
367 return mImpl->getBroadcastAcrossBatch();
368 }
369
378 {
379 return mImpl->getLocation();
380 }
381
397 {
398 mImpl->setLocation(location);
399 }
400
408 TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
409 {
410 return mImpl->dynamicRangeIsSet();
411 }
412
416 void resetDynamicRange() noexcept
417 {
418 mImpl->resetDynamicRange();
419 }
420
426 float getDynamicRangeMin() const noexcept
427 {
428 return mImpl->getDynamicRangeMin();
429 }
430
436 float getDynamicRangeMax() const noexcept
437 {
438 return mImpl->getDynamicRangeMax();
439 }
440
458 void setAllowedFormats(TensorFormats formats) noexcept
459 {
460 mImpl->setAllowedFormats(formats);
461 }
462
472 {
473 return mImpl->getAllowedFormats();
474 }
475
502 bool isShapeTensor() const noexcept
503 {
504 return mImpl->isShapeTensor();
505 }
506
523 bool isExecutionTensor() const noexcept
524 {
525 return mImpl->isExecutionTensor();
526 }
527
549 void setDimensionName(int32_t index, char const* name) noexcept
550 {
551 mImpl->setDimensionName(index, name);
552 }
553
564 char const* getDimensionName(int32_t index) const noexcept
565 {
566 return mImpl->getDimensionName(index);
567 }
568
569protected:
570 apiv::VTensor* mImpl;
571 virtual ~ITensor() noexcept = default;
572};
573
581class ILayer : public INoCopy
582{
583public:
589 LayerType getType() const noexcept
590 {
591 return mLayer->getType();
592 }
593
603 void setName(char const* name) noexcept
604 {
605 mLayer->setName(name);
606 }
607
613 char const* getName() const noexcept
614 {
615 return mLayer->getName();
616 }
617
621 int32_t getNbInputs() const noexcept
622 {
623 return mLayer->getNbInputs();
624 }
625
634 ITensor* getInput(int32_t index) const noexcept
635 {
636 return mLayer->getInput(index);
637 }
638
642 int32_t getNbOutputs() const noexcept
643 {
644 return mLayer->getNbOutputs();
645 }
646
652 ITensor* getOutput(int32_t index) const noexcept
653 {
654 return mLayer->getOutput(index);
655 }
656
669 void setInput(int32_t index, ITensor& tensor) noexcept
670 {
671 return mLayer->setInput(index, tensor);
672 }
673
702 TRT_DEPRECATED void setPrecision(DataType dataType) noexcept
703 {
704 mLayer->setPrecision(dataType);
705 }
706
714 DataType getPrecision() const noexcept
715 {
716 return mLayer->getPrecision();
717 }
718
728 TRT_DEPRECATED bool precisionIsSet() const noexcept
729 {
730 return mLayer->precisionIsSet();
731 }
732
741 {
742 mLayer->resetPrecision();
743 }
744
790 TRT_DEPRECATED void setOutputType(int32_t index, DataType dataType) noexcept
791 {
792 mLayer->setOutputType(index, dataType);
793 }
794
805 DataType getOutputType(int32_t index) const noexcept
806 {
807 return mLayer->getOutputType(index);
808 }
809
821 TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
822 {
823 return mLayer->outputTypeIsSet(index);
824 }
825
835 TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
836 {
837 return mLayer->resetOutputType(index);
838 }
839
853 void setMetadata(char const* metadata) noexcept
854 {
855 mLayer->setMetadata(metadata);
856 }
857
866 char const* getMetadata() const noexcept
867 {
868 return mLayer->getMetadata();
869 }
870
871protected:
872 virtual ~ILayer() noexcept = default;
873 apiv::VLayer* mLayer;
874};
875
1032enum class PaddingMode : int32_t
1033{
1035 kEXPLICIT_ROUND_UP = 1,
1036 kSAME_UPPER = 2,
1037 kSAME_LOWER = 3,
1038};
1039
1040namespace impl
1041{
1047template <>
1049{
1050 static constexpr int32_t kVALUE = 4;
1051};
1052} // namespace impl
1053
1067{
1068public:
1076 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
1077 {
1078 mImpl->setNbOutputMaps(nbOutputMaps);
1079 }
1080
1086 int64_t getNbOutputMaps() const noexcept
1087 {
1088 return mImpl->getNbOutputMaps();
1089 }
1090
1106 void setNbGroups(int64_t nbGroups) noexcept
1107 {
1108 mImpl->setNbGroups(nbGroups);
1109 }
1110
1116 int64_t getNbGroups() const noexcept
1117 {
1118 return mImpl->getNbGroups();
1119 }
1120
1130 void setKernelWeights(Weights weights) noexcept
1131 {
1132 mImpl->setKernelWeights(weights);
1133 }
1134
1140 Weights getKernelWeights() const noexcept
1141 {
1142 return mImpl->getKernelWeights();
1143 }
1144
1155 void setBiasWeights(Weights weights) noexcept
1156 {
1157 mImpl->setBiasWeights(weights);
1158 }
1159
1165 Weights getBiasWeights() const noexcept
1166 {
1167 return mImpl->getBiasWeights();
1168 }
1169
1182 void setPrePadding(Dims const& padding) noexcept
1183 {
1184 mImpl->setPrePadding(padding);
1185 }
1186
1192 Dims getPrePadding() const noexcept
1193 {
1194 return mImpl->getPrePadding();
1195 }
1196
1209 void setPostPadding(Dims const& padding) noexcept
1210 {
1211 mImpl->setPostPadding(padding);
1212 }
1213
1219 Dims getPostPadding() const noexcept
1220 {
1221 return mImpl->getPostPadding();
1222 }
1223
1233 void setPaddingMode(PaddingMode paddingMode) noexcept
1234 {
1235 mImpl->setPaddingMode(paddingMode);
1236 }
1237
1246 {
1247 return mImpl->getPaddingMode();
1248 }
1249
1258 void setKernelSizeNd(Dims const& kernelSize) noexcept
1259 {
1260 mImpl->setKernelSizeNd(kernelSize);
1261 }
1262
1268 Dims getKernelSizeNd() const noexcept
1269 {
1270 return mImpl->getKernelSizeNd();
1271 }
1272
1283 void setStrideNd(Dims const& stride) noexcept
1284 {
1285 mImpl->setStrideNd(stride);
1286 }
1287
1293 Dims getStrideNd() const noexcept
1294 {
1295 return mImpl->getStrideNd();
1296 }
1297
1311 void setPaddingNd(Dims const& padding) noexcept
1312 {
1313 mImpl->setPaddingNd(padding);
1314 }
1315
1323 Dims getPaddingNd() const noexcept
1324 {
1325 return mImpl->getPaddingNd();
1326 }
1327
1337 void setDilationNd(Dims const& dilation) noexcept
1338 {
1339 mImpl->setDilationNd(dilation);
1340 }
1341
1347 Dims getDilationNd() const noexcept
1348 {
1349 return mImpl->getDilationNd();
1350 }
1351
1366 using ILayer::setInput;
1367
1368protected:
1369 virtual ~IConvolutionLayer() noexcept = default;
1370 apiv::VConvolutionLayer* mImpl;
1371};
1372
1387{
1388public:
1397 {
1398 mImpl->setActivationType(type);
1399 }
1400
1407 {
1408 return mImpl->getActivationType();
1409 }
1410
1421 void setAlpha(float alpha) noexcept
1422 {
1423 mImpl->setAlpha(alpha);
1424 }
1425
1435 void setBeta(float beta) noexcept
1436 {
1437 mImpl->setBeta(beta);
1438 }
1439
1444 float getAlpha() const noexcept
1445 {
1446 return mImpl->getAlpha();
1447 }
1448
1453 float getBeta() const noexcept
1454 {
1455 return mImpl->getBeta();
1456 }
1457
1458protected:
1459 virtual ~IActivationLayer() noexcept = default;
1460 apiv::VActivationLayer* mImpl;
1461};
1462
1468enum class PoolingType : int32_t
1469{
1470 kMAX = 0,
1471 kAVERAGE = 1,
1473};
1474
1475namespace impl
1476{
1482template <>
1484{
1485 static constexpr int32_t kVALUE = 3;
1486};
1487} // namespace impl
1488
1500class IPoolingLayer : public ILayer
1501{
1502public:
1510 void setPoolingType(PoolingType type) noexcept
1511 {
1512 mImpl->setPoolingType(type);
1513 }
1514
1521 {
1522 return mImpl->getPoolingType();
1523 }
1524
1535 void setBlendFactor(float blendFactor) noexcept
1536 {
1537 mImpl->setBlendFactor(blendFactor);
1538 }
1539
1548 float getBlendFactor() const noexcept
1549 {
1550 return mImpl->getBlendFactor();
1551 }
1552
1562 void setAverageCountExcludesPadding(bool exclusive) noexcept
1563 {
1564 mImpl->setAverageCountExcludesPadding(exclusive);
1565 }
1566
1574 {
1575 return mImpl->getAverageCountExcludesPadding();
1576 }
1577
1591 void setPrePadding(Dims const& padding) noexcept
1592 {
1593 mImpl->setPrePadding(padding);
1594 }
1595
1601 Dims getPrePadding() const noexcept
1602 {
1603 return mImpl->getPrePadding();
1604 }
1605
1619 void setPostPadding(Dims const& padding) noexcept
1620 {
1621 mImpl->setPostPadding(padding);
1622 }
1623
1629 Dims getPostPadding() const noexcept
1630 {
1631 return mImpl->getPostPadding();
1632 }
1633
1642 void setPaddingMode(PaddingMode paddingMode) noexcept
1643 {
1644 mImpl->setPaddingMode(paddingMode);
1645 }
1646
1654 {
1655 return mImpl->getPaddingMode();
1656 }
1657
1666 void setWindowSizeNd(Dims const& windowSize) noexcept
1667 {
1668 mImpl->setWindowSizeNd(windowSize);
1669 }
1670
1676 Dims getWindowSizeNd() const noexcept
1677 {
1678 return mImpl->getWindowSizeNd();
1679 }
1680
1691 void setStrideNd(Dims const& stride) noexcept
1692 {
1693 mImpl->setStrideNd(stride);
1694 }
1695
1701 Dims getStrideNd() const noexcept
1702 {
1703 return mImpl->getStrideNd();
1704 }
1705
1720 void setPaddingNd(Dims const& padding) noexcept
1721 {
1722 mImpl->setPaddingNd(padding);
1723 }
1724
1732 Dims getPaddingNd() const noexcept
1733 {
1734 return mImpl->getPaddingNd();
1735 }
1736
1737protected:
1738 virtual ~IPoolingLayer() noexcept = default;
1739 apiv::VPoolingLayer* mImpl;
1740};
1741
1751class ILRNLayer : public ILayer
1752{
1753public:
1763 void setWindowSize(int64_t windowSize) noexcept
1764 {
1765 mImpl->setWindowSize(windowSize);
1766 }
1767
1773 int64_t getWindowSize() const noexcept
1774 {
1775 return mImpl->getWindowSize();
1776 }
1777
1785 void setAlpha(float alpha) noexcept
1786 {
1787 mImpl->setAlpha(alpha);
1788 }
1789
1795 float getAlpha() const noexcept
1796 {
1797 return mImpl->getAlpha();
1798 }
1799
1807 void setBeta(float beta) noexcept
1808 {
1809 mImpl->setBeta(beta);
1810 }
1811
1817 float getBeta() const noexcept
1818 {
1819 return mImpl->getBeta();
1820 }
1821
1829 void setK(float k) noexcept
1830 {
1831 mImpl->setK(k);
1832 }
1833
1839 float getK() const noexcept
1840 {
1841 return mImpl->getK();
1842 }
1843
1844protected:
1845 virtual ~ILRNLayer() noexcept = default;
1846 apiv::VLRNLayer* mImpl;
1847};
1848
1854enum class ScaleMode : int32_t
1855{
1856 kUNIFORM = 0,
1857 kCHANNEL = 1,
1858 kELEMENTWISE = 2
1859};
1860
1866template <>
1867constexpr inline int32_t EnumMax<ScaleMode>() noexcept
1868{
1869 return 3;
1870}
1871
1897class IScaleLayer : public ILayer
1898{
1899public:
1905 void setMode(ScaleMode mode) noexcept
1906 {
1907 mImpl->setMode(mode);
1908 }
1909
1915 ScaleMode getMode() const noexcept
1916 {
1917 return mImpl->getMode();
1918 }
1919
1925 void setShift(Weights shift) noexcept
1926 {
1927 mImpl->setShift(shift);
1928 }
1929
1935 Weights getShift() const noexcept
1936 {
1937 return mImpl->getShift();
1938 }
1939
1945 void setScale(Weights scale) noexcept
1946 {
1947 mImpl->setScale(scale);
1948 }
1949
1955 Weights getScale() const noexcept
1956 {
1957 return mImpl->getScale();
1958 }
1959
1965 void setPower(Weights power) noexcept
1966 {
1967 mImpl->setPower(power);
1968 }
1969
1975 Weights getPower() const noexcept
1976 {
1977 return mImpl->getPower();
1978 }
1979
1990 int32_t getChannelAxis() const noexcept
1991 {
1992 return mImpl->getChannelAxis();
1993 }
1994
2011 void setChannelAxis(int32_t channelAxis) noexcept
2012 {
2013 mImpl->setChannelAxis(channelAxis);
2014 }
2015
2016protected:
2017 virtual ~IScaleLayer() noexcept = default;
2018 apiv::VScaleLayer* mImpl;
2019};
2020
2041class ISoftMaxLayer : public ILayer
2042{
2043public:
2064 void setAxes(uint32_t axes) noexcept
2065 {
2066 mImpl->setAxes(axes);
2067 }
2068
2074 uint32_t getAxes() const noexcept
2075 {
2076 return mImpl->getAxes();
2077 }
2078
2079protected:
2080 virtual ~ISoftMaxLayer() noexcept = default;
2081 apiv::VSoftMaxLayer* mImpl;
2082};
2083
2097{
2098public:
2110 void setAxis(int32_t axis) noexcept
2111 {
2112 mImpl->setAxis(axis);
2113 }
2114
2120 int32_t getAxis() const noexcept
2121 {
2122 return mImpl->getAxis();
2123 }
2124
2125protected:
2126 virtual ~IConcatenationLayer() noexcept = default;
2127 apiv::VConcatenationLayer* mImpl;
2128};
2129
2138{
2139public:
2147 void setNbOutputMaps(int64_t nbOutputMaps) noexcept
2148 {
2149 mImpl->setNbOutputMaps(nbOutputMaps);
2150 }
2151
2157 int64_t getNbOutputMaps() const noexcept
2158 {
2159 return mImpl->getNbOutputMaps();
2160 }
2161
2177 void setNbGroups(int64_t nbGroups) noexcept
2178 {
2179 mImpl->setNbGroups(nbGroups);
2180 }
2181
2187 int64_t getNbGroups() const noexcept
2188 {
2189 return mImpl->getNbGroups();
2190 }
2191
2201 void setKernelWeights(Weights weights) noexcept
2202 {
2203 mImpl->setKernelWeights(weights);
2204 }
2205
2211 Weights getKernelWeights() const noexcept
2212 {
2213 return mImpl->getKernelWeights();
2214 }
2215
2226 void setBiasWeights(Weights weights) noexcept
2227 {
2228 mImpl->setBiasWeights(weights);
2229 }
2230
2236 Weights getBiasWeights() const noexcept
2237 {
2238 return mImpl->getBiasWeights();
2239 }
2240
2253 void setPrePadding(Dims const& padding) noexcept
2254 {
2255 mImpl->setPrePadding(padding);
2256 }
2257
2263 Dims getPrePadding() const noexcept
2264 {
2265 return mImpl->getPrePadding();
2266 }
2267
2280 void setPostPadding(Dims const& padding) noexcept
2281 {
2282 mImpl->setPostPadding(padding);
2283 }
2284
2290 Dims getPostPadding() const noexcept
2291 {
2292 return mImpl->getPostPadding();
2293 }
2294
2304 void setPaddingMode(PaddingMode paddingMode) noexcept
2305 {
2306 mImpl->setPaddingMode(paddingMode);
2307 }
2308
2317 {
2318 return mImpl->getPaddingMode();
2319 }
2320
2331 void setKernelSizeNd(Dims const& kernelSize) noexcept
2332 {
2333 mImpl->setKernelSizeNd(kernelSize);
2334 }
2335
2341 Dims getKernelSizeNd() const noexcept
2342 {
2343 return mImpl->getKernelSizeNd();
2344 }
2345
2358 void setStrideNd(Dims const& stride) noexcept
2359 {
2360 mImpl->setStrideNd(stride);
2361 }
2362
2368 Dims getStrideNd() const noexcept
2369 {
2370 return mImpl->getStrideNd();
2371 }
2372
2386 void setPaddingNd(Dims const& padding) noexcept
2387 {
2388 mImpl->setPaddingNd(padding);
2389 }
2390
2398 Dims getPaddingNd() const noexcept
2399 {
2400 return mImpl->getPaddingNd();
2401 }
2402
2415 using ILayer::setInput;
2416
2424 void setDilationNd(Dims const& dilation) noexcept
2425 {
2426 mImpl->setDilationNd(dilation);
2427 }
2428
2434 Dims getDilationNd() const noexcept
2435 {
2436 return mImpl->getDilationNd();
2437 }
2438
2439protected:
2440 virtual ~IDeconvolutionLayer() noexcept = default;
2441 apiv::VDeconvolutionLayer* mImpl;
2442};
2443
2456enum class ElementWiseOperation : int32_t
2457{
2458 kSUM = 0,
2459 kPROD = 1,
2460 kMAX = 2,
2461 kMIN = 3,
2462 kSUB = 4,
2463 kDIV = 5,
2464 kPOW = 6,
2465 kFLOOR_DIV = 7,
2466 kAND = 8,
2467 kOR = 9,
2468 kXOR = 10,
2469 kEQUAL = 11,
2470 kGREATER = 12,
2471 kLESS = 13
2472};
2473
2474namespace impl
2475{
2481template <>
2483{
2484 static constexpr int32_t kVALUE = 14;
2485};
2486} // namespace impl
2487
2508{
2509public:
2520 {
2521 return mImpl->setOperation(op);
2522 }
2523
2532 {
2533 return mImpl->getOperation();
2534 }
2535
2536protected:
2537 apiv::VElementWiseLayer* mImpl;
2538 virtual ~IElementWiseLayer() noexcept = default;
2539};
2540
2546enum class GatherMode : int32_t
2547{
2548 kDEFAULT = 0,
2549 kELEMENT = 1,
2550 kND = 2
2551};
2552
2558template <>
2559constexpr inline int32_t EnumMax<GatherMode>() noexcept
2560{
2561 return 3;
2562}
2563
2640class IGatherLayer : public ILayer
2641{
2642public:
2652 void setGatherAxis(int32_t axis) noexcept
2653 {
2654 mImpl->setGatherAxis(axis);
2655 }
2656
2664 int32_t getGatherAxis() const noexcept
2665 {
2666 return mImpl->getGatherAxis();
2667 }
2668
2687 void setNbElementWiseDims(int32_t elementWiseDims) noexcept
2688 {
2689 mImpl->setNbElementWiseDims(elementWiseDims);
2690 }
2691
2697 int32_t getNbElementWiseDims() const noexcept
2698 {
2699 return mImpl->getNbElementWiseDims();
2700 }
2701
2707 void setMode(GatherMode mode) noexcept
2708 {
2709 mImpl->setMode(mode);
2710 }
2711
2717 GatherMode getMode() const noexcept
2718 {
2719 return mImpl->getMode();
2720 }
2721
2722protected:
2723 apiv::VGatherLayer* mImpl;
2724 virtual ~IGatherLayer() noexcept = default;
2725};
2726
2739{
2740public:
2747 {
2748 return mImpl->getPlugin();
2749 }
2750
2751protected:
2752 apiv::VPluginV2Layer* mImpl;
2753 virtual ~IPluginV2Layer() noexcept = default;
2754};
2755
2766{
2767public:
2774 {
2775 return mImpl->getPlugin();
2776 }
2777
2778protected:
2779 apiv::VPluginV3Layer* mImpl;
2780 virtual ~IPluginV3Layer() noexcept = default;
2781};
2782
2799enum class UnaryOperation : int32_t
2800{
2801 kEXP = 0,
2802 kLOG = 1,
2803 kSQRT = 2,
2804 kRECIP = 3,
2805 kABS = 4,
2806 kNEG = 5,
2807 kSIN = 6,
2808 kCOS = 7,
2809 kTAN = 8,
2810 kSINH = 9,
2811 kCOSH = 10,
2812 kASIN = 11,
2813 kACOS = 12,
2814 kATAN = 13,
2815 kASINH = 14,
2816 kACOSH = 15,
2817 kATANH = 16,
2818 kCEIL = 17,
2819 kFLOOR = 18,
2820 kERF = 19,
2821 kNOT = 20,
2822 kSIGN = 21,
2823 kROUND = 22,
2824 kISINF = 23,
2825 kISNAN = 24,
2826};
2827
2833template <>
2834constexpr inline int32_t EnumMax<UnaryOperation>() noexcept
2835{
2836 return 25;
2837}
2838
2846class IUnaryLayer : public ILayer
2847{
2848public:
2857 {
2858 mImpl->setOperation(op);
2859 }
2860
2867 {
2868 return mImpl->getOperation();
2869 }
2870
2871protected:
2872 apiv::VUnaryLayer* mImpl;
2873 virtual ~IUnaryLayer() noexcept = default;
2874};
2875
2894enum class ReduceOperation : int32_t
2895{
2896 kSUM = 0,
2897 kPROD = 1,
2898 kMAX = 2,
2899 kMIN = 3,
2900 kAVG = 4
2901};
2902
2908template <>
2909constexpr inline int32_t EnumMax<ReduceOperation>() noexcept
2910{
2911 return 5;
2912}
2913
2921class IReduceLayer : public ILayer
2922{
2923public:
2930 {
2931 mImpl->setOperation(op);
2932 }
2933
2940 {
2941 return mImpl->getOperation();
2942 }
2943
2949 void setReduceAxes(uint32_t reduceAxes) noexcept
2950 {
2951 mImpl->setReduceAxes(reduceAxes);
2952 }
2953
2959 uint32_t getReduceAxes() const noexcept
2960 {
2961 return mImpl->getReduceAxes();
2962 }
2963
2969 void setKeepDimensions(bool keepDimensions) noexcept
2970 {
2971 mImpl->setKeepDimensions(keepDimensions);
2972 }
2973
2979 bool getKeepDimensions() const noexcept
2980 {
2981 return mImpl->getKeepDimensions();
2982 }
2983
2984protected:
2985 apiv::VReduceLayer* mImpl;
2986 virtual ~IReduceLayer() noexcept = default;
2987};
2988
3001class IPaddingLayer : public ILayer
3002{
3003public:
3013 void setPrePaddingNd(Dims const& padding) noexcept
3014 {
3015 mImpl->setPrePaddingNd(padding);
3016 }
3017
3025 Dims getPrePaddingNd() const noexcept
3026 {
3027 return mImpl->getPrePaddingNd();
3028 }
3029
3039 void setPostPaddingNd(Dims const& padding) noexcept
3040 {
3041 mImpl->setPostPaddingNd(padding);
3042 }
3043
3051 Dims getPostPaddingNd() const noexcept
3052 {
3053 return mImpl->getPostPaddingNd();
3054 }
3055
3056protected:
3057 apiv::VPaddingLayer* mImpl;
3058 virtual ~IPaddingLayer() noexcept = default;
3059};
3060
3067{
3074 int32_t order[Dims::MAX_DIMS];
3075};
3076
3089class IShuffleLayer : public ILayer
3090{
3091public:
3101 void setFirstTranspose(Permutation permutation) noexcept
3102 {
3103 mImpl->setFirstTranspose(permutation);
3104 }
3105
3114 {
3115 return mImpl->getFirstTranspose();
3116 }
3117
3141 void setReshapeDimensions(Dims const& dimensions) noexcept
3142 {
3143 mImpl->setReshapeDimensions(dimensions);
3144 }
3145
3155 {
3156 return mImpl->getReshapeDimensions();
3157 }
3158
3164 //
3187 using ILayer::setInput;
3188
3201 void setSecondTranspose(Permutation permutation) noexcept
3202 {
3203 mImpl->setSecondTranspose(permutation);
3204 }
3205
3214 {
3215 return mImpl->getSecondTranspose();
3216 }
3217
3229 void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
3230 {
3231 return mImpl->setZeroIsPlaceholder(zeroIsPlaceholder);
3232 }
3233
3242 bool getZeroIsPlaceholder() const noexcept
3243 {
3244 return mImpl->getZeroIsPlaceholder();
3245 }
3246
3247protected:
3248 apiv::VShuffleLayer* mImpl;
3249 virtual ~IShuffleLayer() noexcept = default;
3250};
3251
3257enum class SampleMode : int32_t
3258{
3259 kSTRICT_BOUNDS = 0,
3260 kWRAP = 1,
3261 kCLAMP = 2,
3262 kFILL = 3,
3263 kREFLECT = 4,
3266};
3267
3273template <>
3274constexpr inline int32_t EnumMax<SampleMode>() noexcept
3275{
3276 return 5;
3277}
3278
3341class ISliceLayer : public ILayer
3342{
3343public:
3353 void setStart(Dims const& start) noexcept
3354 {
3355 mImpl->setStart(start);
3356 }
3357
3368 Dims getStart() const noexcept
3369 {
3370 return mImpl->getStart();
3371 }
3372
3382 void setSize(Dims const& size) noexcept
3383 {
3384 return mImpl->setSize(size);
3385 }
3386
3397 Dims getSize() const noexcept
3398 {
3399 return mImpl->getSize();
3400 }
3401
3411 void setStride(Dims const& stride) noexcept
3412 {
3413 mImpl->setStride(stride);
3414 }
3415
3426 Dims getStride() const noexcept
3427 {
3428 return mImpl->getStride();
3429 }
3430
3436 void setMode(SampleMode mode) noexcept
3437 {
3438 mImpl->setMode(mode);
3439 }
3440
3446 SampleMode getMode() const noexcept
3447 {
3448 return mImpl->getMode();
3449 }
3450
3478 using ILayer::setInput;
3479
3489 void setAxes(Dims const& axes) noexcept
3490 {
3491 mImpl->setAxes(axes);
3492 }
3493
3504 Dims getAxes() const noexcept
3505 {
3506 return mImpl->getAxes();
3507 }
3508
3509protected:
3510 apiv::VSliceLayer* mImpl;
3511 virtual ~ISliceLayer() noexcept = default;
3512};
3513
3526class IShapeLayer : public ILayer
3527{
3528protected:
3529 apiv::VShapeLayer* mImpl;
3530 virtual ~IShapeLayer() noexcept = default;
3531};
3532
3538enum class TopKOperation : int32_t
3539{
3540 kMAX = 0,
3541 kMIN = 1,
3542};
3543
3549template <>
3550constexpr inline int32_t EnumMax<TopKOperation>() noexcept
3551{
3552 return 2;
3553}
3554
3566class ITopKLayer : public ILayer
3567{
3568public:
3574 void setOperation(TopKOperation op) noexcept
3575 {
3576 mImpl->setOperation(op);
3577 }
3578
3585 {
3586 return mImpl->getOperation();
3587 }
3588
3598 void setK(int32_t k) noexcept
3599 {
3600 mImpl->setK(k);
3601 }
3602
3612 int32_t getK() const noexcept
3613 {
3614 return mImpl->getK();
3615 }
3616
3622 void setReduceAxes(uint32_t reduceAxes) noexcept
3623 {
3624 mImpl->setReduceAxes(reduceAxes);
3625 }
3626
3632 uint32_t getReduceAxes() const noexcept
3633 {
3634 return mImpl->getReduceAxes();
3635 }
3636
3651 using ILayer::setInput;
3652
3663 bool setIndicesType(DataType type) noexcept
3664 {
3665 return mImpl->setIndicesType(type);
3666 }
3667
3675 DataType getIndicesType() const noexcept
3676 {
3677 return mImpl->getIndicesType();
3678 }
3679
3680protected:
3681 apiv::VTopKLayer* mImpl;
3682 virtual ~ITopKLayer() noexcept = default;
3683};
3684
3691enum class MatrixOperation : int32_t
3692{
3696 kNONE = 0,
3697
3699 kTRANSPOSE = 1,
3700
3711 kVECTOR = 2,
3712};
3713
3719template <>
3720constexpr inline int32_t EnumMax<MatrixOperation>() noexcept
3721{
3722 return 3;
3723}
3724
3751{
3752public:
3761 void setOperation(int32_t index, MatrixOperation op) noexcept
3762 {
3763 mImpl->setOperation(index, op);
3764 }
3765
3773 MatrixOperation getOperation(int32_t index) const noexcept
3774 {
3775 return mImpl->getOperation(index);
3776 }
3777
3778protected:
3779 apiv::VMatrixMultiplyLayer* mImpl;
3780 virtual ~IMatrixMultiplyLayer() noexcept = default;
3781};
3782
3804class INonZeroLayer : public ILayer
3805{
3806public:
3817 bool setIndicesType(DataType type) noexcept
3818 {
3819 return mImpl->setIndicesType(type);
3820 }
3821
3829 DataType getIndicesType() const noexcept
3830 {
3831 return mImpl->getIndicesType();
3832 }
3833
3834protected:
3835 virtual ~INonZeroLayer() noexcept = default;
3836 apiv::VNonZeroLayer* mImpl;
3837};
3838
3854{
3855protected:
3856 apiv::VRaggedSoftMaxLayer* mImpl;
3857 virtual ~IRaggedSoftMaxLayer() noexcept = default;
3858};
3859
3904{
3905protected:
3906 apiv::VIdentityLayer* mImpl;
3907 virtual ~IIdentityLayer() noexcept = default;
3908};
3909
3916class ICastLayer : public ILayer
3917{
3918public:
3926 void setToType(DataType toType) noexcept
3927 {
3928 mImpl->setToType(toType);
3929 }
3930
3937 DataType getToType() const noexcept
3938 {
3939 return mImpl->getToType();
3940 }
3941
3942protected:
3943 apiv::VCastLayer* mImpl;
3944 virtual ~ICastLayer() noexcept = default;
3945};
3946
3956{
3957public:
3966 void setWeights(Weights weights) noexcept
3967 {
3968 mImpl->setWeights(weights);
3969 }
3970
3976 Weights getWeights() const noexcept
3977 {
3978 return mImpl->getWeights();
3979 }
3980
3988 void setDimensions(Dims const& dimensions) noexcept
3989 {
3990 mImpl->setDimensions(dimensions);
3991 }
3992
4000 Dims getDimensions() const noexcept
4001 {
4002 return mImpl->getDimensions();
4003 }
4004
4005protected:
4006 apiv::VConstantLayer* mImpl;
4007 virtual ~IConstantLayer() noexcept = default;
4008};
4009
4020{
4021protected:
4022 apiv::VParametricReLULayer* mImpl;
4023 virtual ~IParametricReLULayer() noexcept = default;
4024};
4025
4031enum class InterpolationMode : int32_t
4032{
4033 kNEAREST = 0,
4034 kLINEAR = 1,
4035 kCUBIC = 2
4036};
4037
4038namespace impl
4039{
4045template <>
4047{
4048 static constexpr int32_t kVALUE = 3;
4049};
4050} // namespace impl
4051
4060{
4073 kALIGN_CORNERS = 0,
4074
4081 kASYMMETRIC = 1,
4082
4089 kHALF_PIXEL = 2,
4090};
4091
4092namespace impl
4093{
4099template <>
4101{
4102 static constexpr int32_t kVALUE = 3;
4103};
4104} // namespace impl
4105
4113enum class ResizeSelector : int32_t
4114{
4116 kFORMULA = 0,
4117
4119 kUPPER = 1,
4120};
4121
4122namespace impl
4123{
4129template <>
4131{
4132 static constexpr int32_t kVALUE = 2;
4133};
4134} // namespace impl
4135
4143enum class ResizeRoundMode : int32_t
4144{
4146 kHALF_UP = 0,
4147
4149 kHALF_DOWN = 1,
4150
4152 kFLOOR = 2,
4153
4155 kCEIL = 3,
4156};
4157
4158namespace impl
4159{
4165template <>
4167{
4168 static constexpr int32_t kVALUE = 4;
4169};
4170} // namespace impl
4171
4208class IResizeLayer : public ILayer
4209{
4210public:
4229 void setOutputDimensions(Dims const& dimensions) noexcept
4230 {
4231 return mImpl->setOutputDimensions(dimensions);
4232 }
4233
4239 Dims getOutputDimensions() const noexcept
4240 {
4241 return mImpl->getOutputDimensions();
4242 }
4243
4269 void setScales(float const* scales, int32_t nbScales) noexcept
4270 {
4271 mImpl->setScales(scales, nbScales);
4272 }
4273
4288 int32_t getScales(int32_t size, float* scales) const noexcept
4289 {
4290 return mImpl->getScales(size, scales);
4291 }
4292
4300 void setResizeMode(InterpolationMode interpolationMode) noexcept
4301 {
4302 mImpl->setResizeMode(interpolationMode);
4303 }
4304
4311 {
4312 return mImpl->getResizeMode();
4313 }
4314
4334 using ILayer::setInput;
4335
4346 {
4347 mImpl->setCoordinateTransformation(coordTransform);
4348 }
4349
4356 {
4357 return mImpl->getCoordinateTransformation();
4358 }
4359
4371 {
4372 mImpl->setSelectorForSinglePixel(selector);
4373 }
4374
4381 {
4382 return mImpl->getSelectorForSinglePixel();
4383 }
4384
4395 {
4396 mImpl->setNearestRounding(value);
4397 }
4398
4405 {
4406 return mImpl->getNearestRounding();
4407 }
4408
4426 void setCubicCoeff(float A) noexcept
4427 {
4428 mImpl->setCubicCoeff(A);
4429 }
4430
4436 float getCubicCoeff() const noexcept
4437 {
4438 return mImpl->getCubicCoeff();
4439 }
4440
4449 void setExcludeOutside(bool excludeFlag) noexcept
4450 {
4451 mImpl->setExcludeOutside(excludeFlag);
4452 }
4453
4459 bool getExcludeOutside() const noexcept
4460 {
4461 return mImpl->getExcludeOutside();
4462 }
4463
4464protected:
4465 virtual ~IResizeLayer() noexcept = default;
4466 apiv::VResizeLayer* mImpl;
4467};
4468
4474enum class LoopOutput : int32_t
4475{
4477 kLAST_VALUE = 0,
4478
4480 kCONCATENATE = 1,
4481
4483 kREVERSE = 2
4484};
4485
4491template <>
4492constexpr inline int32_t EnumMax<LoopOutput>() noexcept
4493{
4494 return 3;
4495}
4496
4502enum class TripLimit : int32_t
4503{
4504
4505 kCOUNT = 0,
4506 kWHILE = 1
4507};
4508
4514template <>
4515constexpr inline int32_t EnumMax<TripLimit>() noexcept
4516{
4517 return 2;
4518}
4519
4520class ILoop;
4521
4536{
4537public:
4541 ILoop* getLoop() const noexcept
4542 {
4543 return mBoundary->getLoop();
4544 }
4545
4546protected:
4547 virtual ~ILoopBoundaryLayer() noexcept = default;
4548 apiv::VLoopBoundaryLayer* mBoundary;
4549};
4550
4559{
4560public:
4565 {
4566 return mBoundary->getConditional();
4567 }
4568
4569protected:
4570 virtual ~IIfConditionalBoundaryLayer() noexcept = default;
4571 apiv::VConditionalBoundaryLayer* mBoundary;
4572};
4573
4580{
4581public:
4582protected:
4583 virtual ~IConditionLayer() noexcept = default;
4584 apiv::VConditionLayer* mImpl;
4585};
4586
4597{
4598public:
4599protected:
4600 virtual ~IIfConditionalOutputLayer() noexcept = default;
4601 apiv::VConditionalOutputLayer* mImpl;
4602};
4603
4610{
4611public:
4612protected:
4613 virtual ~IIfConditionalInputLayer() noexcept = default;
4614 apiv::VConditionalInputLayer* mImpl;
4615};
4616
4642{
4643public:
4654 {
4655 return mImpl->setCondition(condition);
4656 }
4657
4671 IIfConditionalOutputLayer* addOutput(ITensor& trueSubgraphOutput, ITensor& falseSubgraphOutput) noexcept
4672 {
4673 return mImpl->addOutput(trueSubgraphOutput, falseSubgraphOutput);
4674 }
4675
4684 {
4685 return mImpl->addInput(input);
4686 }
4687
4698 void setName(char const* name) noexcept
4699 {
4700 mImpl->setName(name);
4701 }
4702
4708 char const* getName() const noexcept
4709 {
4710 return mImpl->getName();
4711 }
4712
4713protected:
4714 virtual ~IIfConditional() noexcept = default;
4715 apiv::VIfConditional* mImpl;
4716};
4717
4726{
4727public:
4733 //
4746 using ILayer::setInput;
4747
4748protected:
4749 virtual ~IRecurrenceLayer() noexcept = default;
4750 apiv::VRecurrenceLayer* mImpl;
4751};
4752
4773{
4774public:
4778 LoopOutput getLoopOutput() const noexcept
4779 {
4780 return mImpl->getLoopOutput();
4781 }
4782
4795 void setAxis(int32_t axis) noexcept
4796 {
4797 mImpl->setAxis(axis);
4798 }
4799
4803 int32_t getAxis() const noexcept
4804 {
4805 return mImpl->getAxis();
4806 }
4807
4813 //
4828 using ILayer::setInput;
4829
4830protected:
4831 virtual ~ILoopOutputLayer() noexcept = default;
4832 apiv::VLoopOutputLayer* mImpl;
4833};
4834
4847{
4848public:
4852 TripLimit getTripLimit() const noexcept
4853 {
4854 return mImpl->getTripLimit();
4855 }
4856
4857protected:
4858 virtual ~ITripLimitLayer() noexcept = default;
4859 apiv::VTripLimitLayer* mImpl;
4860};
4861
4873{
4874public:
4878 void setAxis(int32_t axis) noexcept
4879 {
4880 mImpl->setAxis(axis);
4881 }
4882
4886 int32_t getAxis() const noexcept
4887 {
4888 return mImpl->getAxis();
4889 }
4890
4900 void setReverse(bool reverse) noexcept
4901 {
4902 mImpl->setReverse(reverse);
4903 }
4904
4910 bool getReverse() const noexcept
4911 {
4912 return mImpl->getReverse();
4913 }
4914
4915protected:
4916 virtual ~IIteratorLayer() noexcept = default;
4917 apiv::VIteratorLayer* mImpl;
4918};
4919
4930class ILoop : public INoCopy
4931{
4932public:
4939 IRecurrenceLayer* addRecurrence(ITensor& initialValue) noexcept
4940 {
4941 return mImpl->addRecurrence(initialValue);
4942 }
4943
4961 {
4962 return mImpl->addTripLimit(tensor, limit);
4963 }
4964
4973 IIteratorLayer* addIterator(ITensor& tensor, int32_t axis = 0, bool reverse = false) noexcept
4974 {
4975 return mImpl->addIterator(tensor, axis, reverse);
4976 }
4977
4986 ILoopOutputLayer* addLoopOutput(ITensor& tensor, LoopOutput outputKind, int32_t axis = 0) noexcept
4987 {
4988 return mImpl->addLoopOutput(tensor, outputKind, axis);
4989 }
4990
5001 void setName(char const* name) noexcept
5002 {
5003 mImpl->setName(name);
5004 }
5005
5011 char const* getName() const noexcept
5012 {
5013 return mImpl->getName();
5014 }
5015
5016protected:
5017 virtual ~ILoop() noexcept = default;
5018 apiv::VLoop* mImpl;
5019};
5020
5033class ISelectLayer : public ILayer
5034{
5035protected:
5036 virtual ~ISelectLayer() noexcept = default;
5037 apiv::VSelectLayer* mImpl;
5038};
5039
5056{
5057public:
5066 void setMessage(char const* message) noexcept
5067 {
5068 mImpl->setMessage(message);
5069 }
5070
5076 char const* getMessage() const noexcept
5077 {
5078 return mImpl->getMessage();
5079 }
5080
5081protected:
5082 virtual ~IAssertionLayer() noexcept = default;
5083
5084 apiv::VAssertionLayer* mImpl;
5085};
5086
5094enum class FillOperation : int32_t
5095{
5111 kLINSPACE = 0,
5112
5114 kRANDOM_UNIFORM = 1,
5115
5117 kRANDOM_NORMAL = 2
5118};
5119
5125template <>
5126constexpr inline int32_t EnumMax<FillOperation>() noexcept
5127{
5128 return 3;
5129}
5130
5166class IFillLayer : public ILayer
5167{
5168public:
5177 //
5178 void setDimensions(Dims const& dimensions) noexcept
5179 {
5180 mImpl->setDimensions(dimensions);
5181 }
5182
5193 Dims getDimensions() const noexcept
5194 {
5195 return mImpl->getDimensions();
5196 }
5197
5203 void setOperation(FillOperation op) noexcept
5204 {
5205 mImpl->setOperation(op);
5206 }
5207
5214 {
5215 return mImpl->getOperation();
5216 }
5217
5231 //
5232 void setAlpha(double alpha) noexcept
5233 {
5234 mImpl->setAlpha(alpha);
5235 }
5236
5247 double getAlpha() const noexcept
5248 {
5249 return mImpl->getAlpha();
5250 }
5251
5266 void setBeta(double beta) noexcept
5267 {
5268 mImpl->setBeta(beta);
5269 }
5270
5281 double getBeta() const noexcept
5282 {
5283 return mImpl->getBeta();
5284 }
5285
5326 using ILayer::setInput;
5327
5341 //
5342 void setAlphaInt64(int64_t alpha) noexcept
5343 {
5344 mImpl->setAlphaInt64(alpha);
5345 }
5346
5357 int64_t getAlphaInt64() const noexcept
5358 {
5359 return mImpl->getAlphaInt64();
5360 }
5361
5376 void setBetaInt64(int64_t beta) noexcept
5377 {
5378 mImpl->setBetaInt64(beta);
5379 }
5380
5391 int64_t getBetaInt64() const noexcept
5392 {
5393 return mImpl->getBetaInt64();
5394 }
5395
5399 bool isAlphaBetaInt64() const noexcept
5400 {
5401 return mImpl->isAlphaBetaInt64();
5402 }
5403
5416 void setToType(DataType toType) noexcept
5417 {
5418 mImpl->setToType(toType);
5419 }
5420
5428 DataType getToType() const noexcept
5429 {
5430 return mImpl->getToType();
5431 }
5432
5433protected:
5434 virtual ~IFillLayer() noexcept = default;
5435 apiv::VFillLayer* mImpl;
5436};
5437
5513{
5514public:
5523 int32_t getAxis() const noexcept
5524 {
5525 return mImpl->getAxis();
5526 }
5534 void setAxis(int32_t axis) noexcept
5535 {
5536 mImpl->setAxis(axis);
5537 }
5538
5547 bool setBlockShape(Dims const& blockShape) noexcept
5548 {
5549 return mImpl->setBlockShape(blockShape);
5550 }
5551
5559 {
5560 return mImpl->getBlockShape();
5561 }
5562
5574 void setToType(DataType toType) noexcept
5575 {
5576 mImpl->setToType(toType);
5577 }
5578
5586 DataType getToType() const noexcept
5587 {
5588 return mImpl->getToType();
5589 }
5590
5591protected:
5592 virtual ~IQuantizeLayer() noexcept = default;
5593 apiv::VQuantizeLayer* mImpl;
5594};
5595
5665{
5666public:
5675 int32_t getAxis() const noexcept
5676 {
5677 return mImpl->getAxis();
5678 }
5686 void setAxis(int32_t axis) noexcept
5687 {
5688 mImpl->setAxis(axis);
5689 }
5690
5703 bool setBlockShape(Dims const& blockShape) noexcept
5704 {
5705 return mImpl->setBlockShape(blockShape);
5706 }
5707
5715 {
5716 return mImpl->getBlockShape();
5717 }
5718
5730 void setToType(DataType toType) noexcept
5731 {
5732 mImpl->setToType(toType);
5733 }
5734
5742 DataType getToType() const noexcept
5743 {
5744 return mImpl->getToType();
5745 }
5746
5747protected:
5748 virtual ~IDequantizeLayer() noexcept = default;
5749 apiv::VDequantizeLayer* mImpl;
5750};
5751
5770{
5771public:
5783 using ILayer::setInput;
5784
5797 void setToType(DataType toType) noexcept
5798 {
5799 mImpl->setToType(toType);
5800 }
5801
5810 DataType getToType() const noexcept
5811 {
5812 return mImpl->getToType();
5813 }
5814
5823 void setScaleType(DataType scaleType) noexcept
5824 {
5825 mImpl->setScaleType(scaleType);
5826 }
5827
5836 DataType getScaleType() const noexcept
5837 {
5838 return mImpl->getScaleType();
5839 }
5840
5849 TRT_DEPRECATED void setAxis(int32_t axis) noexcept
5850 {
5851 mImpl->setAxis(axis);
5852 }
5853
5859 TRT_DEPRECATED int32_t getAxis() const noexcept
5860 {
5861 return mImpl->getAxis();
5862 }
5863
5872 TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
5873 {
5874 mImpl->setBlockSize(size);
5875 }
5876
5882 TRT_DEPRECATED int32_t getBlockSize() const noexcept
5883 {
5884 return mImpl->getBlockSize();
5885 }
5886
5895 void setBlockShape(Dims const& blockShape) noexcept
5896 {
5897 mImpl->setBlockShape(blockShape);
5898 }
5899
5907 Dims getBlockShape() const noexcept
5908 {
5909 return mImpl->getBlockShape();
5910 }
5911
5912protected:
5913 virtual ~IDynamicQuantizeLayer() noexcept = default;
5914 apiv::VDynamicQuantizeLayer* mImpl;
5915};
5916
5951class IEinsumLayer : public ILayer
5952{
5953public:
5963 bool setEquation(char const* equation) noexcept
5964 {
5965 return mImpl->setEquation(equation);
5966 }
5967
5973 char const* getEquation() const noexcept
5974 {
5975 return mImpl->getEquation();
5976 }
5977
5978protected:
5979 virtual ~IEinsumLayer() noexcept = default;
5980 apiv::VEinsumLayer* mImpl;
5981};
5982
5990enum class ScatterMode : int32_t
5991{
5992 kELEMENT = 0,
5993 kND = 1,
5994};
5995
6001template <>
6002constexpr inline int32_t EnumMax<ScatterMode>() noexcept
6003{
6004 return 2;
6005}
6006
6064class IScatterLayer : public ILayer
6065{
6066public:
6072 void setMode(ScatterMode mode) noexcept
6073 {
6074 mImpl->setMode(mode);
6075 }
6076
6082 ScatterMode getMode() const noexcept
6083 {
6084 return mImpl->getMode();
6085 }
6086
6092 void setAxis(int32_t axis) noexcept
6093 {
6094 mImpl->setAxis(axis);
6095 }
6096
6100 int32_t getAxis() const noexcept
6101 {
6102 return mImpl->getAxis();
6103 }
6104
6105protected:
6106 apiv::VScatterLayer* mImpl;
6107 virtual ~IScatterLayer() noexcept = default;
6108}; // class IScatterLayer
6109
6136class IOneHotLayer : public ILayer
6137{
6138public:
6144 void setAxis(int32_t axis) noexcept
6145 {
6146 mImpl->setAxis(axis);
6147 }
6148
6152 int32_t getAxis() const noexcept
6153 {
6154 return mImpl->getAxis();
6155 }
6156
6157protected:
6158 apiv::VOneHotLayer* mImpl;
6159 virtual ~IOneHotLayer() noexcept = default;
6160};
6161
6174{
6175public:
6182 {
6183 mImpl->setInterpolationMode(mode);
6184 }
6185
6194 {
6195 return mImpl->getInterpolationMode();
6196 }
6197
6203 void setAlignCorners(bool alignCorners) noexcept
6204 {
6205 mImpl->setAlignCorners(alignCorners);
6206 }
6207
6215 bool getAlignCorners() const noexcept
6216 {
6217 return mImpl->getAlignCorners();
6218 }
6219
6227 bool setSampleMode(SampleMode mode) noexcept
6228 {
6229 return mImpl->setSampleMode(mode);
6230 }
6231
6239 SampleMode getSampleMode() const noexcept
6240 {
6241 return mImpl->getSampleMode();
6242 }
6243
6244protected:
6245 apiv::VGridSampleLayer* mImpl;
6246 virtual ~IGridSampleLayer() noexcept = default;
6247}; // class IGridSampleLayer
6248
6256enum class BoundingBoxFormat : int32_t
6257{
6259 kCORNER_PAIRS = 0,
6261 kCENTER_SIZES = 1
6262};
6263
6269template <>
6270constexpr inline int32_t EnumMax<BoundingBoxFormat>() noexcept
6271{
6272 return 2;
6273}
6274
6325class INMSLayer : public ILayer
6326{
6327public:
6338 {
6339 mImpl->setBoundingBoxFormat(fmt);
6340 }
6341
6350 {
6351 return mImpl->getBoundingBoxFormat();
6352 }
6353
6363 void setTopKBoxLimit(int32_t limit) noexcept
6364 {
6365 mImpl->setTopKBoxLimit(limit);
6366 }
6367
6373 int32_t getTopKBoxLimit() const noexcept
6374 {
6375 return mImpl->getTopKBoxLimit();
6376 }
6377
6396 using ILayer::setInput;
6397
6408 bool setIndicesType(DataType type) noexcept
6409 {
6410 return mImpl->setIndicesType(type);
6411 }
6412
6420 DataType getIndicesType() const noexcept
6421 {
6422 return mImpl->getIndicesType();
6423 }
6424
6425protected:
6426 apiv::VNMSLayer* mImpl;
6427 virtual ~INMSLayer() noexcept = default;
6428}; // class INMSLayer
6429
6443{
6444public:
6453 void setBatchAxis(int32_t batchAxis) noexcept
6454 {
6455 mImpl->setBatchAxis(batchAxis);
6456 }
6457
6463 int32_t getBatchAxis() const noexcept
6464 {
6465 return mImpl->getBatchAxis();
6466 }
6467
6476 void setSequenceAxis(int32_t sequenceAxis) noexcept
6477 {
6478 mImpl->setSequenceAxis(sequenceAxis);
6479 }
6480
6486 int32_t getSequenceAxis() const noexcept
6487 {
6488 return mImpl->getSequenceAxis();
6489 }
6490
6491protected:
6492 apiv::VReverseSequenceLayer* mImpl;
6493 virtual ~IReverseSequenceLayer() noexcept = default;
6494}; // class IReverseSequenceLayer
6495
6515{
6516public:
6524 void setEpsilon(float eps) noexcept
6525 {
6526 return mImpl->setEpsilon(eps);
6527 }
6528
6534 float getEpsilon() const noexcept
6535 {
6536 return mImpl->getEpsilon();
6537 }
6538
6544 void setAxes(uint32_t axesMask) noexcept
6545 {
6546 return mImpl->setAxes(axesMask);
6547 }
6548
6554 uint32_t getAxes() const noexcept
6555 {
6556 return mImpl->getAxes();
6557 }
6558
6575 void setNbGroups(int64_t nbGroups) noexcept
6576 {
6577 return mImpl->setNbGroups(nbGroups);
6578 }
6579
6585 int64_t getNbGroups() const noexcept
6586 {
6587 return mImpl->getNbGroups();
6588 }
6589
6611 void setComputePrecision(DataType type) noexcept
6612 {
6613 return mImpl->setComputePrecision(type);
6614 }
6615
6622 {
6623 return mImpl->getComputePrecision();
6624 }
6625
6631 TRT_NODISCARD bool isV2() const noexcept
6632 {
6633 return mImpl->isV2();
6634 }
6635
6636protected:
6637 apiv::VNormalizationLayer* mImpl;
6638 virtual ~INormalizationLayer() noexcept = default;
6639};
6640
6641
6650class ISqueezeLayer : public ILayer
6651{
6652public:
6665 using ILayer::setInput;
6666
6667protected:
6668 apiv::VSqueezeLayer* mImpl;
6669 virtual ~ISqueezeLayer() noexcept = default;
6670};
6671
6681{
6682public:
6696 using ILayer::setInput;
6697
6698protected:
6699 apiv::VUnsqueezeLayer* mImpl;
6700 virtual ~IUnsqueezeLayer() noexcept = default;
6701};
6702
6714enum class CumulativeOperation : int32_t
6715{
6716 kSUM = 0,
6717};
6718
6719namespace impl
6720{
6721
6727template <>
6729{
6730 static constexpr int32_t kVALUE = 1;
6731};
6732
6733} // namespace impl
6734
6763{
6764public:
6775 {
6776 return mImpl->setOperation(op);
6777 }
6778
6787 {
6788 return mImpl->getOperation();
6789 }
6790
6798 void setExclusive(bool exclusive) noexcept
6799 {
6800 mImpl->setExclusive(exclusive);
6801 }
6802
6810 bool getExclusive() const noexcept
6811 {
6812 return mImpl->getExclusive();
6813 }
6814
6822 void setReverse(bool reverse) noexcept
6823 {
6824 mImpl->setReverse(reverse);
6825 }
6826
6834 bool getReverse() const noexcept
6835 {
6836 return mImpl->getReverse();
6837 }
6838
6839protected:
6840 apiv::VCumulativeLayer* mImpl;
6841 virtual ~ICumulativeLayer() noexcept = default;
6842};
6843
6849enum class AttentionNormalizationOp : int32_t
6850{
6851 kNONE
6852 = 0,
6853 kSOFTMAX = 1,
6854};
6855
6856namespace impl
6857{
6863template <>
6865{
6866 static constexpr int32_t kVALUE = 2;
6867};
6868
6869} // namespace impl
6870
6881{
6882public:
6886 IAttention* getAttention() const noexcept
6887 {
6888 return mBoundary->getAttention();
6889 }
6890
6891protected:
6892 virtual ~IAttentionBoundaryLayer() noexcept = default;
6893 apiv::VAttentionBoundaryLayer* mBoundary;
6894};
6895
6907{
6908public:
6924 using ILayer::setInput;
6925
6926protected:
6927 virtual ~IAttentionInputLayer() noexcept = default;
6928 apiv::VAttentionInputLayer* mImpl;
6929};
6930
6942{
6943public:
6944protected:
6945 virtual ~IAttentionOutputLayer() noexcept = default;
6946 apiv::VAttentionOutputLayer* mImpl;
6947};
6948
6998class IAttention : public INoCopy
6999{
7000public:
7009 {
7010 return mImpl->setNormalizationOperation(op);
7011 }
7012
7021 {
7022 return mImpl->getNormalizationOperation();
7023 }
7024
7037 bool setMask(ITensor& mask) noexcept
7038 {
7039 return mImpl->setMask(mask);
7040 }
7041
7049 ITensor* getMask() noexcept
7050 {
7051 return mImpl->getMask();
7052 }
7053
7062 bool setCausal(bool isCausal) noexcept
7063 {
7064 return mImpl->setCausal(isCausal);
7065 }
7066
7074 bool getCausal() const noexcept
7075 {
7076 return mImpl->getCausal();
7077 }
7078
7086 bool setDecomposable(bool decomposable) noexcept
7087 {
7088 return mImpl->setDecomposable(decomposable);
7089 }
7090
7099 bool getDecomposable() const noexcept
7100 {
7101 return mImpl->getDecomposable();
7102 }
7103
7118 bool setInput(int32_t index, ITensor& input) noexcept
7119 {
7120 return mImpl->setInput(index, input);
7121 }
7122
7127 int32_t getNbInputs() const noexcept
7128 {
7129 return mImpl->getNbInputs();
7130 }
7131
7139 ITensor* getInput(int32_t index) const noexcept
7140 {
7141 return mImpl->getInput(index);
7142 }
7143
7147 int32_t getNbOutputs() const noexcept
7148 {
7149 return mImpl->getNbOutputs();
7150 }
7151
7159 ITensor* getOutput(int32_t index) const noexcept
7160 {
7161 return mImpl->getOutput(index);
7162 }
7163
7176 bool setName(char const* name) noexcept
7177 {
7178 return mImpl->setName(name);
7179 }
7180
7188 char const* getName() const noexcept
7189 {
7190 return mImpl->getName();
7191 }
7192
7205 {
7206 return mImpl->setNormalizationQuantizeScale(tensor);
7207 }
7208
7216 {
7217 return mImpl->getNormalizationQuantizeScale();
7218 }
7219
7229 {
7230 return mImpl->setNormalizationQuantizeToType(type);
7231 }
7232
7241 {
7242 return mImpl->getNormalizationQuantizeToType();
7243 }
7244
7260 bool setMetadata(char const* metadata) noexcept
7261 {
7262 return mImpl->setMetadata(metadata);
7263 }
7264
7273 char const* getMetadata() const noexcept
7274 {
7275 return mImpl->getMetadata();
7276 }
7277
7278
7279protected:
7280 apiv::VAttention* mImpl;
7281 virtual ~IAttention() noexcept = default;
7282};
7283
7291{
7292public:
7298 void setInterleaved(bool interleaved) noexcept
7299 {
7300 mImpl->setInterleaved(interleaved);
7301 }
7302
7303
7309 TRT_NODISCARD bool getInterleaved() const noexcept
7310 {
7311 return mImpl->getInterleaved();
7312 }
7313
7314
7320 TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
7321 {
7322 return mImpl->setRotaryEmbeddingDim(rotaryEmbeddingDim);
7323 }
7324
7325
7331 TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
7332 {
7333 return mImpl->getRotaryEmbeddingDim();
7334 }
7335
7336
7350 using ILayer::setInput;
7351
7352
7353protected:
7354 apiv::VRotaryEmbeddingLayer* mImpl;
7355 virtual ~IRotaryEmbeddingLayer() noexcept = default;
7356};
7357
7363enum class KVCacheMode : int32_t
7364{
7365 kLINEAR = 0,
7366};
7367
7368namespace impl
7369{
7375template <>
7377{
7378 static constexpr int32_t kVALUE = 1;
7379};
7380
7381} // namespace impl
7382
7403{
7404public:
7417 using ILayer::setInput;
7418
7426 bool setCacheMode(KVCacheMode cacheMode) noexcept
7427 {
7428 return mImpl->setCacheMode(cacheMode);
7429 }
7430
7436 KVCacheMode getCacheMode() const noexcept
7437 {
7438 return mImpl->getCacheMode();
7439 }
7440
7441protected:
7442 apiv::VKVCacheUpdateLayer* mImpl;
7443 virtual ~IKVCacheUpdateLayer() noexcept = default;
7444};
7445
7464{
7465public:
7466 virtual ~INetworkDefinition() noexcept = default;
7467
7503 ITensor* addInput(char const* name, DataType type, Dims const& dimensions) noexcept
7504 {
7505 return mImpl->addInput(name, type, dimensions);
7506 }
7507
7517 void markOutput(ITensor& tensor) noexcept
7518 {
7519 mImpl->markOutput(tensor);
7520 }
7521
7535 bool markDebug(ITensor& tensor) noexcept
7536 {
7537 return mImpl->markDebug(tensor);
7538 }
7539
7551 bool unmarkDebug(ITensor& tensor) noexcept
7552 {
7553 return mImpl->unmarkDebug(tensor);
7554 }
7555
7561 bool isDebugTensor(ITensor const& tensor) const noexcept
7562 {
7563 return mImpl->isDebugTensor(tensor);
7564 }
7565
7584 {
7585 return mImpl->markUnfusedTensorsAsDebugTensors();
7586 }
7587
7598 {
7599 return mImpl->unmarkUnfusedTensorsAsDebugTensors();
7600 }
7601
7618 {
7619 return mImpl->addActivation(input, type);
7620 }
7621
7636 ILRNLayer* addLRN(ITensor& input, int64_t window, float alpha, float beta, float k) noexcept
7637 {
7638 return mImpl->addLRN(input, window, alpha, beta, k);
7639 }
7640
7662 IScaleLayer* addScale(ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
7663 {
7664 return mImpl->addScale(input, mode, shift, scale, power);
7665 }
7666
7676 {
7677 return mImpl->addSoftMax(input);
7678 }
7679
7692 IConcatenationLayer* addConcatenation(ITensor* const* inputs, int32_t nbInputs) noexcept
7693 {
7694 return mImpl->addConcatenation(inputs, nbInputs);
7695 }
7696
7720 {
7721 return mImpl->addElementWise(input1, input2, op);
7722 }
7723
7741 IUnaryLayer* addUnary(ITensor& input, UnaryOperation operation) noexcept
7742 {
7743 return mImpl->addUnary(input, operation);
7744 }
7745
7756 {
7757 return mImpl->addShuffle(input);
7758 }
7759
7772 IOneHotLayer* addOneHot(ITensor& indices, ITensor& values, ITensor& depth, int32_t axis) noexcept
7773 {
7774 return mImpl->addOneHot(indices, values, depth, axis);
7775 }
7776
7784 int32_t getNbLayers() const noexcept
7785 {
7786 return mImpl->getNbLayers();
7787 }
7788
7798 ILayer* getLayer(int32_t index) const noexcept
7799 {
7800 return mImpl->getLayer(index);
7801 }
7802
7810 int32_t getNbInputs() const noexcept
7811 {
7812 return mImpl->getNbInputs();
7813 }
7814
7826 ITensor* getInput(int32_t index) const noexcept
7827 {
7828 return mImpl->getInput(index);
7829 }
7830
7840 int32_t getNbOutputs() const noexcept
7841 {
7842 return mImpl->getNbOutputs();
7843 }
7844
7856 ITensor* getOutput(int32_t index) const noexcept
7857 {
7858 return mImpl->getOutput(index);
7859 }
7860
7883 ITensor& input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
7884 {
7885 return mImpl->addReduce(input, operation, reduceAxes, keepDimensions);
7886 }
7887
7918 TRT_DEPRECATED ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes) noexcept
7919 {
7920 return mImpl->addTopK(input, op, k, reduceAxes);
7921 }
7922
7951 ITopKLayer* addTopK(ITensor& input, TopKOperation op, int32_t k, uint32_t reduceAxes, DataType indicesType) noexcept
7952 {
7953 return mImpl->addTopKV2(input, op, k, reduceAxes, indicesType);
7954 }
7955
7967 IGatherLayer* addGather(ITensor& data, ITensor& indices, int32_t axis) noexcept
7968 {
7969 return mImpl->addGather(data, indices, axis);
7970 }
7971
7983 IGatherLayer* addGatherV2(ITensor& data, ITensor& indices, GatherMode mode) noexcept
7984 {
7985 return mImpl->addGatherV2(data, indices, mode);
7986 }
7987
8003 {
8004 return mImpl->addRaggedSoftMax(input, bounds);
8005 }
8006
8024 ITensor& input0, MatrixOperation op0, ITensor& input1, MatrixOperation op1) noexcept
8025 {
8026 return mImpl->addMatrixMultiply(input0, op0, input1, op1);
8027 }
8028
8043 {
8044 return mImpl->addNonZero(input);
8045 }
8046
8058 INonZeroLayer* addNonZero(ITensor& input, DataType indicesType) noexcept
8059 {
8060 return mImpl->addNonZeroV2(input, indicesType);
8061 }
8062
8082 IConstantLayer* addConstant(Dims const& dimensions, Weights weights) noexcept
8083 {
8084 return mImpl->addConstant(dimensions, weights);
8085 }
8086
8097 {
8098 return mImpl->addIdentity(input);
8099 }
8100
8111 ICastLayer* addCast(ITensor& input, DataType toType) noexcept
8112 {
8113 return mImpl->addCast(input, toType);
8114 }
8115
8126 void removeTensor(ITensor& tensor) noexcept
8127 {
8128 mImpl->removeTensor(tensor);
8129 }
8130
8138 void unmarkOutput(ITensor& tensor) noexcept
8139 {
8140 mImpl->unmarkOutput(tensor);
8141 }
8142
8159 TRT_DEPRECATED IPluginV2Layer* addPluginV2(ITensor* const* inputs, int32_t nbInputs, IPluginV2& plugin) noexcept
8160 {
8161 return mImpl->addPluginV2(inputs, nbInputs, plugin);
8162 }
8163
8177 IPluginV3Layer* addPluginV3(ITensor* const* inputs, int32_t nbInputs, ITensor* const* shapeInputs,
8178 int32_t nbShapeInputs, IPluginV3& plugin) noexcept
8179 {
8180 return mImpl->addPluginV3(inputs, nbInputs, shapeInputs, nbShapeInputs, plugin);
8181 }
8182
8197 ISliceLayer* addSlice(ITensor& input, Dims const& start, Dims const& size, Dims const& stride) noexcept
8198 {
8199 return mImpl->addSlice(input, start, size, stride);
8200 }
8201
8221 void setName(char const* name) noexcept
8222 {
8223 mImpl->setName(name);
8224 }
8225
8235 char const* getName() const noexcept
8236 {
8237 return mImpl->getName();
8238 }
8239
8251 IShapeLayer* addShape(ITensor& input) noexcept
8252 {
8253 return mImpl->addShape(input);
8254 }
8255
8266 {
8267 return mImpl->hasImplicitBatchDimension();
8268 }
8269
8276 {
8277 return mImpl->getFlags();
8278 }
8279
8287 bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
8288 {
8289 return mImpl->getFlag(networkDefinitionCreationFlag);
8290 }
8291
8304 bool markOutputForShapes(ITensor& tensor) noexcept
8305 {
8306 return mImpl->markOutputForShapes(tensor);
8307 }
8308
8316 bool unmarkOutputForShapes(ITensor& tensor) noexcept
8317 {
8318 return mImpl->unmarkOutputForShapes(tensor);
8319 }
8320
8335 {
8336 return mImpl->addParametricReLU(input, slope);
8337 }
8338
8357 ITensor& input, int64_t nbOutputMaps, Dims const& kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8358 {
8359 return mImpl->addConvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8360 }
8361
8376 IPoolingLayer* addPoolingNd(ITensor& input, PoolingType type, Dims const& windowSize) noexcept
8377 {
8378 return mImpl->addPoolingNd(input, type, windowSize);
8379 }
8380
8395 //
8399 ITensor& input, int64_t nbOutputMaps, Dims kernelSize, Weights kernelWeights, Weights biasWeights) noexcept
8400 {
8401 return mImpl->addDeconvolutionNd(input, nbOutputMaps, kernelSize, kernelWeights, biasWeights);
8402 }
8403
8436 ITensor& input, ScaleMode mode, Weights shift, Weights scale, Weights power, int32_t channelAxis) noexcept
8437 {
8438 return mImpl->addScaleNd(input, mode, shift, scale, power, channelAxis);
8439 }
8440
8453 {
8454 return mImpl->addResize(input);
8455 }
8456
8466 ILoop* addLoop() noexcept
8467 {
8468 return mImpl->addLoop();
8469 }
8470
8482 {
8483 return mImpl->addIfConditional();
8484 }
8485
8520 ISelectLayer* addSelect(ITensor& condition, ITensor& thenInput, ITensor& elseInput) noexcept
8521 {
8522 return mImpl->addSelect(condition, thenInput, elseInput);
8523 }
8524
8537 IAssertionLayer* addAssertion(ITensor& condition, char const* message) noexcept
8538 {
8539 return mImpl->addAssertion(condition, message);
8540 }
8541
8562 TRT_DEPRECATED IFillLayer* addFill(Dims const& dimensions, FillOperation op) noexcept
8563 {
8564 return mImpl->addFill(dimensions, op);
8565 }
8566
8588 IFillLayer* addFill(Dims const& dimensions, FillOperation op, DataType outputType) noexcept
8589 {
8590 return mImpl->addFillV2(dimensions, op, outputType);
8591 }
8592
8604 IPaddingLayer* addPaddingNd(ITensor& input, Dims const& prePadding, Dims const& postPadding) noexcept
8605 {
8606 return mImpl->addPaddingNd(input, prePadding, postPadding);
8607 }
8608
8628 bool setWeightsName(Weights weights, char const* name) noexcept
8629 {
8630 return mImpl->setWeightsName(weights, name);
8631 }
8632
8644 //
8647 void setErrorRecorder(IErrorRecorder* recorder) noexcept
8648 {
8649 mImpl->setErrorRecorder(recorder);
8650 }
8651
8663 {
8664 return mImpl->getErrorRecorder();
8665 }
8666
8684 {
8685 return mImpl->addDequantize(input, scale);
8686 }
8687
8706 IDequantizeLayer* addDequantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8707 {
8708 return mImpl->addDequantizeV2(input, scale, outputType);
8709 }
8710
8726 IScatterLayer* addScatter(ITensor& data, ITensor& indices, ITensor& updates, ScatterMode mode) noexcept
8727 {
8728 return mImpl->addScatter(data, indices, updates, mode);
8729 }
8730
8748 {
8749 return mImpl->addQuantize(input, scale);
8750 }
8751
8771 IQuantizeLayer* addQuantize(ITensor& input, ITensor& scale, DataType outputType) noexcept
8772 {
8773 return mImpl->addQuantizeV2(input, scale, outputType);
8774 }
8775
8799 ITensor& input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
8800 {
8801 return mImpl->addDynamicQuantize(input, axis, blockSize, outputType, scaleType);
8802 }
8803
8823 ITensor& input, Dims const& blockShape, DataType outputType, DataType scaleType) noexcept
8824 {
8825 return mImpl->addDynamicQuantizeV2(input, blockShape, outputType, scaleType);
8826 }
8827
8838 IEinsumLayer* addEinsum(ITensor* const* inputs, int32_t nbInputs, char const* equation) noexcept
8839 {
8840 return mImpl->addEinsum(inputs, nbInputs, equation);
8841 }
8842
8857 {
8858 return mImpl->addGridSample(input, grid);
8859 }
8860
8878 TRT_DEPRECATED INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass) noexcept
8879 {
8880 return mImpl->addNMS(boxes, scores, maxOutputBoxesPerClass);
8881 }
8882
8898 INMSLayer* addNMS(ITensor& boxes, ITensor& scores, ITensor& maxOutputBoxesPerClass, DataType indicesType) noexcept
8899 {
8900 return mImpl->addNMSV2(boxes, scores, maxOutputBoxesPerClass, indicesType);
8901 }
8902
8916 {
8917 return mImpl->addReverseSequence(input, sequenceLens);
8918 }
8919
8947 TRT_DEPRECATED INormalizationLayer* addNormalization(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
8948 {
8949 return mImpl->addNormalization(input, scale, bias, axesMask);
8950 }
8951
8969 ICumulativeLayer* addCumulative(ITensor& input, ITensor& axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
8970 {
8971 return mImpl->addCumulative(input, axis, operation, exclusive, reverse);
8972 }
8973
8997 ITensor& query, ITensor& key, ITensor& value, AttentionNormalizationOp normOp, bool causal) noexcept
8998 {
8999 return mImpl->addAttention(query, key, value, normOp, causal);
9000 }
9001
9021 IRotaryEmbeddingLayer* addRotaryEmbedding(ITensor& input, ITensor& cosCache, ITensor& sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
9022 {
9023 return mImpl->addRotaryEmbedding(input, cosCache, sinCache, interleaved, rotaryEmbeddingDim);
9024 }
9025
9056 ITensor& cache, ITensor& update, ITensor& writeIndices, KVCacheMode cacheMode) noexcept
9057 {
9058 return mImpl->addKVCacheUpdate(cache, update, writeIndices, cacheMode);
9059 }
9060
9067 virtual IBuilder& getBuilder() const noexcept
9068 {
9069 return mImpl->getBuilder();
9070 }
9071
9080 bool markWeightsRefittable(char const* name) noexcept
9081 {
9082 return mImpl->markWeightsRefittable(name);
9083 }
9084
9092 bool unmarkWeightsRefittable(char const* name) noexcept
9093 {
9094 return mImpl->unmarkWeightsRefittable(name);
9095 }
9096
9105 bool areWeightsMarkedRefittable(char const* name) const noexcept
9106 {
9107 return mImpl->areWeightsMarkedRefittable(name);
9108 }
9109
9124 ISqueezeLayer* addSqueeze(ITensor& input, ITensor& axes) noexcept
9125 {
9126 return mImpl->addSqueeze(input, axes);
9127 }
9128
9146 {
9147 return mImpl->addUnsqueeze(input, axes);
9148 }
9149
9171 TRT_NODISCARD INormalizationLayer* addNormalizationV2(ITensor& input, ITensor& scale, ITensor& bias, uint32_t axesMask) noexcept
9172 {
9173 return mImpl->addNormalizationV2(input, scale, bias, axesMask);
9174 }
9175
9176protected:
9177 apiv::VNetworkDefinition* mImpl;
9178};
9179
9187enum class CalibrationAlgoType : int32_t
9188{
9193};
9194
9200template <>
9201constexpr inline int32_t EnumMax<CalibrationAlgoType>() noexcept
9202{
9203 return 4;
9204}
9205
9220{
9221public:
9229 TRT_DEPRECATED virtual int32_t getBatchSize() const noexcept = 0;
9230
9245 virtual bool getBatch(void* bindings[], char const* names[], int32_t nbBindings) noexcept = 0;
9246
9261 virtual void const* readCalibrationCache(std::size_t& length) noexcept = 0;
9262
9271 virtual void writeCalibrationCache(void const* ptr, std::size_t length) noexcept = 0;
9272
9278 virtual CalibrationAlgoType getAlgorithm() noexcept = 0;
9279
9280 ~IInt8Calibrator() noexcept override = default;
9281};
9282
9283namespace v_1_0
9284{
9286{
9287public:
9291 InterfaceInfo getInterfaceInfo() const noexcept override
9292 {
9293 return InterfaceInfo{"IInt8EntropyCalibrator", 1, 0};
9294 }
9295
9300 {
9302 }
9303
9304 ~IInt8EntropyCalibrator() noexcept override = default;
9305};
9306} // namespace v_1_0
9307
9322
9323namespace v_1_0
9324{
9326{
9327public:
9331 InterfaceInfo getInterfaceInfo() const noexcept override
9332 {
9333 return InterfaceInfo{"IInt8EntropyCalibrator2", 1, 0};
9334 }
9335
9340 {
9342 }
9343
9344 ~IInt8EntropyCalibrator2() noexcept override = default;
9345};
9346} // namespace v_1_0
9347
9362
9363namespace v_1_0
9364{
9366{
9367public:
9371 InterfaceInfo getInterfaceInfo() const noexcept override
9372 {
9373 return InterfaceInfo{"IInt8MinMaxCalibrator", 1, 0};
9374 }
9375
9380 {
9382 }
9383
9384 ~IInt8MinMaxCalibrator() noexcept override = default;
9385};
9386} // namespace v_1_0
9387
9401
9402namespace v_1_0
9403{
9405{
9406public:
9410 InterfaceInfo getInterfaceInfo() const noexcept override
9411 {
9412 return InterfaceInfo{"IInt8Calibrator", 1, 0};
9413 }
9414
9419 {
9421 }
9422
9429 virtual double getQuantile() const noexcept = 0;
9430
9437 virtual double getRegressionCutoff() const noexcept = 0;
9438
9451 virtual void const* readHistogramCache(std::size_t& length) noexcept = 0;
9452
9461 virtual void writeHistogramCache(void const* ptr, std::size_t length) noexcept = 0;
9462
9463 ~IInt8LegacyCalibrator() noexcept override = default;
9464};
9465} // namespace v_1_0
9466
9481
9495{
9496public:
9502 DataType getDataType() const noexcept
9503 {
9504 return mImpl->getDataType();
9505 }
9506
9513 Dims getStrides() const noexcept
9514 {
9515 return mImpl->getStrides();
9516 }
9517
9523 int64_t getVectorizedDim() const noexcept
9524 {
9525 return mImpl->getVectorizedDim();
9526 }
9527
9534 int64_t getComponentsPerElement() const noexcept
9535 {
9536 return mImpl->getComponentsPerElement();
9537 }
9538
9539protected:
9540 virtual ~IAlgorithmIOInfo() noexcept = default;
9541 apiv::VAlgorithmIOInfo* mImpl;
9542};
9543
9558{
9559public:
9563 int64_t getImplementation() const noexcept
9564 {
9565 return mImpl->getImplementation();
9566 }
9567
9571 int64_t getTactic() const noexcept
9572 {
9573 return mImpl->getTactic();
9574 }
9575
9576protected:
9577 virtual ~IAlgorithmVariant() noexcept = default;
9578 apiv::VAlgorithmVariant* mImpl;
9579};
9580
9592{
9593public:
9599 char const* getName() const noexcept
9600 {
9601 return mImpl->getName();
9602 }
9603
9611 Dims getDimensions(int32_t index, OptProfileSelector select) const noexcept
9612 {
9613 return mImpl->getDimensions(index, select);
9614 }
9615
9619 int32_t getNbInputs() const noexcept
9620 {
9621 return mImpl->getNbInputs();
9622 }
9623
9627 int32_t getNbOutputs() const noexcept
9628 {
9629 return mImpl->getNbOutputs();
9630 }
9631
9632protected:
9633 virtual ~IAlgorithmContext() noexcept = default;
9634 apiv::VAlgorithmContext* mImpl;
9635};
9636
9651{
9652public:
9657 {
9658 return mImpl->getAlgorithmVariant();
9659 }
9660
9664 float getTimingMSec() const noexcept
9665 {
9666 return mImpl->getTimingMSec();
9667 }
9668
9672 std::size_t getWorkspaceSize() const noexcept
9673 {
9674 return mImpl->getWorkspaceSize();
9675 }
9676
9686 IAlgorithmIOInfo const* getAlgorithmIOInfoByIndex(int32_t index) const noexcept
9687 {
9688 return mImpl->getAlgorithmIOInfoByIndex(index);
9689 }
9690
9691protected:
9692 virtual ~IAlgorithm() noexcept = default;
9693 apiv::VAlgorithm* mImpl;
9694}; // IAlgorithm
9695
9696namespace v_1_0
9697{
9699{
9700public:
9704 InterfaceInfo getInterfaceInfo() const noexcept override
9705 {
9706 return InterfaceInfo{"IAlgorithmSelector", 1, 0};
9707 }
9722 virtual int32_t selectAlgorithms(IAlgorithmContext const& context, IAlgorithm const* const* choices,
9723 int32_t nbChoices, int32_t* selection) noexcept = 0;
9724
9735 virtual void reportAlgorithms(IAlgorithmContext const* const* algoContexts, IAlgorithm const* const* algoChoices,
9736 int32_t nbAlgorithms) noexcept = 0;
9737
9738 virtual ~IAlgorithmSelector() noexcept = default;
9739};
9740} // namespace v_1_0
9741
9755
9762using QuantizationFlags = uint32_t;
9763
9773enum class QuantizationFlag : int32_t
9774{
9779};
9780
9786template <>
9787constexpr inline int32_t EnumMax<QuantizationFlag>() noexcept
9788{
9789 return 1;
9790}
9791
9809enum class RuntimePlatform : int32_t
9810{
9813 kSAME_AS_BUILD = 0,
9814
9817 kWINDOWS_AMD64 = 1,
9818
9819
9820};
9821
9822namespace impl
9823{
9829template <>
9831{
9832 static constexpr int32_t kVALUE = 2;
9833};
9834} // namespace impl
9835
9842using BuilderFlags = uint32_t;
9843
9851enum class BuilderFlag : int32_t
9852{
9856
9860
9862 kDEBUG = 2,
9863
9865 kGPU_FALLBACK = 3,
9866
9868 kREFIT = 4,
9869
9872
9876 kTF32 = 6,
9877
9879 kSPARSE_WEIGHTS = 7,
9880
9887 kSAFETY_SCOPE = 8,
9888
9892
9897
9903
9907
9914
9920
9928
9932
9937
9943
9945 kSTRIP_PLAN = 19,
9946
9949
9956 kREFIT_IDENTICAL = 20,
9957
9983 kWEIGHT_STREAMING = 21,
9984
9988
9993 kREFIT_INDIVIDUAL = 23,
9994
10003 kSTRICT_NANS = 24,
10004
10006 kMONITOR_MEMORY = 25,
10007
10011
10014
10026
10027#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
10034 kREQUIRE_USER_ALLOCATION = 29,
10035#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
10036
10037};
10038
10044template <>
10045constexpr inline int32_t EnumMax<BuilderFlag>() noexcept
10046{
10047#if ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
10048 return 30;
10049#else
10050 return 29;
10051#endif // ENABLE_FEATURE_DISABLE_RUNTIME_ALLOCATION
10052}
10053
10054namespace v_1_0
10055{
10069{
10070 uint8_t data[16];
10071};
10072
10081{
10083 uint64_t tacticHash;
10087 static constexpr uint64_t kINVALID_TACTIC_HASH = UINT64_MAX;
10088};
10089} // namespace v_1_0
10090
10104class ITimingCache : public INoCopy
10105{
10106public:
10107 virtual ~ITimingCache() noexcept = default;
10108
10118 nvinfer1::IHostMemory* serialize() const noexcept
10119 {
10120 return mImpl->serialize();
10121 }
10122
10142 bool combine(ITimingCache const& inputCache, bool ignoreMismatch) noexcept
10143 {
10144 return mImpl->combine(inputCache, ignoreMismatch);
10145 }
10146
10152 bool reset() noexcept
10153 {
10154 return mImpl->reset();
10155 }
10156
10171 int64_t queryKeys(TimingCacheKey* keyBuffer, int64_t capacity) const noexcept
10172 {
10173 return mImpl->queryKeys(keyBuffer, capacity);
10174 }
10175
10188 TimingCacheValue query(TimingCacheKey const& key) const noexcept
10189 {
10190 return mImpl->query(key);
10191 }
10192
10210 bool update(TimingCacheKey const& key, TimingCacheValue const& value) noexcept
10211 {
10212 return mImpl->update(key, value);
10213 }
10214
10215protected:
10216 apiv::VTimingCache* mImpl;
10217};
10218
10226enum class MemoryPoolType : int32_t
10227{
10234 kWORKSPACE = 0,
10235
10243
10249 kDLA_LOCAL_DRAM = 2,
10250
10256 kDLA_GLOBAL_DRAM = 3,
10257
10265 kTACTIC_DRAM = 4,
10266
10280};
10281
10287template <>
10288constexpr inline int32_t EnumMax<MemoryPoolType>() noexcept
10289{
10290 return 6;
10291}
10292
10301enum class PreviewFeature : int32_t
10302{
10309
10314
10321};
10322
10323namespace impl
10324{
10330template <>
10332{
10333 static constexpr int32_t kVALUE = 3;
10334};
10335} // namespace impl
10336
10345enum class HardwareCompatibilityLevel : int32_t
10346{
10349 kNONE = 0,
10350
10362 kAMPERE_PLUS = 1,
10363
10373};
10374
10375namespace impl
10376{
10382template <>
10384{
10385 static constexpr int32_t kVALUE = 3;
10386};
10387} // namespace impl
10388
10389
10398enum class TilingOptimizationLevel : int32_t
10399{
10401 kNONE = 0,
10402
10404 kFAST = 1,
10405
10408 kMODERATE = 2,
10409
10411 kFULL = 3
10412
10413};
10414
10415namespace impl
10416{
10422template <>
10424{
10425 static constexpr int32_t kVALUE = 4;
10426};
10427} // namespace impl
10428
10429namespace v_1_0
10430{
10432{
10433public:
10434 IProgressMonitor() = default;
10435 virtual ~IProgressMonitor() noexcept = default;
10436
10440 InterfaceInfo getInterfaceInfo() const noexcept override
10441 {
10442 return InterfaceInfo{"IProgressMonitor", 1, 0};
10443 }
10444
10464 virtual void phaseStart(char const* phaseName, char const* parentPhase, int32_t nbSteps) noexcept = 0;
10465
10478 virtual bool stepComplete(char const* phaseName, int32_t step) noexcept = 0;
10479
10491 virtual void phaseFinish(char const* phaseName) noexcept = 0;
10492
10493}; // class IProgressMonitor
10494} // namespace v_1_0
10495
10516
10525{
10526public:
10527 virtual ~IBuilderConfig() noexcept = default;
10528
10537 virtual void setAvgTimingIterations(int32_t avgTiming) noexcept
10538 {
10539 mImpl->setAvgTimingIterations(avgTiming);
10540 }
10541
10549 int32_t getAvgTimingIterations() const noexcept
10550 {
10551 return mImpl->getAvgTimingIterations();
10552 }
10553
10562 void setEngineCapability(EngineCapability capability) noexcept
10563 {
10564 mImpl->setEngineCapability(capability);
10565 }
10566
10575 {
10576 return mImpl->getEngineCapability();
10577 }
10578
10587 {
10588 mImpl->setInt8Calibrator(calibrator);
10589 }
10590
10597 {
10598 return mImpl->getInt8Calibrator();
10599 }
10600
10613 void setFlags(BuilderFlags builderFlags) noexcept
10614 {
10615 mImpl->setFlags(builderFlags);
10616 }
10617
10625 BuilderFlags getFlags() const noexcept
10626 {
10627 return mImpl->getFlags();
10628 }
10629
10637 void clearFlag(BuilderFlag builderFlag) noexcept
10638 {
10639 mImpl->clearFlag(builderFlag);
10640 }
10641
10649 void setFlag(BuilderFlag builderFlag) noexcept
10650 {
10651 mImpl->setFlag(builderFlag);
10652 }
10653
10661 bool getFlag(BuilderFlag builderFlag) const noexcept
10662 {
10663 return mImpl->getFlag(builderFlag);
10664 }
10665
10678 void setDeviceType(ILayer const* layer, DeviceType deviceType) noexcept
10679 {
10680 mImpl->setDeviceType(layer, deviceType);
10681 }
10682
10688 DeviceType getDeviceType(ILayer const* layer) const noexcept
10689 {
10690 return mImpl->getDeviceType(layer);
10691 }
10692
10700 bool isDeviceTypeSet(ILayer const* layer) const noexcept
10701 {
10702 return mImpl->isDeviceTypeSet(layer);
10703 }
10704
10710 void resetDeviceType(ILayer const* layer) noexcept
10711 {
10712 mImpl->resetDeviceType(layer);
10713 }
10714
10720 bool canRunOnDLA(ILayer const* layer) const noexcept
10721 {
10722 return mImpl->canRunOnDLA(layer);
10723 }
10724
10736 void setDLACore(int32_t dlaCore) noexcept
10737 {
10738 mImpl->setDLACore(dlaCore);
10739 }
10740
10746 int32_t getDLACore() const noexcept
10747 {
10748 return mImpl->getDLACore();
10749 }
10750
10757 void setDefaultDeviceType(DeviceType deviceType) noexcept
10758 {
10759 mImpl->setDefaultDeviceType(deviceType);
10760 }
10761
10768 {
10769 return mImpl->getDefaultDeviceType();
10770 }
10771
10777 void reset() noexcept
10778 {
10779 mImpl->reset();
10780 }
10781
10789 void setProfileStream(const cudaStream_t stream) noexcept
10790 {
10791 return mImpl->setProfileStream(stream);
10792 }
10793
10801 cudaStream_t getProfileStream() const noexcept
10802 {
10803 return mImpl->getProfileStream();
10804 }
10805
10818 int32_t addOptimizationProfile(IOptimizationProfile const* profile) noexcept
10819 {
10820 return mImpl->addOptimizationProfile(profile);
10821 }
10822
10831 int32_t getNbOptimizationProfiles() const noexcept
10832 {
10833 return mImpl->getNbOptimizationProfiles();
10834 }
10835
10844 {
10845 mImpl->setProfilingVerbosity(verbosity);
10846 }
10847
10857 {
10858 return mImpl->getProfilingVerbosity();
10859 }
10860
10869 {
10870 mImpl->setAlgorithmSelector(selector);
10871 }
10872
10879 {
10880 return mImpl->getAlgorithmSelector();
10881 }
10882
10897 {
10898 return mImpl->setCalibrationProfile(profile);
10899 }
10900
10909 {
10910 return mImpl->getCalibrationProfile();
10911 }
10912
10928 {
10929 mImpl->setQuantizationFlags(flags);
10930 }
10931
10942 {
10943 return mImpl->getQuantizationFlags();
10944 }
10945
10956 {
10957 mImpl->clearQuantizationFlag(flag);
10958 }
10959
10970 {
10971 mImpl->setQuantizationFlag(flag);
10972 }
10973
10984 {
10985 return mImpl->getQuantizationFlag(flag);
10986 }
10987
11005 bool setTacticSources(TacticSources tacticSources) noexcept
11006 {
11007 return mImpl->setTacticSources(tacticSources);
11008 }
11009
11021 {
11022 return mImpl->getTacticSources();
11023 }
11024
11040 nvinfer1::ITimingCache* createTimingCache(void const* blob, std::size_t size) const noexcept
11041 {
11042 return mImpl->createTimingCache(blob, size);
11043 }
11044
11063 bool setTimingCache(ITimingCache const& cache, bool ignoreMismatch) noexcept
11064 {
11065 return mImpl->setTimingCache(cache, ignoreMismatch);
11066 }
11067
11074 {
11075 return mImpl->getTimingCache();
11076 }
11077
11105 void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
11106 {
11107 mImpl->setMemoryPoolLimit(pool, poolSize);
11108 }
11109
11124 std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
11125 {
11126 return mImpl->getMemoryPoolLimit(pool);
11127 }
11128
11142 void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
11143 {
11144 mImpl->setPreviewFeature(feature, enable);
11145 }
11146
11156 bool getPreviewFeature(PreviewFeature feature) const noexcept
11157 {
11158 return mImpl->getPreviewFeature(feature);
11159 }
11160
11189 void setBuilderOptimizationLevel(int32_t level) noexcept
11190 {
11191 mImpl->setBuilderOptimizationLevel(level);
11192 }
11193
11202 {
11203 return mImpl->getBuilderOptimizationLevel();
11204 }
11205
11218 void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
11219 {
11220 mImpl->setHardwareCompatibilityLevel(hardwareCompatibilityLevel);
11221 }
11222
11232 {
11233 return mImpl->getHardwareCompatibilityLevel();
11234 }
11235
11244 void setPluginsToSerialize(char const* const* paths, int32_t nbPaths) noexcept
11245 {
11246 mImpl->setPluginsToSerialize(paths, nbPaths);
11247 }
11248
11257 char const* getPluginToSerialize(int32_t index) const noexcept
11258 {
11259 return mImpl->getPluginToSerialize(index);
11260 }
11261
11267 int32_t getNbPluginsToSerialize() const noexcept
11268 {
11269 return mImpl->getNbPluginsToSerialize();
11270 }
11271
11296 void setMaxAuxStreams(int32_t nbStreams) noexcept
11297 {
11298 mImpl->setMaxAuxStreams(nbStreams);
11299 }
11300
11306 int32_t getMaxAuxStreams() const noexcept
11307 {
11308 return mImpl->getMaxAuxStreams();
11309 }
11310
11322 void setProgressMonitor(IProgressMonitor* monitor) noexcept
11323 {
11324 return mImpl->setProgressMonitor(monitor);
11325 }
11326
11333 {
11334 return mImpl->getProgressMonitor();
11335 }
11336
11348 void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
11349 {
11350 mImpl->setRuntimePlatform(runtimePlatform);
11351 }
11352
11361 {
11362 return mImpl->getRuntimePlatform();
11363 }
11364
11372 void setMaxNbTactics(int32_t maxNbTactics) noexcept
11373 {
11374 mImpl->setMaxNbTactics(maxNbTactics);
11375 }
11376
11384 int32_t getMaxNbTactics() const noexcept
11385 {
11386 return mImpl->getMaxNbTactics();
11387 }
11388
11401 {
11402 return mImpl->setTilingOptimizationLevel(level);
11403 }
11404
11413 {
11414 return mImpl->getTilingOptimizationLevel();
11415 }
11416
11428 bool setL2LimitForTiling(int64_t size) noexcept
11429 {
11430 return mImpl->setL2LimitForTiling(size);
11431 }
11432
11440 int64_t getL2LimitForTiling() const noexcept
11441 {
11442 return mImpl->getL2LimitForTiling();
11443 }
11444
11454 bool setRemoteAutoTuningConfig(char const* config) noexcept
11455 {
11456 return mImpl->setRemoteAutoTuningConfig(config);
11457 }
11458
11464 char const* getRemoteAutoTuningConfig() const noexcept
11465 {
11466 return mImpl->getRemoteAutoTuningConfig();
11467 }
11468
11469protected:
11470 apiv::VBuilderConfig* mImpl;
11471};
11472
11481
11491{
11496
11501 kSTRONGLY_TYPED = 1,
11506
11511};
11512
11518template <>
11519constexpr inline int32_t EnumMax<NetworkDefinitionCreationFlag>() noexcept
11520{
11521 return 4;
11522}
11523
11531class IBuilder : public INoCopy
11532{
11533public:
11534 virtual ~IBuilder() noexcept = default;
11535
11541 TRT_DEPRECATED bool platformHasFastFp16() const noexcept
11542 {
11543 return mImpl->platformHasFastFp16();
11544 }
11545
11552 {
11553 return mImpl->platformHasFastInt8();
11554 }
11555
11563 int32_t getMaxDLABatchSize() const noexcept
11564 {
11565 return mImpl->getMaxDLABatchSize();
11566 }
11567
11571 int32_t getNbDLACores() const noexcept
11572 {
11573 return mImpl->getNbDLACores();
11574 }
11575
11589 void setGpuAllocator(IGpuAllocator* allocator) noexcept
11590 {
11591 mImpl->setGpuAllocator(allocator);
11592 }
11593
11604 {
11605 return mImpl->createBuilderConfig();
11606 }
11607
11630 {
11631 return mImpl->createNetworkV2(flags);
11632 }
11633
11645 {
11646 return mImpl->createOptimizationProfile();
11647 }
11648
11663 void setErrorRecorder(IErrorRecorder* recorder) noexcept
11664 {
11665 mImpl->setErrorRecorder(recorder);
11666 }
11667
11679 {
11680 return mImpl->getErrorRecorder();
11681 }
11682
11686 void reset() noexcept
11687 {
11688 mImpl->reset();
11689 }
11690
11696 TRT_DEPRECATED bool platformHasTf32() const noexcept
11697 {
11698 return mImpl->platformHasTf32();
11699 }
11700
11716 {
11717 return mImpl->buildSerializedNetwork(network, config);
11718 }
11719
11737 INetworkDefinition& network, IBuilderConfig& config, IStreamWriter& writer) noexcept
11738 {
11739 return mImpl->buildSerializedNetworkToStream(network, config, writer);
11740 }
11741
11761 INetworkDefinition& network, IBuilderConfig& config, IHostMemory*& kernelText) noexcept
11762 {
11763 return mImpl->buildSerializedNetworkWithKernelText(network, config, kernelText);
11764 }
11765
11782 {
11783 return mImpl->buildEngineWithConfig(network, config);
11784 }
11785
11803 bool isNetworkSupported(INetworkDefinition const& network, IBuilderConfig const& config) const noexcept
11804 {
11805 return mImpl->isNetworkSupported(network, config);
11806 }
11807
11813 ILogger* getLogger() const noexcept
11814 {
11815 return mImpl->getLogger();
11816 }
11817
11829 bool setMaxThreads(int32_t maxThreads) noexcept
11830 {
11831 return mImpl->setMaxThreads(maxThreads);
11832 }
11833
11843 int32_t getMaxThreads() const noexcept
11844 {
11845 return mImpl->getMaxThreads();
11846 }
11847
11854 {
11855 return mImpl->getPluginRegistry();
11856 }
11857
11858protected:
11859 apiv::VBuilder* mImpl;
11860};
11861
11862} // namespace nvinfer1
11863
11868extern "C" TENSORRTAPI void* createInferBuilder_INTERNAL(void* logger, int32_t version) noexcept;
11869
11870namespace nvinfer1
11871{
11872namespace
11873{
11874
11882inline IBuilder* createInferBuilder(ILogger& logger) noexcept
11883{
11884 return static_cast<IBuilder*>(createInferBuilder_INTERNAL(&logger, NV_TENSORRT_VERSION));
11885}
11886
11887} // namespace
11888
11901 nvinfer1::EngineCapability capability) noexcept;
11902
11903namespace safe
11904{
11906class IPluginRegistry;
11907} // namespace safe
11908
11916extern "C" TRT_DEPRECATED_API nvinfer1::safe::IPluginRegistry* getBuilderSafePluginRegistry(
11917 nvinfer1::EngineCapability capability) noexcept;
11918
11919} // namespace nvinfer1
11920
11921#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_NODISCARD
A stand-in for [[nodiscard]] and [[nodiscard(REASON)]] that works with older compilers.
Definition: NvInferRuntimeBase.h:57
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
Definition: NvInferRuntimeBase.h: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:1387
void setBeta(float beta) noexcept
Set the beta parameter (must be finite).
Definition: NvInfer.h:1435
void setActivationType(ActivationType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1396
ActivationType getActivationType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1406
float getAlpha() const noexcept
Get the alpha parameter.
Definition: NvInfer.h:1444
virtual ~IActivationLayer() noexcept=default
float getBeta() const noexcept
Get the beta parameter.
Definition: NvInfer.h:1453
void setAlpha(float alpha) noexcept
Set the alpha parameter (must be finite).
Definition: NvInfer.h:1421
Describes the context and requirements, that could be fulfilled by one or more instances of IAlgorith...
Definition: NvInfer.h:9592
int32_t getNbOutputs() const noexcept
Return number of outputs of the algorithm.
Definition: NvInfer.h:9627
int32_t getNbInputs() const noexcept
Return number of inputs of the algorithm.
Definition: NvInfer.h:9619
char const * getName() const noexcept
Return name of the algorithm node.
Definition: NvInfer.h:9599
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:9611
Describes a variation of execution of a layer. An algorithm is represented by IAlgorithmVariant and t...
Definition: NvInfer.h:9651
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:9672
float getTimingMSec() const noexcept
The time in milliseconds to execute the algorithm.
Definition: NvInfer.h:9664
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:9686
virtual ~IAlgorithm() noexcept=default
IAlgorithmVariant const & getAlgorithmVariant() const noexcept
Returns the algorithm variant.
Definition: NvInfer.h:9656
Carries information about input or output of the algorithm. IAlgorithmIOInfo for all the input and ou...
Definition: NvInfer.h:9495
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:9523
Dims getStrides() const noexcept
Return strides of the input/output tensor of algorithm. For vectorized formats, strides are given in ...
Definition: NvInfer.h:9513
DataType getDataType() const noexcept
Return DataType of the input/output of algorithm.
Definition: NvInfer.h:9502
int64_t getComponentsPerElement() const noexcept
Return the number of components per element. This is always 1 for non-vectorized formats.
Definition: NvInfer.h:9534
provides a unique 128-bit identifier, which along with the input and output information denotes the v...
Definition: NvInfer.h:9558
virtual ~IAlgorithmVariant() noexcept=default
int64_t getTactic() const noexcept
Return tactic of the algorithm.
Definition: NvInfer.h:9571
int64_t getImplementation() const noexcept
Return implementation of the algorithm.
Definition: NvInfer.h:9563
An assertion layer in a network.
Definition: NvInfer.h:5056
void setMessage(char const *message) noexcept
Set the message to print if the assertion fails.
Definition: NvInfer.h:5066
char const * getMessage() const noexcept
Return the assertion message.
Definition: NvInfer.h:5076
virtual ~IAssertionLayer() noexcept=default
This is a base class for Attention boundary layers.
Definition: NvInfer.h:6881
IAttention * getAttention() const noexcept
Get a pointer to the IAttention associated with this boundary layer.
Definition: NvInfer.h:6886
virtual ~IAttentionBoundaryLayer() noexcept=default
Helper for constructing an attention that consumes query, key and value tensors.
Definition: NvInfer.h:6999
ITensor * getMask() noexcept
Get the optional mask in attention.
Definition: NvInfer.h:7049
bool setMetadata(char const *metadata) noexcept
Set the metadata for IAttention.
Definition: NvInfer.h:7260
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:7086
bool setName(char const *name) noexcept
Set the name of the attention.
Definition: NvInfer.h:7176
bool getDecomposable() const noexcept
Get whether the attention can be decomposed to use multiple kernels if no fused kernel support found.
Definition: NvInfer.h:7099
ITensor * getInput(int32_t index) const noexcept
Get the IAttention input corresponding to the given index.
Definition: NvInfer.h:7139
ITensor * getOutput(int32_t index) const noexcept
Get the IAttention output corresponding to the given index. IAttention has only one output.
Definition: NvInfer.h:7159
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer. IAttention has one output.
Definition: NvInfer.h:7147
int32_t getNbInputs() const noexcept
Get the number of inputs of IAttention. IAttention has three inputs.
Definition: NvInfer.h:7127
bool setCausal(bool isCausal) noexcept
Set whether the attention will run a causal inference. Cannot be used together with setMask().
Definition: NvInfer.h:7062
bool setNormalizationOperation(AttentionNormalizationOp op) noexcept
Set the normalization operation for the attention.
Definition: NvInfer.h:7008
char const * getName() const noexcept
Return the name of the attention.
Definition: NvInfer.h:7188
bool setNormalizationQuantizeToType(DataType type) noexcept
Set the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7228
AttentionNormalizationOp getNormalizationOperation() const noexcept
Get the normalization operation for the attention.
Definition: NvInfer.h:7020
bool setNormalizationQuantizeScale(ITensor &tensor) noexcept
Set the quantization scale for the attention normalization output.
Definition: NvInfer.h:7204
char const * getMetadata() const noexcept
Get the metadata of IAttention.
Definition: NvInfer.h:7273
DataType getNormalizationQuantizeToType() const noexcept
Get the datatype the attention normalization is quantized to.
Definition: NvInfer.h:7240
ITensor * getNormalizationQuantizeScale() const noexcept
Get the quantization scale for the attention normalization output.
Definition: NvInfer.h:7215
bool setInput(int32_t index, ITensor &input) noexcept
Append or replace an input of this layer with a specific tensor.
Definition: NvInfer.h:7118
bool setMask(ITensor &mask) noexcept
Set whether a mask will be used for the normalization operation.
Definition: NvInfer.h:7037
bool getCausal() const noexcept
Get whether the attention will run a causal inference.
Definition: NvInfer.h:7074
apiv::VAttention * mImpl
Definition: NvInfer.h:7280
virtual ~IAttention() noexcept=default
This layer represents an input to an attention subgraph.
Definition: NvInfer.h:6907
virtual ~IAttentionInputLayer() noexcept=default
This layer represents an output of an IAttention.
Definition: NvInfer.h:6942
virtual ~IAttentionOutputLayer() noexcept=default
Holds properties for configuring a builder to produce an engine.
Definition: NvInfer.h:10525
void setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) noexcept
Set the memory size for the memory pool.
Definition: NvInfer.h:11105
TRT_DEPRECATED void setQuantizationFlags(QuantizationFlags flags) noexcept
Set the quantization flags.
Definition: NvInfer.h:10927
nvinfer1::ITimingCache * createTimingCache(void const *blob, std::size_t size) const noexcept
Create timing cache.
Definition: NvInfer.h:11040
void setPreviewFeature(PreviewFeature feature, bool enable) noexcept
Enable or disable a specific preview feature.
Definition: NvInfer.h:11142
TRT_DEPRECATED void setAlgorithmSelector(IAlgorithmSelector *selector) noexcept
Set Algorithm Selector.
Definition: NvInfer.h:10868
TRT_DEPRECATED void setInt8Calibrator(IInt8Calibrator *calibrator) noexcept
Set Int8 Calibration interface.
Definition: NvInfer.h:10586
bool getPreviewFeature(PreviewFeature feature) const noexcept
Get status of preview feature.
Definition: NvInfer.h:11156
int32_t getBuilderOptimizationLevel() noexcept
Get builder optimization level.
Definition: NvInfer.h:11201
bool setTacticSources(TacticSources tacticSources) noexcept
Set tactic sources.
Definition: NvInfer.h:11005
void setPluginsToSerialize(char const *const *paths, int32_t nbPaths) noexcept
Set the plugin libraries to be serialized with version-compatible engines.
Definition: NvInfer.h:11244
bool setTilingOptimizationLevel(TilingOptimizationLevel level) noexcept
Set the Tiling optimization level.
Definition: NvInfer.h:11400
bool setL2LimitForTiling(int64_t size) noexcept
Set the L2 cache usage limit for Tiling optimization.
Definition: NvInfer.h:11428
TRT_DEPRECATED IInt8Calibrator * getInt8Calibrator() const noexcept
Get Int8 Calibration interface.
Definition: NvInfer.h:10596
std::size_t getMemoryPoolLimit(MemoryPoolType pool) const noexcept
Get the memory size limit of the memory pool.
Definition: NvInfer.h:11124
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInfer.h:10746
int32_t getNbPluginsToSerialize() const noexcept
Get the number of plugin library paths to be serialized with version-compatible engines.
Definition: NvInfer.h:11267
void setDeviceType(ILayer const *layer, DeviceType deviceType) noexcept
Set the device that this layer must execute on.
Definition: NvInfer.h:10678
void setEngineCapability(EngineCapability capability) noexcept
Configure the builder to target specified EngineCapability flow.
Definition: NvInfer.h:10562
int32_t getMaxAuxStreams() const noexcept
Get the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11306
bool getFlag(BuilderFlag builderFlag) const noexcept
Returns true if the build mode flag is set.
Definition: NvInfer.h:10661
void setMaxNbTactics(int32_t maxNbTactics) noexcept
Set the maximum number of tactics to time when there is a choice of tactics.
Definition: NvInfer.h:11372
TRT_DEPRECATED void clearQuantizationFlag(QuantizationFlag flag) noexcept
clear a quantization flag.
Definition: NvInfer.h:10955
int64_t getL2LimitForTiling() const noexcept
Get the L2 cache usage limit for tiling optimization.
Definition: NvInfer.h:11440
bool setRemoteAutoTuningConfig(char const *config) noexcept
Set a config string for remote auto tuning.
Definition: NvInfer.h:11454
void setProgressMonitor(IProgressMonitor *monitor) noexcept
Sets the progress monitor for building a network.
Definition: NvInfer.h:11322
void setProfilingVerbosity(ProfilingVerbosity verbosity) noexcept
Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10843
int32_t getNbOptimizationProfiles() const noexcept
Get number of optimization profiles.
Definition: NvInfer.h:10831
nvinfer1::ITimingCache const * getTimingCache() const noexcept
Get the pointer to the timing cache from current IBuilderConfig.
Definition: NvInfer.h:11073
void reset() noexcept
Resets the builder configuration to defaults.
Definition: NvInfer.h:10777
bool setTimingCache(ITimingCache const &cache, bool ignoreMismatch) noexcept
Attach a timing cache to IBuilderConfig.
Definition: NvInfer.h:11063
char const * getPluginToSerialize(int32_t index) const noexcept
Get the plugin library path to be serialized with version-compatible engines.
Definition: NvInfer.h:11257
EngineCapability getEngineCapability() const noexcept
Query EngineCapability flow configured for the builder.
Definition: NvInfer.h:10574
RuntimePlatform getRuntimePlatform() const noexcept
Get the target platform for runtime execution.
Definition: NvInfer.h:11360
DeviceType getDefaultDeviceType() const noexcept
Get the default DeviceType which was set by setDefaultDeviceType.
Definition: NvInfer.h:10767
void setRuntimePlatform(RuntimePlatform runtimePlatform) noexcept
Set the target platform for runtime execution.
Definition: NvInfer.h:11348
int32_t getMaxNbTactics() const noexcept
Query the maximum number of tactics timed when there is a choice.
Definition: NvInfer.h:11384
BuilderFlags getFlags() const noexcept
Get the build mode flags for this builder config. Defaults to 0.
Definition: NvInfer.h:10625
void setFlags(BuilderFlags builderFlags) noexcept
Set the build mode flags to turn on builder options for this network.
Definition: NvInfer.h:10613
TacticSources getTacticSources() const noexcept
Get tactic sources.
Definition: NvInfer.h:11020
void resetDeviceType(ILayer const *layer) noexcept
reset the DeviceType for this layer
Definition: NvInfer.h:10710
void setDLACore(int32_t dlaCore) noexcept
Sets the DLA core used by the network. Defaults to -1.
Definition: NvInfer.h:10736
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Get the hardware compatibility level.
Definition: NvInfer.h:11231
char const * getRemoteAutoTuningConfig() const noexcept
Get a config string for remote auto tuning.
Definition: NvInfer.h:11464
TRT_DEPRECATED QuantizationFlags getQuantizationFlags() const noexcept
Get the quantization flags.
Definition: NvInfer.h:10941
void clearFlag(BuilderFlag builderFlag) noexcept
clear a single build mode flag.
Definition: NvInfer.h:10637
int32_t addOptimizationProfile(IOptimizationProfile const *profile) noexcept
Add an optimization profile.
Definition: NvInfer.h:10818
IProgressMonitor * getProgressMonitor() const noexcept
Definition: NvInfer.h:11332
apiv::VBuilderConfig * mImpl
Definition: NvInfer.h:11470
TRT_DEPRECATED IOptimizationProfile const * getCalibrationProfile() noexcept
Get the current calibration profile.
Definition: NvInfer.h:10908
int32_t getAvgTimingIterations() const noexcept
Query the number of averaging iterations.
Definition: NvInfer.h:10549
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:10757
void setFlag(BuilderFlag builderFlag) noexcept
Set a single build mode flag.
Definition: NvInfer.h:10649
TRT_DEPRECATED bool setCalibrationProfile(IOptimizationProfile const *profile) noexcept
Add a calibration profile.
Definition: NvInfer.h:10896
virtual ~IBuilderConfig() noexcept=default
DeviceType getDeviceType(ILayer const *layer) const noexcept
Get the device that this layer executes on.
Definition: NvInfer.h:10688
bool canRunOnDLA(ILayer const *layer) const noexcept
Checks if a layer can run on DLA.
Definition: NvInfer.h:10720
TRT_DEPRECATED bool getQuantizationFlag(QuantizationFlag flag) const noexcept
Returns true if the quantization flag is set.
Definition: NvInfer.h:10983
cudaStream_t getProfileStream() const noexcept
Get the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10801
void setHardwareCompatibilityLevel(HardwareCompatibilityLevel hardwareCompatibilityLevel) noexcept
Set the hardware compatibility level.
Definition: NvInfer.h:11218
TilingOptimizationLevel getTilingOptimizationLevel() const noexcept
Get the Tiling optimization level.
Definition: NvInfer.h:11412
TRT_DEPRECATED void setQuantizationFlag(QuantizationFlag flag) noexcept
Set a single quantization flag.
Definition: NvInfer.h:10969
void setMaxAuxStreams(int32_t nbStreams) noexcept
Set the maximum number of auxiliary streams that TRT is allowed to use.
Definition: NvInfer.h:11296
ProfilingVerbosity getProfilingVerbosity() const noexcept
Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
Definition: NvInfer.h:10856
bool isDeviceTypeSet(ILayer const *layer) const noexcept
whether the DeviceType has been explicitly set for this layer
Definition: NvInfer.h:10700
void setBuilderOptimizationLevel(int32_t level) noexcept
Set builder optimization level.
Definition: NvInfer.h:11189
void setProfileStream(const cudaStream_t stream) noexcept
Set the CUDA stream that is used to profile this network.
Definition: NvInfer.h:10789
TRT_DEPRECATED IAlgorithmSelector * getAlgorithmSelector() const noexcept
Get Algorithm Selector.
Definition: NvInfer.h:10878
Builds an engine from a network definition.
Definition: NvInfer.h:11532
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:11563
int32_t getNbDLACores() const noexcept
Return the number of DLA engines available to this builder.
Definition: NvInfer.h:11571
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:11678
apiv::VBuilder * mImpl
Definition: NvInfer.h:11859
ILogger * getLogger() const noexcept
get the logger with which the builder was created
Definition: NvInfer.h:11813
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:11803
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the builder.
Definition: NvInfer.h:11843
IPluginRegistry & getPluginRegistry() noexcept
get the local plugin registry that can be used by the builder.
Definition: NvInfer.h:11853
TRT_DEPRECATED bool platformHasFastInt8() const noexcept
Determine whether the platform has fast native int8.
Definition: NvInfer.h:11551
nvinfer1::IOptimizationProfile * createOptimizationProfile() noexcept
Create a new optimization profile.
Definition: NvInfer.h:11644
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInfer.h:11589
nvinfer1::INetworkDefinition * createNetworkV2(NetworkDefinitionCreationFlags flags) noexcept
Create a network definition object.
Definition: NvInfer.h:11629
nvinfer1::IBuilderConfig * createBuilderConfig() noexcept
Create a builder configuration object.
Definition: NvInfer.h:11603
void reset() noexcept
Resets the builder state to default values.
Definition: NvInfer.h:11686
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInfer.h:11829
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:11663
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11715
virtual ~IBuilder() noexcept=default
TRT_DEPRECATED bool platformHasTf32() const noexcept
Determine whether the platform has TF32 support.
Definition: NvInfer.h:11696
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:11736
nvinfer1::ICudaEngine * buildEngineWithConfig(INetworkDefinition &network, IBuilderConfig &config) noexcept
Builds a network for the given INetworkDefinition and IBuilderConfig.
Definition: NvInfer.h:11781
nvinfer1::IHostMemory * buildSerializedNetwork(INetworkDefinition &network, IBuilderConfig &config, IHostMemory *&kernelText) noexcept
Extended form of buildSerializedNetwork that optionally permits getting the kernelText.
Definition: NvInfer.h:11760
A cast layer in a network.
Definition: NvInfer.h:3917
virtual ~ICastLayer() noexcept=default
apiv::VCastLayer * mImpl
Definition: NvInfer.h:3943
DataType getToType() const noexcept
Return cast layer output type.
Definition: NvInfer.h:3937
void setToType(DataType toType) noexcept
Set cast layer output type.
Definition: NvInfer.h:3926
A concatenation layer in a network definition.
Definition: NvInfer.h:2097
void setAxis(int32_t axis) noexcept
Set the axis along which concatenation occurs.
Definition: NvInfer.h:2110
int32_t getAxis() const noexcept
Get the axis along which concatenation occurs.
Definition: NvInfer.h:2120
virtual ~IConcatenationLayer() noexcept=default
This layer represents a condition input to an IIfConditional.
Definition: NvInfer.h:4580
virtual ~IConditionLayer() noexcept=default
Layer that represents a constant value.
Definition: NvInfer.h:3956
void setWeights(Weights weights) noexcept
Set the weights for the layer.
Definition: NvInfer.h:3966
Weights getWeights() const noexcept
Get the weights for the layer.
Definition: NvInfer.h:3976
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions for the layer.
Definition: NvInfer.h:3988
apiv::VConstantLayer * mImpl
Definition: NvInfer.h:4006
virtual ~IConstantLayer() noexcept=default
Dims getDimensions() const noexcept
Get the dimensions for the layer.
Definition: NvInfer.h:4000
A convolution layer in a network definition.
Definition: NvInfer.h:1067
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1192
Weights getBiasWeights() const noexcept
Get the bias weights for the convolution.
Definition: NvInfer.h:1165
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1233
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1337
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the convolution.
Definition: NvInfer.h:1323
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the convolution.
Definition: NvInfer.h:1293
Weights getKernelWeights() const noexcept
Get the kernel weights of the convolution.
Definition: NvInfer.h:1140
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the convolution.
Definition: NvInfer.h:1283
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the convolution.
Definition: NvInfer.h:1347
int64_t getNbOutputMaps() const noexcept
Get the number of output maps for the convolution.
Definition: NvInfer.h:1086
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the convolution.
Definition: NvInfer.h:1130
Dims getPostPadding() const noexcept
Get the post-padding.
Definition: NvInfer.h:1219
int64_t getNbGroups() const noexcept
Get the number of groups of the convolution.
Definition: NvInfer.h:1116
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1245
virtual ~IConvolutionLayer() noexcept=default
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a convolution.
Definition: NvInfer.h:1106
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output maps for the convolution.
Definition: NvInfer.h:1076
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the convolution.
Definition: NvInfer.h:1155
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1268
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the convolution.
Definition: NvInfer.h:1311
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the convolution.
Definition: NvInfer.h:1182
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the convolution.
Definition: NvInfer.h:1209
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the convolution.
Definition: NvInfer.h:1258
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:6763
bool setOperation(CumulativeOperation op) noexcept
Set the cumulative operation for the layer.
Definition: NvInfer.h:6774
void setReverse(bool reverse) noexcept
Specify whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6822
apiv::VCumulativeLayer * mImpl
Definition: NvInfer.h:6840
bool getExclusive() const noexcept
Get whether it is exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6810
virtual ~ICumulativeLayer() noexcept=default
bool getReverse() const noexcept
Get the boolean that specifies whether the cumulative operation should be applied backward.
Definition: NvInfer.h:6834
void setExclusive(bool exclusive) noexcept
Set whether it is an exclusive accumulation or inclusive accumulation.
Definition: NvInfer.h:6798
CumulativeOperation getOperation() const noexcept
Get the cumulative operation for the layer.
Definition: NvInfer.h:6786
A deconvolution layer in a network definition.
Definition: NvInfer.h:2138
void setBiasWeights(Weights weights) noexcept
Set the bias weights for the deconvolution.
Definition: NvInfer.h:2226
int64_t getNbGroups() const noexcept
Get the number of groups for a deconvolution.
Definition: NvInfer.h:2187
Weights getKernelWeights() const noexcept
Get the kernel weights for the deconvolution.
Definition: NvInfer.h:2211
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding of the deconvolution.
Definition: NvInfer.h:2253
Dims getStrideNd() const noexcept
Get the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2368
Dims getDilationNd() const noexcept
Get the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2434
Weights getBiasWeights() const noexcept
Get the bias weights for the deconvolution.
Definition: NvInfer.h:2236
void setKernelWeights(Weights weights) noexcept
Set the kernel weights for the deconvolution.
Definition: NvInfer.h:2201
int64_t getNbOutputMaps() const noexcept
Get the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2157
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride of the deconvolution.
Definition: NvInfer.h:2358
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:2290
Dims getKernelSizeNd() const noexcept
Get the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2341
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding of the deconvolution.
Definition: NvInfer.h:2280
void setKernelSizeNd(Dims const &kernelSize) noexcept
Set the multi-dimension kernel size of the deconvolution.
Definition: NvInfer.h:2331
virtual ~IDeconvolutionLayer() noexcept=default
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2386
void setNbOutputMaps(int64_t nbOutputMaps) noexcept
Set the number of output feature maps for the deconvolution.
Definition: NvInfer.h:2147
Dims getPaddingNd() const noexcept
Get the multi-dimension padding of the deconvolution.
Definition: NvInfer.h:2398
void setDilationNd(Dims const &dilation) noexcept
Set the multi-dimension dilation of the deconvolution.
Definition: NvInfer.h:2424
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:2304
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups for a deconvolution.
Definition: NvInfer.h:2177
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:2263
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:2316
A Dequantize layer in a network definition.
Definition: NvInfer.h:5665
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5714
void setToType(DataType toType) noexcept
Set the Dequantize layer output type.
Definition: NvInfer.h:5730
virtual ~IDequantizeLayer() noexcept=default
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5675
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5703
DataType getToType() const noexcept
Return the Dequantize layer output type.
Definition: NvInfer.h:5742
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5686
A network layer to perform dynamic quantization.
Definition: NvInfer.h:5770
DataType getScaleType() const noexcept
Return the scale factors data type.
Definition: NvInfer.h:5836
TRT_DEPRECATED void setAxis(int32_t axis) noexcept
Set the axis along which block quantization occurs.
Definition: NvInfer.h:5849
TRT_DEPRECATED void setBlockSize(int32_t size) noexcept
Set the size of the quantization block.
Definition: NvInfer.h:5872
Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5907
void setScaleType(DataType scaleType) noexcept
Set the data type of the scale factors used to quantize the data.
Definition: NvInfer.h:5823
DataType getToType() const noexcept
Return DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5810
TRT_DEPRECATED int32_t getAxis() const noexcept
Get the axis along which blocking occurs.
Definition: NvInfer.h:5859
virtual ~IDynamicQuantizeLayer() noexcept=default
void setToType(DataType toType) noexcept
Set DynamicQuantizeLayer's quantized output type.
Definition: NvInfer.h:5797
void setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5895
TRT_DEPRECATED int32_t getBlockSize() const noexcept
Get the size of the quantization block.
Definition: NvInfer.h:5882
An Einsum layer in a network.
Definition: NvInfer.h:5952
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:5963
virtual ~IEinsumLayer() noexcept=default
char const * getEquation() const noexcept
Return the equation.
Definition: NvInfer.h:5973
A elementwise layer in a network definition.
Definition: NvInfer.h:2508
virtual ~IElementWiseLayer() noexcept=default
apiv::VElementWiseLayer * mImpl
Definition: NvInfer.h:2537
ElementWiseOperation getOperation() const noexcept
Get the binary operation for the layer.
Definition: NvInfer.h:2531
void setOperation(ElementWiseOperation op) noexcept
Set the binary operation for the layer.
Definition: NvInfer.h:2519
Generate a tensor according to a specified mode.
Definition: NvInfer.h:5167
bool isAlphaBetaInt64() const noexcept
Return true if alpha/beta have type int64, false if they have type double.
Definition: NvInfer.h:5399
FillOperation getOperation() const noexcept
Get the fill operation for the layer.
Definition: NvInfer.h:5213
void setOperation(FillOperation op) noexcept
Set the fill operation for the layer.
Definition: NvInfer.h:5203
DataType getToType() const noexcept
Get the fill layer output type.
Definition: NvInfer.h:5428
void setAlphaInt64(int64_t alpha) noexcept
Set the alpha parameter with int64 datatype.
Definition: NvInfer.h:5342
void setBetaInt64(int64_t beta) noexcept
Set the beta parameter with int64 datatype.
Definition: NvInfer.h:5376
void setBeta(double beta) noexcept
Set the beta parameter.
Definition: NvInfer.h:5266
int64_t getAlphaInt64() const noexcept
Get the value of alpha parameter with int64 datatype.
Definition: NvInfer.h:5357
int64_t getBetaInt64() const noexcept
Get the value of beta parameter with int64 datatype.
Definition: NvInfer.h:5391
double getAlpha() const noexcept
Get the value of alpha parameter.
Definition: NvInfer.h:5247
void setDimensions(Dims const &dimensions) noexcept
Set the output tensor's dimensions.
Definition: NvInfer.h:5178
void setAlpha(double alpha) noexcept
Set the alpha parameter.
Definition: NvInfer.h:5232
void setToType(DataType toType) noexcept
Set the fill layer output type.
Definition: NvInfer.h:5416
Dims getDimensions() const noexcept
Get the output tensor's dimensions.
Definition: NvInfer.h:5193
double getBeta() const noexcept
Get the value of beta parameter.
Definition: NvInfer.h:5281
virtual ~IFillLayer() noexcept=default
A Gather layer in a network definition. Supports several kinds of gathering.
Definition: NvInfer.h:2641
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:2652
void setNbElementWiseDims(int32_t elementWiseDims) noexcept
Set the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2687
apiv::VGatherLayer * mImpl
Definition: NvInfer.h:2723
int32_t getNbElementWiseDims() const noexcept
Get the number of leading dimensions of indices tensor to be handled elementwise.
Definition: NvInfer.h:2697
void setMode(GatherMode mode) noexcept
Set the gather mode.
Definition: NvInfer.h:2707
int32_t getGatherAxis() const noexcept
Get the axis to gather on.
Definition: NvInfer.h:2664
GatherMode getMode() const noexcept
Get the gather mode.
Definition: NvInfer.h:2717
virtual ~IGatherLayer() noexcept=default
A GridSample layer in a network definition.
Definition: NvInfer.h:6174
void setInterpolationMode(InterpolationMode mode) noexcept
Set the grid sample interpolation mode.
Definition: NvInfer.h:6181
bool setSampleMode(SampleMode mode) noexcept
Set the sample mode.
Definition: NvInfer.h:6227
void setAlignCorners(bool alignCorners) noexcept
Set the align corners mode.
Definition: NvInfer.h:6203
apiv::VGridSampleLayer * mImpl
Definition: NvInfer.h:6245
SampleMode getSampleMode() const noexcept
Get the sample mode.
Definition: NvInfer.h:6239
InterpolationMode getInterpolationMode() const noexcept
Get the grid sample interpolation mode.
Definition: NvInfer.h:6193
bool getAlignCorners() const noexcept
Get the align corners mode.
Definition: NvInfer.h:6215
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:3904
apiv::VIdentityLayer * mImpl
Definition: NvInfer.h:3906
virtual ~IIdentityLayer() noexcept=default
This is a base class for Conditional boundary layers.
Definition: NvInfer.h:4559
IIfConditional * getConditional() const noexcept
Get a pointer to the IIfConditional associated with this boundary layer.
Definition: NvInfer.h:4564
virtual ~IIfConditionalBoundaryLayer() noexcept=default
Helper for constructing conditionally-executed subgraphs.
Definition: NvInfer.h:4642
IIfConditionalInputLayer * addInput(ITensor &input) noexcept
Add an If-conditional input.
Definition: NvInfer.h:4683
char const * getName() const noexcept
Return the name of the conditional.
Definition: NvInfer.h:4708
virtual ~IIfConditional() noexcept=default
IConditionLayer * setCondition(ITensor &condition) noexcept
Set the condition tensor for this If-Conditional construct.
Definition: NvInfer.h:4653
IIfConditionalOutputLayer * addOutput(ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept
Add an If-conditional output.
Definition: NvInfer.h:4671
void setName(char const *name) noexcept
Set the name of the conditional.
Definition: NvInfer.h:4698
This layer represents an input to an IIfConditional.
Definition: NvInfer.h:4610
virtual ~IIfConditionalInputLayer() noexcept=default
This layer represents an output of an IIfConditional.
Definition: NvInfer.h:4597
virtual ~IIfConditionalOutputLayer() noexcept=default
Application-implemented interface for calibration.
Definition: NvInfer.h:9220
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:4873
virtual ~IIteratorLayer() noexcept=default
void setReverse(bool reverse) noexcept
Set iteration order to be reverse.
Definition: NvInfer.h:4900
bool getReverse() const noexcept
Check if the iteration order is reverse.
Definition: NvInfer.h:4910
int32_t getAxis() const noexcept
Get axis being iterated over.
Definition: NvInfer.h:4886
void setAxis(int32_t axis) noexcept
Set axis to iterate over.
Definition: NvInfer.h:4878
Layer that represents a KVCacheUpdate operation.
Definition: NvInfer.h:7403
bool setCacheMode(KVCacheMode cacheMode) noexcept
Set the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7426
virtual ~IKVCacheUpdateLayer() noexcept=default
KVCacheMode getCacheMode() const noexcept
Get the mode of the KVCacheUpdate layer.
Definition: NvInfer.h:7436
apiv::VKVCacheUpdateLayer * mImpl
Definition: NvInfer.h:7442
A LRN layer in a network definition.
Definition: NvInfer.h:1752
int64_t getWindowSize() const noexcept
Get the LRN window size.
Definition: NvInfer.h:1773
float getAlpha() const noexcept
Get the LRN alpha value.
Definition: NvInfer.h:1795
void setWindowSize(int64_t windowSize) noexcept
Set the LRN window size.
Definition: NvInfer.h:1763
void setK(float k) noexcept
Set the LRN K value.
Definition: NvInfer.h:1829
void setAlpha(float alpha) noexcept
Set the LRN alpha value.
Definition: NvInfer.h:1785
void setBeta(float beta) noexcept
Set the LRN beta value.
Definition: NvInfer.h:1807
virtual ~ILRNLayer() noexcept=default
float getBeta() const noexcept
Get the LRN beta value.
Definition: NvInfer.h:1817
float getK() const noexcept
Get the LRN K value.
Definition: NvInfer.h:1839
Base class for all layer classes in a network definition.
Definition: NvInfer.h:582
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:702
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:790
TRT_DEPRECATED bool precisionIsSet() const noexcept
whether the computational precision has been set for this layer
Definition: NvInfer.h:728
void setMetadata(char const *metadata) noexcept
Set the metadata for this layer.
Definition: NvInfer.h:853
TRT_DEPRECATED void resetOutputType(int32_t index) noexcept
reset the output type for this layer
Definition: NvInfer.h:835
void setName(char const *name) noexcept
Set the name of a layer.
Definition: NvInfer.h:603
int32_t getNbInputs() const noexcept
Get the number of inputs of a layer.
Definition: NvInfer.h:621
char const * getMetadata() const noexcept
Get the metadata of the layer.
Definition: NvInfer.h:866
DataType getOutputType(int32_t index) const noexcept
get the output type of this layer
Definition: NvInfer.h:805
DataType getPrecision() const noexcept
get the computational precision of this layer
Definition: NvInfer.h:714
TRT_DEPRECATED bool outputTypeIsSet(int32_t index) const noexcept
whether the output type has been set for this layer
Definition: NvInfer.h:821
char const * getName() const noexcept
Return the name of a layer.
Definition: NvInfer.h:613
int32_t getNbOutputs() const noexcept
Get the number of outputs of a layer.
Definition: NvInfer.h:642
ITensor * getOutput(int32_t index) const noexcept
Get the layer output corresponding to the given index.
Definition: NvInfer.h:652
void setInput(int32_t index, ITensor &tensor) noexcept
Replace an input of this layer with a specific tensor.
Definition: NvInfer.h:669
ITensor * getInput(int32_t index) const noexcept
Get the layer input corresponding to the given index.
Definition: NvInfer.h:634
LayerType getType() const noexcept
Return the type of a layer.
Definition: NvInfer.h:589
TRT_DEPRECATED void resetPrecision() noexcept
reset the computational precision for this layer
Definition: NvInfer.h:740
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:4536
virtual ~ILoopBoundaryLayer() noexcept=default
ILoop * getLoop() const noexcept
Get a pointer to ILoop associated with this boundary layer.
Definition: NvInfer.h:4541
Helper for creating a recurrent subgraph.
Definition: NvInfer.h:4931
void setName(char const *name) noexcept
Set the name of the loop.
Definition: NvInfer.h:5001
ITripLimitLayer * addTripLimit(ITensor &tensor, TripLimit limit) noexcept
Add a trip-count limiter, based on the given tensor.
Definition: NvInfer.h:4960
IIteratorLayer * addIterator(ITensor &tensor, int32_t axis=0, bool reverse=false) noexcept
Return layer that subscripts tensor by loop iteration.
Definition: NvInfer.h:4973
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:4986
virtual ~ILoop() noexcept=default
char const * getName() const noexcept
Return the name of the loop.
Definition: NvInfer.h:5011
IRecurrenceLayer * addRecurrence(ITensor &initialValue) noexcept
Create a recurrence layer for this loop with initialValue as its first input.
Definition: NvInfer.h:4939
An ILoopOutputLayer is the sole way to get output from a loop.
Definition: NvInfer.h:4773
virtual ~ILoopOutputLayer() noexcept=default
int32_t getAxis() const noexcept
Get axis being concatenated over.
Definition: NvInfer.h:4803
LoopOutput getLoopOutput() const noexcept
Get which kind a loop output has.
Definition: NvInfer.h:4778
void setAxis(int32_t axis) noexcept
Set where to insert the contenation axis. Ignored if getLoopOutput() is kLAST_VALUE.
Definition: NvInfer.h:4795
Layer that represents a Matrix Multiplication.
Definition: NvInfer.h:3751
apiv::VMatrixMultiplyLayer * mImpl
Definition: NvInfer.h:3779
virtual ~IMatrixMultiplyLayer() noexcept=default
MatrixOperation getOperation(int32_t index) const noexcept
Get the operation for an input tensor.
Definition: NvInfer.h:3773
void setOperation(int32_t index, MatrixOperation op) noexcept
Set the operation for an input tensor.
Definition: NvInfer.h:3761
A non-maximum suppression layer in a network definition.
Definition: NvInfer.h:6326
virtual ~INMSLayer() noexcept=default
void setTopKBoxLimit(int32_t limit) noexcept
Set the TopK box limit parameter for the layer.
Definition: NvInfer.h:6363
void setBoundingBoxFormat(BoundingBoxFormat fmt) noexcept
Set the bounding box format parameter for the layer.
Definition: NvInfer.h:6337
BoundingBoxFormat getBoundingBoxFormat() const noexcept
Get the bounding box format parameter for the layer.
Definition: NvInfer.h:6349
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:6408
apiv::VNMSLayer * mImpl
Definition: NvInfer.h:6426
int32_t getTopKBoxLimit() const noexcept
Get the TopK box limit parameter for the layer.
Definition: NvInfer.h:6373
DataType getIndicesType() const noexcept
Return the NMS layer indices type.
Definition: NvInfer.h:6420
A network definition for input to the builder.
Definition: NvInfer.h:7464
IConcatenationLayer * addConcatenation(ITensor *const *inputs, int32_t nbInputs) noexcept
Add a concatenation layer to the network.
Definition: NvInfer.h:7692
IShuffleLayer * addShuffle(ITensor &input) noexcept
Add a shuffle layer to the network.
Definition: NvInfer.h:7755
void setName(char const *name) noexcept
Sets the name of the network.
Definition: NvInfer.h:8221
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:7951
bool markDebug(ITensor &tensor) noexcept
Mark a tensor as a debug tensor.
Definition: NvInfer.h:7535
ILRNLayer * addLRN(ITensor &input, int64_t window, float alpha, float beta, float k) noexcept
Add a LRN layer to the network.
Definition: NvInfer.h:7636
ICumulativeLayer * addCumulative(ITensor &input, ITensor &axis, CumulativeOperation operation, bool exclusive, bool reverse) noexcept
Add a cumulative layer to the network.
Definition: NvInfer.h:8969
IAssertionLayer * addAssertion(ITensor &condition, char const *message) noexcept
Add an assertion layer to the network.
Definition: NvInfer.h:8537
TRT_DEPRECATED INonZeroLayer * addNonZero(ITensor &input) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8042
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:8356
ICastLayer * addCast(ITensor &input, DataType toType) noexcept
Add a cast layer.
Definition: NvInfer.h:8111
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:8435
char const * getName() const noexcept
Returns the name associated with the network.
Definition: NvInfer.h:8235
IParametricReLULayer * addParametricReLU(ITensor &input, ITensor &slope) noexcept
Add a parametric ReLU layer to the network.
Definition: NvInfer.h:8334
ITensor * getOutput(int32_t index) const noexcept
Get the output tensor specified by the given index.
Definition: NvInfer.h:7856
ITensor * getInput(int32_t index) const noexcept
Get the input tensor specified by the given index.
Definition: NvInfer.h:7826
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:7918
IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8706
bool unmarkOutputForShapes(ITensor &tensor) noexcept
Undo markOutputForShapes.
Definition: NvInfer.h:8316
IFillLayer * addFill(Dims const &dimensions, FillOperation op, DataType outputType) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:8588
ILoop * addLoop() noexcept
Add a loop to the network.
Definition: NvInfer.h:8466
bool markUnfusedTensorsAsDebugTensors() noexcept
Mark unfused tensors as debug tensors.
Definition: NvInfer.h:7583
TRT_NODISCARD INormalizationLayer * addNormalizationV2(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:9171
IActivationLayer * addActivation(ITensor &input, ActivationType type) noexcept
Add an activation layer to the network.
Definition: NvInfer.h:7617
TRT_DEPRECATED IFillLayer * addFill(Dims const &dimensions, FillOperation op) noexcept
Add a fill layer to the network.
Definition: NvInfer.h:8562
ISliceLayer * addSlice(ITensor &input, Dims const &start, Dims const &size, Dims const &stride) noexcept
Add a slice layer to the network.
Definition: NvInfer.h:8197
virtual ~INetworkDefinition() noexcept=default
TRT_DEPRECATED IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8747
virtual IBuilder & getBuilder() const noexcept
Return the builder from which this INetworkDefinition was created.
Definition: NvInfer.h:9067
ILayer * getLayer(int32_t index) const noexcept
Get the layer specified by the given index.
Definition: NvInfer.h:7798
bool isDebugTensor(ITensor const &tensor) const noexcept
Check if a tensor is marked as debug tensor.
Definition: NvInfer.h:7561
bool getFlag(NetworkDefinitionCreationFlag networkDefinitionCreationFlag) const noexcept
Returns true if the network definition creation flag is set.
Definition: NvInfer.h:8287
IIfConditional * addIfConditional() noexcept
Add an if-then-else to the network.
Definition: NvInfer.h:8481
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInfer.h:8662
ISqueezeLayer * addSqueeze(ITensor &input, ITensor &axes) noexcept
Add a squeeze layer to the network.
Definition: NvInfer.h:9124
TRT_DEPRECATED INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8878
IReverseSequenceLayer * addReverseSequence(ITensor &input, ITensor &sequenceLens) noexcept
Add a ReverseSequence layer to the network.
Definition: NvInfer.h:8915
TRT_DEPRECATED IDynamicQuantizeLayer * addDynamicQuantize(ITensor &input, int32_t axis, int32_t blockSize, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:8798
int32_t getNbInputs() const noexcept
Get the number of inputs in the network.
Definition: NvInfer.h:7810
NetworkDefinitionCreationFlags getFlags() const noexcept
Get the network definition creation flags for this network definition object. Defaults to 0.
Definition: NvInfer.h:8275
IQuantizeLayer * addQuantize(ITensor &input, ITensor &scale, DataType outputType) noexcept
Add a quantization layer to the network.
Definition: NvInfer.h:8771
IDynamicQuantizeLayer * addDynamicQuantizeV2(ITensor &input, Dims const &blockShape, DataType outputType, DataType scaleType) noexcept
Add a dynamic quantization layer to the network.
Definition: NvInfer.h:8822
IReduceLayer * addReduce(ITensor &input, ReduceOperation operation, uint32_t reduceAxes, bool keepDimensions) noexcept
Add a reduce layer to the network.
Definition: NvInfer.h:7882
IUnaryLayer * addUnary(ITensor &input, UnaryOperation operation) noexcept
Add a unary layer to the network.
Definition: NvInfer.h:7741
IGridSampleLayer * addGridSample(ITensor &input, ITensor &grid) noexcept
Add a GridSample layer to the network.
Definition: NvInfer.h:8856
void removeTensor(ITensor &tensor) noexcept
remove a tensor from the network definition.
Definition: NvInfer.h:8126
bool areWeightsMarkedRefittable(char const *name) const noexcept
Whether the weight has been marked as refittable.
Definition: NvInfer.h:9105
ISelectLayer * addSelect(ITensor &condition, ITensor &thenInput, ITensor &elseInput) noexcept
Add a select layer to the network.
Definition: NvInfer.h:8520
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:8726
TRT_DEPRECATED INormalizationLayer * addNormalization(ITensor &input, ITensor &scale, ITensor &bias, uint32_t axesMask) noexcept
Add a normalization layer to the network.
Definition: NvInfer.h:8947
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInfer.h:7784
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
Query whether the network was created with an implicit batch dimension.
Definition: NvInfer.h:8265
apiv::VNetworkDefinition * mImpl
Definition: NvInfer.h:9177
IKVCacheUpdateLayer * addKVCacheUpdate(ITensor &cache, ITensor &update, ITensor &writeIndices, KVCacheMode cacheMode) noexcept
Add a KVCacheUpdate layer to the network.
Definition: NvInfer.h:9055
bool markOutputForShapes(ITensor &tensor) noexcept
Enable tensor's value to be computed by IExecutionContext::getShapeBinding.
Definition: NvInfer.h:8304
IOneHotLayer * addOneHot(ITensor &indices, ITensor &values, ITensor &depth, int32_t axis) noexcept
Add a OneHot layer to the network.
Definition: NvInfer.h:7772
IScaleLayer * addScale(ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power) noexcept
Add a Scale layer to the network.
Definition: NvInfer.h:7662
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:8177
void unmarkOutput(ITensor &tensor) noexcept
unmark a tensor as a network output.
Definition: NvInfer.h:8138
IIdentityLayer * addIdentity(ITensor &input) noexcept
Add an identity layer.
Definition: NvInfer.h:8096
IGatherLayer * addGatherV2(ITensor &data, ITensor &indices, GatherMode mode) noexcept
Add gather with specified mode, axis=0 and nbElementWiseDims=0.
Definition: NvInfer.h:7983
INonZeroLayer * addNonZero(ITensor &input, DataType indicesType) noexcept
Add a nonzero layer to the network.
Definition: NvInfer.h:8058
IElementWiseLayer * addElementWise(ITensor &input1, ITensor &input2, ElementWiseOperation op) noexcept
Add an elementwise layer to the network.
Definition: NvInfer.h:7719
IConstantLayer * addConstant(Dims const &dimensions, Weights weights) noexcept
Add a constant layer to the network.
Definition: NvInfer.h:8082
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInfer.h:8647
IPoolingLayer * addPoolingNd(ITensor &input, PoolingType type, Dims const &windowSize) noexcept
Add a multi-dimension pooling layer to the network.
Definition: NvInfer.h:8376
INMSLayer * addNMS(ITensor &boxes, ITensor &scores, ITensor &maxOutputBoxesPerClass, DataType indicesType) noexcept
Add a non-maximum suppression layer to the network.
Definition: NvInfer.h:8898
IRaggedSoftMaxLayer * addRaggedSoftMax(ITensor &input, ITensor &bounds) noexcept
Add a RaggedSoftMax layer to the network.
Definition: NvInfer.h:8002
IShapeLayer * addShape(ITensor &input) noexcept
Add a shape layer to the network.
Definition: NvInfer.h:8251
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:7967
IAttention * addAttention(ITensor &query, ITensor &key, ITensor &value, AttentionNormalizationOp normOp, bool causal) noexcept
Add an attention to the network.
Definition: NvInfer.h:8996
bool unmarkWeightsRefittable(char const *name) noexcept
Unmark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9092
bool markWeightsRefittable(char const *name) noexcept
Mark weights as refittable when the builder flag kREFIT_INDIVIDUAL is set.
Definition: NvInfer.h:9080
IRotaryEmbeddingLayer * addRotaryEmbedding(ITensor &input, ITensor &cosCache, ITensor &sinCache, bool interleaved, int32_t rotaryEmbeddingDim) noexcept
Add a Rotary Position Embedding (RoPE) layer to the network.
Definition: NvInfer.h:9021
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:8398
IResizeLayer * addResize(ITensor &input) noexcept
Add a resize layer to the network.
Definition: NvInfer.h:8452
IUnsqueezeLayer * addUnsqueeze(ITensor &input, ITensor &axes) noexcept
Add an unsqueeze layer to the network.
Definition: NvInfer.h:9145
IMatrixMultiplyLayer * addMatrixMultiply(ITensor &input0, MatrixOperation op0, ITensor &input1, MatrixOperation op1) noexcept
Add a MatrixMultiply layer to the network.
Definition: NvInfer.h:8023
ISoftMaxLayer * addSoftMax(ITensor &input) noexcept
Add a SoftMax layer to the network.
Definition: NvInfer.h:7675
bool unmarkDebug(ITensor &tensor) noexcept
Unmark a tensor as a debug tensor.
Definition: NvInfer.h:7551
IEinsumLayer * addEinsum(ITensor *const *inputs, int32_t nbInputs, char const *equation) noexcept
Add an Einsum layer to the network.
Definition: NvInfer.h:8838
void markOutput(ITensor &tensor) noexcept
Mark a tensor as a network output.
Definition: NvInfer.h:7517
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:8159
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:8604
TRT_DEPRECATED IDequantizeLayer * addDequantize(ITensor &input, ITensor &scale) noexcept
Add a dequantization layer to the network.
Definition: NvInfer.h:8683
int32_t getNbOutputs() const noexcept
Get the number of outputs in the network.
Definition: NvInfer.h:7840
bool setWeightsName(Weights weights, char const *name) noexcept
Associate a name with all current uses of the given weights.
Definition: NvInfer.h:8628
bool unmarkUnfusedTensorsAsDebugTensors() noexcept
Undo the marking of unfused tensors as debug tensors.
Definition: NvInfer.h:7597
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:51
Definition: NvInfer.h:3805
DataType getIndicesType() const noexcept
Return the NonZero layer indices type.
Definition: NvInfer.h:3829
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3817
virtual ~INonZeroLayer() noexcept=default
A normalization layer in a network definition.
Definition: NvInfer.h:6515
float getEpsilon() const noexcept
Get the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6534
uint32_t getAxes() const noexcept
Get the axes value used for the normalization calculation.
Definition: NvInfer.h:6554
virtual ~INormalizationLayer() noexcept=default
void setEpsilon(float eps) noexcept
Set the epsilon value used for the normalization calculation.
Definition: NvInfer.h:6524
TRT_NODISCARD bool isV2() const noexcept
Returns true if this layer was created through addNormalizationV2().
Definition: NvInfer.h:6631
DataType getComputePrecision() const noexcept
Get the compute precision of this layer.
Definition: NvInfer.h:6621
apiv::VNormalizationLayer * mImpl
Definition: NvInfer.h:6637
int64_t getNbGroups() const noexcept
Get the number of groups used to split the channels for the normalization calculation.
Definition: NvInfer.h:6585
void setAxes(uint32_t axesMask) noexcept
Set the reduction axes for the normalization calculation.
Definition: NvInfer.h:6544
void setComputePrecision(DataType type) noexcept
Set the compute precision of this layer.
Definition: NvInfer.h:6611
void setNbGroups(int64_t nbGroups) noexcept
Set the number of groups used to split the channels in the normalization calculation.
Definition: NvInfer.h:6575
A OneHot layer in a network definition.
Definition: NvInfer.h:6137
virtual ~IOneHotLayer() noexcept=default
apiv::VOneHotLayer * mImpl
Definition: NvInfer.h:6158
void setAxis(int32_t axis) noexcept
Set the axis parameter.
Definition: NvInfer.h:6144
int32_t getAxis() const noexcept
Get the value of the axis parameter.
Definition: NvInfer.h:6152
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2675
Layer that represents a padding operation.
Definition: NvInfer.h:3002
Dims getPostPaddingNd() const noexcept
Get the padding that is applied at the end of the tensor.
Definition: NvInfer.h:3051
void setPrePaddingNd(Dims const &padding) noexcept
Set the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3013
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:3039
Dims getPrePaddingNd() const noexcept
Get the padding that is applied at the start of the tensor.
Definition: NvInfer.h:3025
apiv::VPaddingLayer * mImpl
Definition: NvInfer.h:3057
Layer that represents a parametric ReLU operation.
Definition: NvInfer.h:4020
apiv::VParametricReLULayer * mImpl
Definition: NvInfer.h:4022
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:2739
virtual ~IPluginV2Layer() noexcept=default
apiv::VPluginV2Layer * mImpl
Definition: NvInfer.h:2752
IPluginV2 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2746
Layer type for V3 plugins.
Definition: NvInfer.h:2766
virtual ~IPluginV3Layer() noexcept=default
IPluginV3 & getPlugin() noexcept
Get the plugin for the layer.
Definition: NvInfer.h:2773
apiv::VPluginV3Layer * mImpl
Definition: NvInfer.h:2779
A Pooling layer in a network definition.
Definition: NvInfer.h:1501
PoolingType getPoolingType() const noexcept
Get the type of activation to be performed.
Definition: NvInfer.h:1520
PaddingMode getPaddingMode() const noexcept
Get the padding mode.
Definition: NvInfer.h:1653
Dims getPostPadding() const noexcept
Get the padding.
Definition: NvInfer.h:1629
bool getAverageCountExcludesPadding() const noexcept
Get whether average pooling uses as a denominator the overlap area between the window and the unpadde...
Definition: NvInfer.h:1573
Dims getPrePadding() const noexcept
Get the pre-padding.
Definition: NvInfer.h:1601
void setPoolingType(PoolingType type) noexcept
Set the type of activation to be performed.
Definition: NvInfer.h:1510
void setWindowSizeNd(Dims const &windowSize) noexcept
Set the multi-dimension window size for pooling.
Definition: NvInfer.h:1666
void setPaddingMode(PaddingMode paddingMode) noexcept
Set the padding mode.
Definition: NvInfer.h:1642
Dims getWindowSizeNd() const noexcept
Get the multi-dimension window size for pooling.
Definition: NvInfer.h:1676
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:1562
void setPaddingNd(Dims const &padding) noexcept
Set the multi-dimension padding for pooling.
Definition: NvInfer.h:1720
float getBlendFactor() const noexcept
Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1548
void setStrideNd(Dims const &stride) noexcept
Set the multi-dimension stride for pooling.
Definition: NvInfer.h:1691
Dims getStrideNd() const noexcept
Get the multi-dimension stride for pooling.
Definition: NvInfer.h:1701
virtual ~IPoolingLayer() noexcept=default
Dims getPaddingNd() const noexcept
Get the multi-dimension padding for pooling.
Definition: NvInfer.h:1732
void setPostPadding(Dims const &padding) noexcept
Set the multi-dimension post-padding for pooling.
Definition: NvInfer.h:1619
void setPrePadding(Dims const &padding) noexcept
Set the multi-dimension pre-padding for pooling.
Definition: NvInfer.h:1591
void setBlendFactor(float blendFactor) noexcept
Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPo...
Definition: NvInfer.h:1535
A Quantize layer in a network definition.
Definition: NvInfer.h:5513
void setToType(DataType toType) noexcept
Set the Quantize layer output type.
Definition: NvInfer.h:5574
bool setBlockShape(Dims const &blockShape) noexcept
Set the shape of the quantization block.
Definition: NvInfer.h:5547
void setAxis(int32_t axis) noexcept
Set the quantization axis.
Definition: NvInfer.h:5534
TRT_NODISCARD Dims getBlockShape() const noexcept
Get the shape of the quantization block.
Definition: NvInfer.h:5558
int32_t getAxis() const noexcept
Get the quantization axis.
Definition: NvInfer.h:5523
virtual ~IQuantizeLayer() noexcept=default
DataType getToType() const noexcept
Return the Quantize layer output type.
Definition: NvInfer.h:5586
A RaggedSoftmax layer in a network definition.
Definition: NvInfer.h:3854
apiv::VRaggedSoftMaxLayer * mImpl
Definition: NvInfer.h:3856
virtual ~IRaggedSoftMaxLayer() noexcept=default
A recurrence layer in a network definition.
Definition: NvInfer.h:4726
virtual ~IRecurrenceLayer() noexcept=default
Layer that represents a reduction across a non-bool tensor.
Definition: NvInfer.h:2922
void setKeepDimensions(bool keepDimensions) noexcept
Set the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2969
void setOperation(ReduceOperation op) noexcept
Set the reduce operation for the layer.
Definition: NvInfer.h:2929
ReduceOperation getOperation() const noexcept
Get the reduce operation for the layer.
Definition: NvInfer.h:2939
virtual ~IReduceLayer() noexcept=default
uint32_t getReduceAxes() const noexcept
Get the axes over which to reduce for the layer.
Definition: NvInfer.h:2959
void setReduceAxes(uint32_t reduceAxes) noexcept
Set the axes over which to reduce.
Definition: NvInfer.h:2949
apiv::VReduceLayer * mImpl
Definition: NvInfer.h:2985
bool getKeepDimensions() const noexcept
Get the boolean that specifies whether or not to keep the reduced dimensions for the layer.
Definition: NvInfer.h:2979
A resize layer in a network definition.
Definition: NvInfer.h:4209
void setSelectorForSinglePixel(ResizeSelector selector) noexcept
Set coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4370
void setNearestRounding(ResizeRoundMode value) noexcept
Set rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4394
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:4288
void setOutputDimensions(Dims const &dimensions) noexcept
Set the output dimensions.
Definition: NvInfer.h:4229
void setCubicCoeff(float A) noexcept
Set the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4426
void setScales(float const *scales, int32_t nbScales) noexcept
Set the resize scales.
Definition: NvInfer.h:4269
float getCubicCoeff() const noexcept
Get the coefficient 'A' used in cubic interpolation.
Definition: NvInfer.h:4436
ResizeSelector getSelectorForSinglePixel() const noexcept
Get the coordinate selector function when resized to single pixel.
Definition: NvInfer.h:4380
InterpolationMode getResizeMode() const noexcept
Get resize mode for an input tensor.
Definition: NvInfer.h:4310
void setCoordinateTransformation(ResizeCoordinateTransformation coordTransform) noexcept
Set coordinate transformation function.
Definition: NvInfer.h:4345
void setExcludeOutside(bool excludeFlag) noexcept
Set the state for excluding outside pixels.
Definition: NvInfer.h:4449
void setResizeMode(InterpolationMode interpolationMode) noexcept
Set resize mode for an input tensor.
Definition: NvInfer.h:4300
Dims getOutputDimensions() const noexcept
Get the output dimensions.
Definition: NvInfer.h:4239
ResizeRoundMode getNearestRounding() const noexcept
Get rounding mode for nearest neighbor resize.
Definition: NvInfer.h:4404
bool getExcludeOutside() const noexcept
Get the state for excluding outside pixels.
Definition: NvInfer.h:4459
ResizeCoordinateTransformation getCoordinateTransformation() const noexcept
Get coordinate transformation function.
Definition: NvInfer.h:4355
A ReverseSequence layer in a network definition.
Definition: NvInfer.h:6443
void setSequenceAxis(int32_t sequenceAxis) noexcept
Set the sequence axis. Default is 0.
Definition: NvInfer.h:6476
int32_t getBatchAxis() const noexcept
Return the batch axis. Return 1 if no batch axis was set.
Definition: NvInfer.h:6463
apiv::VReverseSequenceLayer * mImpl
Definition: NvInfer.h:6492
int32_t getSequenceAxis() const noexcept
Return the sequence axis. Return 0 if no sequence axis was set.
Definition: NvInfer.h:6486
void setBatchAxis(int32_t batchAxis) noexcept
Set the batch axis. Default is 1.
Definition: NvInfer.h:6453
virtual ~IReverseSequenceLayer() noexcept=default
Layer that implements Rotary Position Embedding (RoPE) (https://arxiv.org/abs/2104....
Definition: NvInfer.h:7291
TRT_NODISCARD int32_t getRotaryEmbeddingDim() const noexcept
Get the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7331
virtual ~IRotaryEmbeddingLayer() noexcept=default
void setInterleaved(bool interleaved) noexcept
Set whether the input is in interleaved format, i.e., whether the 2-d vectors rotated are taken from ...
Definition: NvInfer.h:7298
TRT_NODISCARD bool setRotaryEmbeddingDim(int32_t rotaryEmbeddingDim) noexcept
Set the number of hidden dimensions participating in RoPE. The default value is 0,...
Definition: NvInfer.h:7320
apiv::VRotaryEmbeddingLayer * mImpl
Definition: NvInfer.h:7354
TRT_NODISCARD bool getInterleaved() const noexcept
Get whether the input is in interleaved format. The default value is false.
Definition: NvInfer.h:7309
A Scale layer in a network definition.
Definition: NvInfer.h:1898
Weights getScale() const noexcept
Get the scale value.
Definition: NvInfer.h:1955
Weights getPower() const noexcept
Get the power value.
Definition: NvInfer.h:1975
void setScale(Weights scale) noexcept
Set the scale value.
Definition: NvInfer.h:1945
void setPower(Weights power) noexcept
Set the power value.
Definition: NvInfer.h:1965
ScaleMode getMode() const noexcept
Get the scale mode.
Definition: NvInfer.h:1915
void setShift(Weights shift) noexcept
Set the shift value.
Definition: NvInfer.h:1925
void setChannelAxis(int32_t channelAxis) noexcept
Set the channel axis.
Definition: NvInfer.h:2011
Weights getShift() const noexcept
Get the shift value.
Definition: NvInfer.h:1935
virtual ~IScaleLayer() noexcept=default
void setMode(ScaleMode mode) noexcept
Set the scale mode.
Definition: NvInfer.h:1905
int32_t getChannelAxis() const noexcept
Get the channel axis.
Definition: NvInfer.h:1990
A scatter layer in a network definition. Supports several kinds of scattering.
Definition: NvInfer.h:6065
void setMode(ScatterMode mode) noexcept
Set the scatter mode.
Definition: NvInfer.h:6072
apiv::VScatterLayer * mImpl
Definition: NvInfer.h:6106
void setAxis(int32_t axis) noexcept
Set the axis used by ScatterMode::kELEMENTS.
Definition: NvInfer.h:6092
int32_t getAxis() const noexcept
Get the axis.
Definition: NvInfer.h:6100
ScatterMode getMode() const noexcept
Get the scatter mode.
Definition: NvInfer.h:6082
virtual ~IScatterLayer() noexcept=default
Select elements from two data tensors based on a condition tensor.
Definition: NvInfer.h:5034
virtual ~ISelectLayer() noexcept=default
Layer type for getting shape of a tensor.
Definition: NvInfer.h:3527
virtual ~IShapeLayer() noexcept=default
apiv::VShapeLayer * mImpl
Definition: NvInfer.h:3529
Layer type for shuffling data.
Definition: NvInfer.h:3090
apiv::VShuffleLayer * mImpl
Definition: NvInfer.h:3248
void setFirstTranspose(Permutation permutation) noexcept
Set the permutation applied by the first transpose operation.
Definition: NvInfer.h:3101
void setSecondTranspose(Permutation permutation) noexcept
Set the permutation applied by the second transpose operation.
Definition: NvInfer.h:3201
Dims getReshapeDimensions() const noexcept
Get the reshaped dimensions.
Definition: NvInfer.h:3154
void setReshapeDimensions(Dims const &dimensions) noexcept
Set the reshaped dimensions.
Definition: NvInfer.h:3141
Permutation getFirstTranspose() const noexcept
Get the permutation applied by the first transpose operation.
Definition: NvInfer.h:3113
virtual ~IShuffleLayer() noexcept=default
Permutation getSecondTranspose() const noexcept
Get the permutation applied by the second transpose operation.
Definition: NvInfer.h:3213
bool getZeroIsPlaceholder() const noexcept
Get meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3242
void setZeroIsPlaceholder(bool zeroIsPlaceholder) noexcept
Set meaning of 0 in reshape dimensions.
Definition: NvInfer.h:3229
Slices an input tensor into an output tensor based on the offset and strides.
Definition: NvInfer.h:3342
void setStride(Dims const &stride) noexcept
Set the stride for computing the output slice data.
Definition: NvInfer.h:3411
apiv::VSliceLayer * mImpl
Definition: NvInfer.h:3510
virtual ~ISliceLayer() noexcept=default
void setSize(Dims const &size) noexcept
Set the dimensions of the output slice.
Definition: NvInfer.h:3382
void setAxes(Dims const &axes) noexcept
Set the axes for this ISliceLayer.
Definition: NvInfer.h:3489
void setStart(Dims const &start) noexcept
Set the start offset that the slice layer uses to create the output slice.
Definition: NvInfer.h:3353
Dims getStart() const noexcept
Get the start offset for the slice layer.
Definition: NvInfer.h:3368
void setMode(SampleMode mode) noexcept
Set the slice mode.
Definition: NvInfer.h:3436
Dims getSize() const noexcept
Get dimensions of the output slice.
Definition: NvInfer.h:3397
SampleMode getMode() const noexcept
Get the slice mode.
Definition: NvInfer.h:3446
Dims getStride() const noexcept
Get the stride for the output slice.
Definition: NvInfer.h:3426
Dims getAxes() const noexcept
Get the axes for this ISliceLayer.
Definition: NvInfer.h:3504
A Softmax layer in a network definition.
Definition: NvInfer.h:2042
void setAxes(uint32_t axes) noexcept
Set the axis along which softmax is computed. Currently, only one axis can be set.
Definition: NvInfer.h:2064
uint32_t getAxes() const noexcept
Get the axis along which softmax occurs.
Definition: NvInfer.h:2074
virtual ~ISoftMaxLayer() noexcept=default
Layer that represents a squeeze operation, removing unit dimensions of the first input tensor on a se...
Definition: NvInfer.h:6651
virtual ~ISqueezeLayer() noexcept=default
apiv::VSqueezeLayer * mImpl
Definition: NvInfer.h:6668
A tensor in a network definition.
Definition: NvInfer.h:188
void setAllowedFormats(TensorFormats formats) noexcept
Set allowed formats for an input or output tensor. By default all formats are allowed....
Definition: NvInfer.h:458
TensorLocation getLocation() const noexcept
Get the storage location of a tensor.
Definition: NvInfer.h:377
void setDimensions(Dims const &dimensions) noexcept
Set the dimensions of a tensor.
Definition: NvInfer.h:236
void resetDynamicRange() noexcept
Undo effect of setDynamicRange.
Definition: NvInfer.h:416
void setName(char const *name) noexcept
Set the tensor name.
Definition: NvInfer.h:205
bool isExecutionTensor() const noexcept
Whether the tensor is an execution tensor.
Definition: NvInfer.h:523
TRT_DEPRECATED bool dynamicRangeIsSet() const noexcept
Query whether dynamic range is set.
Definition: NvInfer.h:408
char const * getName() const noexcept
Get the tensor name.
Definition: NvInfer.h:217
bool isShapeTensor() const noexcept
Whether the tensor is a shape tensor.
Definition: NvInfer.h:502
float getDynamicRangeMax() const noexcept
Get maximum of dynamic range.
Definition: NvInfer.h:436
bool isNetworkInput() const noexcept
Whether the tensor is a network input.
Definition: NvInfer.h:326
TRT_DEPRECATED void setBroadcastAcrossBatch(bool broadcastAcrossBatch) noexcept
Set whether to enable broadcast of tensor across the implicit batch dimension.
Definition: NvInfer.h:351
TRT_DEPRECATED bool setDynamicRange(float min, float max) noexcept
Set dynamic range for the tensor.
Definition: NvInfer.h:318
TRT_DEPRECATED void setType(DataType type) noexcept
Set the data type of a tensor.
Definition: NvInfer.h:286
TRT_DEPRECATED bool getBroadcastAcrossBatch() const noexcept
Check if tensor is broadcast across the implicit batch dimension.
Definition: NvInfer.h:365
bool isNetworkOutput() const noexcept
Whether the tensor is a network output.
Definition: NvInfer.h:334
DataType getType() const noexcept
Get the data type of a tensor.
Definition: NvInfer.h:301
apiv::VTensor * mImpl
Definition: NvInfer.h:570
float getDynamicRangeMin() const noexcept
Get minimum of dynamic range.
Definition: NvInfer.h:426
virtual ~ITensor() noexcept=default
void setDimensionName(int32_t index, char const *name) noexcept
Name a dimension of an input tensor.
Definition: NvInfer.h:549
char const * getDimensionName(int32_t index) const noexcept
Get the name of an input dimension.
Definition: NvInfer.h:564
TRT_DEPRECATED void setLocation(TensorLocation location) noexcept
Set the storage location of a tensor.
Definition: NvInfer.h:396
Dims getDimensions() const noexcept
Get the dimensions of a tensor.
Definition: NvInfer.h:250
TensorFormats getAllowedFormats() const noexcept
Get a bitmask of TensorFormat values that the tensor supports. For a shape tensor,...
Definition: NvInfer.h:471
Class to handle tactic timing info collected from builder.
Definition: NvInfer.h:10105
int64_t queryKeys(TimingCacheKey *keyBuffer, int64_t capacity) const noexcept
Query cache keys from Timing Cache.
Definition: NvInfer.h:10171
bool combine(ITimingCache const &inputCache, bool ignoreMismatch) noexcept
Combine input timing cache into local instance.
Definition: NvInfer.h:10142
TimingCacheValue query(TimingCacheKey const &key) const noexcept
Query value in a cache entry.
Definition: NvInfer.h:10188
virtual ~ITimingCache() noexcept=default
bool update(TimingCacheKey const &key, TimingCacheValue const &value) noexcept
Update values in a cache entry.
Definition: NvInfer.h:10210
apiv::VTimingCache * mImpl
Definition: NvInfer.h:10216
bool reset() noexcept
Empty the timing cache.
Definition: NvInfer.h:10152
Layer that represents a TopK reduction.
Definition: NvInfer.h:3567
void setK(int32_t k) noexcept
Set the static k value for the layer.
Definition: NvInfer.h:3598
void setReduceAxes(uint32_t reduceAxes) noexcept
Set which axes to reduce for the layer.
Definition: NvInfer.h:3622
TopKOperation getOperation() const noexcept
Get the operation for the layer.
Definition: NvInfer.h:3584
apiv::VTopKLayer * mImpl
Definition: NvInfer.h:3681
void setOperation(TopKOperation op) noexcept
Set the operation for the layer.
Definition: NvInfer.h:3574
bool setIndicesType(DataType type) noexcept
Set the indices type for the layer.
Definition: NvInfer.h:3663
int32_t getK() const noexcept
Get the k value for the layer.
Definition: NvInfer.h:3612
uint32_t getReduceAxes() const noexcept
Get the axes to reduce for the layer.
Definition: NvInfer.h:3632
virtual ~ITopKLayer() noexcept=default
DataType getIndicesType() const noexcept
Return the TopK layer indices type.
Definition: NvInfer.h:3675
A layer that represents a trip-count limiter.
Definition: NvInfer.h:4847
TripLimit getTripLimit() const noexcept
Get a trip limiter type.
Definition: NvInfer.h:4852
virtual ~ITripLimitLayer() noexcept=default
Layer that represents an unary operation.
Definition: NvInfer.h:2847
void setOperation(UnaryOperation op) noexcept
Set the unary operation for the layer.
Definition: NvInfer.h:2856
apiv::VUnaryLayer * mImpl
Definition: NvInfer.h:2872
UnaryOperation getOperation() const noexcept
Get the unary operation for the layer.
Definition: NvInfer.h:2866
virtual ~IUnaryLayer() noexcept=default
Layer that represents an unsqueeze operation, which reshapes the first input tensor by inserting unit...
Definition: NvInfer.h:6681
virtual ~IUnsqueezeLayer() noexcept=default
apiv::VUnsqueezeLayer * mImpl
Definition: NvInfer.h:6699
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:9699
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:9704
virtual ~IAlgorithmSelector() noexcept=default
Definition: NvInferRuntimeBase.h:415
Definition: NvInferRuntime.h:1656
~IInt8EntropyCalibrator2() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:9339
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:9331
Definition: NvInfer.h:9286
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:9299
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:9291
~IInt8EntropyCalibrator() noexcept override=default
Definition: NvInfer.h:9405
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:9418
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:9410
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:9366
~IInt8MinMaxCalibrator() noexcept override=default
CalibrationAlgoType getAlgorithm() noexcept override
Definition: NvInfer.h:9379
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInfer.h:9371
Definition: NvInferPluginBase.h:206
Definition: NvInfer.h:10432
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:11882
The TensorRT API version 1 namespace.
Definition: NvInferPluginBase.h:29
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2961
ResizeSelector
The coordinate selector when resize to single pixel output.
Definition: NvInfer.h:4114
@ 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:10227
ScaleMode
Controls how shift, scale and power are applied in a Scale layer.
Definition: NvInfer.h:1855
@ 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:9810
uint32_t QuantizationFlags
Represents one or more QuantizationFlag values using binary OR operations.
Definition: NvInfer.h:9762
@ kNONE
Tensor is not an input or output.
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10346
CumulativeOperation
Enumerates the cumulative operations that may be performed by a Cumulative layer.
Definition: NvInfer.h:6715
BoundingBoxFormat
Representation of bounding box data used for the Boxes input tensor in INMSLayer.
Definition: NvInfer.h:6257
@ 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:10045
constexpr int32_t EnumMax< LayerType >() noexcept
Definition: NvInfer.h:122
@ kFP4
FP4 field type.
@ kINT8
INT8 field type.
@ kFP8
FP8 field type.
@ kBF16
BF16 field type.
@ kINT4
INT4 field type.
constexpr int32_t EnumMax< CalibrationAlgoType >() noexcept
Definition: NvInfer.h:9201
UnaryOperation
Enumerates the unary operations that may be performed by a Unary layer.
Definition: NvInfer.h:2800
@ 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:2909
constexpr int32_t EnumMax< TripLimit >() noexcept
Definition: NvInfer.h:4515
ActivationType
Enumerates the types of activation to perform in an activation layer.
Definition: NvInfer.h:141
@ 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:5095
@ 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:4144
@ 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:1033
@ 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:4503
@ 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:11480
PreviewFeature
Define preview features.
Definition: NvInfer.h:10302
TilingOptimizationLevel
Define the optimization levels for Tiling.
Definition: NvInfer.h:10399
@ 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:2559
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:9842
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1350
constexpr int32_t EnumMax< ScaleMode >() noexcept
Definition: NvInfer.h:1867
CalibrationAlgoType
Version of calibration algorithm to use.
Definition: NvInfer.h:9188
@ 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.
@ kROTARY_EMBEDDING
Rotary Embedding layer.
@ kRECURRENCE
Loop Recurrence layer.
@ kDEQUANTIZE
Dequantize layer.
@ kSHUFFLE
Shuffle layer.
@ kPLUGIN_V3
PluginV3 layer.
@ kITERATOR
Loop Iterator layer.
@ kPOOLING
Pooling layer.
@ kTRIP_LIMIT
Loop Trip limit layer.
@ kSCALE
Scale layer.
@ kDYNAMIC_QUANTIZE
Dynamic Quantize layer.
@ kGATHER
Gather layer.
@ kUNARY
UnaryOp operation Layer.
@ kACTIVATION
Activation layer.
@ kELEMENTWISE
Elementwise layer.
@ kSELECT
Select layer.
@ kPLUGIN_V2
PluginV2 layer.
@ kLOOP_OUTPUT
Loop output layer.
@ kCONDITIONAL_OUTPUT
Conditional Output layer.
@ kCONSTANT
Constant layer.
@ kNON_ZERO
NonZero layer.
@ kFILL
Fill layer.
@ kKVCACHE_UPDATE
KV Cache Update layer.
@ kPLUGIN
Plugin layer.
constexpr int32_t EnumMax< QuantizationFlag >() noexcept
Definition: NvInfer.h:9787
SampleMode
Controls how ISliceLayer and IGridSample handle out-of-bounds coordinates.
Definition: NvInfer.h:3258
@ 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:2547
@ 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:133
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:11491
ElementWiseOperation
Enumerates the binary operations that may be performed by an ElementWise layer.
Definition: NvInfer.h:2457
@ 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:9774
constexpr int32_t EnumMax< SampleMode >() noexcept
Definition: NvInfer.h:3274
InterpolationMode
Enumerates various modes of interpolation.
Definition: NvInfer.h:4032
@ 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:9852
@ 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:3550
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:10288
TopKOperation
Enumerates the operations that may be performed by a TopK layer.
Definition: NvInfer.h:3539
ReduceOperation
Enumerates the reduce operations that may be performed by a Reduce layer.
Definition: NvInfer.h:2895
constexpr int32_t EnumMax< LoopOutput >() noexcept
Definition: NvInfer.h:4492
constexpr int32_t EnumMax< NetworkDefinitionCreationFlag >() noexcept
Definition: NvInfer.h:11519
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:5991
MatrixOperation
Enumerates the operations that may be performed on a tensor by IMatrixMultiplyLayer before multiplica...
Definition: NvInfer.h:3692
@ kTRANSPOSE
Like kNONE, but transpose the matrix dimensions.
ResizeCoordinateTransformation
The resize coordinate transformation function.
Definition: NvInfer.h:4060
constexpr int32_t EnumMax< UnaryOperation >() noexcept
Definition: NvInfer.h:2834
LoopOutput
Enum that describes kinds of loop outputs.
Definition: NvInfer.h:4475
@ 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:6270
constexpr int32_t EnumMax< MatrixOperation >() noexcept
Definition: NvInfer.h:3720
KVCacheMode
Enumerates the KVCache modes that may be performed by a KVCacheUpdate layer.
Definition: NvInfer.h:7364
PoolingType
The type of pooling to perform in a pooling layer.
Definition: NvInfer.h:1469
@ 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:10515
constexpr int32_t EnumMax< FillOperation >() noexcept
Definition: NvInfer.h:5126
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:6850
constexpr int32_t EnumMax< ScatterMode >() noexcept
Definition: NvInfer.h:6002
Represents a permutation of dimensions.
Definition: NvInfer.h:3067
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:10069
Definition: NvInfer.h:10081
uint64_t tacticHash
Hash of the selected tactic.
Definition: NvInfer.h:10083
float timingMSec
Timing of this tactic in milliseconds. Negative numbers and NaN are invalid values.
Definition: NvInfer.h:10085

  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