objc2-ml-compute 0.3.2

Bindings to the MLCompute framework
Documentation
//! 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!(
    /// A tensor parameter object.  This is used to describe input tensors that are updated by the optimizer during training.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlctensorparameter?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct MLCTensorParameter;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MLCTensorParameter {}
);

impl MLCTensorParameter {
    extern_methods!(
        #[cfg(feature = "MLCTensor")]
        /// The underlying tensor
        #[deprecated]
        #[unsafe(method(tensor))]
        #[unsafe(method_family = none)]
        pub unsafe fn tensor(&self) -> Retained<MLCTensor>;

        /// Specifies whether this tensor parameter is updatable
        #[deprecated]
        #[unsafe(method(isUpdatable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isUpdatable(&self) -> bool;

        /// Setter for [`isUpdatable`][Self::isUpdatable].
        #[deprecated]
        #[unsafe(method(setIsUpdatable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIsUpdatable(&self, is_updatable: bool);

        #[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>;

        #[cfg(feature = "MLCTensor")]
        /// Create a tensor parameter
        ///
        /// Parameter `tensor`: The unedrlying tensor
        ///
        /// Returns: A new tensor parameter object
        #[deprecated]
        #[unsafe(method(parameterWithTensor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn parameterWithTensor(tensor: &MLCTensor) -> Retained<Self>;

        #[cfg(all(feature = "MLCTensor", feature = "MLCTensorData"))]
        /// Create a tensor parameter
        ///
        /// Parameter `tensor`: The unedrlying tensor
        ///
        /// Parameter `optimizerData`: The optimizer data needed for this input tensor
        ///
        /// Returns: A new tensor parameter object
        #[deprecated]
        #[unsafe(method(parameterWithTensor:optimizerData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn parameterWithTensor_optimizerData(
            tensor: &MLCTensor,
            optimizer_data: Option<&NSArray<MLCTensorData>>,
        ) -> Retained<Self>;
    );
}