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