Skip to main content

apple_mpsgraph/ffi/
mod.rs

1use core::ffi::{c_char, c_void};
2
3/// Mirrors the `MPSGraph` framework counterpart for `TensorArrayCallback`.
4pub type TensorArrayCallback = unsafe extern "C" fn(context: *mut c_void) -> *mut c_void;
5/// Mirrors the `MPSGraph` framework counterpart for `TensorArrayInputCallback`.
6pub type TensorArrayInputCallback =
7    unsafe extern "C" fn(context: *mut c_void, input_box_handle: *mut c_void) -> *mut c_void;
8/// Mirrors the `MPSGraph` framework counterpart for `WhileBeforeCallback`.
9pub type WhileBeforeCallback = unsafe extern "C" fn(
10    context: *mut c_void,
11    input_box_handle: *mut c_void,
12    out_result_box_handle: *mut *mut c_void,
13) -> *mut c_void;
14/// Mirrors the `MPSGraph` framework counterpart for `ForBodyCallback`.
15pub type ForBodyCallback = unsafe extern "C" fn(
16    context: *mut c_void,
17    index_handle: *mut c_void,
18    input_box_handle: *mut c_void,
19) -> *mut c_void;
20
21mod specialized;
22/// Re-exports the `MPSGraph` framework surface for this item.
23pub use specialized::*;
24
25unsafe extern "C" {
26/// Calls the `MPSGraph` framework counterpart for `mpsgraph_object_release`.
27    pub fn mpsgraph_object_release(handle: *mut c_void);
28
29/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_new_with_bytes`.
30    pub fn mpsgraph_tensor_data_new_with_bytes(
31        device_handle: *mut c_void,
32        bytes: *const c_void,
33        byte_len: usize,
34        shape: *const usize,
35        shape_len: usize,
36        data_type: u32,
37    ) -> *mut c_void;
38/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_new_with_buffer`.
39    pub fn mpsgraph_tensor_data_new_with_buffer(
40        buffer_handle: *mut c_void,
41        shape: *const usize,
42        shape_len: usize,
43        data_type: u32,
44    ) -> *mut c_void;
45/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_data_type`.
46    pub fn mpsgraph_tensor_data_data_type(handle: *mut c_void) -> u32;
47/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_shape_len`.
48    pub fn mpsgraph_tensor_data_shape_len(handle: *mut c_void) -> usize;
49/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_copy_shape`.
50    pub fn mpsgraph_tensor_data_copy_shape(handle: *mut c_void, out_shape: *mut usize);
51/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_read_bytes`.
52    pub fn mpsgraph_tensor_data_read_bytes(
53        handle: *mut c_void,
54        dst: *mut c_void,
55        dst_len: usize,
56    ) -> bool;
57/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_device`.
58    pub fn mpsgraph_tensor_data_device(handle: *mut c_void) -> *mut c_void;
59
60/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_new`.
61    pub fn mpsgraph_graph_new() -> *mut c_void;
62/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_placeholder`.
63    pub fn mpsgraph_graph_placeholder(
64        graph_handle: *mut c_void,
65        shape: *const usize,
66        shape_len: usize,
67        data_type: u32,
68        name: *const c_char,
69    ) -> *mut c_void;
70/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_data`.
71    pub fn mpsgraph_graph_constant_data(
72        graph_handle: *mut c_void,
73        bytes: *const c_void,
74        byte_len: usize,
75        shape: *const usize,
76        shape_len: usize,
77        data_type: u32,
78    ) -> *mut c_void;
79/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_scalar`.
80    pub fn mpsgraph_graph_constant_scalar(
81        graph_handle: *mut c_void,
82        scalar: f64,
83        data_type: u32,
84    ) -> *mut c_void;
85/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_constant_scalar_shaped`.
86    pub fn mpsgraph_graph_constant_scalar_shaped(
87        graph_handle: *mut c_void,
88        scalar: f64,
89        shape: *const usize,
90        shape_len: usize,
91        data_type: u32,
92    ) -> *mut c_void;
93
94/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_addition`.
95    pub fn mpsgraph_graph_addition(
96        graph_handle: *mut c_void,
97        primary_tensor: *mut c_void,
98        secondary_tensor: *mut c_void,
99        name: *const c_char,
100    ) -> *mut c_void;
101/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_subtraction`.
102    pub fn mpsgraph_graph_subtraction(
103        graph_handle: *mut c_void,
104        primary_tensor: *mut c_void,
105        secondary_tensor: *mut c_void,
106        name: *const c_char,
107    ) -> *mut c_void;
108/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_multiplication`.
109    pub fn mpsgraph_graph_multiplication(
110        graph_handle: *mut c_void,
111        primary_tensor: *mut c_void,
112        secondary_tensor: *mut c_void,
113        name: *const c_char,
114    ) -> *mut c_void;
115/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_division`.
116    pub fn mpsgraph_graph_division(
117        graph_handle: *mut c_void,
118        primary_tensor: *mut c_void,
119        secondary_tensor: *mut c_void,
120        name: *const c_char,
121    ) -> *mut c_void;
122/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_matrix_multiplication`.
123    pub fn mpsgraph_graph_matrix_multiplication(
124        graph_handle: *mut c_void,
125        primary_tensor: *mut c_void,
126        secondary_tensor: *mut c_void,
127        name: *const c_char,
128    ) -> *mut c_void;
129/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_relu`.
130    pub fn mpsgraph_graph_relu(
131        graph_handle: *mut c_void,
132        tensor: *mut c_void,
133        name: *const c_char,
134    ) -> *mut c_void;
135/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_sigmoid`.
136    pub fn mpsgraph_graph_sigmoid(
137        graph_handle: *mut c_void,
138        tensor: *mut c_void,
139        name: *const c_char,
140    ) -> *mut c_void;
141/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_softmax`.
142    pub fn mpsgraph_graph_softmax(
143        graph_handle: *mut c_void,
144        tensor: *mut c_void,
145        axis: isize,
146        name: *const c_char,
147    ) -> *mut c_void;
148/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reshape`.
149    pub fn mpsgraph_graph_reshape(
150        graph_handle: *mut c_void,
151        tensor: *mut c_void,
152        shape: *const usize,
153        shape_len: usize,
154        name: *const c_char,
155    ) -> *mut c_void;
156/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_transpose`.
157    pub fn mpsgraph_graph_transpose(
158        graph_handle: *mut c_void,
159        tensor: *mut c_void,
160        permutation: *const usize,
161        permutation_len: usize,
162        name: *const c_char,
163    ) -> *mut c_void;
164/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_slice`.
165    pub fn mpsgraph_graph_slice(
166        graph_handle: *mut c_void,
167        tensor: *mut c_void,
168        dimension: usize,
169        start: isize,
170        length: isize,
171        name: *const c_char,
172    ) -> *mut c_void;
173/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_broadcast`.
174    pub fn mpsgraph_graph_broadcast(
175        graph_handle: *mut c_void,
176        tensor: *mut c_void,
177        shape: *const usize,
178        shape_len: usize,
179        name: *const c_char,
180    ) -> *mut c_void;
181/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_sum`.
182    pub fn mpsgraph_graph_reduction_sum(
183        graph_handle: *mut c_void,
184        tensor: *mut c_void,
185        axes: *const usize,
186        axes_len: usize,
187        name: *const c_char,
188    ) -> *mut c_void;
189/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_maximum`.
190    pub fn mpsgraph_graph_reduction_maximum(
191        graph_handle: *mut c_void,
192        tensor: *mut c_void,
193        axes: *const usize,
194        axes_len: usize,
195        name: *const c_char,
196    ) -> *mut c_void;
197/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_minimum`.
198    pub fn mpsgraph_graph_reduction_minimum(
199        graph_handle: *mut c_void,
200        tensor: *mut c_void,
201        axes: *const usize,
202        axes_len: usize,
203        name: *const c_char,
204    ) -> *mut c_void;
205/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_mean`.
206    pub fn mpsgraph_graph_mean(
207        graph_handle: *mut c_void,
208        tensor: *mut c_void,
209        axes: *const usize,
210        axes_len: usize,
211        name: *const c_char,
212    ) -> *mut c_void;
213
214/// Calls the `MPSGraph` framework counterpart for `mpsgraph_convolution2d_descriptor_new`.
215    pub fn mpsgraph_convolution2d_descriptor_new(
216        stride_in_x: usize,
217        stride_in_y: usize,
218        dilation_rate_in_x: usize,
219        dilation_rate_in_y: usize,
220        groups: usize,
221        padding_left: usize,
222        padding_right: usize,
223        padding_top: usize,
224        padding_bottom: usize,
225        padding_style: usize,
226        data_layout: usize,
227        weights_layout: usize,
228    ) -> *mut c_void;
229/// Calls the `MPSGraph` framework counterpart for `mpsgraph_pooling2d_descriptor_new`.
230    pub fn mpsgraph_pooling2d_descriptor_new(
231        kernel_width: usize,
232        kernel_height: usize,
233        stride_in_x: usize,
234        stride_in_y: usize,
235        dilation_rate_in_x: usize,
236        dilation_rate_in_y: usize,
237        padding_left: usize,
238        padding_right: usize,
239        padding_top: usize,
240        padding_bottom: usize,
241        padding_style: usize,
242        data_layout: usize,
243    ) -> *mut c_void;
244/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_convolution2d`.
245    pub fn mpsgraph_graph_convolution2d(
246        graph_handle: *mut c_void,
247        source_tensor: *mut c_void,
248        weights_tensor: *mut c_void,
249        descriptor_handle: *mut c_void,
250        name: *const c_char,
251    ) -> *mut c_void;
252/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_max_pooling2d`.
253    pub fn mpsgraph_graph_max_pooling2d(
254        graph_handle: *mut c_void,
255        source_tensor: *mut c_void,
256        descriptor_handle: *mut c_void,
257        name: *const c_char,
258    ) -> *mut c_void;
259/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_normalize`.
260    pub fn mpsgraph_graph_normalize(
261        graph_handle: *mut c_void,
262        tensor: *mut c_void,
263        mean_tensor: *mut c_void,
264        variance_tensor: *mut c_void,
265        gamma_tensor: *mut c_void,
266        beta_tensor: *mut c_void,
267        epsilon: f32,
268        name: *const c_char,
269    ) -> *mut c_void;
270
271/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_run`.
272    pub fn mpsgraph_graph_run(
273        graph_handle: *mut c_void,
274        feed_tensors: *const *mut c_void,
275        feed_data: *const *mut c_void,
276        feed_count: usize,
277        target_tensors: *const *mut c_void,
278        target_count: usize,
279        out_results: *mut *mut c_void,
280    ) -> bool;
281/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_run_with_command_queue`.
282    pub fn mpsgraph_graph_run_with_command_queue(
283        graph_handle: *mut c_void,
284        command_queue_handle: *mut c_void,
285        feed_tensors: *const *mut c_void,
286        feed_data: *const *mut c_void,
287        feed_count: usize,
288        target_tensors: *const *mut c_void,
289        target_count: usize,
290        out_results: *mut *mut c_void,
291    ) -> bool;
292/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_compile`.
293    pub fn mpsgraph_graph_compile(
294        graph_handle: *mut c_void,
295        device_handle: *mut c_void,
296        feed_tensors: *const *mut c_void,
297        feed_count: usize,
298        flat_shapes: *const usize,
299        shape_lengths: *const usize,
300        data_types: *const u32,
301        target_tensors: *const *mut c_void,
302        target_count: usize,
303    ) -> *mut c_void;
304/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run`.
305    pub fn mpsgraph_executable_run(
306        executable_handle: *mut c_void,
307        command_queue_handle: *mut c_void,
308        input_data: *const *mut c_void,
309        input_count: usize,
310        output_count: usize,
311        out_results: *mut *mut c_void,
312    ) -> bool;
313
314/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_len`.
315    pub fn mpsgraph_tensor_array_box_len(handle: *mut c_void) -> usize;
316/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_get`.
317    pub fn mpsgraph_tensor_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
318/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_array_box_len`.
319    pub fn mpsgraph_tensor_data_array_box_len(handle: *mut c_void) -> usize;
320/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_array_box_get`.
321    pub fn mpsgraph_tensor_data_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
322/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_array_box_len`.
323    pub fn mpsgraph_shaped_type_array_box_len(handle: *mut c_void) -> usize;
324/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_array_box_get`.
325    pub fn mpsgraph_shaped_type_array_box_get(handle: *mut c_void, index: usize) -> *mut c_void;
326
327/// Calls the `MPSGraph` framework counterpart for `mpsgraph_device_new_with_metal_device`.
328    pub fn mpsgraph_device_new_with_metal_device(metal_device_handle: *mut c_void) -> *mut c_void;
329/// Calls the `MPSGraph` framework counterpart for `mpsgraph_device_type`.
330    pub fn mpsgraph_device_type(handle: *mut c_void) -> u32;
331
332/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_new`.
333    pub fn mpsgraph_shaped_type_new(
334        shape: *const isize,
335        shape_len: usize,
336        data_type: u32,
337    ) -> *mut c_void;
338/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_has_shape`.
339    pub fn mpsgraph_shaped_type_has_shape(handle: *mut c_void) -> bool;
340/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_shape_len`.
341    pub fn mpsgraph_shaped_type_shape_len(handle: *mut c_void) -> usize;
342/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_copy_shape`.
343    pub fn mpsgraph_shaped_type_copy_shape(handle: *mut c_void, out_shape: *mut isize);
344/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_data_type`.
345    pub fn mpsgraph_shaped_type_data_type(handle: *mut c_void) -> u32;
346/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_set_shape`.
347    pub fn mpsgraph_shaped_type_set_shape(
348        handle: *mut c_void,
349        shape: *const isize,
350        shape_len: usize,
351    ) -> bool;
352/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_set_data_type`.
353    pub fn mpsgraph_shaped_type_set_data_type(handle: *mut c_void, data_type: u32) -> bool;
354/// Calls the `MPSGraph` framework counterpart for `mpsgraph_shaped_type_is_equal`.
355    pub fn mpsgraph_shaped_type_is_equal(handle: *mut c_void, other_handle: *mut c_void) -> bool;
356
357/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_has_shape`.
358    pub fn mpsgraph_tensor_has_shape(handle: *mut c_void) -> bool;
359/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_shape_len`.
360    pub fn mpsgraph_tensor_shape_len(handle: *mut c_void) -> usize;
361/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_copy_shape`.
362    pub fn mpsgraph_tensor_copy_shape(handle: *mut c_void, out_shape: *mut isize);
363/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_data_type`.
364    pub fn mpsgraph_tensor_data_type(handle: *mut c_void) -> u32;
365/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_operation`.
366    pub fn mpsgraph_tensor_operation(handle: *mut c_void) -> *mut c_void;
367
368/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_options`.
369    pub fn mpsgraph_graph_options(handle: *mut c_void) -> u64;
370/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_set_options`.
371    pub fn mpsgraph_graph_set_options(handle: *mut c_void, raw_value: u64) -> bool;
372/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_placeholder_tensors`.
373    pub fn mpsgraph_graph_placeholder_tensors(handle: *mut c_void) -> *mut c_void;
374
375/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_new`.
376    pub fn mpsgraph_compilation_descriptor_new() -> *mut c_void;
377/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_disable_type_inference`.
378    pub fn mpsgraph_compilation_descriptor_disable_type_inference(handle: *mut c_void) -> bool;
379/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_optimization_level`.
380    pub fn mpsgraph_compilation_descriptor_optimization_level(handle: *mut c_void) -> u64;
381/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_optimization_level`.
382    pub fn mpsgraph_compilation_descriptor_set_optimization_level(
383        handle: *mut c_void,
384        raw_value: u64,
385    ) -> bool;
386/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_wait_for_completion`.
387    pub fn mpsgraph_compilation_descriptor_wait_for_completion(handle: *mut c_void) -> bool;
388/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_wait_for_completion`.
389    pub fn mpsgraph_compilation_descriptor_set_wait_for_completion(
390        handle: *mut c_void,
391        value: bool,
392    ) -> bool;
393/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_optimization_profile`.
394    pub fn mpsgraph_compilation_descriptor_optimization_profile(handle: *mut c_void) -> u64;
395/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_optimization_profile`.
396    pub fn mpsgraph_compilation_descriptor_set_optimization_profile(
397        handle: *mut c_void,
398        raw_value: u64,
399    ) -> bool;
400/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_reduced_precision_fast_math`.
401    pub fn mpsgraph_compilation_descriptor_reduced_precision_fast_math(
402        handle: *mut c_void,
403    ) -> usize;
404/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_reduced_precision_fast_math`.
405    pub fn mpsgraph_compilation_descriptor_set_reduced_precision_fast_math(
406        handle: *mut c_void,
407        raw_value: usize,
408    ) -> bool;
409
410/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_new`.
411    pub fn mpsgraph_execution_descriptor_new() -> *mut c_void;
412/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_wait_until_completed`.
413    pub fn mpsgraph_execution_descriptor_wait_until_completed(handle: *mut c_void) -> bool;
414/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_set_wait_until_completed`.
415    pub fn mpsgraph_execution_descriptor_set_wait_until_completed(
416        handle: *mut c_void,
417        value: bool,
418    ) -> bool;
419/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_compilation_descriptor`.
420    pub fn mpsgraph_execution_descriptor_compilation_descriptor(handle: *mut c_void)
421        -> *mut c_void;
422/// Calls the `MPSGraph` framework counterpart for `mpsgraph_execution_descriptor_set_compilation_descriptor`.
423    pub fn mpsgraph_execution_descriptor_set_compilation_descriptor(
424        handle: *mut c_void,
425        compilation_descriptor_handle: *mut c_void,
426    ) -> bool;
427
428/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_new`.
429    pub fn mpsgraph_executable_execution_descriptor_new() -> *mut c_void;
430/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_wait_until_completed`.
431    pub fn mpsgraph_executable_execution_descriptor_wait_until_completed(
432        handle: *mut c_void,
433    ) -> bool;
434/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_execution_descriptor_set_wait_until_completed`.
435    pub fn mpsgraph_executable_execution_descriptor_set_wait_until_completed(
436        handle: *mut c_void,
437        value: bool,
438    ) -> bool;
439
440/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_new`.
441    pub fn mpsgraph_executable_serialization_descriptor_new() -> *mut c_void;
442/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_append`.
443    pub fn mpsgraph_executable_serialization_descriptor_append(handle: *mut c_void) -> bool;
444/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_append`.
445    pub fn mpsgraph_executable_serialization_descriptor_set_append(
446        handle: *mut c_void,
447        value: bool,
448    ) -> bool;
449/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_deployment_platform`.
450    pub fn mpsgraph_executable_serialization_descriptor_deployment_platform(
451        handle: *mut c_void,
452    ) -> u64;
453/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_deployment_platform`.
454    pub fn mpsgraph_executable_serialization_descriptor_set_deployment_platform(
455        handle: *mut c_void,
456        raw_value: u64,
457    ) -> bool;
458/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_minimum_deployment_target_len`.
459    pub fn mpsgraph_executable_serialization_descriptor_minimum_deployment_target_len(
460        handle: *mut c_void,
461    ) -> usize;
462/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_copy_minimum_deployment_target`.
463    pub fn mpsgraph_executable_serialization_descriptor_copy_minimum_deployment_target(
464        handle: *mut c_void,
465        out_bytes: *mut u8,
466        out_len: usize,
467    ) -> bool;
468/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialization_descriptor_set_minimum_deployment_target`.
469    pub fn mpsgraph_executable_serialization_descriptor_set_minimum_deployment_target(
470        handle: *mut c_void,
471        value: *const c_char,
472    ) -> bool;
473
474/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_compile_with_descriptor`.
475    pub fn mpsgraph_graph_compile_with_descriptor(
476        graph_handle: *mut c_void,
477        device_handle: *mut c_void,
478        feed_tensors: *const *mut c_void,
479        feed_count: usize,
480        flat_shapes: *const usize,
481        shape_lengths: *const usize,
482        data_types: *const u32,
483        target_tensors: *const *mut c_void,
484        target_count: usize,
485        compilation_descriptor_handle: *mut c_void,
486    ) -> *mut c_void;
487
488/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_options`.
489    pub fn mpsgraph_executable_options(handle: *mut c_void) -> u64;
490/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_set_options`.
491    pub fn mpsgraph_executable_set_options(handle: *mut c_void, raw_value: u64) -> bool;
492/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_feed_tensors`.
493    pub fn mpsgraph_executable_feed_tensors(handle: *mut c_void) -> *mut c_void;
494/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_target_tensors`.
495    pub fn mpsgraph_executable_target_tensors(handle: *mut c_void) -> *mut c_void;
496/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_specialize`.
497    pub fn mpsgraph_executable_specialize(
498        handle: *mut c_void,
499        device_handle: *mut c_void,
500        input_type_handles: *const *mut c_void,
501        input_type_count: usize,
502        compilation_descriptor_handle: *mut c_void,
503    ) -> bool;
504/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_get_output_types`.
505    pub fn mpsgraph_executable_get_output_types(
506        handle: *mut c_void,
507        device_handle: *mut c_void,
508        input_type_handles: *const *mut c_void,
509        input_type_count: usize,
510        compilation_descriptor_handle: *mut c_void,
511    ) -> *mut c_void;
512/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run_with_descriptor`.
513    pub fn mpsgraph_executable_run_with_descriptor(
514        executable_handle: *mut c_void,
515        command_queue_handle: *mut c_void,
516        input_handles: *const *mut c_void,
517        input_count: usize,
518        result_handles: *const *mut c_void,
519        result_count: usize,
520        execution_descriptor_handle: *mut c_void,
521    ) -> *mut c_void;
522/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_run_async_with_descriptor`.
523    pub fn mpsgraph_executable_run_async_with_descriptor(
524        executable_handle: *mut c_void,
525        command_queue_handle: *mut c_void,
526        input_handles: *const *mut c_void,
527        input_count: usize,
528        result_handles: *const *mut c_void,
529        result_count: usize,
530        execution_descriptor_handle: *mut c_void,
531    ) -> *mut c_void;
532/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_serialize_package`.
533    pub fn mpsgraph_executable_serialize_package(
534        handle: *mut c_void,
535        path: *const c_char,
536        descriptor_handle: *mut c_void,
537    ) -> bool;
538/// Calls the `MPSGraph` framework counterpart for `mpsgraph_executable_new_with_package`.
539    pub fn mpsgraph_executable_new_with_package(
540        path: *const c_char,
541        compilation_descriptor_handle: *mut c_void,
542    ) -> *mut c_void;
543
544/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_arithmetic_unary`.
545    pub fn mpsgraph_graph_arithmetic_unary(
546        graph_handle: *mut c_void,
547        op: u32,
548        tensor_handle: *mut c_void,
549        name: *const c_char,
550    ) -> *mut c_void;
551/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_arithmetic_binary`.
552    pub fn mpsgraph_graph_arithmetic_binary(
553        graph_handle: *mut c_void,
554        op: u32,
555        primary_handle: *mut c_void,
556        secondary_handle: *mut c_void,
557        name: *const c_char,
558    ) -> *mut c_void;
559/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_select`.
560    pub fn mpsgraph_graph_select(
561        graph_handle: *mut c_void,
562        predicate_handle: *mut c_void,
563        true_handle: *mut c_void,
564        false_handle: *mut c_void,
565        name: *const c_char,
566    ) -> *mut c_void;
567/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_relu_gradient`.
568    pub fn mpsgraph_graph_relu_gradient(
569        graph_handle: *mut c_void,
570        gradient_handle: *mut c_void,
571        source_handle: *mut c_void,
572        name: *const c_char,
573    ) -> *mut c_void;
574/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_sigmoid_gradient`.
575    pub fn mpsgraph_graph_sigmoid_gradient(
576        graph_handle: *mut c_void,
577        gradient_handle: *mut c_void,
578        source_handle: *mut c_void,
579        name: *const c_char,
580    ) -> *mut c_void;
581/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_softmax_gradient`.
582    pub fn mpsgraph_graph_softmax_gradient(
583        graph_handle: *mut c_void,
584        gradient_handle: *mut c_void,
585        source_handle: *mut c_void,
586        axis: isize,
587        name: *const c_char,
588    ) -> *mut c_void;
589/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_scalar`.
590    pub fn mpsgraph_graph_leaky_relu_scalar(
591        graph_handle: *mut c_void,
592        tensor_handle: *mut c_void,
593        alpha: f64,
594        name: *const c_char,
595    ) -> *mut c_void;
596/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_tensor`.
597    pub fn mpsgraph_graph_leaky_relu_tensor(
598        graph_handle: *mut c_void,
599        tensor_handle: *mut c_void,
600        alpha_tensor_handle: *mut c_void,
601        name: *const c_char,
602    ) -> *mut c_void;
603/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_leaky_relu_gradient`.
604    pub fn mpsgraph_graph_leaky_relu_gradient(
605        graph_handle: *mut c_void,
606        gradient_handle: *mut c_void,
607        source_handle: *mut c_void,
608        alpha_tensor_handle: *mut c_void,
609        name: *const c_char,
610    ) -> *mut c_void;
611/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_axis`.
612    pub fn mpsgraph_graph_reduction_axis(
613        graph_handle: *mut c_void,
614        op: u32,
615        tensor_handle: *mut c_void,
616        axis: isize,
617        name: *const c_char,
618    ) -> *mut c_void;
619/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_reduction_axes`.
620    pub fn mpsgraph_graph_reduction_axes(
621        graph_handle: *mut c_void,
622        op: u32,
623        tensor_handle: *mut c_void,
624        axes: *const usize,
625        axes_len: usize,
626        name: *const c_char,
627    ) -> *mut c_void;
628/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_concat_pair`.
629    pub fn mpsgraph_graph_concat_pair(
630        graph_handle: *mut c_void,
631        first_handle: *mut c_void,
632        second_handle: *mut c_void,
633        dimension: isize,
634        name: *const c_char,
635    ) -> *mut c_void;
636/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_concat_tensors`.
637    pub fn mpsgraph_graph_concat_tensors(
638        graph_handle: *mut c_void,
639        tensor_handles: *const *mut c_void,
640        tensor_count: usize,
641        dimension: isize,
642        interleave: bool,
643        name: *const c_char,
644    ) -> *mut c_void;
645/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_sizes`.
646    pub fn mpsgraph_graph_split_sizes(
647        graph_handle: *mut c_void,
648        tensor_handle: *mut c_void,
649        split_sizes: *const usize,
650        split_count: usize,
651        axis: isize,
652        name: *const c_char,
653    ) -> *mut c_void;
654/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_sizes_tensor`.
655    pub fn mpsgraph_graph_split_sizes_tensor(
656        graph_handle: *mut c_void,
657        tensor_handle: *mut c_void,
658        split_sizes_tensor_handle: *mut c_void,
659        axis: isize,
660        name: *const c_char,
661    ) -> *mut c_void;
662/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_split_num`.
663    pub fn mpsgraph_graph_split_num(
664        graph_handle: *mut c_void,
665        tensor_handle: *mut c_void,
666        num_splits: usize,
667        axis: isize,
668        name: *const c_char,
669    ) -> *mut c_void;
670/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_stack`.
671    pub fn mpsgraph_graph_stack(
672        graph_handle: *mut c_void,
673        tensor_handles: *const *mut c_void,
674        tensor_count: usize,
675        axis: isize,
676        name: *const c_char,
677    ) -> *mut c_void;
678/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_pad`.
679    pub fn mpsgraph_graph_pad(
680        graph_handle: *mut c_void,
681        tensor_handle: *mut c_void,
682        padding_mode: isize,
683        left_padding: *const isize,
684        left_padding_len: usize,
685        right_padding: *const isize,
686        right_padding_len: usize,
687        constant_value: f64,
688        name: *const c_char,
689    ) -> *mut c_void;
690/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_top_k`.
691    pub fn mpsgraph_graph_top_k(
692        graph_handle: *mut c_void,
693        source_handle: *mut c_void,
694        k: usize,
695        name: *const c_char,
696    ) -> *mut c_void;
697/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_top_k_tensor`.
698    pub fn mpsgraph_graph_top_k_tensor(
699        graph_handle: *mut c_void,
700        source_handle: *mut c_void,
701        k_tensor_handle: *mut c_void,
702        name: *const c_char,
703    ) -> *mut c_void;
704/// Calls the `MPSGraph` framework counterpart for `mpsgraph_tensor_array_box_new`.
705    pub fn mpsgraph_tensor_array_box_new(handles: *const *mut c_void, count: usize) -> *mut c_void;
706/// Calls the `MPSGraph` framework counterpart for `mpsgraph_compilation_descriptor_set_callable`.
707    pub fn mpsgraph_compilation_descriptor_set_callable(
708        handle: *mut c_void,
709        symbol_name: *const c_char,
710        executable_handle: *mut c_void,
711    ) -> bool;
712/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_call_symbol`.
713    pub fn mpsgraph_graph_call_symbol(
714        graph_handle: *mut c_void,
715        symbol_name: *const c_char,
716        input_handles: *const *mut c_void,
717        input_count: usize,
718        output_type_handles: *const *mut c_void,
719        output_type_count: usize,
720        name: *const c_char,
721    ) -> *mut c_void;
722/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_nd`.
723    pub fn mpsgraph_graph_gather_nd(
724        graph_handle: *mut c_void,
725        updates_tensor_handle: *mut c_void,
726        indices_tensor_handle: *mut c_void,
727        batch_dimensions: usize,
728        name: *const c_char,
729    ) -> *mut c_void;
730/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather`.
731    pub fn mpsgraph_graph_gather(
732        graph_handle: *mut c_void,
733        updates_tensor_handle: *mut c_void,
734        indices_tensor_handle: *mut c_void,
735        axis: usize,
736        batch_dimensions: usize,
737        name: *const c_char,
738    ) -> *mut c_void;
739/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_along_axis`.
740    pub fn mpsgraph_graph_gather_along_axis(
741        graph_handle: *mut c_void,
742        axis: isize,
743        updates_tensor_handle: *mut c_void,
744        indices_tensor_handle: *mut c_void,
745        name: *const c_char,
746    ) -> *mut c_void;
747/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gather_along_axis_tensor`.
748    pub fn mpsgraph_graph_gather_along_axis_tensor(
749        graph_handle: *mut c_void,
750        axis_tensor_handle: *mut c_void,
751        updates_tensor_handle: *mut c_void,
752        indices_tensor_handle: *mut c_void,
753        name: *const c_char,
754    ) -> *mut c_void;
755/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_new`.
756    pub fn mpsgraph_random_op_descriptor_new(distribution: u64, data_type: u32) -> *mut c_void;
757/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_distribution`.
758    pub fn mpsgraph_random_op_descriptor_distribution(handle: *mut c_void) -> u64;
759/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_distribution`.
760    pub fn mpsgraph_random_op_descriptor_set_distribution(
761        handle: *mut c_void,
762        raw_value: u64,
763    ) -> bool;
764/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_data_type`.
765    pub fn mpsgraph_random_op_descriptor_data_type(handle: *mut c_void) -> u32;
766/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_data_type`.
767    pub fn mpsgraph_random_op_descriptor_set_data_type(handle: *mut c_void, raw_value: u32)
768        -> bool;
769/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_min`.
770    pub fn mpsgraph_random_op_descriptor_min(handle: *mut c_void) -> f32;
771/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_min`.
772    pub fn mpsgraph_random_op_descriptor_set_min(handle: *mut c_void, value: f32) -> bool;
773/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_max`.
774    pub fn mpsgraph_random_op_descriptor_max(handle: *mut c_void) -> f32;
775/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_max`.
776    pub fn mpsgraph_random_op_descriptor_set_max(handle: *mut c_void, value: f32) -> bool;
777/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_min_integer`.
778    pub fn mpsgraph_random_op_descriptor_min_integer(handle: *mut c_void) -> isize;
779/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_min_integer`.
780    pub fn mpsgraph_random_op_descriptor_set_min_integer(handle: *mut c_void, value: isize)
781        -> bool;
782/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_max_integer`.
783    pub fn mpsgraph_random_op_descriptor_max_integer(handle: *mut c_void) -> isize;
784/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_max_integer`.
785    pub fn mpsgraph_random_op_descriptor_set_max_integer(handle: *mut c_void, value: isize)
786        -> bool;
787/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_mean`.
788    pub fn mpsgraph_random_op_descriptor_mean(handle: *mut c_void) -> f32;
789/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_mean`.
790    pub fn mpsgraph_random_op_descriptor_set_mean(handle: *mut c_void, value: f32) -> bool;
791/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_standard_deviation`.
792    pub fn mpsgraph_random_op_descriptor_standard_deviation(handle: *mut c_void) -> f32;
793/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_standard_deviation`.
794    pub fn mpsgraph_random_op_descriptor_set_standard_deviation(
795        handle: *mut c_void,
796        value: f32,
797    ) -> bool;
798/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_sampling_method`.
799    pub fn mpsgraph_random_op_descriptor_sampling_method(handle: *mut c_void) -> u64;
800/// Calls the `MPSGraph` framework counterpart for `mpsgraph_random_op_descriptor_set_sampling_method`.
801    pub fn mpsgraph_random_op_descriptor_set_sampling_method(
802        handle: *mut c_void,
803        raw_value: u64,
804    ) -> bool;
805/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_philox_state_seed`.
806    pub fn mpsgraph_graph_random_philox_state_seed(
807        graph_handle: *mut c_void,
808        seed: usize,
809        name: *const c_char,
810    ) -> *mut c_void;
811/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_philox_state_counter`.
812    pub fn mpsgraph_graph_random_philox_state_counter(
813        graph_handle: *mut c_void,
814        counter_low: usize,
815        counter_high: usize,
816        key: usize,
817        name: *const c_char,
818    ) -> *mut c_void;
819/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor`.
820    pub fn mpsgraph_graph_random_tensor(
821        graph_handle: *mut c_void,
822        shape: *const usize,
823        shape_len: usize,
824        descriptor_handle: *mut c_void,
825        name: *const c_char,
826    ) -> *mut c_void;
827/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor`.
828    pub fn mpsgraph_graph_random_tensor_shape_tensor(
829        graph_handle: *mut c_void,
830        shape_tensor_handle: *mut c_void,
831        descriptor_handle: *mut c_void,
832        name: *const c_char,
833    ) -> *mut c_void;
834/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_seed`.
835    pub fn mpsgraph_graph_random_tensor_seed(
836        graph_handle: *mut c_void,
837        shape: *const usize,
838        shape_len: usize,
839        descriptor_handle: *mut c_void,
840        seed: usize,
841        name: *const c_char,
842    ) -> *mut c_void;
843/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor_seed`.
844    pub fn mpsgraph_graph_random_tensor_shape_tensor_seed(
845        graph_handle: *mut c_void,
846        shape_tensor_handle: *mut c_void,
847        descriptor_handle: *mut c_void,
848        seed: usize,
849        name: *const c_char,
850    ) -> *mut c_void;
851/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_state`.
852    pub fn mpsgraph_graph_random_tensor_state(
853        graph_handle: *mut c_void,
854        shape: *const usize,
855        shape_len: usize,
856        descriptor_handle: *mut c_void,
857        state_handle: *mut c_void,
858        name: *const c_char,
859    ) -> *mut c_void;
860/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_random_tensor_shape_tensor_state`.
861    pub fn mpsgraph_graph_random_tensor_shape_tensor_state(
862        graph_handle: *mut c_void,
863        shape_tensor_handle: *mut c_void,
864        descriptor_handle: *mut c_void,
865        state_handle: *mut c_void,
866        name: *const c_char,
867    ) -> *mut c_void;
868/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_dropout`.
869    pub fn mpsgraph_graph_dropout(
870        graph_handle: *mut c_void,
871        tensor_handle: *mut c_void,
872        rate: f64,
873        name: *const c_char,
874    ) -> *mut c_void;
875/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_dropout_tensor`.
876    pub fn mpsgraph_graph_dropout_tensor(
877        graph_handle: *mut c_void,
878        tensor_handle: *mut c_void,
879        rate_tensor_handle: *mut c_void,
880        name: *const c_char,
881    ) -> *mut c_void;
882/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_new`.
883    pub fn mpsgraph_single_gate_rnn_descriptor_new() -> *mut c_void;
884/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_reverse`.
885    pub fn mpsgraph_single_gate_rnn_descriptor_reverse(handle: *mut c_void) -> bool;
886/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_reverse`.
887    pub fn mpsgraph_single_gate_rnn_descriptor_set_reverse(
888        handle: *mut c_void,
889        value: bool,
890    ) -> bool;
891/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_bidirectional`.
892    pub fn mpsgraph_single_gate_rnn_descriptor_bidirectional(handle: *mut c_void) -> bool;
893/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_bidirectional`.
894    pub fn mpsgraph_single_gate_rnn_descriptor_set_bidirectional(
895        handle: *mut c_void,
896        value: bool,
897    ) -> bool;
898/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_training`.
899    pub fn mpsgraph_single_gate_rnn_descriptor_training(handle: *mut c_void) -> bool;
900/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_training`.
901    pub fn mpsgraph_single_gate_rnn_descriptor_set_training(
902        handle: *mut c_void,
903        value: bool,
904    ) -> bool;
905/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_activation`.
906    pub fn mpsgraph_single_gate_rnn_descriptor_activation(handle: *mut c_void) -> usize;
907/// Calls the `MPSGraph` framework counterpart for `mpsgraph_single_gate_rnn_descriptor_set_activation`.
908    pub fn mpsgraph_single_gate_rnn_descriptor_set_activation(
909        handle: *mut c_void,
910        value: usize,
911    ) -> bool;
912/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_new`.
913    pub fn mpsgraph_lstm_descriptor_new() -> *mut c_void;
914/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_reverse`.
915    pub fn mpsgraph_lstm_descriptor_reverse(handle: *mut c_void) -> bool;
916/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_reverse`.
917    pub fn mpsgraph_lstm_descriptor_set_reverse(handle: *mut c_void, value: bool) -> bool;
918/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_bidirectional`.
919    pub fn mpsgraph_lstm_descriptor_bidirectional(handle: *mut c_void) -> bool;
920/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_bidirectional`.
921    pub fn mpsgraph_lstm_descriptor_set_bidirectional(handle: *mut c_void, value: bool) -> bool;
922/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_produce_cell`.
923    pub fn mpsgraph_lstm_descriptor_produce_cell(handle: *mut c_void) -> bool;
924/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_produce_cell`.
925    pub fn mpsgraph_lstm_descriptor_set_produce_cell(handle: *mut c_void, value: bool) -> bool;
926/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_training`.
927    pub fn mpsgraph_lstm_descriptor_training(handle: *mut c_void) -> bool;
928/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_training`.
929    pub fn mpsgraph_lstm_descriptor_set_training(handle: *mut c_void, value: bool) -> bool;
930/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_forget_gate_last`.
931    pub fn mpsgraph_lstm_descriptor_forget_gate_last(handle: *mut c_void) -> bool;
932/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_forget_gate_last`.
933    pub fn mpsgraph_lstm_descriptor_set_forget_gate_last(handle: *mut c_void, value: bool) -> bool;
934/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_input_gate_activation`.
935    pub fn mpsgraph_lstm_descriptor_input_gate_activation(handle: *mut c_void) -> usize;
936/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_input_gate_activation`.
937    pub fn mpsgraph_lstm_descriptor_set_input_gate_activation(
938        handle: *mut c_void,
939        value: usize,
940    ) -> bool;
941/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_forget_gate_activation`.
942    pub fn mpsgraph_lstm_descriptor_forget_gate_activation(handle: *mut c_void) -> usize;
943/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_forget_gate_activation`.
944    pub fn mpsgraph_lstm_descriptor_set_forget_gate_activation(
945        handle: *mut c_void,
946        value: usize,
947    ) -> bool;
948/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_cell_gate_activation`.
949    pub fn mpsgraph_lstm_descriptor_cell_gate_activation(handle: *mut c_void) -> usize;
950/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_cell_gate_activation`.
951    pub fn mpsgraph_lstm_descriptor_set_cell_gate_activation(
952        handle: *mut c_void,
953        value: usize,
954    ) -> bool;
955/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_output_gate_activation`.
956    pub fn mpsgraph_lstm_descriptor_output_gate_activation(handle: *mut c_void) -> usize;
957/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_output_gate_activation`.
958    pub fn mpsgraph_lstm_descriptor_set_output_gate_activation(
959        handle: *mut c_void,
960        value: usize,
961    ) -> bool;
962/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_activation`.
963    pub fn mpsgraph_lstm_descriptor_activation(handle: *mut c_void) -> usize;
964/// Calls the `MPSGraph` framework counterpart for `mpsgraph_lstm_descriptor_set_activation`.
965    pub fn mpsgraph_lstm_descriptor_set_activation(handle: *mut c_void, value: usize) -> bool;
966/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_new`.
967    pub fn mpsgraph_gru_descriptor_new() -> *mut c_void;
968/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reverse`.
969    pub fn mpsgraph_gru_descriptor_reverse(handle: *mut c_void) -> bool;
970/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reverse`.
971    pub fn mpsgraph_gru_descriptor_set_reverse(handle: *mut c_void, value: bool) -> bool;
972/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_bidirectional`.
973    pub fn mpsgraph_gru_descriptor_bidirectional(handle: *mut c_void) -> bool;
974/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_bidirectional`.
975    pub fn mpsgraph_gru_descriptor_set_bidirectional(handle: *mut c_void, value: bool) -> bool;
976/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_training`.
977    pub fn mpsgraph_gru_descriptor_training(handle: *mut c_void) -> bool;
978/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_training`.
979    pub fn mpsgraph_gru_descriptor_set_training(handle: *mut c_void, value: bool) -> bool;
980/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_gate_first`.
981    pub fn mpsgraph_gru_descriptor_reset_gate_first(handle: *mut c_void) -> bool;
982/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_gate_first`.
983    pub fn mpsgraph_gru_descriptor_set_reset_gate_first(handle: *mut c_void, value: bool) -> bool;
984/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_after`.
985    pub fn mpsgraph_gru_descriptor_reset_after(handle: *mut c_void) -> bool;
986/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_after`.
987    pub fn mpsgraph_gru_descriptor_set_reset_after(handle: *mut c_void, value: bool) -> bool;
988/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_flip_z`.
989    pub fn mpsgraph_gru_descriptor_flip_z(handle: *mut c_void) -> bool;
990/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_flip_z`.
991    pub fn mpsgraph_gru_descriptor_set_flip_z(handle: *mut c_void, value: bool) -> bool;
992/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_update_gate_activation`.
993    pub fn mpsgraph_gru_descriptor_update_gate_activation(handle: *mut c_void) -> usize;
994/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_update_gate_activation`.
995    pub fn mpsgraph_gru_descriptor_set_update_gate_activation(
996        handle: *mut c_void,
997        value: usize,
998    ) -> bool;
999/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_reset_gate_activation`.
1000    pub fn mpsgraph_gru_descriptor_reset_gate_activation(handle: *mut c_void) -> usize;
1001/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_reset_gate_activation`.
1002    pub fn mpsgraph_gru_descriptor_set_reset_gate_activation(
1003        handle: *mut c_void,
1004        value: usize,
1005    ) -> bool;
1006/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_output_gate_activation`.
1007    pub fn mpsgraph_gru_descriptor_output_gate_activation(handle: *mut c_void) -> usize;
1008/// Calls the `MPSGraph` framework counterpart for `mpsgraph_gru_descriptor_set_output_gate_activation`.
1009    pub fn mpsgraph_gru_descriptor_set_output_gate_activation(
1010        handle: *mut c_void,
1011        value: usize,
1012    ) -> bool;
1013/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_single_gate_rnn`.
1014    pub fn mpsgraph_graph_single_gate_rnn(
1015        graph_handle: *mut c_void,
1016        source_handle: *mut c_void,
1017        recurrent_weight_handle: *mut c_void,
1018        input_weight_handle: *mut c_void,
1019        bias_handle: *mut c_void,
1020        init_state_handle: *mut c_void,
1021        mask_handle: *mut c_void,
1022        descriptor_handle: *mut c_void,
1023        name: *const c_char,
1024    ) -> *mut c_void;
1025/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_lstm`.
1026    pub fn mpsgraph_graph_lstm(
1027        graph_handle: *mut c_void,
1028        source_handle: *mut c_void,
1029        recurrent_weight_handle: *mut c_void,
1030        input_weight_handle: *mut c_void,
1031        bias_handle: *mut c_void,
1032        init_state_handle: *mut c_void,
1033        init_cell_handle: *mut c_void,
1034        mask_handle: *mut c_void,
1035        peephole_handle: *mut c_void,
1036        descriptor_handle: *mut c_void,
1037        name: *const c_char,
1038    ) -> *mut c_void;
1039/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_gru`.
1040    pub fn mpsgraph_graph_gru(
1041        graph_handle: *mut c_void,
1042        source_handle: *mut c_void,
1043        recurrent_weight_handle: *mut c_void,
1044        input_weight_handle: *mut c_void,
1045        bias_handle: *mut c_void,
1046        init_state_handle: *mut c_void,
1047        mask_handle: *mut c_void,
1048        secondary_bias_handle: *mut c_void,
1049        descriptor_handle: *mut c_void,
1050        name: *const c_char,
1051    ) -> *mut c_void;
1052/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_control_dependency`.
1053    pub fn mpsgraph_graph_control_dependency(
1054        graph_handle: *mut c_void,
1055        operation_handles: *const *mut c_void,
1056        operation_count: usize,
1057        dependent_callback: Option<TensorArrayCallback>,
1058        dependent_context: *mut c_void,
1059        name: *const c_char,
1060    ) -> *mut c_void;
1061/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_if_then_else`.
1062    pub fn mpsgraph_graph_if_then_else(
1063        graph_handle: *mut c_void,
1064        predicate_handle: *mut c_void,
1065        then_callback: Option<TensorArrayCallback>,
1066        then_context: *mut c_void,
1067        else_callback: Option<TensorArrayCallback>,
1068        else_context: *mut c_void,
1069        name: *const c_char,
1070    ) -> *mut c_void;
1071/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_while_loop`.
1072    pub fn mpsgraph_graph_while_loop(
1073        graph_handle: *mut c_void,
1074        input_handles: *const *mut c_void,
1075        input_count: usize,
1076        before_callback: Option<WhileBeforeCallback>,
1077        before_context: *mut c_void,
1078        after_callback: Option<TensorArrayInputCallback>,
1079        after_context: *mut c_void,
1080        name: *const c_char,
1081    ) -> *mut c_void;
1082/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_for_loop`.
1083    pub fn mpsgraph_graph_for_loop(
1084        graph_handle: *mut c_void,
1085        lower_bound_handle: *mut c_void,
1086        upper_bound_handle: *mut c_void,
1087        step_handle: *mut c_void,
1088        argument_handles: *const *mut c_void,
1089        argument_count: usize,
1090        body_callback: Option<ForBodyCallback>,
1091        body_context: *mut c_void,
1092        name: *const c_char,
1093    ) -> *mut c_void;
1094/// Calls the `MPSGraph` framework counterpart for `mpsgraph_graph_for_loop_iterations`.
1095    pub fn mpsgraph_graph_for_loop_iterations(
1096        graph_handle: *mut c_void,
1097        number_of_iterations_handle: *mut c_void,
1098        argument_handles: *const *mut c_void,
1099        argument_count: usize,
1100        body_callback: Option<ForBodyCallback>,
1101        body_context: *mut c_void,
1102        name: *const c_char,
1103    ) -> *mut c_void;
1104}