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