objc2_ml_compute/generated/
MLCBatchNormalizationLayer.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 batch normalizaion layer
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcbatchnormalizationlayer?language=objc)
13    #[unsafe(super(MLCLayer, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MLCLayer")]
16    #[deprecated]
17    pub struct MLCBatchNormalizationLayer;
18);
19
20#[cfg(feature = "MLCLayer")]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for MLCBatchNormalizationLayer {}
23);
24
25#[cfg(feature = "MLCLayer")]
26impl MLCBatchNormalizationLayer {
27    extern_methods!(
28        /// The number of feature channels
29        #[deprecated]
30        #[unsafe(method(featureChannelCount))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn featureChannelCount(&self) -> NSUInteger;
33
34        #[cfg(feature = "MLCTensor")]
35        /// The mean tensor
36        #[deprecated]
37        #[unsafe(method(mean))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn mean(&self) -> Retained<MLCTensor>;
40
41        #[cfg(feature = "MLCTensor")]
42        /// The variance tensor
43        #[deprecated]
44        #[unsafe(method(variance))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn variance(&self) -> Retained<MLCTensor>;
47
48        #[cfg(feature = "MLCTensor")]
49        /// The beta tensor
50        #[deprecated]
51        #[unsafe(method(beta))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn beta(&self) -> Option<Retained<MLCTensor>>;
54
55        #[cfg(feature = "MLCTensor")]
56        /// The gamma tensor
57        #[deprecated]
58        #[unsafe(method(gamma))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn gamma(&self) -> Option<Retained<MLCTensor>>;
61
62        #[cfg(feature = "MLCTensorParameter")]
63        /// The beta tensor parameter used for optimizer update
64        #[deprecated]
65        #[unsafe(method(betaParameter))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn betaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
68
69        #[cfg(feature = "MLCTensorParameter")]
70        /// The gamma tensor parameter used for optimizer update
71        #[deprecated]
72        #[unsafe(method(gammaParameter))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn gammaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
75
76        /// A value used for numerical stability
77        #[deprecated]
78        #[unsafe(method(varianceEpsilon))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn varianceEpsilon(&self) -> c_float;
81
82        /// The value used for the running mean and variance computation
83        ///
84        /// The default is 0.99f.
85        #[deprecated]
86        #[unsafe(method(momentum))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn momentum(&self) -> c_float;
89
90        #[cfg(feature = "MLCTensor")]
91        /// Create a batch normalization layer
92        ///
93        /// Parameter `featureChannelCount`: The number of feature channels
94        ///
95        /// Parameter `mean`: The mean tensor
96        ///
97        /// Parameter `variance`: The variance tensor
98        ///
99        /// Parameter `beta`: The beta tensor
100        ///
101        /// Parameter `gamma`: The gamma tensor
102        ///
103        /// Parameter `varianceEpsilon`: The  epslion value
104        ///
105        /// Returns: A new batch normalization layer.
106        #[deprecated]
107        #[unsafe(method(layerWithFeatureChannelCount:mean:variance:beta:gamma:varianceEpsilon:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn layerWithFeatureChannelCount_mean_variance_beta_gamma_varianceEpsilon(
110            feature_channel_count: NSUInteger,
111            mean: &MLCTensor,
112            variance: &MLCTensor,
113            beta: Option<&MLCTensor>,
114            gamma: Option<&MLCTensor>,
115            variance_epsilon: c_float,
116        ) -> Option<Retained<Self>>;
117
118        #[cfg(feature = "MLCTensor")]
119        /// Create a batch normalization layer
120        ///
121        /// Parameter `featureChannelCount`: The number of feature channels
122        ///
123        /// Parameter `mean`: The mean tensor
124        ///
125        /// Parameter `variance`: The variance tensor
126        ///
127        /// Parameter `beta`: The beta tensor
128        ///
129        /// Parameter `gamma`: The gamma tensor
130        ///
131        /// Parameter `varianceEpsilon`: The  epslion value
132        ///
133        /// Parameter `momentum`: The  momentum value for the running mean and variance computation
134        ///
135        /// Returns: A new batch normalization layer.
136        #[deprecated]
137        #[unsafe(method(layerWithFeatureChannelCount:mean:variance:beta:gamma:varianceEpsilon:momentum:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn layerWithFeatureChannelCount_mean_variance_beta_gamma_varianceEpsilon_momentum(
140            feature_channel_count: NSUInteger,
141            mean: &MLCTensor,
142            variance: &MLCTensor,
143            beta: Option<&MLCTensor>,
144            gamma: Option<&MLCTensor>,
145            variance_epsilon: c_float,
146            momentum: c_float,
147        ) -> Option<Retained<Self>>;
148    );
149}
150
151/// Methods declared on superclass `MLCLayer`.
152#[cfg(feature = "MLCLayer")]
153impl MLCBatchNormalizationLayer {
154    extern_methods!(
155        #[deprecated]
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub unsafe fn new() -> Retained<Self>;
159
160        #[deprecated]
161        #[unsafe(method(init))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
164    );
165}