objc2_metal_performance_shaders_graph/generated/
MPSGraphTensor.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#[cfg(feature = "objc2-metal-performance-shaders")]
7use objc2_metal_performance_shaders::*;
8
9use crate::*;
10
11extern_class!(
12    /// The symbolic representation of a compute data type.
13    ///
14    /// `NSCopy` will take a refrence, this is so `NSDictionary` can work with the tensor.
15    /// All tensors are created, owned and destroyed by the MPSGraph
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphtensor?language=objc)
18    #[unsafe(super(MPSGraphObject, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "MPSGraphCore")]
21    pub struct MPSGraphTensor;
22);
23
24#[cfg(feature = "MPSGraphCore")]
25extern_conformance!(
26    unsafe impl NSCopying for MPSGraphTensor {}
27);
28
29#[cfg(feature = "MPSGraphCore")]
30unsafe impl CopyingHelper for MPSGraphTensor {
31    type Result = Self;
32}
33
34#[cfg(feature = "MPSGraphCore")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for MPSGraphTensor {}
37);
38
39#[cfg(feature = "MPSGraphCore")]
40impl MPSGraphTensor {
41    extern_methods!(
42        #[cfg(feature = "objc2-metal-performance-shaders")]
43        /// The shape of the tensor.
44        ///
45        /// nil shape represents an unranked tensor.
46        /// -1 value for a dimension represents that it will be resolved via shape inference at runtime and it can be anything.
47        #[unsafe(method(shape))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn shape(&self) -> Option<Retained<MPSShape>>;
50
51        #[cfg(feature = "objc2-metal-performance-shaders")]
52        /// The data type of the tensor.
53        #[unsafe(method(dataType))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn dataType(&self) -> MPSDataType;
56
57        #[cfg(feature = "MPSGraphOperation")]
58        /// The operation responsible for creating this tensor.
59        #[unsafe(method(operation))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn operation(&self) -> Retained<MPSGraphOperation>;
62
63        /// Unavailable, please utilize graph methods to create and initialize tensors.
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67    );
68}
69
70/// Methods declared on superclass `NSObject`.
71#[cfg(feature = "MPSGraphCore")]
72impl MPSGraphTensor {
73    extern_methods!(
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new() -> Retained<Self>;
77    );
78}