objc2_ml_compute/generated/
MLCTensorParameter.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    /// A tensor parameter object.  This is used to describe input tensors that are updated by the optimizer during training.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlctensorparameter?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[deprecated]
17    pub struct MLCTensorParameter;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for MLCTensorParameter {}
22);
23
24impl MLCTensorParameter {
25    extern_methods!(
26        #[cfg(feature = "MLCTensor")]
27        /// The underlying tensor
28        #[deprecated]
29        #[unsafe(method(tensor))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn tensor(&self) -> Retained<MLCTensor>;
32
33        /// Specifies whether this tensor parameter is updatable
34        #[deprecated]
35        #[unsafe(method(isUpdatable))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn isUpdatable(&self) -> bool;
38
39        /// Setter for [`isUpdatable`][Self::isUpdatable].
40        #[deprecated]
41        #[unsafe(method(setIsUpdatable:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn setIsUpdatable(&self, is_updatable: bool);
44
45        #[deprecated]
46        #[unsafe(method(new))]
47        #[unsafe(method_family = new)]
48        pub unsafe fn new() -> Retained<Self>;
49
50        #[deprecated]
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[cfg(feature = "MLCTensor")]
56        /// Create a tensor parameter
57        ///
58        /// Parameter `tensor`: The unedrlying tensor
59        ///
60        /// Returns: A new tensor parameter object
61        #[deprecated]
62        #[unsafe(method(parameterWithTensor:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn parameterWithTensor(tensor: &MLCTensor) -> Retained<Self>;
65
66        #[cfg(all(feature = "MLCTensor", feature = "MLCTensorData"))]
67        /// Create a tensor parameter
68        ///
69        /// Parameter `tensor`: The unedrlying tensor
70        ///
71        /// Parameter `optimizerData`: The optimizer data needed for this input tensor
72        ///
73        /// Returns: A new tensor parameter object
74        #[deprecated]
75        #[unsafe(method(parameterWithTensor:optimizerData:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn parameterWithTensor_optimizerData(
78            tensor: &MLCTensor,
79            optimizer_data: Option<&NSArray<MLCTensorData>>,
80        ) -> Retained<Self>;
81    );
82}