objc2_ml_compute/generated/
MLCYOLOLossLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// A YOLO loss layer
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcyololosslayer?language=objc)
13    #[unsafe(super(MLCLossLayer, MLCLayer, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(all(feature = "MLCLayer", feature = "MLCLossLayer"))]
16    #[deprecated]
17    pub struct MLCYOLOLossLayer;
18);
19
20#[cfg(all(feature = "MLCLayer", feature = "MLCLossLayer"))]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for MLCYOLOLossLayer {}
23);
24
25#[cfg(all(feature = "MLCLayer", feature = "MLCLossLayer"))]
26impl MLCYOLOLossLayer {
27    extern_methods!(
28        #[cfg(feature = "MLCYOLOLossDescriptor")]
29        /// The YOLO loss descriptor
30        #[deprecated]
31        #[unsafe(method(yoloLossDescriptor))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn yoloLossDescriptor(&self) -> Retained<MLCYOLOLossDescriptor>;
34
35        #[cfg(feature = "MLCYOLOLossDescriptor")]
36        /// Create a YOLO loss layer
37        ///
38        /// Parameter `lossDescriptor`: The loss descriptor
39        ///
40        /// Returns: A new YOLO loss layer.
41        #[deprecated]
42        #[unsafe(method(layerWithDescriptor:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn layerWithDescriptor(
45            loss_descriptor: &MLCYOLOLossDescriptor,
46        ) -> Retained<Self>;
47    );
48}
49
50/// Methods declared on superclass `MLCLossLayer`.
51#[cfg(all(feature = "MLCLayer", feature = "MLCLossLayer"))]
52impl MLCYOLOLossLayer {
53    extern_methods!(
54        #[cfg(all(feature = "MLCLossDescriptor", feature = "MLCTensor"))]
55        /// Create a MLComputeLoss layer
56        ///
57        /// Parameter `lossDescriptor`: The loss descriptor
58        ///
59        /// Parameter `weights`: The loss label weights tensor
60        ///
61        /// Returns: A new loss layer.
62        #[deprecated]
63        #[unsafe(method(layerWithDescriptor:weights:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn layerWithDescriptor_weights(
66            loss_descriptor: &MLCLossDescriptor,
67            weights: &MLCTensor,
68        ) -> Retained<Self>;
69
70        #[cfg(feature = "MLCTypes")]
71        /// Create a loss layer
72        ///
73        /// Parameter `reductionType`: The reduction type to use
74        ///
75        /// Parameter `labelSmoothing`: Label smoothing value
76        ///
77        /// Parameter `classCount`: Number of classes
78        ///
79        /// Parameter `weight`: A scalar floating point value
80        ///
81        /// Returns: A new softmax cross entropy loss layer.
82        #[deprecated]
83        #[unsafe(method(softmaxCrossEntropyLossWithReductionType:labelSmoothing:classCount:weight:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn softmaxCrossEntropyLossWithReductionType_labelSmoothing_classCount_weight(
86            reduction_type: MLCReductionType,
87            label_smoothing: c_float,
88            class_count: NSUInteger,
89            weight: c_float,
90        ) -> Retained<Self>;
91
92        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
93        /// Create a loss layer
94        ///
95        /// Parameter `reductionType`: The reduction type to use
96        ///
97        /// Parameter `labelSmoothing`: Label smoothing value
98        ///
99        /// Parameter `classCount`: Number of classes
100        ///
101        /// Parameter `weights`: The loss label weights tensor
102        ///
103        /// Returns: A new softmax cross entropy loss layer.
104        #[deprecated]
105        #[unsafe(method(softmaxCrossEntropyLossWithReductionType:labelSmoothing:classCount:weights:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn softmaxCrossEntropyLossWithReductionType_labelSmoothing_classCount_weights(
108            reduction_type: MLCReductionType,
109            label_smoothing: c_float,
110            class_count: NSUInteger,
111            weights: Option<&MLCTensor>,
112        ) -> Retained<Self>;
113
114        #[cfg(feature = "MLCTypes")]
115        /// Create a loss layer
116        ///
117        /// Parameter `reductionType`: The reduction type to use
118        ///
119        /// Parameter `labelSmoothing`: Label smoothing value
120        ///
121        /// Parameter `classCount`: Number of classes
122        ///
123        /// Parameter `weight`: A scalar floating point value
124        ///
125        /// Returns: A new categorical cross entropy loss layer.
126        #[deprecated]
127        #[unsafe(method(categoricalCrossEntropyLossWithReductionType:labelSmoothing:classCount:weight:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn categoricalCrossEntropyLossWithReductionType_labelSmoothing_classCount_weight(
130            reduction_type: MLCReductionType,
131            label_smoothing: c_float,
132            class_count: NSUInteger,
133            weight: c_float,
134        ) -> Retained<Self>;
135
136        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
137        /// Create a loss layer
138        ///
139        /// Parameter `reductionType`: The reduction type to use
140        ///
141        /// Parameter `labelSmoothing`: Label smoothing value
142        ///
143        /// Parameter `classCount`: Number of classes
144        ///
145        /// Parameter `weights`: The loss label weights tensor
146        ///
147        /// Returns: A new categorical cross entropy loss layer.
148        #[deprecated]
149        #[unsafe(method(categoricalCrossEntropyLossWithReductionType:labelSmoothing:classCount:weights:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn categoricalCrossEntropyLossWithReductionType_labelSmoothing_classCount_weights(
152            reduction_type: MLCReductionType,
153            label_smoothing: c_float,
154            class_count: NSUInteger,
155            weights: Option<&MLCTensor>,
156        ) -> Retained<Self>;
157
158        #[cfg(feature = "MLCTypes")]
159        /// Create a loss layer
160        ///
161        /// Parameter `reductionType`: The reduction type to use
162        ///
163        /// Parameter `labelSmoothing`: Label smoothing value
164        ///
165        /// Parameter `weight`: A scalar floating-point value
166        ///
167        /// Returns: A new sigmoid cross entropy loss layer.
168        #[deprecated]
169        #[unsafe(method(sigmoidCrossEntropyLossWithReductionType:labelSmoothing:weight:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn sigmoidCrossEntropyLossWithReductionType_labelSmoothing_weight(
172            reduction_type: MLCReductionType,
173            label_smoothing: c_float,
174            weight: c_float,
175        ) -> Retained<Self>;
176
177        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
178        /// Create a loss layer
179        ///
180        /// Parameter `reductionType`: The reduction type to use
181        ///
182        /// Parameter `labelSmoothing`: Label smoothing value
183        ///
184        /// Parameter `weights`: The loss label weights tensor
185        ///
186        /// Returns: A new sigmoid cross entropy loss layer.
187        #[deprecated]
188        #[unsafe(method(sigmoidCrossEntropyLossWithReductionType:labelSmoothing:weights:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn sigmoidCrossEntropyLossWithReductionType_labelSmoothing_weights(
191            reduction_type: MLCReductionType,
192            label_smoothing: c_float,
193            weights: Option<&MLCTensor>,
194        ) -> Retained<Self>;
195
196        #[cfg(feature = "MLCTypes")]
197        /// Create a loss layer
198        ///
199        /// Parameter `reductionType`: The reduction type to use
200        ///
201        /// Parameter `epsilon`: The epsilon parameter
202        ///
203        /// Parameter `weight`: A scalar floating-point value
204        ///
205        /// Returns: A new log loss layer.
206        #[deprecated]
207        #[unsafe(method(logLossWithReductionType:epsilon:weight:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn logLossWithReductionType_epsilon_weight(
210            reduction_type: MLCReductionType,
211            epsilon: c_float,
212            weight: c_float,
213        ) -> Retained<Self>;
214
215        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
216        /// Create a loss layer
217        ///
218        /// Parameter `reductionType`: The reduction type to use
219        ///
220        /// Parameter `epsilon`: The epsilon parameter
221        ///
222        /// Parameter `weights`: The loss label weights tensor
223        ///
224        /// Returns: A new log loss layer.
225        #[deprecated]
226        #[unsafe(method(logLossWithReductionType:epsilon:weights:))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn logLossWithReductionType_epsilon_weights(
229            reduction_type: MLCReductionType,
230            epsilon: c_float,
231            weights: Option<&MLCTensor>,
232        ) -> Retained<Self>;
233
234        #[cfg(feature = "MLCTypes")]
235        /// Create a loss layer
236        ///
237        /// Parameter `reductionType`: The reduction type to use
238        ///
239        /// Parameter `delta`: The delta parameter
240        ///
241        /// Parameter `weight`: A scalar floating-point value
242        ///
243        /// Returns: A new huber loss layer.
244        #[deprecated]
245        #[unsafe(method(huberLossWithReductionType:delta:weight:))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn huberLossWithReductionType_delta_weight(
248            reduction_type: MLCReductionType,
249            delta: c_float,
250            weight: c_float,
251        ) -> Retained<Self>;
252
253        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
254        /// Create a loss layer
255        ///
256        /// Parameter `reductionType`: The reduction type to use
257        ///
258        /// Parameter `delta`: The delta parameter
259        ///
260        /// Parameter `weights`: The loss label weights tensor
261        ///
262        /// Returns: A new huber loss layer.
263        #[deprecated]
264        #[unsafe(method(huberLossWithReductionType:delta:weights:))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn huberLossWithReductionType_delta_weights(
267            reduction_type: MLCReductionType,
268            delta: c_float,
269            weights: Option<&MLCTensor>,
270        ) -> Retained<Self>;
271
272        #[cfg(feature = "MLCTypes")]
273        /// Create a loss layer
274        ///
275        /// Parameter `reductionType`: The reduction type to use
276        ///
277        /// Parameter `weight`: A scalar floating-point value
278        ///
279        /// Returns: A new L1 i.e. mean absolute error loss layer.
280        #[deprecated]
281        #[unsafe(method(meanAbsoluteErrorLossWithReductionType:weight:))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn meanAbsoluteErrorLossWithReductionType_weight(
284            reduction_type: MLCReductionType,
285            weight: c_float,
286        ) -> Retained<Self>;
287
288        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
289        /// Create a loss layer
290        ///
291        /// Parameter `reductionType`: The reduction type to use
292        ///
293        /// Parameter `weights`: The loss label weights tensor
294        ///
295        /// Returns: A new L1 i.e. mean absolute error loss layer.
296        #[deprecated]
297        #[unsafe(method(meanAbsoluteErrorLossWithReductionType:weights:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn meanAbsoluteErrorLossWithReductionType_weights(
300            reduction_type: MLCReductionType,
301            weights: Option<&MLCTensor>,
302        ) -> Retained<Self>;
303
304        #[cfg(feature = "MLCTypes")]
305        /// Create a loss layer
306        ///
307        /// Parameter `reductionType`: The reduction type to use
308        ///
309        /// Parameter `weight`: A scalar floating-point value
310        ///
311        /// Returns: A new L2 i.e. mean squared error loss layer.
312        #[deprecated]
313        #[unsafe(method(meanSquaredErrorLossWithReductionType:weight:))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn meanSquaredErrorLossWithReductionType_weight(
316            reduction_type: MLCReductionType,
317            weight: c_float,
318        ) -> Retained<Self>;
319
320        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
321        /// Create a loss layer
322        ///
323        /// Parameter `reductionType`: The reduction type to use
324        ///
325        /// Parameter `weights`: The loss label weights tensor
326        ///
327        /// Returns: A new L2 i.e. mean squared error loss layer.
328        #[deprecated]
329        #[unsafe(method(meanSquaredErrorLossWithReductionType:weights:))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn meanSquaredErrorLossWithReductionType_weights(
332            reduction_type: MLCReductionType,
333            weights: Option<&MLCTensor>,
334        ) -> Retained<Self>;
335
336        #[cfg(feature = "MLCTypes")]
337        /// Create a loss layer
338        ///
339        /// Parameter `reductionType`: The reduction type to use
340        ///
341        /// Parameter `weight`: A scalar floating-point value
342        ///
343        /// Returns: A new hinge loss layer.
344        #[deprecated]
345        #[unsafe(method(hingeLossWithReductionType:weight:))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn hingeLossWithReductionType_weight(
348            reduction_type: MLCReductionType,
349            weight: c_float,
350        ) -> Retained<Self>;
351
352        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
353        /// Create a loss layer
354        ///
355        /// Parameter `reductionType`: The reduction type to use
356        ///
357        /// Parameter `weights`: The loss label weights tensor
358        ///
359        /// Returns: A new hinge loss layer.
360        #[deprecated]
361        #[unsafe(method(hingeLossWithReductionType:weights:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn hingeLossWithReductionType_weights(
364            reduction_type: MLCReductionType,
365            weights: Option<&MLCTensor>,
366        ) -> Retained<Self>;
367
368        #[cfg(feature = "MLCTypes")]
369        /// Create a loss layer
370        ///
371        /// Parameter `reductionType`: The reduction type to use
372        ///
373        /// Parameter `weight`: A scalar floating-point value
374        ///
375        /// Returns: A new cosine distance loss layer.
376        #[deprecated]
377        #[unsafe(method(cosineDistanceLossWithReductionType:weight:))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn cosineDistanceLossWithReductionType_weight(
380            reduction_type: MLCReductionType,
381            weight: c_float,
382        ) -> Retained<Self>;
383
384        #[cfg(all(feature = "MLCTensor", feature = "MLCTypes"))]
385        /// Create a loss layer
386        ///
387        /// Parameter `reductionType`: The reduction type to use
388        ///
389        /// Parameter `weights`: The loss label weights tensor
390        ///
391        /// Returns: A new cosine distance loss layer.
392        #[deprecated]
393        #[unsafe(method(cosineDistanceLossWithReductionType:weights:))]
394        #[unsafe(method_family = none)]
395        pub unsafe fn cosineDistanceLossWithReductionType_weights(
396            reduction_type: MLCReductionType,
397            weights: Option<&MLCTensor>,
398        ) -> Retained<Self>;
399    );
400}
401
402/// Methods declared on superclass `MLCLayer`.
403#[cfg(all(feature = "MLCLayer", feature = "MLCLossLayer"))]
404impl MLCYOLOLossLayer {
405    extern_methods!(
406        #[deprecated]
407        #[unsafe(method(new))]
408        #[unsafe(method_family = new)]
409        pub unsafe fn new() -> Retained<Self>;
410
411        #[deprecated]
412        #[unsafe(method(init))]
413        #[unsafe(method_family = init)]
414        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
415    );
416}