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!(
    /// Slice layer is used to slice a given source.
    ///
    /// Slicing should not decrease the tensor dimension.
    /// The start, end and stride vectors must have the same number of dimension as the source tensor.
    /// Only positive stride is supported.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcslicelayer?language=objc)
    #[unsafe(super(MLCLayer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MLCLayer")]
    #[deprecated]
    pub struct MLCSliceLayer;
);

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

#[cfg(feature = "MLCLayer")]
impl MLCSliceLayer {
    extern_methods!(
        /// A vector of length equal to that of source. The element at index i specifies the beginning of slice in dimension i.
        #[deprecated]
        #[unsafe(method(start))]
        #[unsafe(method_family = none)]
        pub unsafe fn start(&self) -> Retained<NSArray<NSNumber>>;

        /// A vector of length equal to that of source. The element at index i specifies the end of slice in dimension i.
        #[deprecated]
        #[unsafe(method(end))]
        #[unsafe(method_family = none)]
        pub unsafe fn end(&self) -> Retained<NSArray<NSNumber>>;

        /// A vector of length equal to that of source. The element at index i specifies the stride of slice in dimension i.
        #[deprecated]
        #[unsafe(method(stride))]
        #[unsafe(method_family = none)]
        pub unsafe fn stride(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Create a slice layer
        ///
        /// Parameter `stride`: If set to nil, it will be set to 1.
        ///
        /// Returns: A new layer for slicing tensors.
        #[deprecated]
        #[unsafe(method(sliceLayerWithStart:end:stride:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sliceLayerWithStart_end_stride(
            start: &NSArray<NSNumber>,
            end: &NSArray<NSNumber>,
            stride: Option<&NSArray<NSNumber>>,
        ) -> Option<Retained<Self>>;
    );
}

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