objc2_metal_performance_shaders_graph/generated/
MPSGraphLinearAlgebraOps.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
9/// MPSGraphLinearAlgebraOps.
10#[cfg(all(feature = "MPSGraph", feature = "MPSGraphCore"))]
11impl MPSGraph {
12    extern_methods!(
13        #[cfg(feature = "MPSGraphTensor")]
14        /// Computes the band part of an input tensor.
15        ///
16        /// This operation copies a diagonal band of values from input tensor to a result tensor of the same size.
17        /// A coordinate `[..., i, j]` is in the band if
18        /// ```md
19        /// (numLower
20        /// <
21        /// 0 || (i-j)
22        /// <
23        /// = numLower)
24        /// &
25        /// &
26        /// (numUpper
27        /// <
28        /// 0 || (j-i)
29        /// <
30        /// = numUpper)
31        /// ```
32        /// The values outside of the band are set to 0.
33        ///
34        /// - Parameters:
35        /// - inputTensor: input tensor
36        /// - numLower: the number of diagonals in the lower triangle to keep. If -1, the framework returns all sub diagnols.
37        /// - numUpper: the number of diagonals in the upper triangle to keep. If -1,  the framework returns all super diagnols.
38        /// - name: name for the operation.
39        /// - Returns: A valid MPSGraphTensor object.
40        #[unsafe(method(bandPartWithTensor:numLower:numUpper:name:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn bandPartWithTensor_numLower_numUpper_name(
43            &self,
44            input_tensor: &MPSGraphTensor,
45            num_lower: NSInteger,
46            num_upper: NSInteger,
47            name: Option<&NSString>,
48        ) -> Retained<MPSGraphTensor>;
49
50        #[cfg(feature = "MPSGraphTensor")]
51        /// Creates the band part operation and returns the result.
52        ///
53        /// See above discussion of bandPartWithTensor: numLower: numUpper: name:
54        ///
55        /// - Parameters:
56        /// - inputTensor: The source tensor to copy.
57        /// - numLowerTensor: Scalar Int32 tensor. The number of diagonals in the lower triangle to keep. If -1, keep all.
58        /// - numUpperTensor: Scalar Int32 tensor. The number of diagonals in the upper triangle to keep. If -1, keep all.
59        /// - name: The name for the operation.
60        /// - Returns: A valid MPSGraphTensor object.
61        #[unsafe(method(bandPartWithTensor:numLowerTensor:numUpperTensor:name:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn bandPartWithTensor_numLowerTensor_numUpperTensor_name(
64            &self,
65            input_tensor: &MPSGraphTensor,
66            num_lower_tensor: &MPSGraphTensor,
67            num_upper_tensor: &MPSGraphTensor,
68            name: Option<&NSString>,
69        ) -> Retained<MPSGraphTensor>;
70    );
71}