1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// The base class for all MLCompute layers
///
/// There are as many MLCLayer subclasses as there are MLCompute neural network layer objects. Make one of those.
/// This class defines an polymorphic interface for them.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlclayer?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct MLCLayer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MLCLayer {}
);
impl MLCLayer {
extern_methods!(
/// The layer ID
///
/// A unique number to identify each layer. Assigned when the layer is created.
#[deprecated]
#[unsafe(method(layerID))]
#[unsafe(method_family = none)]
pub unsafe fn layerID(&self) -> NSUInteger;
/// A string to help identify this object.
#[deprecated]
#[unsafe(method(label))]
#[unsafe(method_family = none)]
pub unsafe fn label(&self) -> Retained<NSString>;
/// Setter for [`label`][Self::label].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[deprecated]
#[unsafe(method(setLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn setLabel(&self, label: &NSString);
/// A flag to identify if we want to debug this layer when executing a graph that includes this layer
///
/// If this is set, we will make sure that the result tensor and gradient tensors are available for reading on CPU
/// The default is NO. If isDebuggingEnabled is set to YES, make sure to set options to enable debugging when
/// compiling the graph. Otherwise this property may be ignored.
#[deprecated]
#[unsafe(method(isDebuggingEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isDebuggingEnabled(&self) -> bool;
/// Setter for [`isDebuggingEnabled`][Self::isDebuggingEnabled].
#[deprecated]
#[unsafe(method(setIsDebuggingEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setIsDebuggingEnabled(&self, is_debugging_enabled: bool);
#[cfg(all(feature = "MLCDevice", feature = "MLCTypes"))]
/// Determine whether instances of this layer accept source tensors of the given data type on the given device.
///
/// Parameter `dataType`: A data type of a possible input tensor to the layer
///
/// Parameter `device`: A device
///
/// Returns: A boolean indicating whether the data type is supported
#[deprecated]
#[unsafe(method(supportsDataType:onDevice:))]
#[unsafe(method_family = none)]
pub unsafe fn supportsDataType_onDevice(data_type: MLCDataType, device: &MLCDevice)
-> bool;
#[cfg(feature = "MLCTypes")]
/// The device type where this layer will be executed
///
/// Typically the MLCDevice passed to compileWithOptions will be the device used to execute layers in the graph.
/// If MLCDeviceTypeANE is selected, it is possible that some of the layers of the graph may not be executed on the ANE
/// but instead on the CPU or GPU. This property can be used to determine which device type the layer will be executed on.
#[unsafe(method(deviceType))]
#[unsafe(method_family = none)]
pub unsafe fn deviceType(&self) -> MLCDeviceType;
#[deprecated]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[deprecated]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}