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