objc2_ml_compute/generated/
MLCFullyConnectedLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// A fully connected layer a.k.a a dense layer
10    ///
11    /// For C:input feature channel, C':output feature channel, the layer maps (*,C) --> (*,C') where * can be 1, 2 or 3 dimesnion.
12    /// There is an exception for the case of (N,C,1,1) which gets mapped to (N,C',1,1).
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcfullyconnectedlayer?language=objc)
15    #[unsafe(super(MLCLayer, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "MLCLayer")]
18    #[deprecated]
19    pub struct MLCFullyConnectedLayer;
20);
21
22#[cfg(feature = "MLCLayer")]
23extern_conformance!(
24    unsafe impl NSObjectProtocol for MLCFullyConnectedLayer {}
25);
26
27#[cfg(feature = "MLCLayer")]
28impl MLCFullyConnectedLayer {
29    extern_methods!(
30        #[cfg(feature = "MLCConvolutionDescriptor")]
31        /// The convolution descriptor
32        #[deprecated]
33        #[unsafe(method(descriptor))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn descriptor(&self) -> Retained<MLCConvolutionDescriptor>;
36
37        #[cfg(feature = "MLCTensor")]
38        /// The weights tensor used by the convolution layer
39        #[deprecated]
40        #[unsafe(method(weights))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn weights(&self) -> Retained<MLCTensor>;
43
44        #[cfg(feature = "MLCTensor")]
45        /// The bias tensor used by the convolution layer
46        #[deprecated]
47        #[unsafe(method(biases))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn biases(&self) -> Option<Retained<MLCTensor>>;
50
51        #[cfg(feature = "MLCTensorParameter")]
52        /// The weights tensor parameter used for optimizer update
53        #[deprecated]
54        #[unsafe(method(weightsParameter))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn weightsParameter(&self) -> Retained<MLCTensorParameter>;
57
58        #[cfg(feature = "MLCTensorParameter")]
59        /// The bias tensor parameter used for optimizer update
60        #[deprecated]
61        #[unsafe(method(biasesParameter))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn biasesParameter(&self) -> Option<Retained<MLCTensorParameter>>;
64
65        #[cfg(all(feature = "MLCConvolutionDescriptor", feature = "MLCTensor"))]
66        /// Create a fully connected layer
67        ///
68        /// Parameter `weights`: The weights tensor
69        ///
70        /// Parameter `biases`: The bias tensor
71        ///
72        /// Parameter `descriptor`: The convolution descriptor
73        ///
74        /// Returns: A new fully connected layer
75        #[deprecated]
76        #[unsafe(method(layerWithWeights:biases:descriptor:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn layerWithWeights_biases_descriptor(
79            weights: &MLCTensor,
80            biases: Option<&MLCTensor>,
81            descriptor: &MLCConvolutionDescriptor,
82        ) -> Option<Retained<Self>>;
83    );
84}
85
86/// Methods declared on superclass `MLCLayer`.
87#[cfg(feature = "MLCLayer")]
88impl MLCFullyConnectedLayer {
89    extern_methods!(
90        #[deprecated]
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94
95        #[deprecated]
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99    );
100}