TensorRT 8.4.3
NvInferLegacyDims.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4 *
5 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6 * property and proprietary rights in and to this material, related
7 * documentation and any modifications thereto. Any use, reproduction,
8 * disclosure or distribution of this material and related documentation
9 * without an express license agreement from NVIDIA CORPORATION or
10 * its affiliates is strictly prohibited.
11 */
12
13#ifndef NV_INFER_LEGACY_DIMS_H
14#define NV_INFER_LEGACY_DIMS_H
15
17
24
30namespace nvinfer1
31{
36class Dims2 : public Dims
37{
38public:
43 : Dims{2, {}}
44 {
45 }
46
53 Dims2(int32_t d0, int32_t d1)
54 : Dims{2, {d0, d1}}
55 {
56 }
57};
58
63class DimsHW : public Dims2
64{
65public:
70 : Dims2()
71 {
72 }
73
80 DimsHW(int32_t height, int32_t width)
81 : Dims2(height, width)
82 {
83 }
84
90 int32_t& h()
91 {
92 return d[0];
93 }
94
100 int32_t h() const
101 {
102 return d[0];
103 }
104
110 int32_t& w()
111 {
112 return d[1];
113 }
114
120 int32_t w() const
121 {
122 return d[1];
123 }
124};
125
130class Dims3 : public Dims
131{
132public:
137 : Dims{3, {}}
138 {
139 }
140
148 Dims3(int32_t d0, int32_t d1, int32_t d2)
149 : Dims{3, {d0, d1, d2}}
150 {
151 }
152};
153
158class Dims4 : public Dims
159{
160public:
165 : Dims{4, {}}
166 {
167 }
168
177 Dims4(int32_t d0, int32_t d1, int32_t d2, int32_t d3)
178 : Dims{4, {d0, d1, d2, d3}}
179 {
180 }
181};
182
183} // namespace nvinfer1
184
185#endif // NV_INFER_LEGCY_DIMS_H
Descriptor for two-dimensional data.
Definition: NvInferLegacyDims.h:37
Dims2(int32_t d0, int32_t d1)
Construct a Dims2 from 2 elements.
Definition: NvInferLegacyDims.h:53
Dims2()
Construct an empty Dims2 object.
Definition: NvInferLegacyDims.h:42
Definition: NvInferRuntimeCommon.h:153
Descriptor for three-dimensional data.
Definition: NvInferLegacyDims.h:131
Dims3()
Construct an empty Dims3 object.
Definition: NvInferLegacyDims.h:136
Dims3(int32_t d0, int32_t d1, int32_t d2)
Construct a Dims3 from 3 elements.
Definition: NvInferLegacyDims.h:148
Descriptor for four-dimensional data.
Definition: NvInferLegacyDims.h:159
Dims4()
Construct an empty Dims4 object.
Definition: NvInferLegacyDims.h:164
Dims4(int32_t d0, int32_t d1, int32_t d2, int32_t d3)
Construct a Dims4 from 4 elements.
Definition: NvInferLegacyDims.h:177
Descriptor for two-dimensional spatial data.
Definition: NvInferLegacyDims.h:64
int32_t w() const
Get the width.
Definition: NvInferLegacyDims.h:120
int32_t h() const
Get the height.
Definition: NvInferLegacyDims.h:100
DimsHW()
Construct an empty DimsHW object.
Definition: NvInferLegacyDims.h:69
int32_t & w()
Get the width.
Definition: NvInferLegacyDims.h:110
DimsHW(int32_t height, int32_t width)
Construct a DimsHW given height and width.
Definition: NvInferLegacyDims.h:80
int32_t & h()
Get the height.
Definition: NvInferLegacyDims.h:90
The TensorRT API version 1 namespace.

  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