objc2_metal_performance_shaders_graph/generated/
MPSGraphNonZeroOps.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/// NonZeroOps.
10#[cfg(all(feature = "MPSGraph", feature = "MPSGraphCore"))]
11impl MPSGraph {
12    extern_methods!(
13        #[cfg(feature = "MPSGraphTensor")]
14        /// Computes the indices of the non-zero elements of the input tensor.
15        ///
16        /// The indices are returned as a two-dimensional tensor of size `[number_of_nonzeros, input_rank]`.
17        /// Each row in the result contains indices of a nonzero elements in input.
18        /// For example:
19        /// ```md
20        /// tensor = [[ 1,  0, 3],
21        /// [ 0, 10, 0]]
22        /// indices = [[ 0, 0],
23        /// [ 0, 2],
24        /// [ 1, 1]]
25        /// ```
26        ///
27        /// - Parameters:
28        /// - tensor: An MPSGraphTensor of which to compute the non-zero indices.
29        /// - Returns: A valid MPSGraphTensor containing indices in signed int32 data type.
30        #[unsafe(method(nonZeroIndicesOfTensor:name:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn nonZeroIndicesOfTensor_name(
33            &self,
34            tensor: &MPSGraphTensor,
35            name: Option<&NSString>,
36        ) -> Retained<MPSGraphTensor>;
37    );
38}