objc2_ml_compute/generated/MLCPoolingDescriptor.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// The MLCPoolingDescriptor specifies a pooling descriptor.
11 ///
12 /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcpoolingdescriptor?language=objc)
13 #[unsafe(super(NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 #[deprecated]
16 pub struct MLCPoolingDescriptor;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for MLCPoolingDescriptor {}
21);
22
23unsafe impl CopyingHelper for MLCPoolingDescriptor {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for MLCPoolingDescriptor {}
29);
30
31impl MLCPoolingDescriptor {
32 extern_methods!(
33 #[cfg(feature = "MLCTypes")]
34 /// The pooling operation
35 #[deprecated]
36 #[unsafe(method(poolingType))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn poolingType(&self) -> MLCPoolingType;
39
40 /// The pooling kernel size in x.
41 #[deprecated]
42 #[unsafe(method(kernelWidth))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn kernelWidth(&self) -> NSUInteger;
45
46 /// The pooling kernel size in y.
47 #[deprecated]
48 #[unsafe(method(kernelHeight))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn kernelHeight(&self) -> NSUInteger;
51
52 /// The stride of the kernel in x.
53 #[deprecated]
54 #[unsafe(method(strideInX))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn strideInX(&self) -> NSUInteger;
57
58 /// The stride of the kernel in y.
59 #[deprecated]
60 #[unsafe(method(strideInY))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn strideInY(&self) -> NSUInteger;
63
64 /// The dilation rate i.e. stride of elements in the kernel in x.
65 #[deprecated]
66 #[unsafe(method(dilationRateInX))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn dilationRateInX(&self) -> NSUInteger;
69
70 /// The dilation rate i.e. stride of elements in the kernel in y.
71 #[deprecated]
72 #[unsafe(method(dilationRateInY))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn dilationRateInY(&self) -> NSUInteger;
75
76 #[cfg(feature = "MLCTypes")]
77 /// The padding policy to use.
78 #[deprecated]
79 #[unsafe(method(paddingPolicy))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn paddingPolicy(&self) -> MLCPaddingPolicy;
82
83 /// The padding size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
84 #[deprecated]
85 #[unsafe(method(paddingSizeInX))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn paddingSizeInX(&self) -> NSUInteger;
88
89 /// The padding size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
90 #[deprecated]
91 #[unsafe(method(paddingSizeInY))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn paddingSizeInY(&self) -> NSUInteger;
94
95 /// Include the zero-padding in the averaging calculation if true. Used only with average pooling.
96 #[deprecated]
97 #[unsafe(method(countIncludesPadding))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn countIncludesPadding(&self) -> bool;
100
101 #[deprecated]
102 #[unsafe(method(new))]
103 #[unsafe(method_family = new)]
104 pub unsafe fn new() -> Retained<Self>;
105
106 #[deprecated]
107 #[unsafe(method(init))]
108 #[unsafe(method_family = init)]
109 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111 #[cfg(feature = "MLCTypes")]
112 /// Create a MLCPoolingDescriptor object
113 ///
114 /// Parameter `poolingType`: The pooling function
115 ///
116 /// Parameter `kernelSize`: The kernel sizes in x and y
117 ///
118 /// Parameter `stride`: The kernel strides in x and y
119 ///
120 /// Returns: A new MLCPoolingDescriptor object.
121 #[deprecated]
122 #[unsafe(method(poolingDescriptorWithType:kernelSize:stride:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn poolingDescriptorWithType_kernelSize_stride(
125 pooling_type: MLCPoolingType,
126 kernel_size: NSUInteger,
127 stride: NSUInteger,
128 ) -> Retained<Self>;
129
130 #[cfg(feature = "MLCTypes")]
131 /// Create a MLCPoolingDescriptor object for a max pooling function
132 ///
133 /// Parameter `kernelSizes`: The kernel sizes in x and y
134 ///
135 /// Parameter `strides`: The kernel strides in x and y
136 ///
137 /// Parameter `paddingPolicy`: The padding policy
138 ///
139 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
140 ///
141 /// Returns: A new MLCPoolingDescriptor object.
142 #[deprecated]
143 #[unsafe(method(maxPoolingDescriptorWithKernelSizes:strides:paddingPolicy:paddingSizes:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn maxPoolingDescriptorWithKernelSizes_strides_paddingPolicy_paddingSizes(
146 kernel_sizes: &NSArray<NSNumber>,
147 strides: &NSArray<NSNumber>,
148 padding_policy: MLCPaddingPolicy,
149 padding_sizes: Option<&NSArray<NSNumber>>,
150 ) -> Retained<Self>;
151
152 #[cfg(feature = "MLCTypes")]
153 /// Create a MLCPoolingDescriptor object for a max pooling function
154 ///
155 /// Parameter `kernelSizes`: The kernel sizes in x and y
156 ///
157 /// Parameter `strides`: The kernel strides in x and y
158 ///
159 /// Parameter `dilationRates`: The kernel dilation rates in x and y
160 ///
161 /// Parameter `paddingPolicy`: The padding policy
162 ///
163 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
164 ///
165 /// Returns: A new MLCPoolingDescriptor object.
166 #[deprecated]
167 #[unsafe(method(maxPoolingDescriptorWithKernelSizes:strides:dilationRates:paddingPolicy:paddingSizes:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn maxPoolingDescriptorWithKernelSizes_strides_dilationRates_paddingPolicy_paddingSizes(
170 kernel_sizes: &NSArray<NSNumber>,
171 strides: &NSArray<NSNumber>,
172 dilation_rates: &NSArray<NSNumber>,
173 padding_policy: MLCPaddingPolicy,
174 padding_sizes: Option<&NSArray<NSNumber>>,
175 ) -> Retained<Self>;
176
177 #[cfg(feature = "MLCTypes")]
178 /// Create a MLCPoolingDescriptor object for an average pooling function
179 ///
180 /// Parameter `kernelSizes`: The kernel sizes in x and y
181 ///
182 /// Parameter `strides`: The kernel strides in x and y
183 ///
184 /// Parameter `paddingPolicy`: The padding policy
185 ///
186 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
187 ///
188 /// Parameter `countIncludesPadding`: Whether to include zero padding in the averaging calculation
189 ///
190 /// Returns: A new MLCPoolingDescriptor object.
191 #[deprecated]
192 #[unsafe(method(averagePoolingDescriptorWithKernelSizes:strides:paddingPolicy:paddingSizes:countIncludesPadding:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn averagePoolingDescriptorWithKernelSizes_strides_paddingPolicy_paddingSizes_countIncludesPadding(
195 kernel_sizes: &NSArray<NSNumber>,
196 strides: &NSArray<NSNumber>,
197 padding_policy: MLCPaddingPolicy,
198 padding_sizes: Option<&NSArray<NSNumber>>,
199 count_includes_padding: bool,
200 ) -> Retained<Self>;
201
202 #[cfg(feature = "MLCTypes")]
203 /// Create a MLCPoolingDescriptor object for an average pooling function
204 ///
205 /// Parameter `kernelSizes`: The kernel sizes in x and y
206 ///
207 /// Parameter `strides`: The kernel strides in x and y
208 ///
209 /// Parameter `dilationRates`: The kernel dilation rates in x and y
210 ///
211 /// Parameter `paddingPolicy`: The padding policy
212 ///
213 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
214 ///
215 /// Parameter `countIncludesPadding`: Whether to include zero padding in the averaging calculation
216 ///
217 /// Returns: A new MLCPoolingDescriptor object.
218 #[deprecated]
219 #[unsafe(method(averagePoolingDescriptorWithKernelSizes:strides:dilationRates:paddingPolicy:paddingSizes:countIncludesPadding:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn averagePoolingDescriptorWithKernelSizes_strides_dilationRates_paddingPolicy_paddingSizes_countIncludesPadding(
222 kernel_sizes: &NSArray<NSNumber>,
223 strides: &NSArray<NSNumber>,
224 dilation_rates: &NSArray<NSNumber>,
225 padding_policy: MLCPaddingPolicy,
226 padding_sizes: Option<&NSArray<NSNumber>>,
227 count_includes_padding: bool,
228 ) -> Retained<Self>;
229
230 #[cfg(feature = "MLCTypes")]
231 /// Create a MLCPoolingDescriptor object for a L2 norm pooling function
232 ///
233 /// Parameter `kernelSizes`: The kernel sizes in x and y
234 ///
235 /// Parameter `strides`: The kernel strides in x and y
236 ///
237 /// Parameter `paddingPolicy`: The padding policy
238 ///
239 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
240 ///
241 /// Returns: A new MLCPoolingDescriptor object.
242 #[deprecated]
243 #[unsafe(method(l2NormPoolingDescriptorWithKernelSizes:strides:paddingPolicy:paddingSizes:))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn l2NormPoolingDescriptorWithKernelSizes_strides_paddingPolicy_paddingSizes(
246 kernel_sizes: &NSArray<NSNumber>,
247 strides: &NSArray<NSNumber>,
248 padding_policy: MLCPaddingPolicy,
249 padding_sizes: Option<&NSArray<NSNumber>>,
250 ) -> Retained<Self>;
251
252 #[cfg(feature = "MLCTypes")]
253 /// Create a MLCPoolingDescriptor object for a L2 norm pooling function
254 ///
255 /// Parameter `kernelSizes`: The kernel sizes in x and y
256 ///
257 /// Parameter `strides`: The kernel strides in x and y
258 ///
259 /// Parameter `dilationRates`: The kernel dilation rates in x and y
260 ///
261 /// Parameter `paddingPolicy`: The padding policy
262 ///
263 /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
264 ///
265 /// Returns: A new MLCPoolingDescriptor object.
266 #[deprecated]
267 #[unsafe(method(l2NormPoolingDescriptorWithKernelSizes:strides:dilationRates:paddingPolicy:paddingSizes:))]
268 #[unsafe(method_family = none)]
269 pub unsafe fn l2NormPoolingDescriptorWithKernelSizes_strides_dilationRates_paddingPolicy_paddingSizes(
270 kernel_sizes: &NSArray<NSNumber>,
271 strides: &NSArray<NSNumber>,
272 dilation_rates: &NSArray<NSNumber>,
273 padding_policy: MLCPaddingPolicy,
274 padding_sizes: Option<&NSArray<NSNumber>>,
275 ) -> Retained<Self>;
276 );
277}