Skip to main content

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