objc2_ml_compute/generated/
MLCActivationLayer.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    /// [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcactivationlayer?language=objc)
11    #[unsafe(super(MLCLayer, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "MLCLayer")]
14    #[deprecated]
15    pub struct MLCActivationLayer;
16);
17
18#[cfg(feature = "MLCLayer")]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for MLCActivationLayer {}
21);
22
23#[cfg(feature = "MLCLayer")]
24impl MLCActivationLayer {
25    extern_methods!(
26        #[cfg(feature = "MLCActivationDescriptor")]
27        /// The activation descriptor
28        #[deprecated]
29        #[unsafe(method(descriptor))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn descriptor(&self) -> Retained<MLCActivationDescriptor>;
32
33        #[cfg(feature = "MLCActivationDescriptor")]
34        /// Create an activation layer
35        ///
36        /// Parameter `descriptor`: The activation descriptor
37        ///
38        /// Returns: A new activation layer
39        #[deprecated]
40        #[unsafe(method(layerWithDescriptor:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn layerWithDescriptor(descriptor: &MLCActivationDescriptor) -> Retained<Self>;
43
44        /// Create a ReLU activation layer
45        ///
46        /// Returns: A new activation layer
47        #[deprecated]
48        #[unsafe(method(reluLayer))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn reluLayer() -> Retained<MLCActivationLayer>;
51
52        /// Create a ReLU6 activation layer
53        ///
54        /// Returns: A new activation layer
55        #[deprecated]
56        #[unsafe(method(relu6Layer))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn relu6Layer() -> Retained<MLCActivationLayer>;
59
60        /// Create a leaky ReLU activation layer
61        ///
62        /// Returns: A new activation layer
63        #[deprecated]
64        #[unsafe(method(leakyReLULayer))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn leakyReLULayer() -> Retained<MLCActivationLayer>;
67
68        /// Create a leaky ReLU activation layer
69        ///
70        /// Parameter `negativeSlope`: Controls the angle of the negative slope
71        ///
72        /// Returns: A new activation layer
73        #[deprecated]
74        #[unsafe(method(leakyReLULayerWithNegativeSlope:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn leakyReLULayerWithNegativeSlope(negative_slope: c_float) -> Retained<Self>;
77
78        /// Create a linear activation layer
79        ///
80        /// Parameter `scale`: The scale factor
81        ///
82        /// Parameter `bias`: The bias value
83        ///
84        /// Returns: A new activation layer
85        #[deprecated]
86        #[unsafe(method(linearLayerWithScale:bias:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn linearLayerWithScale_bias(scale: c_float, bias: c_float) -> Retained<Self>;
89
90        /// Create a sigmoid activation layer
91        ///
92        /// Returns: A new activation layer
93        #[deprecated]
94        #[unsafe(method(sigmoidLayer))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn sigmoidLayer() -> Retained<MLCActivationLayer>;
97
98        /// Create a hard sigmoid activation layer
99        ///
100        /// Returns: A new activation layer
101        #[deprecated]
102        #[unsafe(method(hardSigmoidLayer))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn hardSigmoidLayer() -> Retained<MLCActivationLayer>;
105
106        /// Create a tanh activation layer
107        ///
108        /// Returns: A new activation layer
109        #[deprecated]
110        #[unsafe(method(tanhLayer))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn tanhLayer() -> Retained<MLCActivationLayer>;
113
114        /// Create an absolute activation layer
115        ///
116        /// Returns: A new activation layer
117        #[deprecated]
118        #[unsafe(method(absoluteLayer))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn absoluteLayer() -> Retained<MLCActivationLayer>;
121
122        /// Create a soft plus activation layer
123        ///
124        /// Returns: A new activation layer
125        #[deprecated]
126        #[unsafe(method(softPlusLayer))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn softPlusLayer() -> Retained<MLCActivationLayer>;
129
130        /// Create a soft plus activation layer
131        ///
132        /// Parameter `beta`: The beta value for the softplus formation
133        ///
134        /// Returns: A new activation layer
135        #[deprecated]
136        #[unsafe(method(softPlusLayerWithBeta:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn softPlusLayerWithBeta(beta: c_float) -> Retained<Self>;
139
140        /// Create a soft sign activation layer
141        ///
142        /// Returns: A new activation layer
143        #[deprecated]
144        #[unsafe(method(softSignLayer))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn softSignLayer() -> Retained<MLCActivationLayer>;
147
148        /// Create an ELU activation layer
149        ///
150        /// Returns: A new activation layer
151        #[deprecated]
152        #[unsafe(method(eluLayer))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn eluLayer() -> Retained<MLCActivationLayer>;
155
156        /// Create an ELU activation layer
157        ///
158        /// Parameter `a`: The
159        /// `a`value for the ELU formation
160        ///
161        /// Returns: A new activation layer
162        #[deprecated]
163        #[unsafe(method(eluLayerWithA:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn eluLayerWithA(a: c_float) -> Retained<Self>;
166
167        /// Create a ReLUN activation layer
168        ///
169        /// This can be used to implement layers such as ReLU6 for example.
170        ///
171        /// Parameter `a`: The
172        /// `a`value
173        ///
174        /// Parameter `b`: The
175        /// `b`value
176        ///
177        /// Returns: A new activation layer
178        #[deprecated]
179        #[unsafe(method(relunLayerWithA:b:))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn relunLayerWithA_b(a: c_float, b: c_float) -> Retained<Self>;
182
183        /// Create a log sigmoid activation layer
184        ///
185        /// Returns: A new activation layer
186        #[deprecated]
187        #[unsafe(method(logSigmoidLayer))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn logSigmoidLayer() -> Retained<MLCActivationLayer>;
190
191        /// Create a SELU activation layer
192        ///
193        /// Returns: A new activation layer
194        #[deprecated]
195        #[unsafe(method(seluLayer))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn seluLayer() -> Retained<MLCActivationLayer>;
198
199        /// Create a CELU activation layer
200        ///
201        /// Returns: A new activation layer
202        #[deprecated]
203        #[unsafe(method(celuLayer))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn celuLayer() -> Retained<MLCActivationLayer>;
206
207        /// Create a CELU activation layer
208        ///
209        /// Parameter `a`: The
210        /// `a`value for the CELU formation
211        ///
212        /// Returns: A new activation layer
213        #[deprecated]
214        #[unsafe(method(celuLayerWithA:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn celuLayerWithA(a: c_float) -> Retained<Self>;
217
218        /// Create a hard shrink activation layer
219        ///
220        /// Returns: A new activation layer
221        #[deprecated]
222        #[unsafe(method(hardShrinkLayer))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn hardShrinkLayer() -> Retained<MLCActivationLayer>;
225
226        /// Create a hard shrink activation layer
227        ///
228        /// Parameter `a`: The
229        /// `a`value for the hard shrink formation
230        ///
231        /// Returns: A new activation layer
232        #[deprecated]
233        #[unsafe(method(hardShrinkLayerWithA:))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn hardShrinkLayerWithA(a: c_float) -> Retained<Self>;
236
237        /// Create a soft shrink activation layer
238        ///
239        /// Returns: A new activation layer
240        #[deprecated]
241        #[unsafe(method(softShrinkLayer))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn softShrinkLayer() -> Retained<MLCActivationLayer>;
244
245        /// Create a soft shrink activation layer
246        ///
247        /// Parameter `a`: The
248        /// `a`value for the soft shrink formation
249        ///
250        /// Returns: A new activation layer
251        #[deprecated]
252        #[unsafe(method(softShrinkLayerWithA:))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn softShrinkLayerWithA(a: c_float) -> Retained<Self>;
255
256        /// Create a TanhShrink activation layer
257        ///
258        /// Returns: A new activation layer
259        #[deprecated]
260        #[unsafe(method(tanhShrinkLayer))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn tanhShrinkLayer() -> Retained<MLCActivationLayer>;
263
264        /// Create a threshold activation layer
265        ///
266        /// Parameter `threshold`: The value to threshold at
267        ///
268        /// Parameter `replacement`: The value to replace with
269        ///
270        /// Returns: A new activation layer
271        #[deprecated]
272        #[unsafe(method(thresholdLayerWithThreshold:replacement:))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn thresholdLayerWithThreshold_replacement(
275            threshold: c_float,
276            replacement: c_float,
277        ) -> Retained<Self>;
278
279        /// Create a GELU activation layer
280        ///
281        /// Returns: A new activation layer
282        #[deprecated]
283        #[unsafe(method(geluLayer))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn geluLayer() -> Retained<MLCActivationLayer>;
286
287        /// Create a hardswish activation layer
288        ///
289        /// Returns: A new activation layer
290        #[deprecated]
291        #[unsafe(method(hardSwishLayer))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn hardSwishLayer() -> Retained<MLCActivationLayer>;
294
295        /// Create a clamp activation layer
296        ///
297        /// Parameter `minValue`: The minimum range used by clamp
298        ///
299        /// Parameter `maxValue`: The maximum range used by clamp
300        ///
301        /// Returns: A new activation layer
302        #[deprecated]
303        #[unsafe(method(clampLayerWithMinValue:maxValue:))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn clampLayerWithMinValue_maxValue(
306            min_value: c_float,
307            max_value: c_float,
308        ) -> Retained<Self>;
309    );
310}
311
312/// Methods declared on superclass `MLCLayer`.
313#[cfg(feature = "MLCLayer")]
314impl MLCActivationLayer {
315    extern_methods!(
316        #[deprecated]
317        #[unsafe(method(new))]
318        #[unsafe(method_family = new)]
319        pub unsafe fn new() -> Retained<Self>;
320
321        #[deprecated]
322        #[unsafe(method(init))]
323        #[unsafe(method_family = init)]
324        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
325    );
326}