objc2_ml_compute/generated/MLCLSTMDescriptor.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 MLCLSTMDescriptor specifies a LSTM descriptor
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlclstmdescriptor?language=objc)
14 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[deprecated]
17 pub struct MLCLSTMDescriptor;
18);
19
20extern_conformance!(
21 unsafe impl NSCopying for MLCLSTMDescriptor {}
22);
23
24unsafe impl CopyingHelper for MLCLSTMDescriptor {
25 type Result = Self;
26}
27
28extern_conformance!(
29 unsafe impl NSObjectProtocol for MLCLSTMDescriptor {}
30);
31
32impl MLCLSTMDescriptor {
33 extern_methods!(
34 #[deprecated]
35 #[unsafe(method(new))]
36 #[unsafe(method_family = new)]
37 pub unsafe fn new() -> Retained<Self>;
38
39 #[deprecated]
40 #[unsafe(method(init))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44 /// The number of expected feature channels in the input
45 #[deprecated]
46 #[unsafe(method(inputSize))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn inputSize(&self) -> NSUInteger;
49
50 /// The number of feature channels in the hidden state
51 #[deprecated]
52 #[unsafe(method(hiddenSize))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn hiddenSize(&self) -> NSUInteger;
55
56 /// The number of recurrent layers. Default is 1.
57 #[deprecated]
58 #[unsafe(method(layerCount))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn layerCount(&self) -> NSUInteger;
61
62 /// If NO, the layer does not use bias terms. Default is YES.
63 #[deprecated]
64 #[unsafe(method(usesBiases))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn usesBiases(&self) -> bool;
67
68 /// LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is YES.
69 #[deprecated]
70 #[unsafe(method(batchFirst))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn batchFirst(&self) -> bool;
73
74 /// If YES, becomes a bidirectional LSTM. Default is NO.
75 #[deprecated]
76 #[unsafe(method(isBidirectional))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn isBidirectional(&self) -> bool;
79
80 /// if YES return output for all sequences else return output only for the last sequences. Default: YES
81 #[deprecated]
82 #[unsafe(method(returnsSequences))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn returnsSequences(&self) -> bool;
85
86 /// If non-zero, intrdouces a dropout layer on the outputs of each LSTM layer
87 /// except the last layer, with dropout probablity equal to dropout. Default is 0.0.
88 #[deprecated]
89 #[unsafe(method(dropout))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn dropout(&self) -> c_float;
92
93 #[cfg(feature = "MLCTypes")]
94 /// MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns
95 /// output data, last hidden state h_n, and last cell state c_n. Default MLCLSTMResultModeOutput.
96 #[deprecated]
97 #[unsafe(method(resultMode))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn resultMode(&self) -> MLCLSTMResultMode;
100
101 /// Creates a LSTM descriptor with batchFirst = YES
102 ///
103 /// Parameter `inputSize`: The number of expected features in the input
104 ///
105 /// Parameter `hiddenSize`: The number of features in the hidden state
106 ///
107 /// Parameter `layerCount`: Number of recurrent layers
108 ///
109 /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
110 #[deprecated]
111 #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount(
114 input_size: NSUInteger,
115 hidden_size: NSUInteger,
116 layer_count: NSUInteger,
117 ) -> Retained<Self>;
118
119 /// Creates a LSTM descriptor descriptor with batchFirst = YES
120 ///
121 /// Parameter `inputSize`: The number of expected features in the input
122 ///
123 /// Parameter `hiddenSize`: The number of features in the hidden state
124 ///
125 /// Parameter `layerCount`: Number of recurrent layers
126 ///
127 /// Parameter `usesBiases`: If NO, the layer does not use bias weights. Default: YES
128 ///
129 /// Parameter `isBidirectional`: If YES, becomes a bi-directional LSTM. Default: NO
130 ///
131 /// Parameter `dropout`: If non-zero, introduces a dropout layer on the outputs of each LSTM layer except the last layer
132 /// with dropout probability equal to dropout.
133 ///
134 /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
135 #[deprecated]
136 #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:isBidirectional:dropout:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_isBidirectional_dropout(
139 input_size: NSUInteger,
140 hidden_size: NSUInteger,
141 layer_count: NSUInteger,
142 uses_biases: bool,
143 is_bidirectional: bool,
144 dropout: c_float,
145 ) -> Retained<Self>;
146
147 #[deprecated]
148 #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:dropout:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_dropout(
151 input_size: NSUInteger,
152 hidden_size: NSUInteger,
153 layer_count: NSUInteger,
154 uses_biases: bool,
155 batch_first: bool,
156 is_bidirectional: bool,
157 dropout: c_float,
158 ) -> Retained<Self>;
159
160 #[deprecated]
161 #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:returnsSequences:dropout:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_returnsSequences_dropout(
164 input_size: NSUInteger,
165 hidden_size: NSUInteger,
166 layer_count: NSUInteger,
167 uses_biases: bool,
168 batch_first: bool,
169 is_bidirectional: bool,
170 returns_sequences: bool,
171 dropout: c_float,
172 ) -> Retained<Self>;
173
174 #[cfg(feature = "MLCTypes")]
175 /// Creates a LSTM descriptor.
176 ///
177 /// Parameter `inputSize`: The number of expected features in the input
178 ///
179 /// Parameter `hiddenSize`: The number of features in the hidden state
180 ///
181 /// Parameter `layerCount`: Number of recurrent layers
182 ///
183 /// Parameter `usesBiases`: If NO, the layer does not use bias weights. Default: YES
184 ///
185 /// Parameter `batchFirst`: LSTM only supports batchFirst=YES. This means the input and output will have shape [batch size, time steps, feature]. Default is YES.
186 ///
187 /// Parameter `isBidirectional`: If YES, becomes a bi-directional LSTM. Default: NO
188 ///
189 /// Parameter `returnsSequences`: if YES return output for all sequences else return output only for the last sequences. Default: YES
190 ///
191 /// Parameter `dropout`: If non-zero, introduces a dropout layer on the outputs of each LSTM layer except the last layer
192 /// with dropout probability equal to dropout.
193 ///
194 /// Parameter `resultMode`: expected result tensors. MLCLSTMResultModeOutput returns output data. MLCLSTMResultModeOutputAndStates returns
195 /// output data, last hidden state h_n, and last cell state c_n. Default: MLCLSTMResultModeOutput.
196 ///
197 /// Returns: A valid MLCLSTMDescriptor object or nil, if failure.
198 #[deprecated]
199 #[unsafe(method(descriptorWithInputSize:hiddenSize:layerCount:usesBiases:batchFirst:isBidirectional:returnsSequences:dropout:resultMode:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn descriptorWithInputSize_hiddenSize_layerCount_usesBiases_batchFirst_isBidirectional_returnsSequences_dropout_resultMode(
202 input_size: NSUInteger,
203 hidden_size: NSUInteger,
204 layer_count: NSUInteger,
205 uses_biases: bool,
206 batch_first: bool,
207 is_bidirectional: bool,
208 returns_sequences: bool,
209 dropout: c_float,
210 result_mode: MLCLSTMResultMode,
211 ) -> Retained<Self>;
212 );
213}