objc2_ml_compute/generated/
MLCSliceLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Slice layer is used to slice a given source.
11    ///
12    /// Slicing should not decrease the tensor dimension.
13    /// The start, end and stride vectors must have the same number of dimension as the source tensor.
14    /// Only positive stride is supported.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcslicelayer?language=objc)
17    #[unsafe(super(MLCLayer, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "MLCLayer")]
20    #[deprecated]
21    pub struct MLCSliceLayer;
22);
23
24#[cfg(feature = "MLCLayer")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MLCSliceLayer {}
27);
28
29#[cfg(feature = "MLCLayer")]
30impl MLCSliceLayer {
31    extern_methods!(
32        /// A vector of length equal to that of source. The element at index i specifies the beginning of slice in dimension i.
33        #[deprecated]
34        #[unsafe(method(start))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn start(&self) -> Retained<NSArray<NSNumber>>;
37
38        /// A vector of length equal to that of source. The element at index i specifies the end of slice in dimension i.
39        #[deprecated]
40        #[unsafe(method(end))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn end(&self) -> Retained<NSArray<NSNumber>>;
43
44        /// A vector of length equal to that of source. The element at index i specifies the stride of slice in dimension i.
45        #[deprecated]
46        #[unsafe(method(stride))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn stride(&self) -> Option<Retained<NSArray<NSNumber>>>;
49
50        /// Create a slice layer
51        ///
52        /// Parameter `stride`: If set to nil, it will be set to 1.
53        ///
54        /// Returns: A new layer for slicing tensors.
55        #[deprecated]
56        #[unsafe(method(sliceLayerWithStart:end:stride:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn sliceLayerWithStart_end_stride(
59            start: &NSArray<NSNumber>,
60            end: &NSArray<NSNumber>,
61            stride: Option<&NSArray<NSNumber>>,
62        ) -> Option<Retained<Self>>;
63    );
64}
65
66/// Methods declared on superclass `MLCLayer`.
67#[cfg(feature = "MLCLayer")]
68impl MLCSliceLayer {
69    extern_methods!(
70        #[deprecated]
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74
75        #[deprecated]
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79    );
80}