objc2_ml_compute/generated/
MLCUpsampleLayer.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    /// An upsample layer
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcupsamplelayer?language=objc)
13    #[unsafe(super(MLCLayer, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MLCLayer")]
16    #[deprecated]
17    pub struct MLCUpsampleLayer;
18);
19
20#[cfg(feature = "MLCLayer")]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for MLCUpsampleLayer {}
23);
24
25#[cfg(feature = "MLCLayer")]
26impl MLCUpsampleLayer {
27    extern_methods!(
28        /// A NSArray
29        /// <NSNumber
30        /// *> representing just the width if number of entries in shape array is 1 or
31        /// the height followed by width of result tensor if the number of entries in shape array is 2.
32        #[deprecated]
33        #[unsafe(method(shape))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn shape(&self) -> Retained<NSArray<NSNumber>>;
36
37        #[cfg(feature = "MLCTypes")]
38        /// The sampling mode to use when performing the upsample.
39        #[deprecated]
40        #[unsafe(method(sampleMode))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn sampleMode(&self) -> MLCSampleMode;
43
44        /// A boolean that specifies whether the corner pixels of the source and result tensors are aligned.
45        ///
46        /// If True, the corner pixels of the source and result tensors are aligned, and thus preserving the values at those pixels.
47        /// This only has effect when mode is 'bilinear'. Default is NO.
48        #[deprecated]
49        #[unsafe(method(alignsCorners))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn alignsCorners(&self) -> bool;
52
53        /// Create an upsample layer
54        ///
55        /// Parameter `shape`: A NSArray
56        /// <NSNumber
57        /// *> representing the dimensions of the result tensor
58        ///
59        /// Returns: A new upsample layer.
60        #[deprecated]
61        #[unsafe(method(layerWithShape:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn layerWithShape(shape: &NSArray<NSNumber>) -> Option<Retained<Self>>;
64
65        #[cfg(feature = "MLCTypes")]
66        /// Create an upsample layer
67        ///
68        /// Parameter `shape`: A NSArray
69        /// <NSNumber
70        /// *> representing the dimensions of the result tensor
71        ///
72        /// Parameter `sampleMode`: The upsampling algorithm to use.  Default is nearest.
73        ///
74        /// Parameter `alignsCorners`: Whether the corner pixels of the input and output tensors are aligned or not.
75        ///
76        /// Returns: A new upsample layer.
77        #[deprecated]
78        #[unsafe(method(layerWithShape:sampleMode:alignsCorners:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn layerWithShape_sampleMode_alignsCorners(
81            shape: &NSArray<NSNumber>,
82            sample_mode: MLCSampleMode,
83            aligns_corners: bool,
84        ) -> Option<Retained<Self>>;
85    );
86}
87
88/// Methods declared on superclass `MLCLayer`.
89#[cfg(feature = "MLCLayer")]
90impl MLCUpsampleLayer {
91    extern_methods!(
92        #[deprecated]
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub unsafe fn new() -> Retained<Self>;
96
97        #[deprecated]
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101    );
102}