objc2_metal_performance_shaders_graph/generated/MPSGraphAutomaticDifferentiation.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/// MPSGraphGradientOps.
10#[cfg(all(feature = "MPSGraph", feature = "MPSGraphCore"))]
11impl MPSGraph {
12 extern_methods!(
13 #[cfg(feature = "MPSGraphTensor")]
14 /// Calculates a partial derivative of primaryTensor with respect to the tensors.
15 ///
16 /// - Parameters:
17 /// - primaryTensor: Tensor to be differentiated (numerator).
18 /// - tensors: Tensors to do the differentiation with (denominator).
19 /// - name: Name for the gradient operation.
20 /// - Returns: A valid MPSGraphTensor dictionary object containing partial derivative d(primaryTensor)/d(secondaryTensor) for each tensor as key.
21 #[unsafe(method(gradientForPrimaryTensor:withTensors:name:))]
22 #[unsafe(method_family = none)]
23 pub unsafe fn gradientForPrimaryTensor_withTensors_name(
24 &self,
25 primary_tensor: &MPSGraphTensor,
26 tensors: &NSArray<MPSGraphTensor>,
27 name: Option<&NSString>,
28 ) -> Retained<NSDictionary<MPSGraphTensor, MPSGraphTensor>>;
29 );
30}