objc2_ml_compute/generated/
MLCLayerNormalizationLayer.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// The layer normalizaion layer.  For more information, refer to https://pytorch.org/docs/stable/nn.html#layernorm.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlclayernormalizationlayer?language=objc)
14    #[unsafe(super(MLCLayer, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "MLCLayer")]
17    #[deprecated]
18    pub struct MLCLayerNormalizationLayer;
19);
20
21#[cfg(feature = "MLCLayer")]
22extern_conformance!(
23    unsafe impl NSObjectProtocol for MLCLayerNormalizationLayer {}
24);
25
26#[cfg(feature = "MLCLayer")]
27impl MLCLayerNormalizationLayer {
28    extern_methods!(
29        /// The shape of the axes over which normalization occurs, (W), (H,W) or (C,H,W)
30        #[deprecated]
31        #[unsafe(method(normalizedShape))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn normalizedShape(&self) -> Retained<NSArray<NSNumber>>;
34
35        #[cfg(feature = "MLCTensor")]
36        /// The beta tensor
37        #[deprecated]
38        #[unsafe(method(beta))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn beta(&self) -> Option<Retained<MLCTensor>>;
41
42        #[cfg(feature = "MLCTensor")]
43        /// The gamma tensor
44        #[deprecated]
45        #[unsafe(method(gamma))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn gamma(&self) -> Option<Retained<MLCTensor>>;
48
49        #[cfg(feature = "MLCTensorParameter")]
50        /// The beta tensor parameter used for optimizer update
51        #[deprecated]
52        #[unsafe(method(betaParameter))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn betaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
55
56        #[cfg(feature = "MLCTensorParameter")]
57        /// The gamma tensor parameter used for optimizer update
58        #[deprecated]
59        #[unsafe(method(gammaParameter))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn gammaParameter(&self) -> Option<Retained<MLCTensorParameter>>;
62
63        /// A value used for numerical stability
64        #[deprecated]
65        #[unsafe(method(varianceEpsilon))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn varianceEpsilon(&self) -> c_float;
68
69        #[cfg(feature = "MLCTensor")]
70        /// Create a layer normalization layer
71        ///
72        /// Parameter `normalizedShape`: The shape of the axes over which normalization occurs, currently (C,H,W) only
73        ///
74        /// Parameter `beta`: Training parameter
75        ///
76        /// Parameter `gamma`: Training parameter
77        ///
78        /// Parameter `varianceEpsilon`: A small numerical value added to variance for stability
79        ///
80        /// Returns: A new layer normalization layer.
81        #[deprecated]
82        #[unsafe(method(layerWithNormalizedShape:beta:gamma:varianceEpsilon:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn layerWithNormalizedShape_beta_gamma_varianceEpsilon(
85            normalized_shape: &NSArray<NSNumber>,
86            beta: Option<&MLCTensor>,
87            gamma: Option<&MLCTensor>,
88            variance_epsilon: c_float,
89        ) -> Option<Retained<Self>>;
90    );
91}
92
93/// Methods declared on superclass `MLCLayer`.
94#[cfg(feature = "MLCLayer")]
95impl MLCLayerNormalizationLayer {
96    extern_methods!(
97        #[deprecated]
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub unsafe fn new() -> Retained<Self>;
101
102        #[deprecated]
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106    );
107}