objc2_ml_compute/generated/MLCLSTMLayer.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// A LSTM layer
11 ///
12 /// The hidden and cell state for inputs and outputs have a layout of [numberOfLayers, numberOfDirections, batchSize, hiddenSize].
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlclstmlayer?language=objc)
15 #[unsafe(super(MLCLayer, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "MLCLayer")]
18 #[deprecated]
19 pub struct MLCLSTMLayer;
20);
21
22#[cfg(feature = "MLCLayer")]
23extern_conformance!(
24 unsafe impl NSObjectProtocol for MLCLSTMLayer {}
25);
26
27#[cfg(feature = "MLCLayer")]
28impl MLCLSTMLayer {
29 extern_methods!(
30 #[cfg(feature = "MLCLSTMDescriptor")]
31 /// The LSTM descriptor
32 #[deprecated]
33 #[unsafe(method(descriptor))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn descriptor(&self) -> Retained<MLCLSTMDescriptor>;
36
37 #[cfg(feature = "MLCActivationDescriptor")]
38 /// The array of gate activations for input, hidden, cell and output gates
39 ///
40 /// The default gate activations are: sigmoid, sigmoid, tanh, sigmoid
41 #[deprecated]
42 #[unsafe(method(gateActivations))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn gateActivations(&self) -> Retained<NSArray<MLCActivationDescriptor>>;
45
46 #[cfg(feature = "MLCActivationDescriptor")]
47 /// The output activation descriptor
48 #[deprecated]
49 #[unsafe(method(outputResultActivation))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn outputResultActivation(&self) -> Retained<MLCActivationDescriptor>;
52
53 #[cfg(feature = "MLCTensor")]
54 /// The array of tensors describing the input weights for the input, hidden, cell and output gates
55 #[deprecated]
56 #[unsafe(method(inputWeights))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn inputWeights(&self) -> Retained<NSArray<MLCTensor>>;
59
60 #[cfg(feature = "MLCTensor")]
61 /// The array of tensors describing the hidden weights for the input, hidden, cell and output gates
62 #[deprecated]
63 #[unsafe(method(hiddenWeights))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn hiddenWeights(&self) -> Retained<NSArray<MLCTensor>>;
66
67 #[cfg(feature = "MLCTensor")]
68 /// The array of tensors describing the peephole weights for the input, hidden, cell and output gates
69 #[deprecated]
70 #[unsafe(method(peepholeWeights))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn peepholeWeights(&self) -> Option<Retained<NSArray<MLCTensor>>>;
73
74 #[cfg(feature = "MLCTensor")]
75 /// The array of tensors describing the bias terms for the input, hidden, cell and output gates
76 #[deprecated]
77 #[unsafe(method(biases))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn biases(&self) -> Option<Retained<NSArray<MLCTensor>>>;
80
81 #[cfg(feature = "MLCTensorParameter")]
82 /// The input weights tensor parameters used for optimizer update
83 #[deprecated]
84 #[unsafe(method(inputWeightsParameters))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn inputWeightsParameters(&self) -> Retained<NSArray<MLCTensorParameter>>;
87
88 #[cfg(feature = "MLCTensorParameter")]
89 /// The hidden weights tensor parameters used for optimizer update
90 #[deprecated]
91 #[unsafe(method(hiddenWeightsParameters))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn hiddenWeightsParameters(&self) -> Retained<NSArray<MLCTensorParameter>>;
94
95 #[cfg(feature = "MLCTensorParameter")]
96 /// The peephole weights tensor parameters used for optimizer update
97 #[deprecated]
98 #[unsafe(method(peepholeWeightsParameters))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn peepholeWeightsParameters(
101 &self,
102 ) -> Option<Retained<NSArray<MLCTensorParameter>>>;
103
104 #[cfg(feature = "MLCTensorParameter")]
105 /// The bias tensor parameter used for optimizer update
106 #[deprecated]
107 #[unsafe(method(biasesParameters))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn biasesParameters(&self) -> Option<Retained<NSArray<MLCTensorParameter>>>;
110
111 #[cfg(all(feature = "MLCLSTMDescriptor", feature = "MLCTensor"))]
112 /// Create a LSTM layer
113 ///
114 /// Parameter `descriptor`: The LSTM descriptor
115 ///
116 /// Parameter `inputWeights`: An array of (layerCount * 4) tensors describing the input weights for the
117 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
118 ///
119 /// Parameter `hiddenWeights`: An array of (layerCount * 4) tensors describing the hidden weights for the
120 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
121 ///
122 /// Returns: A new LSTM layer.
123 #[deprecated]
124 #[unsafe(method(layerWithDescriptor:inputWeights:hiddenWeights:biases:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn layerWithDescriptor_inputWeights_hiddenWeights_biases(
127 descriptor: &MLCLSTMDescriptor,
128 input_weights: &NSArray<MLCTensor>,
129 hidden_weights: &NSArray<MLCTensor>,
130 biases: Option<&NSArray<MLCTensor>>,
131 ) -> Option<Retained<Self>>;
132
133 #[cfg(all(feature = "MLCLSTMDescriptor", feature = "MLCTensor"))]
134 /// Create a LSTM layer
135 ///
136 /// Parameter `descriptor`: The LSTM descriptor
137 ///
138 /// Parameter `inputWeights`: An array of (layerCount * 4) tensors describing the input weights for the
139 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
140 ///
141 /// Parameter `hiddenWeights`: An array of (layerCount * 4) tensors describing the hidden weights for the
142 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
143 ///
144 /// Parameter `peepholeWeights`: An array of (layerCount * 4) tensors describing the peephole weights for the
145 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
146 ///
147 /// Returns: A new LSTM layer.
148 #[deprecated]
149 #[unsafe(method(layerWithDescriptor:inputWeights:hiddenWeights:peepholeWeights:biases:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn layerWithDescriptor_inputWeights_hiddenWeights_peepholeWeights_biases(
152 descriptor: &MLCLSTMDescriptor,
153 input_weights: &NSArray<MLCTensor>,
154 hidden_weights: &NSArray<MLCTensor>,
155 peephole_weights: Option<&NSArray<MLCTensor>>,
156 biases: Option<&NSArray<MLCTensor>>,
157 ) -> Option<Retained<Self>>;
158
159 #[cfg(all(
160 feature = "MLCActivationDescriptor",
161 feature = "MLCLSTMDescriptor",
162 feature = "MLCTensor"
163 ))]
164 /// Create a LSTM layer
165 ///
166 /// Parameter `descriptor`: The LSTM descriptor
167 ///
168 /// Parameter `inputWeights`: An array of (layerCount * 4) tensors describing the input weights for the
169 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
170 /// For bidirectional LSTM, the forward time weights for all stacked layers will come first followed by backward time weights
171 ///
172 /// Parameter `hiddenWeights`: An array of (layerCount * 4) tensors describing the hidden weights for the
173 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
174 /// For bidirectional LSTM, the forward time weights for all stacked layers will come first followed by backward time weights
175 ///
176 /// Parameter `peepholeWeights`: An array of (layerCount * 4) tensors describing the peephole weights for the
177 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
178 ///
179 /// Parameter `biases`: An array of (layerCount * 4) tensors describing the input weights for the
180 /// input, hidden, cell and output gates for layer0, layer1.. layer(n-1) for layerCount=n.
181 /// For bidirectional LSTM, the forward time bias terms for all stacked layers will come first followed by backward time bias terms
182 ///
183 /// Parameter `gateActivations`: An array of 4 neuron descriptors for the input, hidden, cell and output gate activations.
184 ///
185 /// Parameter `outputResultActivation`: The neuron descriptor used for the activation function applied to output result. Default is tanh.
186 ///
187 /// Returns: A new LSTM layer.
188 #[deprecated]
189 #[unsafe(method(layerWithDescriptor:inputWeights:hiddenWeights:peepholeWeights:biases:gateActivations:outputResultActivation:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn layerWithDescriptor_inputWeights_hiddenWeights_peepholeWeights_biases_gateActivations_outputResultActivation(
192 descriptor: &MLCLSTMDescriptor,
193 input_weights: &NSArray<MLCTensor>,
194 hidden_weights: &NSArray<MLCTensor>,
195 peephole_weights: Option<&NSArray<MLCTensor>>,
196 biases: Option<&NSArray<MLCTensor>>,
197 gate_activations: &NSArray<MLCActivationDescriptor>,
198 output_result_activation: &MLCActivationDescriptor,
199 ) -> Option<Retained<Self>>;
200 );
201}
202
203/// Methods declared on superclass `MLCLayer`.
204#[cfg(feature = "MLCLayer")]
205impl MLCLSTMLayer {
206 extern_methods!(
207 #[deprecated]
208 #[unsafe(method(new))]
209 #[unsafe(method_family = new)]
210 pub unsafe fn new() -> Retained<Self>;
211
212 #[deprecated]
213 #[unsafe(method(init))]
214 #[unsafe(method_family = init)]
215 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
216 );
217}