objc2_ml_compute/generated/
MLCReductionLayer.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    /// Reduce tensor values across a given dimension to a scalar value.
11    ///
12    /// The layer is used to perform reductionType operation on a given dimension.
13    /// Result of this layer is a tensor of the same shape as source tensor,
14    /// except for the given dimension which is set to 1.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcreductionlayer?language=objc)
17    #[unsafe(super(MLCLayer, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "MLCLayer")]
20    #[deprecated]
21    pub struct MLCReductionLayer;
22);
23
24#[cfg(feature = "MLCLayer")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MLCReductionLayer {}
27);
28
29#[cfg(feature = "MLCLayer")]
30impl MLCReductionLayer {
31    extern_methods!(
32        #[cfg(feature = "MLCTypes")]
33        /// The reduction type
34        #[deprecated]
35        #[unsafe(method(reductionType))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn reductionType(&self) -> MLCReductionType;
38
39        /// The dimension over which to perform the reduction operation
40        #[deprecated]
41        #[unsafe(method(dimension))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn dimension(&self) -> NSUInteger;
44
45        /// The dimensions over which to perform the reduction operation
46        #[unsafe(method(dimensions))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn dimensions(&self) -> Retained<NSArray<NSNumber>>;
49
50        #[cfg(feature = "MLCTypes")]
51        /// Create a reduction layer.
52        ///
53        /// Parameter `reductionType`: The reduction type.
54        ///
55        /// Parameter `dimension`: The reduction dimension.
56        ///
57        /// Returns: A new reduction layer.
58        #[deprecated]
59        #[unsafe(method(layerWithReductionType:dimension:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn layerWithReductionType_dimension(
62            reduction_type: MLCReductionType,
63            dimension: NSUInteger,
64        ) -> Option<Retained<Self>>;
65
66        #[cfg(feature = "MLCTypes")]
67        /// Create a reduction layer.
68        ///
69        /// Parameter `reductionType`: The reduction type.
70        ///
71        /// Parameter `dimensions`: The list of dimensions to reduce over
72        ///
73        /// Returns: A new reduction layer.
74        #[unsafe(method(layerWithReductionType:dimensions:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn layerWithReductionType_dimensions(
77            reduction_type: MLCReductionType,
78            dimensions: &NSArray<NSNumber>,
79        ) -> Option<Retained<Self>>;
80    );
81}
82
83/// Methods declared on superclass `MLCLayer`.
84#[cfg(feature = "MLCLayer")]
85impl MLCReductionLayer {
86    extern_methods!(
87        #[deprecated]
88        #[unsafe(method(new))]
89        #[unsafe(method_family = new)]
90        pub unsafe fn new() -> Retained<Self>;
91
92        #[deprecated]
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96    );
97}