objc2_ml_compute/generated/
MLCConvolutionDescriptor.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 MLCConvolutionDescriptor specifies a convolution descriptor
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcconvolutiondescriptor?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[deprecated]
16    pub struct MLCConvolutionDescriptor;
17);
18
19extern_conformance!(
20    unsafe impl NSCopying for MLCConvolutionDescriptor {}
21);
22
23unsafe impl CopyingHelper for MLCConvolutionDescriptor {
24    type Result = Self;
25}
26
27extern_conformance!(
28    unsafe impl NSObjectProtocol for MLCConvolutionDescriptor {}
29);
30
31impl MLCConvolutionDescriptor {
32    extern_methods!(
33        #[cfg(feature = "MLCTypes")]
34        /// The type of convolution.
35        #[deprecated]
36        #[unsafe(method(convolutionType))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn convolutionType(&self) -> MLCConvolutionType;
39
40        /// The convolution 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 convolution kernel size in y.
47        #[deprecated]
48        #[unsafe(method(kernelHeight))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn kernelHeight(&self) -> NSUInteger;
51
52        /// Number of channels in the input tensor
53        #[deprecated]
54        #[unsafe(method(inputFeatureChannelCount))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn inputFeatureChannelCount(&self) -> NSUInteger;
57
58        /// Number of channels in the output tensor
59        #[deprecated]
60        #[unsafe(method(outputFeatureChannelCount))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn outputFeatureChannelCount(&self) -> NSUInteger;
63
64        /// The stride of the kernel in x.
65        #[deprecated]
66        #[unsafe(method(strideInX))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn strideInX(&self) -> NSUInteger;
69
70        /// The stride of the kernel in y.
71        #[deprecated]
72        #[unsafe(method(strideInY))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn strideInY(&self) -> NSUInteger;
75
76        /// The dilation rate i.e. stride of elements in the kernel in x.
77        #[deprecated]
78        #[unsafe(method(dilationRateInX))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn dilationRateInX(&self) -> NSUInteger;
81
82        /// The dilation rate i.e. stride of elements in the kernel in y.
83        #[deprecated]
84        #[unsafe(method(dilationRateInY))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn dilationRateInY(&self) -> NSUInteger;
87
88        /// Number of blocked connections from input channels to output channels
89        #[deprecated]
90        #[unsafe(method(groupCount))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn groupCount(&self) -> NSUInteger;
93
94        #[cfg(feature = "MLCTypes")]
95        /// The padding policy to use.
96        #[deprecated]
97        #[unsafe(method(paddingPolicy))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn paddingPolicy(&self) -> MLCPaddingPolicy;
100
101        /// The pooling size in x (left and right) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
102        #[deprecated]
103        #[unsafe(method(paddingSizeInX))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn paddingSizeInX(&self) -> NSUInteger;
106
107        /// The pooling size in y (top and bottom) to use if paddingPolicy is MLCPaddingPolicyUsePaddingSize
108        #[deprecated]
109        #[unsafe(method(paddingSizeInY))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn paddingSizeInY(&self) -> NSUInteger;
112
113        /// A flag to indicate if this is a convolution transpose
114        #[deprecated]
115        #[unsafe(method(isConvolutionTranspose))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn isConvolutionTranspose(&self) -> bool;
118
119        /// A flag to indicate depthwise convolution
120        #[deprecated]
121        #[unsafe(method(usesDepthwiseConvolution))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn usesDepthwiseConvolution(&self) -> bool;
124
125        #[cfg(feature = "MLCTypes")]
126        /// Creates a convolution descriptor with the specified convolution type.
127        ///
128        /// Parameter `convolutionType`: The type of convolution.
129        ///
130        /// Parameter `kernelSizes`: The kernel sizes in x and y.
131        ///
132        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor.
133        ///
134        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor. When the convolution type is
135        /// `MLCConvolutionTypeDepthwise`, this value must be a multiple of
136        /// `inputFeatureChannelCount`.
137        ///
138        /// Parameter `groupCount`: The number of groups.
139        ///
140        /// Parameter `strides`: The kernel strides in x and y.
141        ///
142        /// Parameter `dilationRates`: The dilation rates in x and y.
143        ///
144        /// Parameter `paddingPolicy`: The padding policy.
145        ///
146        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is
147        /// `MLCPaddingPolicyUsePaddingSize`.
148        ///
149        /// Returns: A new convolution descriptor.
150        #[deprecated]
151        #[unsafe(method(descriptorWithType:kernelSizes:inputFeatureChannelCount:outputFeatureChannelCount:groupCount:strides:dilationRates:paddingPolicy:paddingSizes:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn descriptorWithType_kernelSizes_inputFeatureChannelCount_outputFeatureChannelCount_groupCount_strides_dilationRates_paddingPolicy_paddingSizes(
154            convolution_type: MLCConvolutionType,
155            kernel_sizes: &NSArray<NSNumber>,
156            input_feature_channel_count: NSUInteger,
157            output_feature_channel_count: NSUInteger,
158            group_count: NSUInteger,
159            strides: &NSArray<NSNumber>,
160            dilation_rates: &NSArray<NSNumber>,
161            padding_policy: MLCPaddingPolicy,
162            padding_sizes: Option<&NSArray<NSNumber>>,
163        ) -> Retained<Self>;
164
165        /// Create a MLCConvolutionDescriptor object
166        ///
167        /// Parameter `kernelWidth`: The kernel size in x
168        ///
169        /// Parameter `kernelHeight`: The kernel size in x
170        ///
171        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
172        ///
173        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
174        ///
175        /// Returns: A new MLCConvolutionDescriptor object.
176        #[deprecated]
177        #[unsafe(method(descriptorWithKernelWidth:kernelHeight:inputFeatureChannelCount:outputFeatureChannelCount:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn descriptorWithKernelWidth_kernelHeight_inputFeatureChannelCount_outputFeatureChannelCount(
180            kernel_width: NSUInteger,
181            kernel_height: NSUInteger,
182            input_feature_channel_count: NSUInteger,
183            output_feature_channel_count: NSUInteger,
184        ) -> Retained<Self>;
185
186        #[cfg(feature = "MLCTypes")]
187        /// Create a MLCConvolutionDescriptor object
188        ///
189        /// Parameter `kernelSizes`: The kernel sizes in x and y
190        ///
191        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
192        ///
193        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
194        ///
195        /// Parameter `strides`: The kernel strides in x and y
196        ///
197        /// Parameter `paddingPolicy`: The padding policy
198        ///
199        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
200        ///
201        /// Returns: A new MLCConvolutionDescriptor object.
202        #[deprecated]
203        #[unsafe(method(descriptorWithKernelSizes:inputFeatureChannelCount:outputFeatureChannelCount:strides:paddingPolicy:paddingSizes:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn descriptorWithKernelSizes_inputFeatureChannelCount_outputFeatureChannelCount_strides_paddingPolicy_paddingSizes(
206            kernel_sizes: &NSArray<NSNumber>,
207            input_feature_channel_count: NSUInteger,
208            output_feature_channel_count: NSUInteger,
209            strides: &NSArray<NSNumber>,
210            padding_policy: MLCPaddingPolicy,
211            padding_sizes: Option<&NSArray<NSNumber>>,
212        ) -> Retained<Self>;
213
214        #[cfg(feature = "MLCTypes")]
215        /// Create a MLCConvolutionDescriptor object
216        ///
217        /// Parameter `kernelSizes`: The kernel sizes in x and y
218        ///
219        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
220        ///
221        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
222        ///
223        /// Parameter `groupCount`: Number of groups
224        ///
225        /// Parameter `strides`: The kernel strides in x and y
226        ///
227        /// Parameter `dilationRates`: The dilation rates in x and y
228        ///
229        /// Parameter `paddingPolicy`: The padding policy
230        ///
231        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
232        ///
233        /// Returns: A new MLCConvolutionDescriptor object.
234        #[deprecated]
235        #[unsafe(method(descriptorWithKernelSizes:inputFeatureChannelCount:outputFeatureChannelCount:groupCount:strides:dilationRates:paddingPolicy:paddingSizes:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn descriptorWithKernelSizes_inputFeatureChannelCount_outputFeatureChannelCount_groupCount_strides_dilationRates_paddingPolicy_paddingSizes(
238            kernel_sizes: &NSArray<NSNumber>,
239            input_feature_channel_count: NSUInteger,
240            output_feature_channel_count: NSUInteger,
241            group_count: NSUInteger,
242            strides: &NSArray<NSNumber>,
243            dilation_rates: &NSArray<NSNumber>,
244            padding_policy: MLCPaddingPolicy,
245            padding_sizes: Option<&NSArray<NSNumber>>,
246        ) -> Retained<Self>;
247
248        /// Create a MLCConvolutionDescriptor object for convolution transpose
249        ///
250        /// Parameter `kernelWidth`: The kernel size in x
251        ///
252        /// Parameter `kernelHeight`: The kernel size in x
253        ///
254        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
255        ///
256        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
257        ///
258        /// Returns: A new MLCConvolutionDescriptor object.
259        #[deprecated]
260        #[unsafe(method(convolutionTransposeDescriptorWithKernelWidth:kernelHeight:inputFeatureChannelCount:outputFeatureChannelCount:))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn convolutionTransposeDescriptorWithKernelWidth_kernelHeight_inputFeatureChannelCount_outputFeatureChannelCount(
263            kernel_width: NSUInteger,
264            kernel_height: NSUInteger,
265            input_feature_channel_count: NSUInteger,
266            output_feature_channel_count: NSUInteger,
267        ) -> Retained<Self>;
268
269        #[cfg(feature = "MLCTypes")]
270        /// Create a MLCConvolutionDescriptor object for convolution transpose
271        ///
272        /// Parameter `kernelSizes`: The kernel sizes in x and y
273        ///
274        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
275        ///
276        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
277        ///
278        /// Parameter `strides`: The kernel strides in x and y
279        ///
280        /// Parameter `paddingPolicy`: The padding policy
281        ///
282        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
283        ///
284        /// Returns: A new MLCConvolutionDescriptor object.
285        #[deprecated]
286        #[unsafe(method(convolutionTransposeDescriptorWithKernelSizes:inputFeatureChannelCount:outputFeatureChannelCount:strides:paddingPolicy:paddingSizes:))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn convolutionTransposeDescriptorWithKernelSizes_inputFeatureChannelCount_outputFeatureChannelCount_strides_paddingPolicy_paddingSizes(
289            kernel_sizes: &NSArray<NSNumber>,
290            input_feature_channel_count: NSUInteger,
291            output_feature_channel_count: NSUInteger,
292            strides: &NSArray<NSNumber>,
293            padding_policy: MLCPaddingPolicy,
294            padding_sizes: Option<&NSArray<NSNumber>>,
295        ) -> Retained<Self>;
296
297        #[cfg(feature = "MLCTypes")]
298        /// Create a MLCConvolutionDescriptor object for convolution transpose
299        ///
300        /// Parameter `kernelSizes`: The kernel sizes in x and y
301        ///
302        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
303        ///
304        /// Parameter `outputFeatureChannelCount`: The number of feature channels in the output tensor
305        ///
306        /// Parameter `groupCount`: Number of groups
307        ///
308        /// Parameter `strides`: The kernel strides in x and y
309        ///
310        /// Parameter `dilationRates`: The dilation rates in x and y
311        ///
312        /// Parameter `paddingPolicy`: The padding policy
313        ///
314        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
315        ///
316        /// Returns: A new MLCConvolutionDescriptor object.
317        #[deprecated]
318        #[unsafe(method(convolutionTransposeDescriptorWithKernelSizes:inputFeatureChannelCount:outputFeatureChannelCount:groupCount:strides:dilationRates:paddingPolicy:paddingSizes:))]
319        #[unsafe(method_family = none)]
320        pub unsafe fn convolutionTransposeDescriptorWithKernelSizes_inputFeatureChannelCount_outputFeatureChannelCount_groupCount_strides_dilationRates_paddingPolicy_paddingSizes(
321            kernel_sizes: &NSArray<NSNumber>,
322            input_feature_channel_count: NSUInteger,
323            output_feature_channel_count: NSUInteger,
324            group_count: NSUInteger,
325            strides: &NSArray<NSNumber>,
326            dilation_rates: &NSArray<NSNumber>,
327            padding_policy: MLCPaddingPolicy,
328            padding_sizes: Option<&NSArray<NSNumber>>,
329        ) -> Retained<Self>;
330
331        /// Create a MLCConvolutionDescriptor object for depthwise convolution
332        ///
333        /// Parameter `kernelWidth`: The kernel size in x
334        ///
335        /// Parameter `kernelHeight`: The kernel size in x
336        ///
337        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
338        ///
339        /// Parameter `channelMultiplier`: The channel multiplier
340        ///
341        /// Returns: A new MLCConvolutionDescriptor object.
342        #[deprecated]
343        #[unsafe(method(depthwiseConvolutionDescriptorWithKernelWidth:kernelHeight:inputFeatureChannelCount:channelMultiplier:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn depthwiseConvolutionDescriptorWithKernelWidth_kernelHeight_inputFeatureChannelCount_channelMultiplier(
346            kernel_width: NSUInteger,
347            kernel_height: NSUInteger,
348            input_feature_channel_count: NSUInteger,
349            channel_multiplier: NSUInteger,
350        ) -> Retained<Self>;
351
352        #[cfg(feature = "MLCTypes")]
353        /// Create a MLCConvolutionDescriptor object for depthwise convolution
354        ///
355        /// Parameter `kernelSizes`: The kernel sizes in x and y
356        ///
357        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
358        ///
359        /// Parameter `channelMultiplier`: The channel multiplier
360        ///
361        /// Parameter `strides`: The kernel strides in x and y
362        ///
363        /// Parameter `paddingPolicy`: The padding policy
364        ///
365        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
366        ///
367        /// Returns: A new MLCConvolutionDescriptor object.
368        #[deprecated]
369        #[unsafe(method(depthwiseConvolutionDescriptorWithKernelSizes:inputFeatureChannelCount:channelMultiplier:strides:paddingPolicy:paddingSizes:))]
370        #[unsafe(method_family = none)]
371        pub unsafe fn depthwiseConvolutionDescriptorWithKernelSizes_inputFeatureChannelCount_channelMultiplier_strides_paddingPolicy_paddingSizes(
372            kernel_sizes: &NSArray<NSNumber>,
373            input_feature_channel_count: NSUInteger,
374            channel_multiplier: NSUInteger,
375            strides: &NSArray<NSNumber>,
376            padding_policy: MLCPaddingPolicy,
377            padding_sizes: Option<&NSArray<NSNumber>>,
378        ) -> Retained<Self>;
379
380        #[cfg(feature = "MLCTypes")]
381        /// Create a MLCConvolutionDescriptor object for depthwise convolution
382        ///
383        /// Parameter `kernelSizes`: The kernel sizes in x and y
384        ///
385        /// Parameter `inputFeatureChannelCount`: The number of feature channels in the input tensor
386        ///
387        /// Parameter `channelMultiplier`: The channel multiplier
388        ///
389        /// Parameter `strides`: The kernel strides in x and y
390        ///
391        /// Parameter `dilationRates`: The dilation rates in x and y
392        ///
393        /// Parameter `paddingPolicy`: The padding policy
394        ///
395        /// Parameter `paddingSizes`: The padding sizes in x and y if padding policy is MLCPaddingPolicyUsePaddingSIze
396        ///
397        /// Returns: A new MLCConvolutionDescriptor object.
398        #[deprecated]
399        #[unsafe(method(depthwiseConvolutionDescriptorWithKernelSizes:inputFeatureChannelCount:channelMultiplier:strides:dilationRates:paddingPolicy:paddingSizes:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn depthwiseConvolutionDescriptorWithKernelSizes_inputFeatureChannelCount_channelMultiplier_strides_dilationRates_paddingPolicy_paddingSizes(
402            kernel_sizes: &NSArray<NSNumber>,
403            input_feature_channel_count: NSUInteger,
404            channel_multiplier: NSUInteger,
405            strides: &NSArray<NSNumber>,
406            dilation_rates: &NSArray<NSNumber>,
407            padding_policy: MLCPaddingPolicy,
408            padding_sizes: Option<&NSArray<NSNumber>>,
409        ) -> Retained<Self>;
410    );
411}
412
413/// Methods declared on superclass `NSObject`.
414impl MLCConvolutionDescriptor {
415    extern_methods!(
416        #[unsafe(method(init))]
417        #[unsafe(method_family = init)]
418        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
419
420        #[unsafe(method(new))]
421        #[unsafe(method_family = new)]
422        pub unsafe fn new() -> Retained<Self>;
423    );
424}