objc2_ml_compute/generated/
MLCGroupNormalizationLayer.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 group normalizaion layer.  For more information, refer to https://pytorch.org/docs/stable/nn.html#groupnorm
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcgroupnormalizationlayer?language=objc)
13    #[unsafe(super(MLCLayer, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MLCLayer")]
16    #[deprecated]
17    pub struct MLCGroupNormalizationLayer;
18);
19
20#[cfg(feature = "MLCLayer")]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for MLCGroupNormalizationLayer {}
23);
24
25#[cfg(feature = "MLCLayer")]
26impl MLCGroupNormalizationLayer {
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        /// The number of groups to separate the channels into
35        #[deprecated]
36        #[unsafe(method(groupCount))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn groupCount(&self) -> NSUInteger;
39
40        #[cfg(feature = "MLCTensor")]
41        /// The beta tensor
42        #[deprecated]
43        #[unsafe(method(beta))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn beta(&self) -> Option<Retained<MLCTensor>>;
46
47        #[cfg(feature = "MLCTensor")]
48        /// The gamma tensor
49        #[deprecated]
50        #[unsafe(method(gamma))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn gamma(&self) -> Option<Retained<MLCTensor>>;
53
54        #[cfg(feature = "MLCTensorParameter")]
55        /// The beta tensor parameter used for optimizer update
56        #[deprecated]
57        #[unsafe(method(betaParameter))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn betaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
60
61        #[cfg(feature = "MLCTensorParameter")]
62        /// The gamma tensor parameter used for optimizer update
63        #[deprecated]
64        #[unsafe(method(gammaParameter))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn gammaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
67
68        /// A value used for numerical stability
69        #[deprecated]
70        #[unsafe(method(varianceEpsilon))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn varianceEpsilon(&self) -> c_float;
73
74        #[cfg(feature = "MLCTensor")]
75        /// Create a group normalization layer
76        ///
77        /// Parameter `featureChannelCount`: The number of feature channels
78        ///
79        /// Parameter `beta`: Training parameter
80        ///
81        /// Parameter `gamma`: Training parameter
82        ///
83        /// Parameter `groupCount`: The number of groups to divide the feature channels into
84        ///
85        /// Parameter `varianceEpsilon`: A small numerical value added to variance for stability
86        ///
87        /// Returns: A new group normalization layer.
88        #[deprecated]
89        #[unsafe(method(layerWithFeatureChannelCount:groupCount:beta:gamma:varianceEpsilon:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn layerWithFeatureChannelCount_groupCount_beta_gamma_varianceEpsilon(
92            feature_channel_count: NSUInteger,
93            group_count: NSUInteger,
94            beta: Option<&MLCTensor>,
95            gamma: Option<&MLCTensor>,
96            variance_epsilon: c_float,
97        ) -> Option<Retained<Self>>;
98    );
99}
100
101/// Methods declared on superclass `MLCLayer`.
102#[cfg(feature = "MLCLayer")]
103impl MLCGroupNormalizationLayer {
104    extern_methods!(
105        #[deprecated]
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub unsafe fn new() -> Retained<Self>;
109
110        #[deprecated]
111        #[unsafe(method(init))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
114    );
115}