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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Reduce tensor values across a given dimension to a scalar value.
    ///
    /// The layer is used to perform reductionType operation on a given dimension.
    /// Result of this layer is a tensor of the same shape as source tensor,
    /// except for the given dimension which is set to 1.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcreductionlayer?language=objc)
    #[unsafe(super(MLCLayer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MLCLayer")]
    #[deprecated]
    pub struct MLCReductionLayer;
);

#[cfg(feature = "MLCLayer")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MLCReductionLayer {}
);

#[cfg(feature = "MLCLayer")]
impl MLCReductionLayer {
    extern_methods!(
        #[cfg(feature = "MLCTypes")]
        /// The reduction type
        #[deprecated]
        #[unsafe(method(reductionType))]
        #[unsafe(method_family = none)]
        pub unsafe fn reductionType(&self) -> MLCReductionType;

        /// The dimension over which to perform the reduction operation
        #[deprecated]
        #[unsafe(method(dimension))]
        #[unsafe(method_family = none)]
        pub unsafe fn dimension(&self) -> NSUInteger;

        /// The dimensions over which to perform the reduction operation
        #[unsafe(method(dimensions))]
        #[unsafe(method_family = none)]
        pub unsafe fn dimensions(&self) -> Retained<NSArray<NSNumber>>;

        #[cfg(feature = "MLCTypes")]
        /// Create a reduction layer.
        ///
        /// Parameter `reductionType`: The reduction type.
        ///
        /// Parameter `dimension`: The reduction dimension.
        ///
        /// Returns: A new reduction layer.
        #[deprecated]
        #[unsafe(method(layerWithReductionType:dimension:))]
        #[unsafe(method_family = none)]
        pub unsafe fn layerWithReductionType_dimension(
            reduction_type: MLCReductionType,
            dimension: NSUInteger,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "MLCTypes")]
        /// Create a reduction layer.
        ///
        /// Parameter `reductionType`: The reduction type.
        ///
        /// Parameter `dimensions`: The list of dimensions to reduce over
        ///
        /// Returns: A new reduction layer.
        #[unsafe(method(layerWithReductionType:dimensions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn layerWithReductionType_dimensions(
            reduction_type: MLCReductionType,
            dimensions: &NSArray<NSNumber>,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `MLCLayer`.
#[cfg(feature = "MLCLayer")]
impl MLCReductionLayer {
    extern_methods!(
        #[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>;
    );
}