objc2-core-ml 0.3.2

Bindings to the CoreML framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-metal")]
#[cfg(not(target_os = "watchos"))]
use objc2_metal::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreml/mlcustomlayer?language=objc)
    pub unsafe trait MLCustomLayer {
        /// # Safety
        ///
        /// `parameters` generic should be of the correct type.
        #[unsafe(method(initWithParameterDictionary:error:_))]
        #[unsafe(method_family = init)]
        unsafe fn initWithParameterDictionary_error(
            this: Allocated<Self>,
            parameters: &NSDictionary<NSString, AnyObject>,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[unsafe(method(setWeightData:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn setWeightData_error(
            &self,
            weights: &NSArray<NSData>,
        ) -> Result<(), Retained<NSError>>;

        #[unsafe(method(outputShapesForInputShapes:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn outputShapesForInputShapes_error(
            &self,
            input_shapes: &NSArray<NSArray<NSNumber>>,
        ) -> Result<Retained<NSArray<NSArray<NSNumber>>>, Retained<NSError>>;

        #[cfg(feature = "MLMultiArray")]
        #[unsafe(method(evaluateOnCPUWithInputs:outputs:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn evaluateOnCPUWithInputs_outputs_error(
            &self,
            inputs: &NSArray<MLMultiArray>,
            outputs: &NSArray<MLMultiArray>,
        ) -> Result<(), Retained<NSError>>;

        #[cfg(feature = "objc2-metal")]
        #[cfg(not(target_os = "watchos"))]
        /// # Safety
        ///
        /// - `inputs` generic may need to be synchronized.
        /// - `inputs` generic may be unretained, you must ensure it is kept alive while in use.
        /// - `outputs` generic may need to be synchronized.
        /// - `outputs` generic may be unretained, you must ensure it is kept alive while in use.
        #[optional]
        #[unsafe(method(encodeToCommandBuffer:inputs:outputs:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn encodeToCommandBuffer_inputs_outputs_error(
            &self,
            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
            inputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
            outputs: &NSArray<ProtocolObject<dyn MTLTexture>>,
        ) -> Result<(), Retained<NSError>>;
    }
);