-
Notifications
You must be signed in to change notification settings - Fork 515
MetalPerformanceShadersGraph iOS xcode15.0 b5
Alex Soto edited this page Jul 26, 2023
·
1 revision
#MetalPerformanceShadersGraph.framework
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h 2023-07-13 22:01:30
@@ -160,7 +160,7 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph : MPSGraphObject
-/// options for the graph, default value is MPSGraphOptionsDefault.
+/// Options for the graph, the default value is MPSGraphOptionsDefault.
@property (readwrite, atomic) MPSGraphOptions options;
/// Create a new MPSGraph to insert nodes in.
@@ -169,11 +169,13 @@
/// Initialize an MPSGraph to insert nodes in.
-(instancetype) init;
-/// an array of all the placeholderTensors.
+/// Array of all the placeholder tensors.
@property (readonly, nonnull, nonatomic) NSArray<MPSGraphTensor *> *placeholderTensors;
-/// Compiles the graph for given feeds to return targetTensor values, ensuring all target operations would be executed. This call blocks till execution has completed.
+/// Compiles the graph for given feeds to return targetTensor values, ensuring all target operations would be executed.
///
+/// This call blocks till execution has completed. The compilation descriptor helps specialize the executable returned.
+///
/// - Parameters:
/// - device: MPSGraph device to optimize for.
/// - feeds: Feeds dictionary for the placeholder tensors.
@@ -187,8 +189,10 @@
targetOperations:(NSArray<MPSGraphOperation *> * _Nullable) targetOperations
compilationDescriptor:(MPSGraphCompilationDescriptor * _Nullable) compilationDescriptor MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed. This call blocks till execution has completed.
+/// Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
///
+/// This call blocks till execution has completed.
+///
/// - Parameters:
/// - feeds: Feeds dictionary for the placeholder tensors.
/// - targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
@@ -213,9 +217,10 @@
targetOperations:(NSArray<MPSGraphOperation *> * _Nullable) targetOperations
MPS_SWIFT_NAME( run(with:feeds:targetTensors:targetOperations:) );
-/// Runs the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user,
-/// ensuring all target operations also executed. This call blocks till execution has completed.
+/// Runs the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user.
///
+/// It also ensures all target operations also executed. This call blocks till execution has completed.
+///
/// - Parameters:
/// - commandQueue: CommandQueue passed to exectute the graph on.
/// - feeds: Feeds dictionary for the placeholder tensors.
@@ -231,6 +236,7 @@
// Async methods
/// Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
+///
/// This call is asynchronous and will return immediately if a completionHandler is set.
///
/// - Parameters:
@@ -247,6 +253,7 @@
/// Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
+///
/// This call is asynchronous and will return immediately if a completionHandler is set.
///
/// - Parameters:
@@ -263,9 +270,10 @@
executionDescriptor:(MPSGraphExecutionDescriptor * _Nullable) executionDescriptor
MPS_SWIFT_NAME( runAsync(with:feeds:targetTensors:targetOperations:executionDescriptor:) );
-/// Runs the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user,
-/// ensuring all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
+/// Encodes the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user.
///
+/// It ensures all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
+///
/// - Parameters:
/// - commandQueue: CommandQueue passed to exectute the graph on.
/// - feeds: Feeds dictionary for the placeholder tensors.
@@ -280,6 +288,7 @@
MPS_SWIFT_NAME( runAsync(with:feeds:targetOperations:resultsDictionary:executionDescriptor:) );
/// Encodes graph for given feeds to return targetTensor values, ensuring all target operations also executed.
+///
/// This call is asynchronous and will return immediately if a completionHandler is set.
///
/// - Parameters:
@@ -296,8 +305,9 @@
executionDescriptor:(MPSGraphExecutionDescriptor * _Nullable) executionDescriptor
MPS_SWIFT_NAME( encode(to:feeds:targetTensors:targetOperations:executionDescriptor:) );
-/// Encodes the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user,
-/// ensuring all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
+/// Encodes the graph for given feeds to return targetTensor values in the resultsDictionary provided by the user.
+///
+/// It ensures all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
///
/// - Parameters:
/// - commandBuffer: commandBuffer passed to execute the graph on, commitAndContinue might be called, please don't rely on underlying MTLCommandBuffer to remain uncommitted.
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphActivationOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphActivationOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphActivationOps.h 2023-05-13 17:15:32
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphActivationOps.h 2023-07-13 22:07:56
@@ -16,106 +16,110 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphActivationOps)
-/// Computes a ReLU (rectified linear activation unit) function with an input tensor.
+/// Computes the ReLU (rectified linear activation unit) function with the input tensor.
+///
/// The operation is: f(x) = max(x, 0).
///
/// - Parameters:
-/// - tensor: An input tensor.
-/// - name: A name for the operation.
+/// - tensor: The input tensor.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object.
-(MPSGraphTensor *) reLUWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Computes gradient of ReLU (rectified linear activation unit) function using the incoming gradient.
-///
+/// Computes the gradient of the ReLU (rectified linear activation unit) function using the incoming gradient.
+///
/// - Parameters:
/// - gradient: The incoming gradient tensor.
/// - source: The input tensor from forward pass.
-/// - name: A name for the operation.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object.
-(MPSGraphTensor *) reLUGradientWithIncomingGradient:(MPSGraphTensor *) gradient
sourceTensor:(MPSGraphTensor *) source
name:(NSString * _Nullable) name;
-/// Computes sigmoid operation on an input tensor.
-///
+/// Computes the sigmoid operation on an input tensor.
+///
/// - Parameters:
-/// - tensor: An input tensor.
-/// - name: A name for the operation.
+/// - tensor: The input tensor.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object.
-(MPSGraphTensor *) sigmoidWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Computes gradient of sigmoid function using the incoming gradient tensor.
-///
+/// Computes the gradient of the sigmoid function using the incoming gradient tensor.
+///
/// - Parameters:
/// - gradient: The incoming gradient tensor.
/// - source: The input tensor.
-/// - name: A name for the operation.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor *) sigmoidGradientWithIncomingGradient:(MPSGraphTensor *) gradient
sourceTensor:(MPSGraphTensor *) source
name:(NSString * _Nullable) name;
-/// Computes a softmax function on an input tensor along a specified axis.
-///
+/// Computes the softmax function on the input tensor along the specified axis.
+///
/// - Parameters:
-/// - tensor: An input tensor.
-/// - axis: An axis along which softmax is computed.
-/// - name: A name for the operation.
+/// - tensor: The input tensor.
+/// - axis: The axis along which softmax is computed.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor *) softMaxWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name;
-/// Computes the gradient of the softmax function along a specified axis using the incoming gradient tensor.
-///
+/// Computes the gradient of the softmax function along the specified axis using the incoming gradient tensor.
+///
/// - Parameters:
/// - gradient: The incoming gradient tensor.
/// - source: The input tensor.
-/// - axis: An axis along which softmax is computed.
-/// - name: A name for the operation
+/// - axis: The axis along which softmax is computed.
+/// - name: The name for the operation
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor *) softMaxGradientWithIncomingGradient:(MPSGraphTensor *) gradient
sourceTensor:(MPSGraphTensor *) source
axis:(NSInteger) axis
name:(NSString * _Nullable) name;
-/// Computes leaky ReLU (rectified linear unit activation) on an input tensor.
+/// Computes the leaky ReLU (rectified linear unit activation) function on the input tensor.
+///
/// The operation is: f(x) = max(x, alpha).
///
/// - Parameters:
/// - tensor: An input tensor.
-/// - alpha: A scalar value alpha used by all elements in the input tensor.
-/// - name: A name for the operation.
+/// - alpha: The scalar value alpha used by all elements in the input tensor.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor*)leakyReLUWithTensor:(MPSGraphTensor* _Nonnull)tensor
alpha:(double) alpha
name:(NSString* _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Computes leaky ReLU (rectified linear unit activation) on an input tensor.
+/// Computes the leaky ReLU (rectified linear unit activation) function on the input tensor.
+///
/// The operation is: f(x) = max(x, alpha).
/// This operation supports broadcasting with the alpha tensor.
///
/// - Parameters:
-/// - tensor: An input tensor.
-/// - alpha: An alpha tensor.
-/// - name: A name for the operation.
+/// - tensor: The input tensor.
+/// - alpha: The alpha tensor.
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor*)leakyReLUWithTensor:(MPSGraphTensor* _Nonnull) tensor
alphaTensor:(MPSGraphTensor* _Nonnull) alphaTensor
name:(NSString* _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Computes gradient of leaky ReLU (rectified linear unit activation).
-/// Supports broadcasting with alpha tensor.
-///
+/// Computes the gradient of the leaky ReLU (rectified linear unit activation).
+///
+/// This operation supports broadcasting with the alpha tensor.
+///
/// - Parameters:
/// - gradient: The incoming gradient tensor.
/// - source: The input tensor in forward pass.
-/// - alpha: An alpha tensor
-/// - name: A name for the operation.
+/// - alpha: The alpha tensor
+/// - name: The name for the operation.
/// - Returns: A valid ``MPSGraphTensor`` object
-(MPSGraphTensor*)leakyReLUGradientWithIncomingGradient:(MPSGraphTensor *) gradient
sourceTensor:(MPSGraphTensor* _Nonnull) source
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h 2023-07-14 00:03:41
@@ -20,383 +20,401 @@
#pragma mark - UnaryArithmeticOps
-/// Identity op - it copies input tensor values to output
+/// Copies the input tensor values into the output, behaving as an identity operation.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object which is a copy of the input.
-(MPSGraphTensor *) identityWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies natural exponent
+/// Applies the natural exponent to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) exponentWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies exponent with base 2
+/// Applies an exponent with base two to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) exponentBase2WithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies exponent with base 10
+/// Applies an exponent with base ten to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) exponentBase10WithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies natural log to input tensor elements
+/// Computes the natural logarithm to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logarithmWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies log with base 2 to input tensor elements
+/// Computes the logarithm with base two to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logarithmBase2WithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies log with base 10 to input tensor elements
+/// Computes the logarithm with base ten to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logarithmBase10WithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies square to input tensor elements
+/// Applies the square operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) squareWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies square root to input tensor elements
+/// Applies the square root operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) squareRootWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It returns reverse square root of input tensor elements
+/// Applies the reverse square root operation to the input tensor elements.
///
+/// The reverse square root operation is the reciprocal of the square root.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) reverseSquareRootWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies reciprocal to input tensor elements
+/// Applies the reciprocal operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) reciprocalWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// It applies absolute to input tensor elements
+/// Returns the absolute values of the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) absoluteWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Return the absolute square of the input tensor.
+/// Returns the absolute square of the input tensor elements.
///
/// - Parameters:
-/// - tensor: input tensor.
-/// - name: name for the operation.
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor..
+/// - name: An optional string which serves as an identifier for the operation..
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) absoluteSquareWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( absoluteSquare(tensor:name:) );
-/// It applies negative to input tensor elements
+/// Applies negative to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) negativeWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Gets back sign of input tensor elements,
-/// `1.0 ifx > 0, -0.0 if x = -0.0, +0.0 ifx = +0.0, or -1.0 if x < 0. Returns 0.0 if x is a NaN.`
+/// Returns the sign of the input tensor elements.
///
+/// This operation returns 1.0 if the correspnding input element is greater than 0,
+/// -1.0 if it is lesser than 0, -0.0 if it is equal to -0.0, and
+/// +0.0 if it is equal to +0.0.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) signWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Gets back signbit of input tensor elements,
-/// `true` if the sign bit is set for the floating-point value in x; otherwise returns `false`
+/// Returns the sign bit of the input tensor elements.
///
+/// This operation returns `true` if the sign bit is set for the correspnding floating-point input element,
+/// otherwise it returns `false`.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) signbitWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with ceil of input tensor elements,
+/// Applies the ceiling operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) ceilWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with floor of input tensor elements,
+/// Applies the floor operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) floorWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with round of input tensor elements,
+/// Rounds the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) roundWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with round of input tensor elements,
-/// Round values to integral value using round to nearest even rounding mode in floating-point format.
+/// Rounds the input tensor elements using "round to nearest even" rounding mode.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) rintWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with sin of input tensor elements,
+/// Applies the sine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) sinWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with cos of input tensor elements,
+/// Applies the cosine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) cosWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with tan of input tensor elements,
+/// Applies the tangent operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) tanWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with sinh of input tensor elements,
+/// Applies the hyperbolic sine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) sinhWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with cosh of input tensor elements,
+/// Applies the hyperbolic cosine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) coshWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with tanh of input tensor elements,
+/// Applies the hyperbolic tangent operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) tanhWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with asin of input tensor elements,
+/// Applies the inverse sine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) asinWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with acos of input tensor elements,
+/// Applies the inverse cosine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) acosWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with atan of input tensor elements,
+/// Applies the inverse tangent operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) atanWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with asinh of input tensor elements,
+/// Applies the inverse hyperbolic sine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) asinhWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with acosh of input tensor elements,
+/// Applies the inverse hyperbolic cosine operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) acoshWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with acosh of input tensor elements,
+/// Applies the inverse hyperbolic tangent operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) atanhWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with logical not of input tensor elements,
+/// Applies the logical not operation to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) notWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with isInfinite of input tensor elements,
+/// Checks if the input tensor elements are infinite or not.
///
+/// If the input tensor element is infinite, the operation returns `true`, else it returns `false`.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) isInfiniteWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with isFinite of input tensor elements,
+/// Checks if the input tensor elements are finite or not.
///
+/// If the input tensor element is finite, the operation returns `true`, else it returns `false`.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) isFiniteWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with isNaN of input tensor elements,
+/// Checks if the input tensor elements are `NaN` or not.
///
+/// If the input tensor element is `NaN`, the operation returns `true`, else it returns `false`.
+///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) isNaNWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Output tensor of elements with erf of input tensor elements,
+/// Applies the error function to the input tensor elements.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) erfWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name;
-/// Truncate op - floor for positive inputs, ceil for negative.
+/// Applies the truncate operation to the input tensor elements.
///
+/// This operation applies the floor operation to positive inputs and ceiling operation to negative inputs.
+///
/// - Parameters:
-/// - tensor: The input
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) truncateWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( truncate(_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Return bitwise not of tensor, takes in only integer dataTypes
+/// Applies the bitwise not operation to the input tensor element.
///
+/// This operation only accepts integer tensors.
+///
/// - Parameters:
-/// - tensor: input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor, which must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseNOTWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwiseNOT(_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return population count of a tensor, takes in only integer dataTypes
+/// Returns the population count of the input tensor elements.
///
+/// This operation only accepts integer tensors, and returns the number of bits set in the input element.
+///
/// - Parameters:
-/// - tensor: input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor, which must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwisePopulationCountWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwisePopulationCount(_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return the complex conjugate of the input tensor.
+/// Returns the complex conjugate of the input tensor elements.
///
/// - Parameters:
-/// - tensor: input tensor.
-/// - name: name for the operation.
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation..
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) conjugateWithTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
@@ -404,16 +422,18 @@
#pragma mark - BinaryArithmeticOps
-/// Create Add op and return the result tensor, it supports broadcasting as well
+/// Adds two input tensors.
+///
+/// This operation creates an add op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor + secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) additionWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
@@ -421,16 +441,18 @@
-/// Create Subtract op and return the result tensor, it supports broadcasting as well
+/// Subtracts the second input tensor from the first.
+///
+/// This operation creates a subtract op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor - secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) subtractionWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
@@ -438,398 +460,440 @@
-/// Create Multiply op and return the result tensor, it supports broadcasting as well
+/// Multiplies two input tensors.
+///
+/// This operation creates a multiply op and returns the result tensor. It supports broadcasting as well.
/// ```md
-/// resultTensor = primaryTensorsecondaryTensor
+/// resultTensor = primaryTensor * secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) multiplicationWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( multiplication(_:_:name:) );
-/// Create Divide op and return the result tensor, it supports broadcasting as well
+/// Divides the first input tensor by the second.
+///
+/// This operation creates a divide op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor / secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) divisionWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( division(_:_:name:) );
-/// Create modulo op and return the result tensor, it supports broadcasting as well
+/// Returns the remainder obtained by dividing the first input tensor by the second.
+///
+/// This operation creates a modulo op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor % secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) moduloWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( modulo(_:_:name:) );
-/// Create power op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise result of raising the first tensor to the power of the second tensor.
+///
+/// This operation creates a power op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = pow(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) powerWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( power(_:_:name:) );
-/// Create minimum op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise minimum of the input tensors.
+///
+/// This operation creates a minimum op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = min(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) minimumWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( minimum(_:_:name:) );
-/// Create maximum op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise maximum of the input tensors.
+///
+/// This operation creates a maximum op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = max(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) maximumWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( maximum(_:_:name:) );
-/// Create Minimum op and return the result tensor, it supports broadcasting as well. If any of the operands is NaN, NaN is returned
+/// Returns the elementwise minimum of the input tensors, while propagating `NaN` values.
+///
+/// This operation creates a minimum with `NaN` propagation op and returns the result tensor. This means that
+/// if any of the elementwise operands is `NaN`, the result is `NaN`.
+/// It supports broadcasting as well.
/// ```md
/// resultTensor = isNaN(primaryTensor) || isNan(secondaryTensor) ? NaN : min(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) minimumWithNaNPropagationWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( minimumWithNaNPropagation(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Create Maximum op and return the result tensor, it supports broadcasting as well. If any of the operands is NaN, NaN is returned
+/// Returns the elementwise maximum of the input tensors, while propagating `NaN` values.
+///
+/// This operation creates a maximum with `NaN` propagation op and returns the result tensor. This means that
+/// if any of the elementwise operands is `NaN`, the result is `NaN`.
+/// It supports broadcasting as well.
/// ```md
/// resultTensor = isNaN(primaryTensor) || isNan(secondaryTensor) ? NaN : max(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) maximumWithNaNPropagationWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( maximumWithNaNPropagation(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Create equal op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise equality check of the input tensors.
+///
+/// This operation creates a equal op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor == secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) equalWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( equal(_:_:name:) );
-/// Create not equal op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise inequality check of the input tensors.
+///
+/// This operation creates a not equal op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor != secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) notEqualWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( notEqual(_:_:name:) );
-/// Create lessThan op and return the result tensor, it supports broadcasting as well
+/// Checks in an elementwise manner if the first input tensor is less than the second.
+///
+/// This operation creates a `lessThan` op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor < secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) lessThanWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( lessThan(_:_:name:) );
-
-/// Create lessThanOrEqualTo op and return the result tensor, it supports broadcasting as well
+/// Checks in an elementwise manner if the first input tensor is less than or equal to the second.
+///
+/// This operation creates a `lessThanOrEqualTo` op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor <= secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) lessThanOrEqualToWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( lessThanOrEqualTo(_:_:name:) );
-/// Create greaterThan op and return the result tensor, it supports broadcasting as well
+/// Checks in an elementwise manner if the first input tensor is greater than the second.
+///
+/// This operation creates a `greaterThan` op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor > secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) greaterThanWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( greaterThan(_:_:name:) );
-
-/// Create greaterThanOrEqual op and return the result tensor, it supports broadcasting as well
+/// Checks in an elementwise manner if the first input tensor is greater than or equal to the second.
+///
+/// This operation creates a `greaterThanOrEqual` op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor < secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) greaterThanOrEqualToWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( greaterThanOrEqualTo(_:_:name:) );
-
-/// Create logical AND op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical AND of the input tensors.
+///
+/// This operation creates a logical AND op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor && secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalANDWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalAND(_:_:name:) );
-/// Create logical OR op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical OR of the input tensors.
+///
+/// This operation creates a logical OR op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = primaryTensor || secondaryTensor
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalOR(_:_:name:) );
-/// Create logical NAND op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical NAND of the input tensors.
+///
+/// This operation creates a logical NAND op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = !(primaryTensor && secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalNANDWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalNAND(_:_:name:) );
-/// Create logical NOR op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical NOR of the input tensors.
+///
+/// This operation creates a logical NOR op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = !(primaryTensor || secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalNORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalNOR(_:_:name:) );
-/// Create logical XOR op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical XOR of the input tensors.
+///
+/// This operation creates a logical XOR op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = XOR(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalXORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalXOR(_:_:name:) );
-/// Create logical XNOR op and return the result tensor, it supports broadcasting as well
+/// Returns the elementwise logical XNOR of the input tensors.
+///
+/// This operation creates a logical XNOR op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = XNOR(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) logicalXNORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( logicalXNOR(_:_:name:) );
-
-/// Create logical atan2 op and return the result tensor, it supports broadcasting as well.
+/// Returns the elementwise 2-argument arctangent of the input tensors.
+///
+/// This operation creates a `atan2` op and returns the result tensor. It supports broadcasting as well.
/// Graph computes arc tangent of primaryTensor over secondaryTensor.
/// ```md
/// resultTensor = atan2(primaryTensor, secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) atan2WithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name;
-/// Return bitwise AND of binary representations of 2 integer tensors
+/// Returns the elementwise bitwise AND of binary representations of two integer tensors.
///
/// - Parameters:
-/// - primaryTensor: primary input tensor, must be integer dataType
-/// - secondaryTensor: secondary input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The primary input tensor, must be of integer type.
+/// - secondaryTensor: The secondary input tensor, must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseANDWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwiseAND(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return bitwise OR of binary representations of 2 integer tensors
+/// Returns the elementwise bitwise OR of binary representations of two integer tensors.
///
/// - Parameters:
-/// - primaryTensor: primary input tensor, must be integer dataType
-/// - secondaryTensor: secondary input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The primary input tensor, must be of integer type.
+/// - secondaryTensor: The secondary input tensor, must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwiseOR(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return bitwise XOR of binary representations of 2 integer tensors
+/// Returns the elementwise bitwise XOR of binary representations of two integer tensors.
///
/// - Parameters:
-/// - primaryTensor: primary input tensor, must be integer dataType
-/// - secondaryTensor: secondary input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The primary input tensor, must be of integer type.
+/// - secondaryTensor: The secondary input tensor, must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseXORWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwiseXOR(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return bitwise left shifted binary representations of primary integer tensor by secondary tensor amount
+/// Returns the elementwise left shifted binary representations of the primary integer by the secondary tensor amount.
///
/// - Parameters:
-/// - primaryTensor: primary input tensor, must be integer dataType
-/// - secondaryTensor: secondary input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The primary input tensor, must be of integer type.
+/// - secondaryTensor: The secondary input tensor, must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseLeftShiftWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bitwiseLeftShift(_:_:name:) )
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Return bitwise right shifted binary representations of primary integer tensor by secondary tensor amount
+/// Returns the elementwise right shifted binary representations of the primary integer by the secondary tensor amount.
///
/// - Parameters:
-/// - primaryTensor: primary input tensor, must be integer dataType
-/// - secondaryTensor: secondary input tensor, must be integer dataType
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The primary input tensor, must be of integer type.
+/// - secondaryTensor: The secondary input tensor, must be of integer type.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) bitwiseRightShiftWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
@@ -839,34 +903,38 @@
#pragma mark - TernaryArithmeticOps
-/// Create select op and return the result tensor, it supports broadcasting as well
+/// Selects values from either the true or false predicate tensor, depending on the values in the first input.
+///
+/// This operation creates a select op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = select(predicateTensor, truePredicateTensor, falseSelectTensor)
/// ```
///
/// - Parameters:
-/// - predicateTensor: tensor with predicate tensor
-/// - truePredicateTensor: tensor we get values from if predicate is true
-/// - falseSelectTensor: tensor we get values from if predicate is false
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - predicateTensor: The predicate tensor.
+/// - truePredicateTensor: The tensor to select values from if predicate is true.
+/// - falseSelectTensor: The tensor to select values from if predicate is false.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) selectWithPredicateTensor:(MPSGraphTensor *) predicateTensor
truePredicateTensor:(MPSGraphTensor *) truePredicateTensor
falsePredicateTensor:(MPSGraphTensor *) falseSelectTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( select(predicate:trueTensor:falseTensor:name:) );
-/// Create select op and return the result tensor, it supports broadcasting as well
+/// Clamps the values in the first tensor between the corresponding values in the min and max value tensor.
+///
+/// This operation creates a clamp op and returns the result tensor. It supports broadcasting as well.
/// ```md
/// resultTensor = clamp(tensor, minValueTensor, maxValueTensor)
/// ```
///
/// - Parameters:
-/// - predicateTensor: tensor with input values
-/// - truePredicateTensor: tensor with min values to clamp to
-/// - falseSelectTensor: tensor with max values to clamp to
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The tensor to be clamped.
+/// - minValueTensor: The tensor with min values to clamp to.
+/// - minValueTensor: The tensor with max values to clamp to.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) clampWithTensor:(MPSGraphTensor *) tensor
minValueTensor:(MPSGraphTensor *) minValueTensor
maxValueTensor:(MPSGraphTensor *) maxValueTensor
@@ -876,31 +944,33 @@
#pragma mark - ConvenienceMathOps
-/// Create DivideNoNaN op and return the result tensor, it supports broadcasting as well, returns 0 if divisor is 0
+/// Divides the first input tensor by the second, with the result being 0 if the denominator is 0.
+///
/// ```md
/// resultTensor = select(secondaryTensor, primaryTensor / secondaryTensor, 0)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) divisionNoNaNWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( divisionNoNaN(_:_:name:) );
+/// Returns the remainder of floor divison between the primary and secondary tensor.
/// Create floorModulo op and return the result tensor, it supports broadcasting as well, returns 0 if divisor is 0
/// ```md
/// resultTensor = primaryTensor - (floor(primaryTensor / secondaryTensor) * secondaryTensor)
/// ```
///
/// - Parameters:
-/// - primaryTensor: LHS tensor of the binary Op
-/// - secondaryTensor: RHS tensor of the binary Op
-/// - name: Name for the operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - primaryTensor: The LHS tensor of the binary Op.
+/// - secondaryTensor: The RHS tensor of the binary Op.
+/// - name: An optional string which serves as an identifier for the operation.
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) floorModuloWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
@@ -908,35 +978,35 @@
#pragma mark - ComplexOps
-/// Return the real part of a tensor.
+/// Returns the real part of a tensor.
///
/// - Parameters:
-/// - tensor: input tensor.
-/// - name: name for the operation.
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation..
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) realPartOfTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( realPartOfTensor(tensor:name:) );
-/// Return the imaginary part of a tensor.
+/// Returns the imaginary part of a tensor.
///
/// - Parameters:
-/// - tensor: input tensor.
-/// - name: name for the operation.
-/// - Returns: A valid MPSGraphTensor object.
+/// - tensor: The input tensor.
+/// - name: An optional string which serves as an identifier for the operation..
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) imaginaryPartOfTensor:(MPSGraphTensor *) tensor
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( imaginaryPartOfTensor(tensor:name:) );
-/// Return a complex tensor from the two input tensors.
+/// Returns a complex tensor from the two input tensors.
///
/// - Parameters:
-/// - realTensor: the real part of the complex tensor.
-/// - imaginaryTensor: the imaginary part of the complex tensor.
-/// - name: name for the operation.
-/// - Returns: A valid MPSGraphTensor object.
+/// - realTensor: The real part of the complex tensor.
+/// - imaginaryTensor: The imaginary part of the complex tensor.
+/// - name: An optional string which serves as an identifier for the operation..
+/// - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation.
-(MPSGraphTensor *) complexTensorWithRealTensor:(MPSGraphTensor *) realTensor
imaginaryTensor:(MPSGraphTensor *) imaginaryTensor
name:(NSString * _Nullable) name
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphAutomaticDifferentiation.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphAutomaticDifferentiation.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphAutomaticDifferentiation.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphAutomaticDifferentiation.h 2023-07-14 00:00:19
@@ -16,13 +16,13 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphGradientOps)
-/// Calculates partial derviative of primaryTensor wrt secondaryTensor
+/// Calculates partial derivative of primaryTensor with respect to the tensors.
///
/// - Parameters:
-/// - primaryTensor: tensor to be differentiated (numerator)
-/// - tensors: tensors to do the differentiation with (denominator)
-/// - name: name for the gradient operation
-/// - Returns: A valid MPSGraphTensor dictionary object containing partial derivative d(primaryTensor)/d(secondaryTensor) for each tensor as key
+/// - primaryTensor: Tensor to be differentiated (numerator).
+/// - tensors: Tensors to do the differentiation with (denominator).
+/// - name: Name for the gradient operation.
+/// - Returns: A valid MPSGraphTensor dictionary object containing partial derivative d(primaryTensor)/d(secondaryTensor) for each tensor as key.
-(NSDictionary<MPSGraphTensor *, MPSGraphTensor *> *) gradientForPrimaryTensor:(MPSGraphTensor *) primaryTensor
withTensors:(NSArray<MPSGraphTensor *> *) tensors
name:(NSString * _Nullable) name
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphControlFlowOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphControlFlowOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphControlFlowOps.h 2023-06-23 18:00:06
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphControlFlowOps.h 2023-07-13 23:25:37
@@ -2,7 +2,7 @@
// MPSGraphControlFlow.h
// MPSGraph
//
-// Created by Dhruv Saksena on 12/27/20.
+// Created on 12/27/20.
// Copyright © 2020 Apple Inc. All rights reserved.
//
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionOps.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionOps.h 2023-07-14 00:03:40
@@ -13,43 +13,67 @@
NS_ASSUME_NONNULL_BEGIN
-/// Descriptor for properties of convolution.
-/// It is used to create 2D convolution operation.
+/// This is a class that describes the properties of a 2d-convolution operator.
+///
+/// Use an instance of this class is to add a 2d-convolution operator with desired properties to the graph.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphConvolution2DOpDescriptor : MPSGraphObject<NSCopying>
-/// stride in `x` or width dimension.
+/// The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
+///
+/// Source `x`-coordiante, `sx` is computed from destination `x`-coordinate, `dx` as `sx = strideInX*dx`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger strideInX;
-/// stride in `y` or height dimension.
+/// The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
+///
+/// Source `y`-coordiante, `sy` is computed from destination `y`-coordinate, `dy` as `sy = strideInY*dy`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger strideInY;
-/// dilation in `x` or width dimension.
+/// The amount by which weights tensor is expanded in `x`-direction.
+///
+/// The weights tensor is dilated by inserting `dilationRateInX-1` zeros between consecutive values in `x`-dimension.
+/// Dilated weights tensor width is `(dilationRateInX-1)*kernelWidth+1`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInX;
-/// dilation in `y` or height dimension.
+/// The amount by which weights tensor is expanded in `y`-direction.
+///
+/// The weights tensor is dilated by inserting `dilationRateInY-1` zeros between consecutive values in `y`-dimension.
+/// Dilated weights tensor width is `(dilationRateInY-1)*kernelHeight+1`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInY;
-/// padding in `x` or width dimension on left side.
+/// The number of zeros that are added on the left side of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingLeft;
-/// padding in `x` or width dimension on right side.
+/// The number of zeros that are added on the right side of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingRight;
-/// padding in `y` or height dimension at top.
+/// The number of zeros that are added at the top of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingTop;
-/// padding in `y` or height dimension at bottom.
+/// The number of zeros that are added at the bottom of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingBottom;
-/// padding style applied on source tensor. If paddingStyle is `MPSGraphPaddingStyleExplicit`, paddingLeft, laddingRight, paddingTop,
-/// paddingBottom must to be specified. This is symbolic padding on input tensor. For all other padding styles,
-/// paddings on left, right, top and bottom are computed internally and need not be specified.
+/// The type of padding that is applied to the source tensor.
+///
+/// If paddingStyle is `MPSGraphPaddingStyleExplicit`, `paddingLeft`, `laddingRight`, `paddingTop`,
+/// and `paddingBottom` must to be specified. For all other padding styles, framework compute these values so you dont need to provide these values.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// layout of source tensor. Convolution operation uses this to interpret data in source tensor i.e. order of named dimensions
-/// e.g. `batch x channels x width x height` for `NCHW` layout
+/// The named layout of data in source tensor.
+///
+/// It defines the order of named dimensions (Batch, Channel, Height, Width). The convolution operation uses this to interpret data in the source tensor.
+/// For example, if `dataLayout` is `MPSGraphTensorNamedDataLayoutNCHW`, frameork interprets data in source tensor as `batch x channels x height x width`
+/// with `width` as fastest moving dimension.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout dataLayout;
-/// layout of weights tensor. Convolution operation uses this to interpret data in weights tensor i.e. order of named dimensions
-/// e.g. `outputChannels x inputChannels x kernelHeight x kernelWidth` for `OIHW`.
+/// The named layout of data in weights tensor.
+///
+/// It defines the order of named dimensions (Output channels, Input channels, Kernel height, Kernel width). The convolution operation uses this to interpret data in the weights tensor.
+/// For example, if `weightsLayout` is `MPSGraphTensorNamedDataLayoutOIHW`, frameork interprets data in weights tensor as `outputChannels x inputChannels x kernelHeight x kernelWidth`
+/// with `kernelWidth` as fastest moving dimension.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout weightsLayout;
-/// number of groups in convolution. Input and output feature channels are divided into groups and
-/// input channels in a group are only connected to output channels in corresponding group.
-/// Number of weights are `outputFeatureChannels x inputFeatureChannels/groups x kernelWidth x kernelHeight`
+/// The number of paritions of input and output channels.
+///
+/// The convolution operation divides input and output channels in `groups` partitions.
+/// input channels in a group or partition are only connected to output channels in corresponding group.
+/// Number of weights the convolution needs is `outputFeatureChannels x inputFeatureChannels/groups x kernelWidth x kernelHeight`
@property (readwrite, nonatomic) NSUInteger groups;
-/// creates convolution descriptor with given values for parameters.
+/// Creates a convolution descriptor with given values for parameters.
/// - Parameters:
/// - strideInX: See ``strideInX`` property.
/// - strideInY: See ``strideInY`` property.
@@ -63,7 +87,7 @@
/// - paddingStyle: See ``paddingStyle`` property.
/// - dataLayout: See ``dataLayout`` property.
/// - weightsLayout: See ``weightsLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - Returns: The `MPSGraphConvolution2DOpDescriptor` on autoreleasepool.
+(nullable instancetype) descriptorWithStrideInX:(NSUInteger) strideInX
strideInY:(NSUInteger) strideInY
dilationRateInX:(NSUInteger) dilationRateInX
@@ -77,7 +101,7 @@
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout
weightsLayout:(MPSGraphTensorNamedDataLayout) weightsLayout;
-/// creates convolution descriptor with given values for parameters.
+/// Creates a convolution descriptor with given values for parameters.
/// - Parameters:
/// - strideInX: See ``strideInX`` property.
/// - strideInY: See ``strideInY`` property.
@@ -87,7 +111,7 @@
/// - paddingStyle: See ``paddingStyle`` property.
/// - dataLayout: See ``dataLayout`` property.
/// - weightsLayout: See ``weightsLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - Returns: The `MPSGraphConvolution2DOpDescriptor` on autoreleasepool.
+(nullable instancetype) descriptorWithStrideInX:(NSUInteger) strideInX
strideInY:(NSUInteger) strideInY
dilationRateInX:(NSUInteger) dilationRateInX
@@ -97,7 +121,7 @@
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout
weightsLayout:(MPSGraphTensorNamedDataLayout) weightsLayout;
-/// sets values of padding to given values.
+/// Sets the left, right, top and bottom padding values.
/// - Parameters:
/// - paddingLeft: See ``paddingLeft`` property.
/// - paddingRight: See ``paddingRight`` property.
@@ -111,51 +135,82 @@
@end
-/// Descriptor for properties of convolution.
-/// It is used to create 3D convolution operation.
+/// This is a class that describes the properties of a 3d-convolution operator.
+///
+/// Use an instance of this class is to add a 3d-convolution operator with desired properties to the graph.
MPS_CLASS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3))
@interface MPSGraphConvolution3DOpDescriptor : MPSGraphObject<NSCopying>
-/// stride in `x` or width dimension.
+/// The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
+///
+/// Source `x`-coordiante, `sx` is computed from destination `x`-coordinate, `dx` as `sx = strideInX*dx`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger strideInX;
-/// stride in `y` or height dimension.
+/// The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
+///
+/// Source `y`-coordiante, `sy` is computed from destination `y`-coordinate, `dy` as `sy = strideInY*dy`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger strideInY;
-/// stride in `z` or depth dimension.
+/// The scale that maps`z`-coordinate of destination to `z`-coordinate of source.
+///
+/// Source `z`-coordiante, `sz` is computed from destination `z`-coordinate, `dz` as `sz = strideInZ*dz`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger strideInZ;
-/// dilation in `x` or width dimension.
+//// The amount by which weights tensor is expanded in `x`-direction.
+///
+/// The weights tensor is dilated by inserting `dilationRateInX-1` zeros between consecutive values in `x`-dimension.
+/// Dilated weights tensor width is `(dilationRateInX-1)*kernelWidth+1`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInX;
-/// dilation in `y` or height dimension.
+/// The amount by which weights tensor is expanded in `y`-direction.
+///
+/// The weights tensor is dilated by inserting `dilationRateInY-1` zeros between consecutive values in `y`-dimension.
+/// Dilated weights tensor width is `(dilationRateInY-1)*kernelHeight+1`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInY;
-/// dilation in `z` or depth dimension.
+/// The amount by which weights tensor is expanded in `z`-direction.
+///
+/// The weights tensor is dilated by inserting `dilationRateInZ-1` zeros between consecutive values in `z`-dimension.
+/// Dilated weights tensor depth is `(dilationRateInZ-1)*kernelDepth+1`.
+/// Default value is 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInZ;
-/// padding in `x` or width dimension on left side.
+/// The number of zeros that are added on the left side of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingLeft;
-/// padding in `x` or width dimension on right side.
+/// The number of zeros that are added on the right side of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingRight;
-/// padding in `y` or height dimension at top.
+/// The number of zeros that are added at the top of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingTop;
-/// padding in `y` or height dimension at bottom.
+/// The number of zeros that are added at the bottom of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingBottom;
-/// padding in `z` or depth dimension in front.
+/// The number of zeros that are added at the front of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingFront;
-/// padding in `z` or depth dimension in back.
+/// The number of zeros that are added at the back of the source tensor.
@property (readwrite, nonatomic) NSUInteger paddingBack;
-/// padding style applied on source tensor. If paddingStyle is `MPSGraphPaddingStyleExplicit`, paddingLeft, laddingRight, paddingTop,
-/// paddingBottom, paddingFront, paddingBack must to be specified. This is symbolic padding on input tensor. For all other padding styles,
-/// paddings on left, right, top, bottom, front and back are computed internally and need not be specified.
+//// The type of padding that is applied to the source tensor.
+///
+/// If paddingStyle is `MPSGraphPaddingStyleExplicit`, `paddingLeft`, `laddingRight`, `paddingTop`,
+/// `paddingBottom`, `paddingFront` and `paddingBack` must to be specified. For all other padding styles, framework compute these values so you dont need to provide these values.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// layout of source tensor. Convolution operation uses this to interpret data in source tensor i.e. order of named dimensions
-/// e.g. `batch x channels x depth x width x height` for `NCDHW` layout
+/// The named layout of data in source tensor.
+///
+/// It defines the order of named dimensions (Batch, Channel, Depth, Height, Width). The convolution operation uses this to interpret data in the source tensor.
+/// For example, if `dataLayout` is `MPSGraphTensorNamedDataLayoutNCDHW`, frameork interprets data in source tensor as `batch x channels x depth x height x width`
+/// with `width` as fastest moving dimension.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout dataLayout;
-/// layout of weights tensor. Convolution operation uses this to interpret data in weights tensor i.e. order of named dimensions
-/// e.g. `outputChannels x inputChannels x kernelDepth x kernelHeight x kernelWidth` for `OIDHW`.
+//// The named layout of data in weights tensor.
+///
+/// It defines the order of named dimensions (Output channels, Input channels, Kernel depth, Kernel height, Kernel width). The convolution operation uses this to interpret data in the weights tensor.
+/// For example, if `weightsLayout` is `MPSGraphTensorNamedDataLayoutOIDHW`, frameork interprets data in weights tensor as `outputChannels x inputChannels x kernelDepth x kernelHeight x kernelWidth`
+/// with `kernelWidth` as fastest moving dimension.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout weightsLayout;
-/// number of groups in convolution. Input and output feature channels are divided into groups and
-/// input channels in a group are only connected to output channels in corresponding group.
-/// Number of weights are `outputFeatureChannels x inputFeatureChannels/groups x kernelDepth x kernelWidth x kernelHeight`
+/// The number of paritions of input and output channels.
+///
+/// The convolution operation divides input and output channels in `groups` partitions.
+/// input channels in a group or partition are only connected to output channels in corresponding group.
+/// Number of weights the convolution needs is `outputFeatureChannels x inputFeatureChannels/groups x kernelDepth x kernelWidth x kernelHeight`
@property (readwrite, nonatomic) NSUInteger groups;
-/// creates convolution descriptor with given values for parameters.
+/// Creates convolution descriptor with given values for parameters.
/// - Parameters:
/// - strideInX: See ``strideInX`` property.
/// - strideInY: See ``strideInY`` property.
@@ -173,7 +228,7 @@
/// - paddingStyle: See ``paddingStyle`` property.
/// - dataLayout: See ``dataLayout`` property.
/// - weightsLayout: See ``weightsLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - Returns: The `MPSGraphConvolution3DOpDescriptor` on autoreleasepool.
+(nullable instancetype) descriptorWithStrideInX:(NSUInteger) strideInX
strideInY:(NSUInteger) strideInY
strideInZ:(NSUInteger) strideInZ
@@ -191,7 +246,7 @@
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout
weightsLayout:(MPSGraphTensorNamedDataLayout) weightsLayout;
-/// creates convolution descriptor with given values for parameters.
+/// Creates convolution descriptor with given values for parameters.
/// - Parameters:
/// - strideInX: See ``strideInX`` property.
/// - strideInY: See ``strideInY`` property.
@@ -203,7 +258,7 @@
/// - paddingStyle: See ``paddingStyle`` property.
/// - dataLayout: See ``dataLayout`` property.
/// - weightsLayout: See ``weightsLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - Returns: The `MPSGraphConvolution3DOpDescriptor` on autoreleasepool.
+(nullable instancetype) descriptorWithStrideInX:(NSUInteger) strideInX
strideInY:(NSUInteger) strideInY
strideInZ:(NSUInteger) strideInZ
@@ -215,7 +270,7 @@
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout
weightsLayout:(MPSGraphTensorNamedDataLayout) weightsLayout;
-/// sets values of padding to given values.
+/// Sets the left, right, top, bottom, front and back padding values.
/// - Parameters:
/// - paddingLeft: See ``paddingLeft`` property.
/// - paddingRight: See ``paddingRight`` property.
@@ -231,13 +286,14 @@
paddingBack:(NSUInteger) paddingBack;
@end
+/// This is a category that defines the methods which can be used to add 2d-convolution operator to the graph with properties described by an instance of `MPSGraphConvolution2DOpDescriptor`.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphConvolutionOps)
/// Creates a 2d (forward) convolution operation and returns the result tensor.
///
/// - Parameters:
-/// - source: source tensor - must be of rank 4. The layout is defined by ``descriptor.dataLayout``.
+/// - source: source tensor - must be a rank 4 tensor. The layout is defined by ``descriptor.dataLayout``.
/// - weights: weights tensor, must be rank 4. The layout is defined by ``descriptor.weightsLayout``.
/// - descriptor: Specifies strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
@@ -248,9 +304,10 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( convolution2D(_:weights:descriptor:name:) );
-/// Create convolution 2d gradient operation with respect to forward convolution source tensor.
-/// If `S` is source tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
-/// and `L` is the loss function, convolution2DDataGradientWithIncomingGradientTensor returns tensor `dL/dS = dL/dR * dR/dS`,
+/// Creates a 2d convoluiton gradient operation with respect to the source tensor of the forward convolution.
+///
+/// If `S` is source tensor to forward convoluiton, `R` is the result/returned tensor from forward convolution,
+/// and `L` is the loss function, `convolution2DDataGradientWithIncomingGradientTensor` returns tensor `dL/dS = dL/dR * dR/dS`,
/// where `dL/dR` is the incomingGradient parameter.
///
/// - Parameters:
@@ -267,7 +324,8 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( convolution2DDataGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create convolution 2d gradient operation with respect to forward convolution source tensor.
+/// Creates a 2d convolution gradient operation with respect to the source tensor of the forward convolution.
+///
/// If `S` is source tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution2DDataGradientWithIncomingGradientTensor returns tensor `dL/dS = dL/dR * dR/dS`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -287,7 +345,8 @@
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
MPS_SWIFT_NAME( convolution2DDataGradient(_:weights:outputShapeTensor:forwardConvolutionDescriptor:name:) );
-/// Create convolution 2d gradient operation with respect to forward convolution weights tensor.
+/// Creates a 2d convolution gradient operation with respect to the weights tensor of the forward convolution.
+///
/// If `W` is weights tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution2DWeightsGradientWithIncomingGradientTensor returns tensor `dL/dW = dL/dR * dR/dW`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -307,7 +366,8 @@
MPS_SWIFT_NAME( convolution2DWeightsGradient(_:source:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create convolution 2d gradient operation with respect to forward convolution weights tensor.
+/// Creates a 2d convolution gradient operation with respect to weights tensor of forward convolution.
+///
/// If `W` is weights tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution2DWeightsGradientWithIncomingGradientTensor returns tensor `dL/dW = dL/dR * dR/dW`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -328,7 +388,7 @@
MPS_SWIFT_NAME( convolution2DWeightsGradient(_:source:outputShapeTensor:forwardConvolutionDescriptor:name:) );
-/// Creates a 3d (forward) convolution operation and returns the result tensor.
+/// Creates a 3d forward convolution operation and returns the result tensor.
///
/// - Parameters:
/// - source: source tensor - must be of rank 5. The layout is defined by ``descriptor.dataLayout``.
@@ -343,7 +403,8 @@
MPS_CLASS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3))
MPS_SWIFT_NAME( convolution3D(_:weights:descriptor:name:) );
-/// Create convolution 3d gradient operation with respect to forward convolution source tensor.
+/// Creates a 3d convolution gradient operation with respect to the source tensor of the forward convolution.
+///
/// If `S` is source tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution3DDataGradientWithIncomingGradientTensor returns tensor `dL/dS = dL/dR * dR/dS`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -363,7 +424,8 @@
MPS_CLASS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3))
MPS_SWIFT_NAME( convolution3DDataGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create convolution 3d gradient operation with respect to forward convolution source tensor.
+/// Creates a 3d convolution gradient operation with respect to the source tensor of the forward convolution.
+///
/// If `S` is source tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution3DDataGradientWithIncomingGradientTensor returns tensor `dL/dS = dL/dR * dR/dS`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -383,7 +445,8 @@
MPS_CLASS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3))
MPS_SWIFT_NAME( convolution3DDataGradient(_:weights:outputShapeTensor:forwardConvolutionDescriptor:name:) );
-/// Create convolution 3d gradient operation with respect to forward convolution weights tensor.
+/// Creates a 3d convolution gradient operation with respect to the weights tensor of the forward convolution.
+///
/// If `W` is weights tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution3DWeightsGradientWithIncomingGradientTensor returns tensor `dL/dW = dL/dR * dR/dW`,
/// where `dL/dR` is the incomingGradient parameter.
@@ -403,7 +466,8 @@
MPS_CLASS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3))
MPS_SWIFT_NAME( convolution3DWeightsGradient(_:source:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create convolution 3d gradient operation with respect to forward convolution weights tensor.
+/// Creates a 3d convolution gradient operation with respect to the weights tensor of the forward convolution.
+///
/// If `W` is weights tensor to forward convoluiton, `R` is the result/returned tensor of forward convolution,
/// and `L` is the loss function, convolution3DWeightsGradientWithIncomingGradientTensor returns tensor `dL/dW = dL/dR * dR/dW`,
/// where `dL/dR` is the incomingGradient parameter.
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionTransposeOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionTransposeOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionTransposeOps.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphConvolutionTransposeOps.h 2023-07-14 00:03:41
@@ -13,31 +13,25 @@
NS_ASSUME_NONNULL_BEGIN
+/// This is a category that defines the methods which can be used to add 2d-convolution transpose operator to the graph with properties described by an instance of `MPSGraphConvolution2DOpDescriptor`.
+
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphConvolutionTransposeOps)
-/// Create ConvolutionTranspose op and return the result tensor
+/// Creates convolution transpose operation and return the result tensor.
///
-/// Convolution Tranpose op is exactly the same as convolution gradint with respect to input image (convolution2DDataGradient)
-/// Weights tensor and source tensors are interpreted as they are in convolution2DDataGradientWithIncomingGradient. For example
-/// if weightsTensor layout is HWIO, inner most (fastest moving) dimension, denoted by O here should be equal to inputFeatureChannels
-/// i.e. number of channels in source tensor
-/// and next fasted moving dimension denoated by I is equal to number of channels in returns (destination) tensor outputFeatureChannels.
-/// TensorFlow interprets the weights tensor same way excpet that it states weights are in HWOI format. We dont define another weights format enum
-/// rather we reinterpret HWIO just like TensorFlow does for gradient with data.
-/// Normally in auto encoder, convoluton transpose is associated with regular convolution i.e. convolution downsamples by stride s
-/// and convolution tranpose upsamples by factor s.
-/// In that case, convolution transpose can map same source size to multiple destination sizes. The relationship between sourceWidth and destinationWidth is
-/// (sourceWidth - 1)stride + 1 + (kernelWidth - 1)dilationRate <= destinationWidth + paddingLeft + paddingRight
-/// so there are stride -1 destinationWidth that give same sourceWidth. In order to disambiguate, outputShape parameter is used.
-/// This is what TensorFlow does.
-/// PyTourch takes additional outputPadding that is applied to destination size.
+/// Convolution Tranpose operation is exactly the same as convolution gradint with respect to input image `convolution2DDataGradientWithIncomingGradient`.
+/// Weights tensor and source tensors are interpreted as they are in `convolution2DDataGradientWithIncomingGradient`.
+/// Convolution with stride `s` downsamples source tensor by factor `s` in spatial dimensions whereas convolution tranpose with stride `s` upsamples
+/// source tensor by factor `s`. Convolution transpose can map the same source size to multiple destination sizes. The relationship between the width of the
+/// source and the width of the destination is `(sourceWidth - 1)stride + 1 + (kernelWidth - 1)dilationRate <= destinationWidth + paddingLeft + paddingRight`
+/// so there are stride -1 values of the width of the destination that give same width of the source. In order to disambiguate, outputShape parameter is used.
///
/// - Parameters:
/// - source: input tensor
/// - weights: weights tensor
/// - outputShape: shape of the result tensor
-/// - descriptor: descriptor for the corresponding forward Conv2d operation
+/// - descriptor: descriptor for the corresponding forward 2d-convolution operation
/// - name: name for the operation
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) convolutionTranspose2DWithSourceTensor:(MPSGraphTensor *) source
@@ -47,23 +41,8 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( convolutionTranspose2D(_:weights:outputShape:descriptor:name:) );
-/// Create ConvolutionTranspose op and return the result tensor
+/// Creates a convolution transpose operation and return the result tensor.
///
-/// Convolution Tranpose op is exactly the same as convolution gradint with respect to input image (convolution2DDataGradient)
-/// Weights tensor and source tensors are interpreted as they are in convolution2DDataGradientWithIncomingGradient. For example
-/// if weightsTensor layout is HWIO, inner most (fastest moving) dimension, denoted by O here should be equal to inputFeatureChannels
-/// i.e. number of channels in source tensor
-/// and next fasted moving dimension denoated by I is equal to number of channels in returns (destination) tensor outputFeatureChannels.
-/// TensorFlow interprets the weights tensor same way excpet that it states weights are in HWOI format. We dont define another weights format enum
-/// rather we reinterpret HWIO just like TensorFlow does for gradient with data.
-/// Normally in auto encoder, convoluton transpose is associated with regular convolution i.e. convolution downsamples by stride s
-/// and convolution tranpose upsamples by factor s.
-/// In that case, convolution transpose can map same source size to multiple destination sizes. The relationship between sourceWidth and destinationWidth is
-/// (sourceWidth - 1)stride + 1 + (kernelWidth - 1)dilationRate <= destinationWidth + paddingLeft + paddingRight
-/// so there are stride -1 destinationWidth that give same sourceWidth. In order to disambiguate, outputShape parameter is used.
-/// This is what TensorFlow does.
-/// PyTourch takes additional outputPadding that is applied to destination size.
-///
/// - Parameters:
/// - source: input tensor
/// - weights: weights tensor
@@ -79,10 +58,10 @@
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
MPS_SWIFT_NAME( convolutionTranspose2D(_:weights:outputShapeTensor:descriptor:name:) );
-/// Create ConvolutionTranspose gradient op and return the result tensor
+/// Creates a convolution transpose gradient operation with respect of source tensor of convolution transpose operation and returns the result tensor.
///
-/// Computes the gradient of source input for the forward pass ConvolutionTranspose op with identical parameters.
-/// See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
+/// Inserts an operation in graph to compute gradient of convolution transpose with respect to source tensor of the corresponding
+/// convolution transpose operation.
///
/// - Parameters:
/// - incomingGradient: Incoming gradient tensor
@@ -98,10 +77,10 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( convolutionTranspose2DDataGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create ConvolutionTranspose gradient op and return the result tensor
+/// Creates a convolution transpose gradient operation with respect of source tensor of convolution transpose operation and returns the result tensor.
///
-/// Computes the gradient of source input for the forward pass ConvolutionTranspose op with identical parameters.
-/// See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
+/// Inserts an operation in graph to compute gradient of convolution transpose with respect to source tensor of the corresponding
+/// convolution transpose operation.
///
/// - Parameters:
/// - incomingGradient: Incoming gradient tensor
@@ -118,10 +97,10 @@
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
MPS_SWIFT_NAME( convolutionTranspose2DDataGradient(_:weights:outputShapeTensor:forwardConvolutionDescriptor:name:) );
-/// Create ConvolutionTranspose gradient op and return the result tensor
+/// Creates a convolution transpose gradient operation with respect of the weights tensor of convolution transpose operation and returns the result tensor.
///
-/// Computes the gradient of weights input for the forward pass ConvolutionTranspose op with identical parameters.
-/// See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
+/// Inserts an operation in graph to compute gradient of convolution transpose with respect to the weights tensor of the corresponding
+/// convolution transpose operation.
///
/// - Parameters:
/// - incomingGradientTensor: Incoming gradient tensor
@@ -137,10 +116,10 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( convolutionTranspose2DWeightsGradient(_:weights:outputShape:forwardConvolutionDescriptor:name:) );
-/// Create ConvolutionTranspose gradient op and return the result tensor
+/// Creates a convolution transpose gradient operation with respect of the weights tensor of convolution transpose operation and returns the result tensor.
///
-/// Computes the gradient of weights input for the forward pass ConvolutionTranspose op with identical parameters.
-/// See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
+/// Inserts an operation in graph to compute gradient of convolution transpose with respect to the weights tensor of the corresponding
+/// convolution transpose operation.
///
/// - Parameters:
/// - incomingGradientTensor: Incoming gradient tensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCore.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCore.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCore.h 2023-06-23 18:00:06
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCore.h 2023-07-13 16:14:32
@@ -15,36 +15,38 @@
NS_ASSUME_NONNULL_BEGIN
MPS_CLASS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
-/// Common base class for all MPSGraph objects. You should use one of the child classes.
+/// Common base class for all MPSGraph objects.
+///
+/// Only the child classes should be used.
@interface MPSGraphObject: NSObject
@end
-/// Base type class for types on MPSGraph tensors
+/// Base type class for types on MPSGraph tensors.
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphType: MPSGraphObject<NSCopying>
@end
-/// Shaped type class for types on MPSGraph tensors has a shape and a dataType
+/// Shaped type class for types on MPSGraph tensors has a shape and a dataType.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphShapedType: MPSGraphType
-/// shape of the shapedType
+/// Shape of the shapedType.
@property (readwrite, nullable, copy, atomic) MPSShape *shape;
-/// dataType of the shapedType
+/// DataType of the shapedType.
@property (readwrite, atomic) MPSDataType dataType;
-/// Initialize an MPSGraphShapedType
+/// Initialize an MPSGraphShapedType.
///
/// - Parameters:
-/// - shape: The MPSShape
-/// - dataType: The dataType of the shaped type
+/// - shape: The shape of the shaped type.
+/// - dataType: The dataType of the shaped type.
/// - Returns: A valid MPSGraphShapedType, or nil if allocation failure.
-(instancetype) initWithShape:(MPSShape * _Nullable) shape
dataType:(MPSDataType) dataType;
-/// checks if shapes and elementDataType are the same as the input shapedType
+/// Checks if shapes and elementDataType are the same as the input shapedType.
///
/// - Parameters:
/// - object: shapedType to compare to
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCumulativeOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCumulativeOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCumulativeOps.h 2023-05-13 17:15:32
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphCumulativeOps.h 2023-07-14 00:03:41
@@ -16,15 +16,15 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphCumulativeOps)
-/// Compute the cumulative sum of the input tensor along a specified axis.
+/// Compute the cumulative sum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to zero
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to zero
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeSumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
exclusive:(BOOL) exclusive
@@ -33,15 +33,15 @@
MPS_SWIFT_NAME( cumulativeSum(_:axis:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative sum of the input tensor along a specified axis.
+/// Compute the cumulative sum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to zero
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to zero
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeSumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
exclusive:(BOOL) exclusive
@@ -50,41 +50,41 @@
MPS_SWIFT_NAME( cumulativeSum(_:axisTensor:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative sum of the input tensor along a specified axis.
+/// Compute the cumulative sum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeSumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeSum(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative sum of the input tensor along a specified axis.
+/// Compute the cumulative sum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeSumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeSum(_:axisTensor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative product of the input tensor along a specified axis.
+/// Compute the cumulative product of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to one
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to one
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeProductWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
exclusive:(BOOL) exclusive
@@ -93,15 +93,15 @@
MPS_SWIFT_NAME( cumulativeProduct(_:axis:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative product of the input tensor along a specified axis.
+/// Compute the cumulative product of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to one
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to one
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeProductWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
exclusive:(BOOL) exclusive
@@ -110,43 +110,43 @@
MPS_SWIFT_NAME( cumulativeProduct(_:axisTensor:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative product of the input tensor along a specified axis.
+/// Compute the cumulative product of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeProductWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeProduct(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative product of the input tensor along a specified axis.
+/// Compute the cumulative product of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to one
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to one
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeProductWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeProduct(_:axisTensor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative minimum of the input tensor along a specified axis.
+/// Compute the cumulative minimum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMinimumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
exclusive:(BOOL) exclusive
@@ -155,15 +155,15 @@
MPS_SWIFT_NAME( cumulativeMinimum(_:axis:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative minimum of the input tensor along a specified axis.
+/// Compute the cumulative minimum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMinimumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
exclusive:(BOOL) exclusive
@@ -172,43 +172,43 @@
MPS_SWIFT_NAME( cumulativeMinimum(_:axisTensor:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative minimum of the input tensor along a specified axis.
+/// Compute the cumulative minimum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMinimumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeMinimum(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative minimum of the input tensor along a specified axis.
+/// Compute the cumulative minimum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to the largest value of the tensor data type
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMinimumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeMinimum(_:axisTensor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative maximum of the input tensor along a specified axis.
+/// Compute the cumulative maximum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to the lowest value of the tensor data type
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to the lowest value of the tensor data type
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMaximumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
exclusive:(BOOL) exclusive
@@ -217,15 +217,15 @@
MPS_SWIFT_NAME( cumulativeMaximum(_:axis:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative maximum of the input tensor along a specified axis.
+/// Compute the cumulative maximum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - exclusive: if true, perform the exclusive cumulative operation, and the first element will be equal to the lowest value of the tensor data type
-/// - reverse: if true, reverse the direction of the cumulative operation along the specified axis
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - exclusive: If true, perform the exclusive cumulative operation, and the first element will be equal to the lowest value of the tensor data type
+/// - reverse: If true, reverse the direction of the cumulative operation along the specified axis
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMaximumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
exclusive:(BOOL) exclusive
@@ -234,26 +234,26 @@
MPS_SWIFT_NAME( cumulativeMaximum(_:axisTensor:exclusive:reverse:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative maximum of the input tensor along a specified axis.
+/// Compute the cumulative maximum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMaximumWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( cumulativeMaximum(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the cumulative maximum of the input tensor along a specified axis.
+/// Compute the cumulative maximum of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension where you compute the cumulative operation
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension where you compute the cumulative operation
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) cumulativeMaximumWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDepthwiseConvolutionOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDepthwiseConvolutionOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDepthwiseConvolutionOps.h 2023-06-23 13:53:29
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDepthwiseConvolutionOps.h 2023-07-13 16:14:31
@@ -12,52 +12,60 @@
NS_ASSUME_NONNULL_BEGIN
-/// Defines a 2d depthwise convolution operation.
+/// This is a class that defines parameters for a 2d depthwise convolution operation.
+///
+/// A `MPSGraphDepthwiseConvolution2DOpDescriptor` defines constant parameters for 2d depthwise convolutions.
+/// Use this class with ``MPSGraph/depthwiseConvolution2DWithSourceTensor:weightsTensor:descriptor:name:``,
+/// ``MPSGraph/depthwiseConvolution2DDataGradientWithIncomingGradientTensor:weightsTensor:outputShape:descriptor:name:``
+/// and ``MPSGraph/depthwiseConvolution2DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShape:descriptor:name:``
+/// methods.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphDepthwiseConvolution2DOpDescriptor : MPSGraphObject<NSCopying>
-/// Defines stride for X (Width) dimension. Default value: 1.
+/// The stride for X (Width) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger strideInX;
-/// Defines stride for Y (Height) dimension. Default value: 1.
+/// The stride for Y (Height) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger strideInY;
-/// Defines dilation rate for X (Width) dimension. Default value: 1.
+/// The dilation rate for X (Width) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInX;
-/// Defines dilation rate for Y (Height) dimension. Default value: 1.
+/// The dilation rate for Y (Height) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInY;
-/// Defines explicit padding value for X (Width) dimension to add before the data. Default value: 0.
+/// The explicit padding value for X (Width) dimension the operation adds before the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingLeft;
-/// Defines explicit padding value for X (Width) dimension to add after the data. Default value: 0.
+/// The explicit padding value for X (Width) dimension operation adds after the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingRight;
-/// Defines explicit padding value for Y (Height) dimension to add before the data. Default value: 0.
+/// The explicit padding value for Y (Height) dimension operation adds before the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingTop;
-/// Defines explicit padding value for Y (Height) dimension to add after the data. Default value: 0.
+/// The explicit padding value for Y (Height) dimension operation adds after the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingBottom;
-/// Defines what kind of padding to apply to operation.
-/// Default value: ``MPSGraphPaddingStyleExplicit``.
+/// The padding style for the operation. Default value: `MPSGraphPaddingStyleExplicit`.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// Defines the data layout of the input data (in forward pass). See: ``MPSGraphTensorNamedDataLayout``.
+/// The data layout of the input data (in forward pass).
+///
+/// See: ``MPSGraphTensorNamedDataLayout``.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout dataLayout;
-/// Defines the data layout of the weights. See: ``MPSGraphTensorNamedDataLayout``.
-/// NOTE: 'O' index is channel multiplier index
+/// The data layout of the weights.
+///
+/// NOTE: 'O' index is channel multiplier index. See: ``MPSGraphTensorNamedDataLayout``.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout weightsLayout;
/// Creates a 2d depthwise convolution descriptor with given values.
///
/// - Parameters:
-/// - strideInX: See ``strideInX`` property.
-/// - strideInY: See ``strideInY`` property.
-/// - dilationRateInX: See ``dilationRateInX`` property.
-/// - dilationRateInY: See ``dilationRateInY`` property.
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
-/// - dataLayout: See ``dataLayout`` property.
-/// - weightsLayout: See ``weightsLayout`` property.
+/// - strideInX: See `strideInX` property.
+/// - strideInY: See `strideInY` property.
+/// - dilationRateInX: See `dilationRateInX` property.
+/// - dilationRateInY: See `dilationRateInY` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
+/// - paddingStyle: See `paddingStyle` property.
+/// - dataLayout: See `dataLayout` property.
+/// - weightsLayout: See `weightsLayout` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithStrideInX:(NSUInteger) strideInX
strideInY:(NSUInteger) strideInY
@@ -74,19 +82,21 @@
/// Creates a 2d depthwise convolution descriptor with given properties and default values.
///
/// - Parameters:
-/// - dataLayout: See ``dataLayout`` property.
-/// - weightsLayout: See ``weightsLayout`` property.
+/// - dataLayout: See `dataLayout` property.
+/// - weightsLayout: See `weightsLayout` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithDataLayout:(MPSGraphTensorNamedDataLayout) dataLayout
weightsLayout:(MPSGraphTensorNamedDataLayout) weightsLayout;
-/// Sets the explicit padding values and sets ``paddingStyle`` to ``MPSGraphPaddingStyleExplicit``
+/// Sets the explicit padding values.
///
+/// Note: this method also sets `paddingStyle` to `MPSGraphPaddingStyleExplicit` (see ``MPSGraphPaddingStyle``).
+///
/// - Parameters:
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
-(void) setExplicitPaddingWithPaddingLeft:(NSUInteger) paddingLeft
paddingRight:(NSUInteger) paddingRight
paddingTop:(NSUInteger) paddingTop
@@ -94,46 +104,58 @@
@end
-/// Defines a 3d depthwise convolution operation.
+/// This class defines parameters for a 3d depthwise convolution operation.
+///
+/// A `MPSGraphDepthwiseConvolution3DOpDescriptor` defines constant parameters for 3d depthwise convolutions.
+/// Use this class with ``MPSGraph/depthwiseConvolution3DWithSourceTensor:weightsTensor:descriptor:name:``,
+/// ``MPSGraph/depthwiseConvolution3DDataGradientWithIncomingGradientTensor:weightsTensor:outputShape:descriptor:name:``
+/// and ``MPSGraph/depthwiseConvolution3DWeightsGradientWithIncomingGradientTensor:sourceTensor:outputShape:descriptor:name:``
+/// methods.
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphDepthwiseConvolution3DOpDescriptor : MPSGraphObject<NSCopying>
-/// Defines strides for spatial dimensions. Must be three numbers, one for each spatial dimension, fastest running index last.
+/// The strides for spatial dimensions.
+///
+/// Must be three numbers, one for each spatial dimension, fastest running index last.
/// Default value: `@[ @1, @1, @1 ]`
@property (readwrite, nonatomic, copy) NSArray<NSNumber *> * _Nonnull strides;
-/// Defines dilation rates for spatial dimensions. Must be three numbers, one for each spatial dimension, fastest running index last.
+/// The dilation rates for spatial dimensions.
+///
+/// Must be three numbers, one for each spatial dimension, fastest running index last.
/// Default value: `@[ @1, @1, @1 ]`
@property (readwrite, nonatomic, copy) NSArray<NSNumber *> * _Nonnull dilationRates;
-/// Defines padding values for spatial dimensions. Must be six numbers, two for each spatial dimension.
-/// For example ``paddingValues[0]`` defines the explicit padding
+/// The padding values for spatial dimensions.
+///
+/// Must be six numbers, two for each spatial dimension.
+/// For example `paddingValues[0]` defines the explicit padding
/// amount before the first spatial dimension (slowest running index of spatial dimensions),
-/// ``paddingValues[1]`` defines the padding amount after the first spatial dimension etc.
-/// Use only with ``paddingStyle = MPSGraphPaddingStyleExplicit``.
+/// `paddingValues[1]` defines the padding amount after the first spatial dimension etc.
+/// Use only with `paddingStyle = MPSGraphPaddingStyleExplicit`.
/// Default value: `@[ @0, @0, @0, @0, @0, @0 ]`
@property (readwrite, nonatomic, copy) NSArray<NSNumber *> * _Nonnull paddingValues;
-/// Defines what kind of padding to apply to operation.
-/// Default value: ``MPSGraphPaddingStyleExplicit``
+/// The padding style for the operation. Default value: `MPSGraphPaddingStyleExplicit`.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// Defines which axis contains the channels in the input and the weights, within
-/// the 4d tile of the last dimensions. For example the value of `-1`
-/// corresponds to `NDHWC`, `NHWC` layouts. This allows the placement
+/// The axis that contains the channels in the input and the weights, within
+/// the 4d tile of the last dimensions.
+///
+/// For example the value of `-1` corresponds to `NDHWC`, `NHWC` layouts. This allows the placement
/// of the channel index anywhere within the last 4 dimensions of the tensor. In case your
-/// weights are in a different layout it is recommended that you bring them to the same layout
-/// as inputs using transposes or permutations.
+/// weights are in a different layout you can bring them to the same layout
+/// as inputs using transposes or permutations.
/// Default value: `-4`, corresponds to `NCDHW` and `CDHW` layouts.
@property (readwrite, nonatomic) NSInteger channelDimensionIndex;
/// Creates a 3d depthwise convolution descriptor with given values.
///
/// - Parameters:
-/// - strides: See ``strides`` property.
-/// - dilationRates: See ``dilationRates`` property.
-/// - paddingValues: See ``paddingValues`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
+/// - strides: See `strides` property.
+/// - dilationRates: See `dilationRates` property.
+/// - paddingValues: See `paddingValues` property.
+/// - paddingStyle: See `paddingStyle` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithStrides:(NSArray<NSNumber *> * _Nonnull) strides
dilationRates:(NSArray<NSNumber *> * _Nonnull) dilationRates
@@ -143,7 +165,7 @@
/// Creates a 3d depthwise convolution descriptor with default values.
///
/// - Parameters:
-/// - paddingStyle: See ``paddingStyle`` property.
+/// - paddingStyle: See `paddingStyle` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithPaddingStyle:(MPSGraphPaddingStyle) paddingStyle;
@@ -155,9 +177,9 @@
/// Creates a 2d depthwise convolution operation and returns the result tensor.
///
/// - Parameters:
-/// - source: 2d Image source as tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - weights: Weights tensor, must be rank=4. The layout is defined by ``descriptor.weightsLayout``.
-/// - descriptor: Specifies strides, dilation rates, paddings and layouts.
+/// - source: A 2d Image source as tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - weights: The weights tensor, must be rank=4. The layout is defined by `descriptor.weightsLayout`.
+/// - descriptor: The descriptor object that specifies strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution2DWithSourceTensor:(MPSGraphTensor *) source
@@ -169,10 +191,10 @@
/// Creates a 2d depthwise convolution gradient for data operation and returns the result tensor.
///
/// - Parameters:
-/// - incomingGradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - weights: Weights tensor, must be rank=4. The layout is defined by ``descriptor.weightsLayout``.
-/// - outputShape: Shape of the οutput tensor (and therefore input tensor of forward pass).
-/// - descriptor: Specifies strides, dilation rates, paddings and layouts.
+/// - incomingGradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - weights: The weights tensor, must be rank=4. The layout is defined by `descriptor.weightsLayout`.
+/// - outputShape: The shape of the οutput tensor (and therefore input tensor of forward pass).
+/// - descriptor: The descriptor object that specifies strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution2DDataGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradient
@@ -185,10 +207,10 @@
/// Creates a 2d depthwise convolution gradient for weights operation and returns the result tensor.
///
/// - Parameters:
-/// - incomingGradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - source: 2d Image source as tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - outputShape: Shape of the οutput tensor (and therefore weight tensor of forward pass).
-/// - descriptor: Specifies strides, dilation rates, paddings and layouts.
+/// - incomingGradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - source: A 2d Image source as tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - outputShape: The shape of the οutput tensor (and therefore weight tensor of forward pass).
+/// - descriptor: The descriptor object that specifies strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution2DWeightsGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradient
@@ -203,13 +225,13 @@
/// Creates a 3d depthwise convolution operation and returns the result tensor.
///
/// Works exactly like depthwise convolution2d, but in three dimensions. Supports different layouts with
-/// the ``channelDimensionIndex`` property. If your weights need a different layout
-/// add a permute operation on them before this operation.
+/// the ``MPSGraphDepthwiseConvolution3DOpDescriptor/channelDimensionIndex`` property.
+/// If your weights need a different layout add a permute operation on them before this operation.
///
/// - Parameters:
-/// - source: 3d Image source as tensor - must be at least rank=4 (CDHW when channelDimensionIndex = -4).
-/// - weights: Weights tensor, must be rank=4 - axes are interpreted as CDHW when channelDimensionIndex = -4 .
-/// - descriptor: Specifies strides, dilation rates and paddings.
+/// - source: A 3d Image source as tensor - must be at least rank=4 (CDHW when channelDimensionIndex = -4).
+/// - weights: The weights tensor, must be rank=4 - axes are interpreted as CDHW when channelDimensionIndex = -4 .
+/// - descriptor: The descriptor object that specifies strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution3DWithSourceTensor:(MPSGraphTensor *) source
@@ -222,10 +244,10 @@
/// Creates a 3d depthwise convolution gradient for data operation and returns the result tensor.
///
/// - Parameters:
-/// - incomingGradient: 3d input gradient tensor - must be at least rank=4 (CDHW).
-/// - weights: Weights tenstor, must be rank=4 - axes are interpreted as CDHW.
-/// - outputShape: Shape of the οutput tensor (and therefore input tensor of forward pass).
-/// - descriptor: Specifies strides, dilation rates and paddings.
+/// - incomingGradient: A 3d input gradient tensor - must be at least rank=4 (CDHW).
+/// - weights: The weights tensor, must be rank=4 - axes are interpreted as CDHW.
+/// - outputShape: The shape of the οutput tensor (and therefore input tensor of forward pass).
+/// - descriptor: The descriptor object that specifies strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution3DDataGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradient
@@ -239,10 +261,10 @@
/// Creates a 3d depthwise convolution gradient for weights operation and returns the result tensor.
///
/// - Parameters:
-/// - incomingGradient: 3d input gradient tensor - must be at least rank=4 (NCDHW).
-/// - source: Forward pass 3d Image source as tensor - must be at least rank=4 (NCDHW).
-/// - outputShape: Shape of the οutput tensor (and therefore weight tensor of forward pass).
-/// - descriptor: Specifies strides, dilation rates and paddings.
+/// - incomingGradient: A 3d input gradient tensor - must be at least rank=4 (NCDHW).
+/// - source: The forward pass 3d Image source as tensor - must be at least rank=4 (NCDHW).
+/// - outputShape: The shape of the οutput tensor (and therefore weight tensor of forward pass).
+/// - descriptor: The descriptor object that specifies strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) depthwiseConvolution3DWeightsGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradient
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDevice.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDevice.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDevice.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphDevice.h 2023-07-14 00:00:19
@@ -23,17 +23,18 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphDevice : MPSGraphObject
-/// MPSGraphDeviceType of the MPSGraphDevice
+/// Device of the MPSGraphDevice.
@property (readonly, nonatomic) MPSGraphDeviceType type;
-/// if deviceType is Metal then returns MTLDevice else nil
+/// If device type is Metal then returns the corresponding MTLDevice else nil.
@property (readonly, nonatomic, nullable) id<MTLDevice> metalDevice;
-/// Creates a Metal MPSGraphDevice from a MTLDevice
+/// Creates a device from given metal device.
///
/// - Parameters:
-/// - metalDevice: MTLDevice to create an MPSGraphDevice from
-/// - Returns: A valid MPSGraphDevice
+/// - metalDevice: `MTLDevice` to create an MPSGraphDevice from.
+/// - Returns: A valid device.
+///
+(instancetype) deviceWithMTLDevice:(id<MTLDevice>) metalDevice;
@end
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h 2023-06-23 13:53:29
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h 2023-07-13 22:07:56
@@ -2,7 +2,7 @@
// MPSGraphExecutable.h
// MPSGraph
//
-// Created by Dhruv Saksena on 4/11/21.
+// Created on 4/11/21.
// Copyright © 2021 Apple Inc. All rights reserved.
//
@@ -13,7 +13,7 @@
NS_ASSUME_NONNULL_BEGIN
-/// A notification when graph executable execution: has finished
+/// A notification when graph executable execution has finished.
///
/// - Parameters:
/// - results: If no error, the results produced by the graph operation. If Graph has not yet allocated the results this will be NSNull
@@ -22,7 +22,7 @@
typedef void (^MPSGraphExecutableCompletionHandler)(NSArray<MPSGraphTensorData *> * results,
NSError * _Nullable error);
-/// A notification when graph executable execution: has been scheduled
+/// A notification when graph executable execution has been scheduled.
///
/// - Parameters:
/// - results: If no error, the results produced by the graph operation.
@@ -34,30 +34,30 @@
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphExecutableExecutionDescriptor : MPSGraphObject<NSCopying>
-/// scheduledHandler for the graph executable, default value is nil
+/// ScheduledHandler for the graph executable, default value is nil.
@property (readwrite, atomic) MPSGraphExecutableScheduledHandler scheduledHandler;
-/// completionHandler for the graph executable, default value is nil
+/// CompletionHandler for the graph executable, default value is nil.
@property (readwrite, atomic) MPSGraphExecutableCompletionHandler completionHandler;
-/// waitUntilCompleted for the graph executable, default value is false
+/// Flag for the graph executable to wait till the execution has completed, default value is false.
@property (readwrite, atomic) BOOL waitUntilCompleted;
/// Executable waits on these shared events before scheduling execution on the HW, this does not include encoding which can still continue.
///
/// - Parameters:
-/// - event: shared event to wait on
-/// - value: value for shared event to wait on
+/// - event: Shared event to wait on.
+/// - value: Value for shared event to wait on.
-(void) waitForEvent:(id<MTLSharedEvent>) event
value:(uint64_t) value
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Executable signals these shared events at execution stage and immediately proceeds
+/// Executable signals these shared events at execution stage and immediately proceeds.
///
/// - Parameters:
-/// - event: shared event to signal
-/// - executionStage: execution stage to signal event at
-/// - value: value for shared event to wait on
+/// - event: Shared event to signal.
+/// - executionStage: Execution stage to signal event at.
+/// - value: Value for shared event to wait on.
-(void) signalEvent:(id<MTLSharedEvent>) event
atExecutionEvent:(MPSGraphExecutionStage) executionStage
value:(uint64_t) value
@@ -68,11 +68,11 @@
/// The options available to a graph.
typedef NS_ENUM(uint64_t, MPSGraphDeploymentPlatform)
{
- /// Deployment platofmr for macOS
+ /// Deployment platofmr for macOS.
MPSGraphDeploymentPlatformMacOS MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)) MPS_SWIFT_NAME(macOS) = 0L,
- /// Deployment target for iOS
+ /// Deployment target for iOS.
MPSGraphDeploymentPlatformIOS MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)) MPS_SWIFT_NAME(iOS) = 1L,
- /// Deployment target for tvOS
+ /// Deployment target for tvOS.
MPSGraphDeploymentPlatformTvOS MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)) MPS_SWIFT_NAME(tvOS) = 2L,
};
@@ -80,38 +80,46 @@
MPS_CLASS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
@interface MPSGraphExecutableSerializationDescriptor : MPSGraphObject
-/// If true, append to an existing .mpsgraphpackage if found at provided url. Otherwise, the exisiting .mpsgraphpackage will be overwritten
+/// Flag to append to an existing .mpsgraphpackage if found at provided url.
+///
+/// If false, the exisiting .mpsgraphpackage will be overwritten.
@property (readwrite, atomic) BOOL append;
-/// The deployment platform used to serialize the MPSGraphExecutable. Defaults to the current platform
+/// The deployment platform used to serialize the MPSGraphExecutable.
+///
+/// Defaults to the current platform.
@property (readwrite, atomic) MPSGraphDeploymentPlatform deploymentPlatform;
-/// The minimum deployment target to serialize the MPSGraphExecutable. Defaults to the current sdk
+/// The minimum deployment target to serialize the MPSGraphExecutable.
+///
+/// Defaults to the current sdk.
@property (readwrite, atomic) NSString* minimumDeploymentTarget;
@end
-/// Compiled representation of a compute graph executable
+/// Compiled representation of a compute graph executable.
///
-/// An MPSGraphExecutable is a compiled graph for specific feeds for specific targetTensors and targetOperations
+/// An MPSGraphExecutable is a compiled graph for specific feeds for specific targetTensors and target operations.
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphExecutable : MPSGraphObject
-/// options for the graph, default value is MPSGraphOptionsDefault
+/// Options for the graph executable.
+///
+/// Default value is `MPSGraphOptionsDefault`.
@property (readwrite, atomic) MPSGraphOptions options;
-/// feedTensors for the graph, can be used to order the inputs when executable was created with an MPSGraph
+/// Feed tensors for the graph, can be used to order the inputs when executable was created with an MPSGraph
@property (readonly, atomic, nullable) NSArray<MPSGraphTensor *> *feedTensors;
-/// targetTensors for the graph, can be used to order the outputs when executable was created with an MPSGraph
+/// Target tensors for the graph, can be used to order the outputs when executable was created with an MPSGraph
@property (readonly, atomic, nullable) NSArray<MPSGraphTensor *> *targetTensors;
-/// Specialize the MPSGraphExecutable and optimize it, use this method to choose when specialization happens, else it occurs at encode time automatically
+/// Specialize the MPSGraphExecutable and optimize it, use this method to choose when specialization happens, else it occurs at encode time automatically.
///
/// - Parameters:
/// - device: optional MPSGraph device to compile with
/// - inputTypes: input types
-/// - compilationDescriptor: compilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can
+/// - compilationDescriptor: compilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
-(void) specializeWithDevice:(MPSGraphDevice * _Nullable) device
inputTypes:(NSArray<MPSGraphType *> *) inputTypes
compilationDescriptor:(MPSGraphCompilationDescriptor * _Nullable) compilationDescriptor;
@@ -121,19 +129,19 @@
/// - Parameters:
/// - device: optional MPSGraph device to compile with
/// - inputTypes: input types
-/// - compilationDescriptor: compilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can
+/// - compilationDescriptor: compilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
-(NSArray<MPSGraphShapedType *> * _Nullable) getOutputTypesWithDevice:(MPSGraphDevice * _Nullable) device
inputTypes:(NSArray<MPSGraphType *> *) inputTypes
compilationDescriptor:(MPSGraphCompilationDescriptor * _Nullable) compilationDescriptor
MPS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3));
/// Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
-/// This call is synchronous and will return on completion of execution
+/// This call is synchronous and will return on completion of execution.
///
/// - Parameters:
-/// - commandQueue: CommandQueue passed to exectute the graph on
-/// - inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function
-/// - resultsArray: Results tensorData for which the caller wishes MPSGraphTensorData to be returned
+/// - commandQueue: CommandQueue passed to exectute the graph on.
+/// - inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function.
+/// - resultsArray: Results tensorData for which the caller wishes MPSGraphTensorData to be returned.
/// - Returns: A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
-(NSArray<MPSGraphTensorData *> *) runWithMTLCommandQueue:(id<MTLCommandQueue>) commandQueue
inputsArray:(NSArray<MPSGraphTensorData *> *) inputsArray
@@ -145,10 +153,10 @@
/// This call is asynchronous and will return immediately.
///
/// - Parameters:
-/// - commandQueue: CommandQueue passed to exectute the graph on
-/// - inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function
-/// - resultsArray: Tensors for which the caller wishes MPSGraphTensorData to be returned
-/// - executionDescriptor: ExecutionDescriptor to be passed in and used,
+/// - commandQueue: CommandQueue passed to exectute the graph on.
+/// - inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function.
+/// - resultsArray: Tensors for which the caller wishes MPSGraphTensorData to be returned.
+/// - executionDescriptor: ExecutionDescriptor to be passed in and used.
/// - Returns: A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
-(NSArray<MPSGraphTensorData *> *) runAsyncWithMTLCommandQueue:(id<MTLCommandQueue>) commandQueue
inputsArray:(NSArray<MPSGraphTensorData *> *) inputsArray
@@ -160,7 +168,7 @@
/// This call is asynchronous and will return immediately after finishing encoding.
///
/// - Parameters:
-/// - commandBuffer: commandBuffer passed to exectute the graph on, commitAndContinue might be called, please don't rely on underlying MTLCommandBuffer to remain uncommitted
+/// - commandBuffer: CommandBuffer passed to exectute the graph on, commitAndContinue might be called, please don't rely on underlying MTLCommandBuffer to remain uncommitted
/// - inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function
/// - resultsArray: Tensors for which the caller wishes MPSGraphTensorData to be returned
/// - executionDescriptor: ExecutionDescriptor to be passed in and used,
@@ -174,8 +182,8 @@
/// Serialize the MPSGraph executable at the provided url.
///
/// - Parameters:
-/// - url: the URL where to serialize the MPSGraph executable
-/// - descriptor: the descriptor to be used to serialize the graph
+/// - url: The URL where to serialize the MPSGraph executable.
+/// - descriptor: The descriptor to be used to serialize the graph.
-(void) serializeToMPSGraphPackageAtURL:(NSURL *) url
descriptor:(MPSGraphExecutableSerializationDescriptor *_Nullable) descriptor
MPS_SWIFT_NAME( serialize(package:descriptor:) )
@@ -184,8 +192,8 @@
/// Initialize the MPSGraph executable with the package at the provided url.
///
/// - Parameters:
-/// - mpsgraphPackageURL: the URL where to read the serialized MPSGraphExecutable
-/// - compilationDescriptor: compilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can
+/// - mpsgraphPackageURL: The URL where to read the serialized MPSGraphExecutable.
+/// - compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
-(instancetype) initWithMPSGraphPackageAtURL:(NSURL *)mpsgraphPackageURL
compilationDescriptor:(MPSGraphCompilationDescriptor * _Nullable) compilationDescriptor
MPS_SWIFT_NAME( init(package:descriptor:) )
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphFourierTransformOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphFourierTransformOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphFourierTransformOps.h 2023-06-23 13:53:30
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphFourierTransformOps.h 2023-07-13 22:07:56
@@ -13,37 +13,46 @@
NS_ASSUME_NONNULL_BEGIN
-/// Scaling modes for Fourier Transform operations. Use this descriptor with ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``,
-/// ``MPSGraph/realToHermiteanFFTWithTensor:axesTensor:descriptor:name:`` and
-/// ``MPSGraph/HermiteanToRealFFTWithTensor:axesTensor:descriptor:name:``.
+/// The scaling modes for Fourier transform operations.
typedef NS_ENUM(NSUInteger, MPSGraphFFTScalingMode)
{
- /// Pass through with no scaling.
+ /// Computes the FFT result with no scaling.
MPSGraphFFTScalingModeNone MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)) MPS_SWIFT_NAME(none) = 0L,
- /// Scales FFT result with reciprocal of the total FFT size over all transformed dimensions.
+ /// Scales the FFT result with reciprocal of the total FFT size over all transformed dimensions.
MPSGraphFFTScalingModeSize MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)),
- /// Scales FFT result with reciprocal square root of the total FFT size over all transformed dimensions, resulting in signal strength conserving transformation.
+ /// Scales the FFT result with reciprocal square root of the total FFT size over all transformed dimensions, resulting in signal strength conserving transformation.
MPSGraphFFTScalingModeUnitary MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
};
-/// Defines a Fast Fourier Tranform (FFT) operation.
+/// This class defines parameters for a fast Fourier transform (FFT) operation.
+///
+/// Use this descriptor with ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``,
+/// ``MPSGraph/realToHermiteanFFTWithTensor:axesTensor:descriptor:name:`` and
+/// ``MPSGraph/HermiteanToRealFFTWithTensor:axesTensor:descriptor:name:`` methods.
MPS_CLASS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
@interface MPSGraphFFTDescriptor : MPSGraphObject<NSCopying>
-/// When set to ``YES`` MPSGraph uses the positive phase factor: `exp(+i 2Pi mu nu / n)`, when computing the (inverse) Fourier transform.
+/// A boolean-valued parameter that defines the phase factor sign for Fourier transforms.
+///
+/// When set to `YES` MPSGraph uses the positive phase factor: `exp(+i 2Pi mu nu / n)`, when computing the (inverse) Fourier transform.
/// Otherwise MPSGraph uses the negative phase factor: `exp(-i 2Pi mu nu / n)`, when computing the Fourier transform.
-/// Default value: ``NO``.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL inverse;
-/// Scaling mode to use with the FFT operation.
-/// Default value: ``MPSGraphFFTScalingModeNone``.
+/// The scaling mode of the FFT operation.
+///
+/// Note that the scaling mode is independent from the phase factor. Default value: `MPSGraphFFTScalingModeNone`.
@property (readwrite, nonatomic) MPSGraphFFTScalingMode scalingMode;
-/// If set then MPSGraph rounds the last output dimension of the result tensor in ``MPSGraph/HermiteanToRealFFTWithTensor:axesTensor:descriptor:name:``
-/// to an odd value. Has no effect in the other Fourier transform operations.
-/// Default value: ``NO``.
+/// A parameter which controls how MPSGraph rounds the output tensor size for a Hermitean-to-real Fourier transform.
+///
+/// If set to `YES` then MPSGraph rounds the last output dimension of the result tensor in
+/// ``MPSGraph/HermiteanToRealFFTWithTensor:axesTensor:descriptor:name:`` to an odd value.
+/// Has no effect in the other Fourier transform operations.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL roundToOddHermitean;
+/// Creates a fast Fourier transform descriptor with default parameter values.
+(nullable instancetype) descriptor;
@end
@@ -52,9 +61,9 @@
MPS_CLASS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
@interface MPSGraph(MPSGraphFourierTransformOps)
-/// Creates a Fast Fourier Transform op and returns the result tensor.
+/// Creates a fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of the input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of the input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where
/// ```
@@ -67,17 +76,17 @@
/// and the sum is done separately over each dimension in `axes` and `n` is the
/// dimension length of that axis.
///
-/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
+/// > Tip: Currently MPSGraph supports the transformation only within the last four dimensions of the input tensor. In case
/// you need to transform higher dimensions than the last four, you can tranpose the higher dimensions of the input
/// with ``MPSGraph/transposeTensor:permutation:name:`` to be within that last four and then transpose
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Complex-valued input tensor. Must have datatype ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16``.
-/// - axes: Specifies over which axes MPSGraph performs the Fourier Transform - all axes must be contained within last four dimensions of the input tensor.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A complex-valued input tensor. Must have datatype `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16`.
+/// - axes: An array of numbers that specifies over which axes MPSGraph performs the Fourier transform - all axes must be contained within last four dimensions of the input tensor.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of the same type as ``tensor``.
+/// - Returns: A valid MPSGraphTensor of the same type as `tensor`.
-(MPSGraphTensor *) fastFourierTransformWithTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
descriptor:(MPSGraphFFTDescriptor *) descriptor
@@ -85,9 +94,9 @@
MPS_SWIFT_NAME(fastFourierTransform(_:axes:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Creates a Fast Fourier Transform op and returns the result tensor.
+/// Creates a fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of the input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of the input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where
/// ```
@@ -100,17 +109,17 @@
/// and the sum is done separately over each dimension in `axes` and `n` is the
/// dimension length of that axis.
///
-/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
+/// > Tip: Currently MPSGraph supports the transformation only within the last four dimensions of the input tensor. In case
/// you need to transform higher dimensions than the last four, you can tranpose the higher dimensions of the input
/// with ``MPSGraph/transposeTensor:permutation:name:`` to be within that last four and then transpose
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Complex-valued input tensor. Must have datatype ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16``.
-/// - axesTensor: Tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A complex-valued input tensor. Must have datatype `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16`.
+/// - axesTensor: A tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of the same type as ``tensor``.
+/// - Returns: A valid MPSGraphTensor of the same type as `tensor`.
-(MPSGraphTensor *) fastFourierTransformWithTensor:(MPSGraphTensor *) tensor
axesTensor:(MPSGraphTensor *) axesTensor
descriptor:(MPSGraphFFTDescriptor *) descriptor
@@ -118,9 +127,9 @@
MPS_SWIFT_NAME(fastFourierTransform(_:axesTensor:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Creates a Real-to-Hermitean Fast Fourier Transform op and returns the result tensor.
+/// Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of a real-valued input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of a real-valued input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where
/// ```
@@ -134,17 +143,17 @@
/// dimension length of that axis. With this API MPSGraph writes out only the results for the unique
/// frequencies, resulting in a tensor which has size `(n/2)+1` in the last dimension defined by `axes`.
///
-/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
+/// > Tip: Currently MPSGraph supports the transformation only within the last four dimensions of the input tensor. In case
/// you need to transform higher dimensions than the last four, you can tranpose the higher dimensions of the input
/// with ``MPSGraph/transposeTensor:permutation:name:`` to be within that last four and then transpose
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Real-valued input tensor. Must have datatype ``MPSDataTypeFloat32`` or ``MPSDatatypeFloat16``.
-/// - axes: Specifies over which axes MPSGraph performs the Fourier Transform - all axes must be contained within last four dimensions of the input tensor.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A Real-valued input tensor. Must have datatype `MPSDataTypeFloat32` or `MPSDatatypeFloat16`.
+/// - axes: An array of numbers that specifies over which axes MPSGraph performs the Fourier transform - all axes must be contained within last four dimensions of the input tensor.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of type ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16`` with reduced size (see Discussion).
+/// - Returns: A valid MPSGraphTensor of type `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16` with reduced size (see Discussion).
-(MPSGraphTensor *) realToHermiteanFFTWithTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
descriptor:(MPSGraphFFTDescriptor *) descriptor
@@ -153,9 +162,9 @@
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Creates a Real-to-Hermitean Fast Fourier Transform op and returns the result tensor.
+/// Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of a real-valued input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of a real-valued input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where
/// ```
@@ -169,17 +178,17 @@
/// dimension length of that axis. With this API MPSGraph writes out only the results for the unique
/// frequencies, resulting in a tensor which has size `(n/2)+1` in the last dimension defined by `axes`.
///
-/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
+/// > Tip: Currently MPSGraph supports the transformation only within the last four dimensions of the input tensor. In case
/// you need to transform higher dimensions than the last four, you can tranpose the higher dimensions of the input
/// with ``MPSGraph/transposeTensor:permutation:name:`` to be within that last four and then transpose
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Real-valued input tensor. Must have datatype ``MPSDataTypeFloat32`` or ``MPSDatatypeFloat16``.
-/// - axesTensor: Tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A real-valued input tensor. Must have datatype `MPSDataTypeFloat32` or `MPSDatatypeFloat16`.
+/// - axesTensor: A tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of type ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16`` with reduced size (see Discussion).
+/// - Returns: A valid MPSGraphTensor of type `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16` with reduced size (see Discussion).
-(MPSGraphTensor *) realToHermiteanFFTWithTensor:(MPSGraphTensor *) tensor
axesTensor:(MPSGraphTensor *) axesTensor
descriptor:(MPSGraphFFTDescriptor *) descriptor
@@ -187,9 +196,9 @@
MPS_SWIFT_NAME(realToHermiteanFFT(_:axesTensor:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Creates a Hermitean-to-Real Fast Fourier Transform op and returns the result tensor.
+/// Creates a Hermitean-to-Real fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of a complex-valued input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of a complex-valued input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) in'[nu], where
/// ```
@@ -203,7 +212,7 @@
/// and the sum is done separately over each dimension in `axes` and `n` is the
/// dimension length of that axis. With this API MPSGraph treats the input tensor to have only the unique
/// frequencies, which means that the resulting tensor has size `(inSize-1)*2 + x` in the last dimension defined by `axes`,
-/// where `inSize = shape(input)[axis] ( = (n/2)+1 )` is the size of the input ``tensor`` in the last transformed dimension and
+/// where `inSize = shape(input)[axis] ( = (n/2)+1 )` is the size of the input `tensor` in the last transformed dimension and
/// `x = 1` when ``MPSGraphFFTDescriptor/roundToOddHermitean`` = `YES` and `x = 0` otherwise.
///
/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
@@ -212,11 +221,11 @@
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Complex-valued input tensor with reduced size (see Discussion). Must have datatype ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16``.
-/// - axes: Specifies over which axes MPSGraph performs the Fourier Transform - all axes must be contained within last four dimensions of the input tensor.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A complex-valued input tensor with reduced size (see Discussion). Must have datatype `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16`.
+/// - axes: An array of numbers that specifies over which axes MPSGraph performs the Fourier transform - all axes must be contained within last four dimensions of the input tensor.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of type ``MPSDataTypeFloat32`` or ``MPSDataTypeFloat16`` (full size).
+/// - Returns: A valid MPSGraphTensor of type `MPSDataTypeFloat32` or `MPSDataTypeFloat16` (full size).
-(MPSGraphTensor *) HermiteanToRealFFTWithTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
descriptor:(MPSGraphFFTDescriptor *) descriptor
@@ -225,9 +234,9 @@
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Creates a Hermitean-to-Real Fast Fourier Transform op and returns the result tensor.
+/// Creates a Hermitean-to-Real fast Fourier transform operation and returns the result tensor.
///
-/// This operation computes the Fast Fourier Transform of a complex-valued input tensor according to the following formulae.
+/// This operation computes the fast Fourier transform of a complex-valued input tensor according to the following formulae.
/// ```md
/// output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) in'[nu], where
/// ```
@@ -241,20 +250,20 @@
/// and the sum is done separately over each dimension in `axes` and `n` is the
/// dimension length of that axis. With this API MPSGraph treats the input tensor to have only the unique
/// frequencies, which means that the resulting tensor has size `(inSize-1)*2 + x` in the last dimension defined by `axes`,
-/// where `inSize = shape(input)[axis] ( = (n/2)+1 )` is the size of the input ``tensor`` in the last transformed dimension and
+/// where `inSize = shape(input)[axis] ( = (n/2)+1 )` is the size of the input `tensor` in the last transformed dimension and
/// `x = 1` when ``MPSGraphFFTDescriptor/roundToOddHermitean`` = `YES` and `x = 0` otherwise.
///
-/// > Tip: Currently transformation is supported only within the last four dimensions of the input tensor. In case
+/// > Tip: Currently MPSGraph supports the transformation only within the last four dimensions of the input tensor. In case
/// you need to transform higher dimensions than the last four, you can tranpose the higher dimensions of the input
/// with ``MPSGraph/transposeTensor:permutation:name:`` to be within that last four and then transpose
/// the result tensor back with the inverse of the input transpose.
///
/// - Parameters:
-/// - tensor: Complex-valued input tensor with reduced size (see Discussion). Must have datatype ``MPSDataTypeComplexFloat32`` or ``MPSDataTypeComplexFloat16``.
-/// - axesTensor: Tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
-/// - descriptor: Defines details of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
+/// - tensor: A complex-valued input tensor with reduced size (see Discussion). Must have datatype `MPSDataTypeComplexFloat32` or `MPSDataTypeComplexFloat16`.
+/// - axesTensor: A tensor of rank one containing the axes over which MPSGraph performs the transformation. See ``MPSGraph/fastFourierTransformWithTensor:axes:descriptor:name:``.
+/// - descriptor: A descriptor that defines parameters of the Fourier transform operation - see ``MPSGraphFFTDescriptor``.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor of type ``MPSDataTypeFloat32`` or ``MPSDataTypeFloat16`` (full size).
+/// - Returns: A valid MPSGraphTensor of type `MPSDataTypeFloat32` or `MPSDataTypeFloat16` (full size).
-(MPSGraphTensor *) HermiteanToRealFFTWithTensor:(MPSGraphTensor *) tensor
axesTensor:(MPSGraphTensor *) axesTensor
descriptor:(MPSGraphFFTDescriptor *) descriptor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphImToColOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphImToColOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphImToColOps.h 2023-06-23 13:53:29
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphImToColOps.h 2023-07-14 00:03:40
@@ -2,7 +2,7 @@
// MPSGraphImToColOps.h
// MetalPerformanceShadersGraph
//
-// Created by local on 4/26/23.
+// Created on 4/26/23.
// Copyright © 2023 Apple Inc. All rights reserved.
//
@@ -13,49 +13,51 @@
NS_ASSUME_NONNULL_BEGIN
-/// Descriptor for properties of convolution.
-/// It is used to create ImToCol operation.
+/// This class defines parameters for an imToCol or colToIm operation.
+/// Use this descriptor with the following ``MPSGraph`` methods:
+/// - ``MPSGraph/imToColWithSourceTensor:descriptor:name:``.
+/// - ``MPSGraph/colToImWithSourceTensor:outputShape:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
@interface MPSGraphImToColOpDescriptor : MPSGraphObject<NSCopying>
-/// kernel in `x` or width dimension.
+/// The property defines the kernel size in `x` or width dimension.
@property (readwrite, nonatomic) NSUInteger kernelWidth;
-/// kernel in `y` or height dimension.
+/// The property defines the kernel size in `y` or height dimension.
@property (readwrite, nonatomic) NSUInteger kernelHeight;
-/// stride in `x` or width dimension.
+/// The property defines the stride in `x` or width dimension.
@property (readwrite, nonatomic) NSUInteger strideInX;
-/// stride in `y` or height dimension.
+/// The property defines the stride in `y` or height dimension.
@property (readwrite, nonatomic) NSUInteger strideInY;
-/// dilation in `x` or width dimension.
+/// The property defines the dilation in `x` or width dimension.
@property (readwrite, nonatomic) NSUInteger dilationRateInX;
-/// dilation in `y` or height dimension.
+/// The property defines the dilation in `y` or height dimension.
@property (readwrite, nonatomic) NSUInteger dilationRateInY;
-/// padding in `x` or width dimension on left side.
+/// The property defines the padding in `x` or width dimension on left side.
@property (readwrite, nonatomic) NSUInteger paddingLeft;
-/// padding in `x` or width dimension on right side.
+/// The property defines the padding in `x` or width dimension on right side.
@property (readwrite, nonatomic) NSUInteger paddingRight;
-/// padding in `y` or height dimension at top.
+/// The property defines the padding in `y` or height dimension at top.
@property (readwrite, nonatomic) NSUInteger paddingTop;
-/// padding in `y` or height dimension at bottom.
+/// The property defines the padding in `y` or height dimension at bottom.
@property (readwrite, nonatomic) NSUInteger paddingBottom;
-/// layout of source tensor.
+/// The property defines the layout of source or output tensor.
/// e.g. `batch x channels x width x height` for `NCHW` layout
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout dataLayout;
-/// Creates imToCol descriptor with given values for parameters.
+/// Creates an imToCol descriptor with given values for parameters.
/// - Parameters:
-/// - kernelWidth: See ``kernelWidth`` property.
-/// - kernelHeight: See ``kernelHeight`` property.
-/// - strideInX: See ``strideInX`` property.
-/// - strideInY: See ``strideInY`` property.
-/// - dilationRateInX: See ``dilationRateInX`` property.
-/// - dilationRateInY: See ``dilationRateInY`` property.
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
-/// - dataLayout: See ``dataLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - kernelWidth: See `kernelWidth` property.
+/// - kernelHeight: See `kernelHeight` property.
+/// - strideInX: See `strideInX` property.
+/// - strideInY: See `strideInY` property.
+/// - dilationRateInX: See `dilationRateInX` property.
+/// - dilationRateInY: See `dilationRateInY` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
+/// - dataLayout: See `dataLayout` property.
+/// - Returns: A valid MPSGraphImToColOpDescriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelWidth:(NSUInteger) kernelWidth
kernelHeight:(NSUInteger) kernelHeight
strideInX:(NSUInteger) strideInX
@@ -70,14 +72,14 @@
/// Creates imToCol descriptor with given values for parameters.
/// - Parameters:
-/// - kernelWidth: See ``kernelWidth`` property.
-/// - kernelHeight: See ``kernelHeight`` property.
-/// - strideInX: See ``strideInX`` property.
-/// - strideInY: See ``strideInY`` property.
-/// - dilationRateInX: See ``dilationRateInX`` property.
-/// - dilationRateInY: See ``dilationRateInY`` property.
-/// - dataLayout: See ``dataLayout`` property.
-/// - Returns: The descriptor on autoreleasepool.
+/// - kernelWidth: See `kernelWidth` property.
+/// - kernelHeight: See `kernelHeight` property.
+/// - strideInX: See `strideInX` property.
+/// - strideInY: See `strideInY` property.
+/// - dilationRateInX: See `dilationRateInX` property.
+/// - dilationRateInY: See `dilationRateInY` property.
+/// - dataLayout: See `dataLayout` property.
+/// - Returns: A valid MPSGraphImToColOpDescriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelWidth:(NSUInteger) kernelWidth
kernelHeight:(NSUInteger) kernelHeight
strideInX:(NSUInteger) strideInX
@@ -86,12 +88,12 @@
dilationRateInY:(NSUInteger) dilationRateInY
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout;
-/// Sets values of padding to given values.
+/// Sets the descriptor's padding to the given values.
/// - Parameters:
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
-(void) setExplicitPaddingWithPaddingLeft:(NSUInteger) paddingLeft
paddingRight:(NSUInteger) paddingRight
paddingTop:(NSUInteger) paddingTop
@@ -106,8 +108,8 @@
/// Creates an imToCol operation and returns the result tensor.
///
/// - Parameters:
-/// - source: source tensor - must be of rank 4. The layout is defined by ``descriptor.dataLayout``.
-/// - descriptor: Specifies strides, dilation rates, paddings and layout.
+/// - source: The tensor containing the source data. Must be of rank 4. The layout is defined by `descriptor.dataLayout`.
+/// - descriptor: The descriptor object that specifies the parameters of the operation.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) imToColWithSourceTensor:(MPSGraphTensor *) source
@@ -119,8 +121,9 @@
/// Creates an colToIm operation and returns the result tensor.
///
/// - Parameters:
-/// - source: source tensor - must be of rank 3. The layout is defined by ``descriptor.dataLayout``.
-/// - descriptor: Specifies strides, dilation rates, paddings and layout.
+/// - source: The tensor containing the source data. Must be of rank 4. The layout is defined by `descriptor.dataLayout`.
+/// - outputShape: The result tensor shape.
+/// - descriptor: The descriptor object that specifies the parameters of the operation.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) colToImWithSourceTensor:(MPSGraphTensor *) source
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLinearAlgebraOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLinearAlgebraOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLinearAlgebraOps.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLinearAlgebraOps.h 2023-07-14 00:00:20
@@ -2,7 +2,7 @@
// MPSGraphLinearAlgebraOps.h
// MPSGraph
//
-// Created by local on 1/21/22.
+// Created on 1/21/22.
// Copyright © 2022 Apple Inc. All rights reserved.
//
@@ -17,37 +17,37 @@
MPS_CLASS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))
@interface MPSGraph(MPSGraphLinearAlgebraOps)
-/// Compute the band part of an input tensor
+/// Computes the band part of an input tensor.
///
-/// The framework copies a diagonal band of values from input tensor to a result tensor of the same size.
+/// This operation copies a diagonal band of values from input tensor to a result tensor of the same size.
/// A coordinate `[..., i, j]` is in the band if
/// ```md
/// (numLower < 0 || (i-j) <= numLower) && (numUpper < 0 || (j-i) <= numUpper)
/// ```
-/// Values outside of the band are set to 0.
+/// The values outside of the band are set to 0.
///
/// - Parameters:
/// - inputTensor: input tensor
-/// - numLower: the number of diagonals in the lower triangle to keep. If -1, the framework returns all sub diagnols
-/// - numUpper: the number of diagonals in the upper triangle to keep. If -1, the framework returns all super diagnols
-/// - name: name for the operation
-/// - Returns: A valid MPSGraphTensor object
+/// - numLower: the number of diagonals in the lower triangle to keep. If -1, the framework returns all sub diagnols.
+/// - numUpper: the number of diagonals in the upper triangle to keep. If -1, the framework returns all super diagnols.
+/// - name: name for the operation.
+/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) bandPartWithTensor:(MPSGraphTensor *) inputTensor
numLower:(NSInteger) numLower
numUpper:(NSInteger) numUpper
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( bandPart(_:numLower:numUpper:name:) );
-/// Create band part op and return the result
+/// Creates band part op and return the result.
///
/// See above discussion of bandPartWithTensor: numLower: numUpper: name:
///
/// - Parameters:
-/// - inputTensor: The source tensor to copy
+/// - inputTensor: The source tensor to copy.
/// - numLowerTensor: Scalar Int32 tensor. The number of diagonals in the lower triangle to keep. If -1, keep all.
/// - numUpperTensor: Scalar Int32 tensor. The number of diagonals in the upper triangle to keep. If -1, keep all.
-/// - name: The name for the operation
-/// - Returns: A valid MPSGraphTensor object
+/// - name: The name for the operation.
+/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) bandPartWithTensor:(MPSGraphTensor *) inputTensor
numLowerTensor:(MPSGraphTensor *) numLowerTensor
numUpperTensor:(MPSGraphTensor *) numUpperTensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLossOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLossOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLossOps.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphLossOps.h 2023-07-14 00:00:20
@@ -13,32 +13,37 @@
NS_ASSUME_NONNULL_BEGIN
-/// Defines the type of the reduction the graph applies in the loss operations.
+/// The type of the reduction MPSGraph applies in the loss operations.
typedef NS_ENUM(uint64_t, MPSGraphLossReductionType)
{
- /// No Reductions
+ /// Computes the loss without reduction.
MPSGraphLossReductionTypeNone MPS_ENUM_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0)) MPS_SWIFT_NAME(none) = 0L,
- /// No Reductions
+ /// Computes the loss without reduction.
MPSGraphLossReductionTypeAxis MPS_ENUM_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0)) MPS_SWIFT_NAME(axis) = MPSGraphLossReductionTypeNone,
- /// Reduce sum down to a scalar.
+ /// Reduces the loss down to a scalar with a sum operation.
MPSGraphLossReductionTypeSum MPS_ENUM_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0)) = 1L,
- /// Reduce mean down to a scalar.
- MPSGraphLossReductionTypeMean MPS_ENUM_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0)) = 2L,
+ /// Reduces the loss down to a scalar with a mean operation.
+ MPSGraphLossReductionTypeMean MPS_ENUM_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0)) = 2L,
};
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphLossOps)
/// Creates a softmax cross entropy loss operation and returns the result tensor.
-/// This computes: `loss = reduction( - labels*ln( softmax(source) ))`,
-/// where `sotfmax(source) = exp(source) / sum( exp(source) )`, where the sum is computed over ``axis``.
///
+/// The softmax cross entropy operation computes:
+/// ```md
+/// loss = reduction( - labels*ln( softmax(source) )), where
+/// sotfmax(source) = exp(source) / sum( exp(source) ), and
+/// ```
+/// the operation performs the reduction over the `axis` dimension.
+///
/// - Parameters:
/// - sourceTensor: The source tensor.
/// - labelsTensor: The labels tensor.
-/// - axis: Axis over which the softmax reduction happens.
-/// - reductionType: The type of reduction MPSGraph uses to reduce across all other axes.
-/// - name: Name for the operation
+/// - axis: The axis over which the operation computes the softmax reduction.
+/// - reductionType: The type of reduction MPSGraph uses to reduce across all other axes than `axis`. See: ``MPSGraphLossReductionType``.
+/// - name: The name for the operation
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) softMaxCrossEntropyWithSourceTensor:(MPSGraphTensor *) sourceTensor
labelsTensor:(MPSGraphTensor *) labelsTensor
@@ -47,15 +52,15 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( softMaxCrossEntropy(_:labels:axis:reuctionType:name:) );
-/// Creates a softmax cross entropy loss operation and returns the result tensor.
+/// Creates the gradient of a softmax cross entropy loss operation and returns the result tensor.
///
/// - Parameters:
-/// - gradientTensor: gradientTensor - Note: in most cases you want to pass in the initial gradient tensor, which is a constant tensor with value one.
+/// - gradientTensor: The input gradientTensor. Note: in most cases this is the initial gradient tensor, which is a constant tensor with value one.
/// - sourceTensor: The source tensor.
/// - labelsTensor: The labels tensor.
-/// - axis: Axis over which loss reduction happens.
-/// - reductionType: The type of reduction MPSGraph uses to reduce across all other axes.
-/// - name: Name for the operation.
+/// - axis: The axis over which the operation computes the softmax reduction.
+/// - reductionType: The type of reduction MPSGraph uses to reduce across all other axes than `axis`. See: ``MPSGraphLossReductionType``.
+/// - name: The name for the operation
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) softMaxCrossEntropyGradientWithIncomingGradientTensor:(MPSGraphTensor *) gradientTensor
sourceTensor:(MPSGraphTensor *) sourceTensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h 2023-07-14 00:00:20
@@ -15,16 +15,17 @@
@interface MPSGraph(MPSGraphMatrixInverseOps)
-/// Compute the inverse of an input tensor.
+/// Computes the inverse of an input tensor.
///
-/// The framework computes the inverse of a square matrix by calling LU decomposition and LU solver.
-/// All dimensions after the first 2 are treated as batch dimensions and the inverse for each batch is computed
+/// The framework computes the inverse of a square matrix by calling LU decomposition and LU solver.
+/// All dimensions after the first 2 are treated as batch dimensions and the inverse for each batch is computed.
/// Results are undefined for ill conditioned matrices.
///
/// - Parameters:
-/// - inputTensor: An input tensor.
-/// - name: A name for the operation.
-/// - Returns: A valid ``MPSGraphTensor`` object.
+/// - inputTensor: The input tensor.
+/// - name: The name for the operation.
+/// - Returns: A valid ``MPSGraphTensor`` object containing the inverse of the input tensor.
+///
-(MPSGraphTensor *) inverseOfTensor:(MPSGraphTensor *) inputTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( inverse(input:name:) )
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixMultiplicationOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixMultiplicationOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixMultiplicationOps.h 2023-06-23 17:39:55
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixMultiplicationOps.h 2023-07-14 00:00:20
@@ -16,29 +16,29 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphMatrixMultiplicationOps)
-/// Computes matrix multiplication of 2 input tensors with support for broadcasting.
+/// Computes the matrix multiplication of 2 input tensors with support for broadcasting.
///
/// - Parameters:
-/// - primaryTensor: A lhs tensor.
-/// - secondaryTensor: A rhs tensor.
-/// - name: A name for the operation.
-/// - Returns: A valid ``MPSGraphTensor`` object
+/// - primaryTensor: The left-hand side tensor.
+/// - secondaryTensor: The right-hand side tensor.
+/// - name: The name for the operation.
+/// - Returns: A valid tensor containing the product of the input matrices.
-(MPSGraphTensor *) matrixMultiplicationWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( matrixMultiplication(primary:secondary:name:) );
-/// Computes hamming distance of 2 input tensors with support for broadcasting.
+/// Computes the hamming distance of 2 input tensors with support for broadcasting.
///
-/// The hamming distance is computed between sets of vectors and the last dimension(s) of each
+/// The hamming distance is computed between 2 sets of vectors and the last dimension(s) of each
/// input tensor is considered a vector.
///
/// - Parameters:
-/// - primaryTensor: A lhs tensor.
-/// - secondaryTensor: A rhs tensor.
-/// - resultDataType: A datatype of the return MPSGraphTensor. Must be either MPSDataTypeUInt32 or MPSDataTypeUInt16.
-/// - name: A name for the operation
-/// - Returns: A valid ``MPSGraphTensor`` object.
+/// - primaryTensor: The first input tensor.
+/// - secondaryTensor: The second input tensor.
+/// - resultDataType: The datatype of the return MPSGraphTensor. Must be either ``MPSDataTypeUInt32`` or ``MPSDataTypeUInt16``.
+/// - name: The name for the operation
+/// - Returns: A valid tensor containing the hamming distance between the input tensors.
-(MPSGraphTensor *) HammingDistanceWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
secondaryTensor:(MPSGraphTensor *) secondaryTensor
resultDataType:(MPSDataType) resultDataType
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMemoryOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMemoryOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMemoryOps.h 2023-05-13 17:17:48
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMemoryOps.h 2023-07-13 16:14:32
@@ -13,13 +13,14 @@
NS_ASSUME_NONNULL_BEGIN
+/// This class defines parameters for an MPSGraphVariableOp.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphVariableOp : MPSGraphOperation
-/// shape of the variable
+/// The shape of the variable.
@property (readonly, nonnull, nonatomic) MPSShape *shape;
-/// dataType of the variable
+/// The dataType of the variable.
@property (readonly, nonatomic) MPSDataType dataType;
@end
@@ -27,82 +28,81 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MemoryOps)
-/// Create a placeholder op and return the result tensor
+/// Creates a placeholder op and returns the result tensor.
///
/// - Parameters:
-/// - shape: shape of the output tensor, nil shape will result in an unranked tensor
-/// - dataType: dataType of the placeholder tensor
-/// - name: name for the placeholder operation
+/// - shape: The shape of the output tensor. A nil shape will result in an unranked tensor.
+/// - dataType: The dataType of the placeholder tensor.
+/// - name: The name for the placeholder operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) placeholderWithShape:(MPSShape * _Nullable) shape
dataType:(MPSDataType) dataType
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( placeholder(shape:dataType:name:) );
-/// Create a placeholder op and return the result tensor
-/// dataType of the placeholder tensor set to MPSDataTypeFloat32
+/// Creates a placeholder op and returns the result tensor with the dataType of the placeholder tensor set to MPSDataTypeFloat32.
///
/// - Parameters:
-/// - shape: shape of the output tensor, nil shape will result in an unranked tensor
-/// - name: name for the operation
+/// - shape: The shape of the output tensor. A nil shape will result in an unranked tensor.
+/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) placeholderWithShape:(MPSShape * _Nullable) shape
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( placeholder(shape:name:) );
-/// Create a constant op and return the result tensor
+/// Creates a constant op with a given shape and data, and returns the result tensor.
///
/// - Parameters:
-/// - data: data for the tensor, number of bytes should be sizeof(dataType)numberOfElements
-/// - shape: shape of the output tensor, has to be statically shaped
-/// - dataType: dataType of theconstant tensor
+/// - data: The data for the tensor. The number of bytes should be sizeof(dataType)numberOfElements.
+/// - shape: The shape of the output tensor. This has to be statically shaped.
+/// - dataType: The dataType of theconstant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithData:(NSData *) data
shape:(MPSShape *) shape
dataType:(MPSDataType) dataType
MPS_SWIFT_NAME( constant(_:shape:dataType:) );
-/// Create a constant op and return the result tensor
+/// Creates a constant op and returns the result tensor.
///
/// - Parameters:
-/// - scalar: scalar to fill the entire tensor values with
-/// - dataType: dataType of the constant tensor
+/// - scalar: The scalar value to fill the entire tensor values with.
+/// - dataType: The dataType of the constant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithScalar:(double) scalar
dataType:(MPSDataType) dataType
MPS_SWIFT_NAME( constant(_:dataType:) );
-/// Create a constant op and return the result tensor
+/// Creates a constant op with a given shape and returns the result tensor.
///
/// - Parameters:
-/// - scalar: scalar to fill the entire tensor values with
-/// - shape: shape of the output tensor.
-/// - dataType: dataType of the constant tensor
+/// - scalar: The scalar value to fill the entire tensor values with.
+/// - shape: The shape of the output tensor.
+/// - dataType: The dataType of the constant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithScalar:(double) scalar
shape:(MPSShape *) shape
dataType:(MPSDataType) dataType
MPS_SWIFT_NAME( constant(_:shape:dataType:) );
-/// Create a complex constant op with MPSDataTypeComplexFloat32 data type and return the result tensor.
+/// Creates a complex constant op with the MPSDataTypeComplexFloat32 data type and returns the result tensor.
///
/// - Parameters:
-/// - realPart: the real part of the complex scalar to fill the entire tensor values with.
-/// - imaginaryPart: the imaginary part of the complex scalar to fill the entire tensor values with.
-/// - dataType: dataType of the constant tensor.
+/// - realPart: The real part of the complex scalar to fill the entire tensor values with.
+/// - imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
+/// - dataType: The dataType of the constant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithRealPart:(double) realPart
imaginaryPart:(double) imaginaryPart
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( complexConstant(realPart:imaginaryPart:) );
-/// Create a complex constant op and return the result tensor.
+/// Creates a complex constant op and returns the result tensor.
///
/// - Parameters:
-/// - realPart: the real part of the complex scalar to fill the entire tensor values with.
-/// - imaginaryPart: the imaginary part of the complex scalar to fill the entire tensor values with.
-/// - dataType: dataType of the constant tensor.
+/// - realPart: The real part of the complex scalar to fill the entire tensor values with.
+/// - imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
+/// - dataType: The dataType of the constant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithRealPart:(double) realPart
imaginaryPart:(double) imaginaryPart
@@ -110,13 +110,13 @@
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( complexConstant(realPart:imaginaryPart:dataType:) );
-/// Create a complex constant op and return the result tensor.
+/// Creates a complex constant op with a given shape and returns the result tensor.
///
/// - Parameters:
-/// - realPart: the real part of the complex scalar to fill the entire tensor values with.
-/// - imaginaryPart: the imaginary part of the complex scalar to fill the entire tensor values with.
-/// - shape: shape of the output tensor, has to be statically shaped.
-/// - dataType: dataType of the constant tensor.
+/// - realPart: The real part of the complex scalar to fill the entire tensor values with.
+/// - imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
+/// - shape: The shape of the output tensor. This has to be statically shaped.
+/// - dataType: The dataType of the constant tensor.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) constantWithRealPart:(double) realPart
imaginaryPart:(double) imaginaryPart
@@ -125,35 +125,35 @@
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0))
MPS_SWIFT_NAME( complexConstant(realPart:imaginaryPart:shape:dataType:) );
-/// Create a variable op and return the result tensor
+/// Creates a variable op and returns the result tensor.
///
/// - Parameters:
-/// - data: data for the tensor, number of bytes should be sizeof(dataType)numberOfElements
-/// - shape: shape of the output tensor, has to be statically shaped
-/// - dataType: dataType of theconstant tensor
-/// - name: name for the operation
+/// - data: The data for the tensor. The number of bytes should be sizeof(dataType)numberOfElements.
+/// - shape: The shape of the output tensor. This has to be statically shaped.
+/// - dataType: The dataType of the constant tensor.
+/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) variableWithData:(NSData *) data
shape:(MPSShape *) shape
dataType:(MPSDataType) dataType
name:(NSString * _Nullable) name;
-/// Create a read op which reads at this point of execution of the graph and return the result tensor
+/// Creates a read op which reads at this point of execution of the graph and returns the result tensor.
///
/// - Parameters:
-/// - variable: variable resource tensor to read from
-/// - name: name for the operation
+/// - variable: The variable resource tensor to read from.
+/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) readVariable:(MPSGraphTensor *) variable
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( read(_:name:) );
-/// Create a read op which reads at this point of execution of the graph and return the result tensor
+/// Creates an assign op which writes at this point of execution of the graph.
///
/// - Parameters:
-/// - variable: variable resource tensor to read from
-/// - tensor: tensor to assign to variable
-/// - name: name for the operation
+/// - variable: The variable resource tensor to assign to.
+/// - tensor: The tensor to assign to the variable.
+/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphOperation *) assignVariable:(MPSGraphTensor *) variable
withValueOfTensor:(MPSGraphTensor *) tensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNonZeroOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNonZeroOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNonZeroOps.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNonZeroOps.h 2023-07-14 00:00:19
@@ -2,7 +2,7 @@
// MPSGraphNonZeroOps.h
// MPSGraph
//
-// Created by Matteo Franciolini on 2/27/23.
+// Created on 2/27/23.
// Copyright © 2023 Apple Inc. All rights reserved.
//
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNormalizationOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNormalizationOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNormalizationOps.h 2023-06-23 14:22:37
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphNormalizationOps.h 2023-07-13 16:14:32
@@ -16,40 +16,40 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphNormalizationOps)
-/// Create a mean op and return the result tensor
+/// Returns the mean of the first input along the specified axes.
///
/// - Parameters:
/// - axes: A list of axes over which to perform the reduction. The order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
-(MPSGraphTensor *) meanOfTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
name:(NSString * _Nullable) name;
-/// Create a variance op when you already have a precomputed mean and return the result tensor
+/// Returns the variance of the first input along the specified axes when the mean has been precomputed.
///
/// - Parameters:
/// - axes: A list of axes over which to perform the reduction such that the order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
-(MPSGraphTensor *) varianceOfTensor:(MPSGraphTensor *) tensor
meanTensor:(MPSGraphTensor *) meanTensor
axes:(NSArray<NSNumber *> *) axes
name:(NSString * _Nullable) name;
-/// Create a variance op and return the result tensor
+/// Returns the variance of the first input along the specified axes.
///
/// - Parameters:
/// - axes: A list of axes over which to perform the reduction. Tthe order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
-(MPSGraphTensor *) varianceOfTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
name:(NSString * _Nullable) name;
-/// Create a batch normalization op and return the result tensor
+/// Create a batch normalization op and return the result tensor.
///
-/// The mean and variance tensors should be outputs of meanWithTensor:axes:name and varianceWithTensor:meanTensor:axes:name.
+/// The mean and variance tensors should be outputs of `meanWithTensor:axes:name` and `varianceWithTensor:meanTensor:axes:name`.
/// Use the axes parameter to achieve different types of normalizations.
/// For example (assuming your data is in NxHxWxC format)
/// Batch normalization: axes = [0, 1, 2]
@@ -58,14 +58,14 @@
/// For batch normalization, gamma and beta would typically be 1x1x1xC i.e. one value per channel.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - mean: mean
-/// - variance: variance
-/// - gamma: Tensor used to scale the normalized result
-/// - beta: Tensor used to bias the normalized result
+/// - tensor: The input tensor.
+/// - mean: The mean tensor.
+/// - variance: The variance tensor.
+/// - gamma: The tensor used to scale the normalized result.
+/// - beta: The tensor used to bias the normalized result.
/// - epsilon: A small value to add to the variance when normalizing the inputs.
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
///
-(MPSGraphTensor *) normalizationWithTensor:(MPSGraphTensor *) tensor
meanTensor:(MPSGraphTensor *) mean
@@ -76,7 +76,7 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( normalize(_:mean:variance:gamma:beta:epsilon:name:) );
-/// Create a normalization gamma gradient op and return the result tensor
+/// Create a normalization gamma gradient op and return the result tensor.
///
/// The mean and variance tensors should be outputs of ``meanWithTensor:axes:name`` and ``varianceWithTensor:meanTensor:axes:name``.
/// Use the axes parameter to achieve different types of normalizations.
@@ -85,14 +85,14 @@
/// Instance normalization: axes = [1, 2]
///
/// - Parameters:
-/// - incomingGradientTensor: incoming original resultTensor gradient
-/// - sourceTensor: original input source in forward direction
-/// - meanTensor: mean tensor
-/// - varianceTensor: variance
-/// - axes: axes to which were normalized
+/// - incomingGradientTensor: The incoming original `resultTensor` gradient.
+/// - sourceTensor: The original input source in forward direction.
+/// - meanTensor: The mean tensor.
+/// - varianceTensor: The variance tensor.
+/// - axes: The axes of normalization.
/// - epsilon: A small value to add to the variance when normalizing the inputs.
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
///
-(MPSGraphTensor *) normalizationGammaGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradientTensor
sourceTensor:(MPSGraphTensor *) sourceTensor
@@ -102,7 +102,7 @@
epsilon:(float) epsilon
name:(NSString * _Nullable) name;
-/// Create a normalization beta gradient op and return the result tensor
+/// Create a normalization beta gradient op and return the result tensor.
///
/// The mean and variance tensors should be outputs of ``meanWithTensor:axes:name`` and ``varianceWithTensor:meanTensor:axes:name``.
/// Use the axes parameter to achieve different types of normalizations.
@@ -111,17 +111,17 @@
/// Instance normalization: axes = [1, 2]
///
/// - Parameters:
-/// - incomingGradientTensor: incoming original resultTensor gradient
-/// - sourceTensor: original input source in forward direction
-/// - axes: axes to which were normalized
-/// - name: name for the placeholder operation
-/// - Returns: A valid MPSGraphTensor object.
+/// - incomingGradientTensor: The incoming original `resultTensor` gradient.
+/// - sourceTensor: The original input source in forward direction.
+/// - axes: The axes of normalization.
+/// - name: An optional name for the operation.
+/// - Returns: A valid `MPSGraphTensor` object.
///
-(MPSGraphTensor *) normalizationBetaGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradientTensor
sourceTensor:(MPSGraphTensor *) sourceTensor
reductionAxes:(NSArray<NSNumber *> *) axes
name:(NSString * _Nullable) name;
-/// Create a normalization input gradient op and return the result tensor
+/// Create a normalization input gradient op and return the result tensor.
///
/// The mean and variance tensors should be outputs of ``meanWithTensor:axes:name`` and ``varianceWithTensor:meanTensor:axes:name``.
/// Use the axes parameter to achieve different types of normalizations.
@@ -130,16 +130,16 @@
/// Instance normalization: axes = [1, 2]
///
/// - Parameters:
-/// - incomingGradientTensor: incoming original resultTensor gradient
-/// - sourceTensor: original input source in forward direction
-/// - meanTensor: mean tensor
-/// - varianceTensor: variance tensor
-/// - gamma: gamma tensor
-/// - gammaGradient: gammaGradient tensor
-/// - betaGradient: betaGradient tensor
-/// - axes: axes to which were normalized
+/// - incomingGradientTensor: The incoming original `resultTensor` gradient.
+/// - sourceTensor: The original input source in forward direction.
+/// - meanTensor: The mean tensor.
+/// - varianceTensor: The variance tensor.
+/// - gamma: The gamma tensor.
+/// - gammaGradient: The `gammaGradient` tensor.
+/// - betaGradient: The `betaGradient` tensor
+/// - axes: The axes of normalization.
/// - epsilon: A small value to add to the variance when normalizing the inputs.
-/// - name: name for the placeholder operation
+/// - name: An optional name for the operation.
///
-(MPSGraphTensor *) normalizationGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradientTensor
sourceTensor:(MPSGraphTensor *) sourceTensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphPoolingOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphPoolingOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphPoolingOps.h 2023-06-23 14:22:36
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphPoolingOps.h 2023-07-14 00:00:19
@@ -13,103 +13,114 @@
NS_ASSUME_NONNULL_BEGIN
-/// Flattening mode for returned indices with max pooling.
+/// The flattening mode for returned indices with max pooling.
MPS_ENUM_AVAILABLE_STARTING(macos(12.2), ios(15.3), tvos(15.3))
typedef NS_ENUM(NSUInteger, MPSGraphPoolingReturnIndicesMode)
{
/// No indices returned.
MPSGraphPoolingReturnIndicesNone,
- /// Return indices flattened in inner most (last) dimension.
+ /// Returns indices flattened in inner most (last) dimension.
MPSGraphPoolingReturnIndicesGlobalFlatten1D,
- /// Return indices flattened in 2 innermost dimensions. eg: HW in NCHW.
+ /// Returns indices flattened in 2 innermost dimensions. eg: HW in NCHW.
MPSGraphPoolingReturnIndicesGlobalFlatten2D,
- /// Return indices flattened in 3 innernost dimensions. eg: HWC in NHWC.
+ /// Returns indices flattened in 3 innernost dimensions. eg: HWC in NHWC.
MPSGraphPoolingReturnIndicesGlobalFlatten3D,
- /// Return indices flattened in 4 innermost dimensions.
+ /// Returns indices flattened in 4 innermost dimensions.
MPSGraphPoolingReturnIndicesGlobalFlatten4D,
- /// Return indices within pooling window, flattened in inner most dimension.
+ /// Returns indices within pooling window, flattened in inner most dimension.
MPSGraphPoolingReturnIndicesLocalFlatten1D,
- /// Return indices within pooling window, flattened in 2 innermost dimensions. eg: HW in NCHW.
+ /// Returns indices within pooling window, flattened in 2 innermost dimensions. eg: HW in NCHW.
MPSGraphPoolingReturnIndicesLocalFlatten2D,
- /// Return indices within pooling window, flattened in 3 innernost dimensions. eg: HWC in NHWC.
+ /// Returns indices within pooling window, flattened in 3 innernost dimensions. eg: HWC in NHWC.
MPSGraphPoolingReturnIndicesLocalFlatten3D,
- /// Return indices within pooling window, flattened in 4 innermost dimensions.
+ /// Returns indices within pooling window, flattened in 4 innermost dimensions.
MPSGraphPoolingReturnIndicesLocalFlatten4D,
};
-/// Defines a 2d pooling operation.
+/// This class defines parameters for a 2d pooling operation.
+///
+/// Use this descriptor with the following methods:
+/// ``MPSGraph/maxPooling2DWithSourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling2DGradientWithGradientTensor:sourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling2DGradientWithGradientTensor:indicesTensor:outputShape:descriptor:name:``,
+/// ``MPSGraph/maxPooling2DGradientWithGradientTensor:indicesTensor:outputShapeTensor:descriptor:name:``,
+/// ``MPSGraph/avgPooling2DWithSourceTensor:descriptor:name:`` and
+/// ``MPSGraph/avgPooling2DGradientWithGradientTensor:sourceTensor:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraphPooling2DOpDescriptor : MPSGraphObject<NSCopying>
-/// Defines the pooling window size for X (Width) dimension.
+/// Defines the pooling window size for the X (Width) dimension.
@property (readwrite, nonatomic) NSUInteger kernelWidth;
-/// Defines the pooling window size for Y (Height) dimension.
+/// Defines the pooling window size for the Y (Height) dimension.
@property (readwrite, nonatomic) NSUInteger kernelHeight;
-/// Defines stride for X (Width) dimension. Default value: 1.
+/// Defines the stride for the X (Width) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger strideInX;
-/// Defines stride for Y (Height) dimension. Default value: 1.
+/// Defines the stride for the Y (Height) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger strideInY;
-/// Defines dilation rate for X (Width) dimension. Default value: 1.
+/// Defines the dilation rate for the X (Width) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInX;
-/// Defines dilation rate for Y (Height) dimension. Default value: 1.
+/// Defines the dilation rate for the Y (Height) dimension. Default value: 1.
@property (readwrite, nonatomic) NSUInteger dilationRateInY;
-/// Defines explicit padding value for X (Width) dimension to add before the data. Default value: 0.
+/// Defines the explicit padding value for the X (Width) dimension to add before the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingLeft;
-/// Defines explicit padding value for X (Width) dimension to add after the data. Default value: 0.
+/// Defines the explicit padding value for theX (Width) dimension to add after the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingRight;
-/// Defines explicit padding value for Y (Height) dimension to add before the data. Default value: 0.
+/// Defines the explicit padding value for the Y (Height) dimension to add before the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingTop;
-/// Defines explicit padding value for Y (Height) dimension to add after the data. Default value: 0.
+/// Defines the explicit padding value for the Y (Height) dimension to add after the data. Default value: 0.
@property (readwrite, nonatomic) NSUInteger paddingBottom;
-/// Defines what kind of padding to apply to operation.
-/// Default value: ``MPSGraphPaddingStyleExplicit``.
+/// Defines what kind of padding MPSGraph applies to the operation.
+/// Default value: `MPSGraphPaddingStyleExplicit`.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
/// Defines the data layout of the input data (in forward pass). See: ``MPSGraphTensorNamedDataLayout``.
@property (readwrite, nonatomic) MPSGraphTensorNamedDataLayout dataLayout;
-/// Use this in conjunction with ``maxPooling2DReturnIndicesWithSourceTensor`` API.
-/// If ``returnIndicesMode = MPSGraphPoolingReturnIndicesNone`` then only the first result
-/// MPSGraph returns from ``maxPooling2DReturnIndicesWithSourceTensor`` will be valid and using the
-/// second result will assert.
-/// Default value: ``MPSGraphPoolingReturnIndicesNone``.
+/// Defines the mode for returned indices of maximum values within each pooling window.
+/// Use this in conjunction with ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:`` API.
+/// If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result
+/// MPSGraph returns from ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:``
+/// will be valid and using the second result will assert.
+/// Default value: `MPSGraphPoolingReturnIndicesNone`.
@property (readwrite, nonatomic) MPSGraphPoolingReturnIndicesMode returnIndicesMode
MPS_AVAILABLE_STARTING(macos(12.2), ios(15.3), tvos(15.3));
-/// Use this in conjunction with ``maxPooling2DReturnIndicesWithSourceTensor`` API.
-/// Currently MPSGraph supports the following datatypes: ``MPSDataTypeInt32``.
-/// Default value: ``MPSDataTypeInt32``.
+/// Defines the data type for returned indices.
+/// Use this in conjunction with ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:`` API.
+/// Currently MPSGraph supports the following datatypes: `MPSDataTypeInt32`.
+/// Default value: `MPSDataTypeInt32`.
@property (readwrite, nonatomic) MPSDataType returnIndicesDataType
MPS_AVAILABLE_STARTING(macos(12.2), ios(15.3), tvos(15.3));
-/// Affects how MPSGraph computes the output size: if set to ``YES`` then output size is
+/// Affects how MPSGraph computes the output size: if set to `YES` then output size is
/// computed by rounding up instead of down when dividing input size by stride.
-/// Default value: ``NO``.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL ceilMode MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// For average pooling use a mode where samples outside the input tensor count as
+/// Defines for average pooling a mode where samples outside the input tensor count as
/// zeroes in the average computation. Otherwise the result is sum over samples divided by
/// number of samples that didn't come from padding.
-/// Default value: ``NO``.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL includeZeroPadToAverage MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
/// Creates a 2d pooling descriptor with given values.
///
/// - Parameters:
-/// - kernelWidth: See ``kernelWidth`` property.
-/// - kernelHeight: See ``kernelHeight`` property.
-/// - strideInX: See ``strideInX`` property.
-/// - strideInY: See ``strideInY`` property.
-/// - dilationRateInX: See ``dilationRateInX`` property.
-/// - dilationRateInY: See ``dilationRateInY`` property.
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
-/// - dataLayout: See ``dataLayout`` property.
+/// - kernelWidth: See `kernelWidth` property.
+/// - kernelHeight: See `kernelHeight` property.
+/// - strideInX: See `strideInX` property.
+/// - strideInY: See `strideInY` property.
+/// - dilationRateInX: See `dilationRateInX` property.
+/// - dilationRateInY: See `dilationRateInY` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
+/// - paddingStyle: See `paddingStyle` property.
+/// - dataLayout: See `dataLayout` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelWidth:(NSUInteger) kernelWidth
kernelHeight:(NSUInteger) kernelHeight
@@ -127,12 +138,12 @@
/// Creates a 2d pooling descriptor with given values.
///
/// - Parameters:
-/// - kernelWidth: See ``kernelWidth`` property.
-/// - kernelHeight: See ``kernelHeight`` property.
-/// - strideInX: See ``strideInX`` property.
-/// - strideInY: See ``strideInY`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
-/// - dataLayout: See ``dataLayout`` property.
+/// - kernelWidth: See `kernelWidth` property.
+/// - kernelHeight: See `kernelHeight`` property.
+/// - strideInX: See `strideInX` property.
+/// - strideInY: See `strideInY` property.
+/// - paddingStyle: See `paddingStyle` property.
+/// - dataLayout: See `dataLayout` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelWidth:(NSUInteger) kernelWidth
kernelHeight:(NSUInteger) kernelHeight
@@ -141,13 +152,13 @@
paddingStyle:(MPSGraphPaddingStyle) paddingStyle
dataLayout:(MPSGraphTensorNamedDataLayout) dataLayout;
-/// Sets the explicit padding values and sets ``paddingStyle`` to ``MPSGraphPaddingStyleExplicit``.
+/// Sets the explicit padding values and sets `paddingStyle` to `MPSGraphPaddingStyleExplicit`.
///
/// - Parameters:
-/// - paddingLeft: See ``paddingLeft`` property.
-/// - paddingRight: See ``paddingRight`` property.
-/// - paddingTop: See ``paddingTop`` property.
-/// - paddingBottom: See ``paddingBottom`` property.
+/// - paddingLeft: See `paddingLeft` property.
+/// - paddingRight: See `paddingRight` property.
+/// - paddingTop: See `paddingTop` property.
+/// - paddingBottom: See `paddingBottom` property.
-(void) setExplicitPaddingWithPaddingLeft:(NSUInteger) paddingLeft
paddingRight:(NSUInteger) paddingRight
paddingTop:(NSUInteger) paddingTop
@@ -155,7 +166,18 @@
@end
-/// Defines a 4d pooling operation.
+/// This class defines parameters for a 4d pooling operation.
+///
+/// Use this descriptor with the following methods:
+/// ``MPSGraph/maxPooling4DWithSourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:``,
+/// ``MPSGraph/maxPooling4DGradientWithGradientTensor:indicesTensor:outputShape:descriptor:name:``,
+/// ``MPSGraph/maxPooling4DGradientWithGradientTensor:indicesTensor:outputShapeTensor:descriptor:name:``,
+/// ``MPSGraph/avgPooling4DWithSourceTensor:descriptor:name:``,
+/// ``MPSGraph/avgPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:``,
+/// ``MPSGraph/L2NormPooling4DWithSourceTensor:descriptor:name:`` and
+/// ``MPSGraph/L2NormPooling4DGradientWithGradientTensor:sourceTensor:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphPooling4DOpDescriptor : MPSGraphObject<NSCopying>
@@ -172,50 +194,52 @@
@property (readwrite, nonatomic, copy) NSArray<NSNumber *> * _Nonnull dilationRates;
/// Defines padding values for spatial dimensions. Must be eight numbers, two for each spatial dimension.
-/// For example ``paddingValues[0]`` defines the explicit padding
+/// For example `paddingValues[0]` defines the explicit padding
/// amount before the first spatial dimension (slowest running index of spatial dimensions),
-/// ``paddingValues[1]`` defines the padding amount after the first spatial dimension etc.
-/// Used only when ``paddingStyle = MPSGraphPaddingStyleExplicit``.
+/// `paddingValues[1]` defines the padding amount after the first spatial dimension etc.
+/// Used only when `paddingStyle = MPSGraphPaddingStyleExplicit`.
/// Default value: `@[ @0, @0, @0, @0, @0, @0, @0, @0 ]`
@property (readwrite, nonatomic, copy) NSArray<NSNumber *> * _Nonnull paddingValues;
-/// Defines what kind of padding to apply to operation.
-/// Default value: ``MPSGraphPaddingStyleExplicit``.
+/// Defines what kind of padding MPSGraph applies to the operation.
+/// Default value: `MPSGraphPaddingStyleExplicit`.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// Affects how MPSGraph computes the output size: if set to ``YES`` then output size is
+/// Affects how MPSGraph computes the output size: if set to `YES` then output size is
/// computed by rounding up instead of down when dividing input size by stride.
-/// Default value: ``NO``.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL ceilMode;
-/// For average pooling use a mode where samples outside the input tensor count as
+/// Defines for average pooling a mode where samples outside the input tensor count as
/// zeroes in the average computation. Otherwise the result is sum over samples divided by
/// number of samples that didn't come from padding.
-/// Default value: ``NO``.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL includeZeroPadToAverage;
-/// Use this in conjunction with ``maxPooling4DReturnIndicesWithSourceTensor`` API.
-/// If ``returnIndicesMode = MPSGraphPoolingReturnIndicesNone`` then only the first result
-/// MPSGraph returns from ``maxPooling4DReturnIndicesWithSourceTensor`` will be valid and using the
-/// second result will assert.
-/// Default value: ``MPSGraphPoolingReturnIndicesNone``.
+/// Defines the mode for returned indices of maximum values within each pooling window.
+/// Use this in conjunction with ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:`` API.
+/// If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result
+/// MPSGraph returns from ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:``
+/// will be valid and using the second result will assert.
+/// Default value: `MPSGraphPoolingReturnIndicesNone`.
@property (readwrite, nonatomic) MPSGraphPoolingReturnIndicesMode returnIndicesMode
MPS_AVAILABLE_STARTING(macos(12.2), ios(15.3), tvos(15.3));
-/// Use this in conjunction with ``maxPooling4DReturnIndicesWithSourceTensor`` API.
-/// Currently MPSGraph supports the following datatypes: ``MPSDataTypeInt32``.
-/// Default value: ``MPSDataTypeInt32``.
+/// Defines the data type for returned indices.
+/// Use this in conjunction with ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:`` API.
+/// Currently MPSGraph supports the following datatypes: `MPSDataTypeInt32`.
+/// Default value: `MPSDataTypeInt32`.
@property (readwrite, nonatomic) MPSDataType returnIndicesDataType
MPS_AVAILABLE_STARTING(macos(12.2), ios(15.3), tvos(15.3));
/// Creates a 4d pooling descriptor with given values.
///
/// - Parameters:
-/// - kernelSizes: See ``kernelSizes`` property.
-/// - strides: See ``strides`` property.
-/// - dilationRates: See ``dilationRates`` property.
-/// - paddingValues: See ``paddingValues`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
+/// - kernelSizes: See `kernelSizes` property.
+/// - strides: See `strides` property.
+/// - dilationRates: See `dilationRates` property.
+/// - paddingValues: See `paddingValues` property.
+/// - paddingStyle: See `paddingStyle` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelSizes:(NSArray<NSNumber *> * _Nonnull) kernelSizes
strides:(NSArray<NSNumber *> * _Nonnull) strides
@@ -226,8 +250,8 @@
/// Creates a 4d pooling descriptor with default values.
///
/// - Parameters:
-/// - kernelSizes: See ``kernelSizes`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
+/// - kernelSizes: See `kernelSizes` property.
+/// - paddingStyle: See `paddingStyle` property.
/// - Returns: The descriptor on autoreleasepool.
+(nullable instancetype) descriptorWithKernelSizes:(NSArray<NSNumber *> * _Nonnull) kernelSizes
paddingStyle:(MPSGraphPaddingStyle) paddingStyle;
@@ -240,8 +264,8 @@
/// Creates a 2d max-pooling operation and returns the result tensor.
///
/// - Parameters:
-/// - source: 2d Image source as tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - source: A 2d Image source as tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) maxPooling2DWithSourceTensor:(MPSGraphTensor *) source
@@ -250,16 +274,16 @@
/// Creates a 2d max-pooling operation and returns the result tensor and the corresponding indices tensor.
///
-/// In order to compute the indices, ``returnIndicesMode`` of the descriptor must be set. The datatype of indices tensor can be set
-/// using ``returnIndicesDataType``.
-/// If ``returnIndicesMode = MPSGraphPoolingReturnIndicesNone`` then only the first result
+/// In order to compute the indices, `returnIndicesMode` of the descriptor must be set. The datatype of indices tensor can be set
+/// using `returnIndicesDataType`.
+/// If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result
/// MPSGraph returns will be valid and using the second result will assert.
///
/// - Parameters:
-/// - source: 2d Image source as tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - source: A 2d Image source as tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
-/// - Returns: NSArray of 2 MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices
+/// - Returns: An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices
-(NSArray<MPSGraphTensor *> *) maxPooling2DReturnIndicesWithSourceTensor:(MPSGraphTensor *) source
descriptor:(MPSGraphPooling2DOpDescriptor *) descriptor
name:(NSString * _Nullable) name
@@ -269,9 +293,9 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - source: Input tensor for the forward pass.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - source: The input tensor for the forward pass.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) maxPooling2DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -282,13 +306,13 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// With this API MPSGraph computes the max pooling gradient efficiently by reusing the indices from the forward API instead of recomputing them.
-/// The descriptor must set ``returnIndicesMode`` and ``returnIndicesDataType`` to the same value as that set by the forward pass.
+/// The descriptor must set `returnIndicesMode` and `returnIndicesDataType` to the same value as that set by the forward pass.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - indices: Indices tensor returned from ``maxPooling2DReturnIndicesWithSourceTensor``.
-/// - outputShape: Shape of the destination gradient.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - indices: The indices tensor returned from ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:``.
+/// - outputShape: The shape of the destination gradient.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: Destination gradient tensor.
-(MPSGraphTensor *) maxPooling2DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -301,13 +325,13 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// With this API MPSGraph computes the max pooling gradient efficiently by reusing the indices from the forward API instead of recomputing them.
-/// The descriptor must set ``returnIndicesMode`` and ``returnIndicesDataType`` to the same value as that set by the forward pass.
+/// The descriptor must set `returnIndicesMode` and `returnIndicesDataType` to the same value as that set by the forward pass.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - indices: Indices tensor returned from ``maxPooling2DReturnIndicesWithSourceTensor``.
-/// - outputShape: Tensor containing the shape of the destination gradient.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - indices: The indices tensor returned from ``MPSGraph/maxPooling2DReturnIndicesWithSourceTensor:descriptor:name:``.
+/// - outputShape: A tensor containing the shape of the destination gradient.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: Destination gradient tensor.
-(MPSGraphTensor *) maxPooling2DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -320,8 +344,8 @@
/// Creates a 2d average-pooling operation and returns the result tensor.
///
/// - Parameters:
-/// - source: 2d Image source as tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - source: A 2d Image source as tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) avgPooling2DWithSourceTensor:(MPSGraphTensor *) source
@@ -331,9 +355,9 @@
/// Creates a 2d average pooling gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - source: Input tensor for the forward pass.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: A 2d input gradient tensor - must be of rank=4. The layout is defined by `descriptor.dataLayout`.
+/// - source: The input tensor for the forward pass.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) avgPooling2DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -344,8 +368,8 @@
/// Creates a 4d max-pooling operation and returns the result tensor.
///
/// - Parameters:
-/// - source: Image source as tensor.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - source: A source tensor.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) maxPooling4DWithSourceTensor:(MPSGraphTensor *) source
@@ -356,16 +380,16 @@
/// Creates a 4d max-pooling operation and returns the result tensor and the corresponding indices tensor.
///
-/// In order to compute the indices, ``returnIndicesMode`` of the descriptor must be set. The datatype of indices tensor can be set
-/// using ``returnIndicesDataType``.
-/// If ``returnIndicesMode = MPSGraphPoolingReturnIndicesNone`` then only the first result
+/// In order to compute the indices, `returnIndicesMode` of the descriptor must be set. The datatype of indices tensor can be set
+/// using `returnIndicesDataType`.
+/// If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result
/// MPSGraph returns will be valid and using the second result will assert.
///
/// - Parameters:
-/// - source: Source tensor on which pooling will be performed.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - source: The source tensor on which pooling will be performed.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
-/// - Returns: NSArray of 2 MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices.
+/// - Returns: An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices.
-(NSArray<MPSGraphTensor *> *) maxPooling4DReturnIndicesWithSourceTensor:(MPSGraphTensor *) source
descriptor:(MPSGraphPooling4DOpDescriptor *) descriptor
name:(NSString * _Nullable) name
@@ -375,9 +399,9 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - gradient: Input gradient tensor.
-/// - source: Input tensor for the forward pass.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - gradient: An input gradient tensor.
+/// - source: The input tensor for the forward pass.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) maxPooling4DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -390,13 +414,13 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// With this API MPSGraph computes the max pooling gradient efficiently by reusing the indices from the forward API instead of recomputing them.
-/// The descriptor must set ``returnIndicesMode`` and ``returnIndicesDataType`` to the same value as that set by the forward pass.
+/// The descriptor must set `returnIndicesMode` and `returnIndicesDataType` to the same value as that set by the forward pass.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - indices: Indices tensor returned from ``maxPooling2DReturnIndicesWithSourceTensor``.
-/// - outputShape: Shape of the destination gradient.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: An input gradient tensor.
+/// - indices: Indices tensor returned from ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:``.
+/// - outputShape: The shape of the destination gradient.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: Destination gradient tensor.
-(MPSGraphTensor *) maxPooling4DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -409,13 +433,13 @@
/// Creates a max pooling gradient operation and returns the result tensor.
///
/// With this API MPSGraph computes the max pooling gradient efficiently by reusing the indices from the forward API instead of recomputing them.
-/// The descriptor must set ``returnIndicesMode`` and ``returnIndicesDataType`` to the same value as that set by the forward pass.
+/// The descriptor must set `returnIndicesMode` and `returnIndicesDataType` to the same value as that set by the forward pass.
///
/// - Parameters:
-/// - gradient: 2d input gradient tensor - must be of rank=4. The layout is defined by ``descriptor.dataLayout``.
-/// - indices: Indices tensor returned from ``maxPooling2DReturnIndicesWithSourceTensor``.
-/// - outputShape: Tensor containing the shape of the destination gradient.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates, paddings and layouts.
+/// - gradient: An input gradient tensor.
+/// - indices: The indices tensor returned from ``MPSGraph/maxPooling4DReturnIndicesWithSourceTensor:descriptor:name:``.
+/// - outputShape: A tensor containing the shape of the destination gradient.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
/// - name: The name for the operation.
/// - Returns: Destination gradient tensor.
-(MPSGraphTensor *) maxPooling4DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -428,8 +452,8 @@
/// Creates a 4d average pooling operation and returns the result tensor.
///
/// - Parameters:
-/// - source: Image source as tensor.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - source: A source tensor.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) avgPooling4DWithSourceTensor:(MPSGraphTensor *) source
@@ -441,9 +465,9 @@
/// Creates an average pooling gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - gradient: Input gradient tensor.
-/// - source: Input tensor for the forward pass.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - gradient: An input gradient tensor.
+/// - source: The input tensor for the forward pass.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) avgPooling4DGradientWithGradientTensor:(MPSGraphTensor *) gradient
@@ -456,8 +480,8 @@
/// Creates a 4d L2-Norm pooling operation and returns the result tensor.
///
/// - Parameters:
-/// - source: Image source as tensor.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - source: A source tensor.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) L2NormPooling4DWithSourceTensor:(MPSGraphTensor *) source
@@ -469,9 +493,9 @@
/// Creates a L2-Norm pooling gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - gradient: Input gradient tensor.
-/// - source: Input tensor for the forward pass.
-/// - descriptor: Specifies pooling window sizes, strides, dilation rates and paddings.
+/// - gradient: An input gradient tensor.
+/// - source: The input tensor for the forward pass.
+/// - descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates and paddings.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) L2NormPooling4DGradientWithGradientTensor:(MPSGraphTensor *) gradient
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphQuantizationOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphQuantizationOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphQuantizationOps.h 2023-05-13 17:15:31
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphQuantizationOps.h 2023-07-14 00:00:19
@@ -2,7 +2,7 @@
// MPSGraphQuantizationOps.h
// MPSGraphQuantizationOps
//
-// Created by stevenlariau on 9/30/21.
+// Created on 9/30/21.
// Copyright © 2021 Apple Inc. All rights reserved.
//
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRNNOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRNNOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRNNOps.h 2023-06-23 14:22:37
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRNNOps.h 2023-07-13 23:25:37
@@ -2,7 +2,7 @@
// MPSGraphRNNOps.h
// MPSGraphRNNOps
//
-// Created by trantalaiho on 9/29/21.
+// Created on 9/29/21.
// Copyright © 2021 Apple Inc. All rights reserved.
//
@@ -14,42 +14,57 @@
NS_ASSUME_NONNULL_BEGIN
-/// Activation modes for RNN ops.
+/// The activation modes for RNN operations.
typedef NS_ENUM(NSUInteger, MPSGraphRNNActivation)
{
- /// Pass through activation.
+ /// Defines a pass through activation.
MPSGraphRNNActivationNone MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(none) = 0L,
- /// ReLU activation.
+ /// Defines a ReLU activation.
MPSGraphRNNActivationRelu MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)),
- /// Tanh activation.
+ /// Defines a Tanh activation.
MPSGraphRNNActivationTanh MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)),
- /// Sigmoid activation.
+ /// Defines a Sigmoid activation.
MPSGraphRNNActivationSigmoid MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)),
- /// Hard sigmoid activation.
+ /// Defines a Hard sigmoid activation.
MPSGraphRNNActivationHardSigmoid MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)),
};
-/// Defines a single gate (vanilla) RNN operation.
+/// This class defines parameters for a single gate (vanilla) RNN operation.
+///
+/// Use this descriptor with the following ``MPSGraph`` methods:
+/// - ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:initState:descriptor:name:``,
+/// - ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``,
+/// - ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``,
+/// - ``MPSGraph/singleGateRNNGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:initState:descriptor:name:``,
+/// - ``MPSGraph/singleGateRNNGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:inputWeight:bias:initState:descriptor:name:``,
+/// - ``MPSGraph/singleGateRNNGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:inputWeight:bias:initState:mask:descriptor:name:``,
+/// and
+/// - ``MPSGraph/singleGateRNNGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:stateGradient:inputWeight:bias:initState:mask:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))
@interface MPSGraphSingleGateRNNDescriptor : MPSGraphObject<NSCopying>
-/// If set then the input sequence is passed in reverse time order to the layer.
-/// Note: Ignored when ``bidirectional = YES``.
-/// Default value: ``NO``.
+/// A parameter that defines time direction of the input sequence.
+///
+/// If set to `YES` then the input sequence is passed in reverse time order to the layer.
+/// Note: Ignored when `bidirectional = YES`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL reverse;
-/// If set then the input sequence is traversed in both directions and the two results
-/// are concatenated together on the channel-axis.
-/// Default value: ``NO``.
+/// A parameter that defines a bidirectional RNN layer.
+///
+/// If set to `YES` then the input sequence is traversed in both directions and the two results
+/// are concatenated together on the channel-axis.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL bidirectional;
-
-/// If set then the layer will produce training state tensor as a secondary output.
-/// Default value: ``NO``.
+/// A parameter that makes the RNN layer support training.
+///
+/// If set to `YES` then the layer will produce training state tensor as a secondary output.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL training;
-/// Activation function to use with the RNN op.
-/// Default value: ``MPSGraphRNNActivationRelu``.
+/// A parameter which defines the activation function to use with the RNN operation.
+/// Default value: `MPSGraphRNNActivationRelu`.
@property (readwrite, nonatomic) MPSGraphRNNActivation activation;
/// Creates a single gate RNN descriptor with default values.
@@ -57,50 +72,69 @@
@end
-/// Defines a Long Short Term Memory (LSTM) operation.
+/// This class defines parameters for a Long Short Term Memory (LSTM) operation.
+///
+/// Use this descriptor with the following ``MPSGraph`` methods:
+/// - ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:initState:initCell:descriptor:name:``,
+/// - ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``,
+/// - ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``,
+/// - ``MPSGraph/LSTMGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:cellOutputFwd:descriptor:name:``,
+/// - ``MPSGraph/LSTMGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:cellOutputFwd:inputWeight:bias:initState:initCell:descriptor:name:``,
+/// - ``MPSGraph/LSTMGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:cellOutputFwd:inputWeight:bias:initState:initCell:mask:descriptor:name:`` and
+/// - ``MPSGraph/LSTMGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:cellOutputFwd:stateGradient:cellGradient:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))
@interface MPSGraphLSTMDescriptor : MPSGraphObject<NSCopying>
-/// If set then the input sequence is passed in reverse time order to the layer.
-/// Note: Ignored when ``bidirectional = YES``.
-/// Default value: ``NO``.
+/// A parameter that defines time direction of the input sequence.
+///
+/// If set to `YES` then the input sequence is passed in reverse time order to the layer.
+/// Note: Ignored when `bidirectional = YES`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL reverse;
-/// If set then the input sequence is traversed in both directions and the two results
-/// are concatenated together on the channel-axis.
-/// Default value: ``NO``.
+/// A parameter that defines a bidirectional LSTM layer.
+///
+/// If set to `YES` then the input sequence is traversed in both directions and the two results
+/// are concatenated together on the channel-axis.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL bidirectional;
-/// If set then this layer will produce the internal cell of the LSTM unit as secondary output.
-/// Default value: ``NO``.
+/// A parameter that controls whether or not to return the output cell from the LSTM layer.
+///
+/// If set to `YES` then this layer will produce the internal cell of the LSTM unit as secondary output.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL produceCell;
-/// If set then the layer will produce training state tensor as a secondary or third output.
-/// Default value: ``NO``
+/// A parameter that makes the LSTM layer support training.
+///
+/// If set to `YES` then the layer will produce training state tensor as a secondary output.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL training;
-/// If set then the layer will use the gate-ordering `[ i, z, f, o ]` instead of default `[ i, f, z, o ]`.
-/// Default value: ``NO``
+/// A parameter that controls the internal order of the LSTM gates.
+///
+/// If set to `YES` then the layer will use the gate-ordering `[ i, z, f, o ]` instead of default `[ i, f, z, o ]`.
+/// Default value: `NO`
@property (readwrite, nonatomic) BOOL forgetGateLast;
-/// Activation function to use with the input gate of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationSigmoid``.
+/// A parameter which defines the activation function used with the input gate of the LSTM operation.
+/// Default value: `MPSGraphRNNActivationSigmoid`.
@property (readwrite, nonatomic) MPSGraphRNNActivation inputGateActivation;
-/// Activation function to use with the forget gate of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationSigmoid``.
+/// A parameter which defines the activation function used with the forget gate of the LSTM operation.
+/// Default value: `MPSGraphRNNActivationSigmoid`.
@property (readwrite, nonatomic) MPSGraphRNNActivation forgetGateActivation;
-/// Activation function to use with the cell gate of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationTanh``.
+/// A parameter which defines the activation function used with the cell gate of the LSTM operation.
+/// Default value: `MPSGraphRNNActivationTanh`.
@property (readwrite, nonatomic) MPSGraphRNNActivation cellGateActivation;
-/// Activation function to use with the output gate of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationSigmoid``.
+/// A parameter which defines the activation function used with the output gate of the LSTM operation.
+/// Default value: `MPSGraphRNNActivationSigmoid`.
@property (readwrite, nonatomic) MPSGraphRNNActivation outputGateActivation;
-/// Activation function to use with the current cell value of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationTanh``.
+/// A parameter which defines the activation function used with the current cell value of the LSTM operation.
+/// Default value: `MPSGraphRNNActivationTanh`.
@property (readwrite, nonatomic) MPSGraphRNNActivation activation;
/// Creates an LSTM descriptor with default values.
@@ -108,48 +142,68 @@
@end
-/// Defines a Gated Recurrent Unit (GRU) operation.
+/// This class defines parameters for a Gated Recurrent Unit (GRU) operation.
+///
+/// Use this descriptor with the following ``MPSGraph`` methods:
+/// - ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:descriptor:name:``,
+/// - ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``,
+/// - ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:``,
+/// - ``MPSGraph/GRUGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:outputFwd:inputWeight:bias:descriptor:name:``,
+/// - ``MPSGraph/GRUGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:outputFwd:inputWeight:bias:initState:descriptor:name:`` and
+/// - ``MPSGraph/GRUGradientsWithSourceTensor:recurrentWeight:sourceGradient:zState:outputFwd:stateGradient:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0))
@interface MPSGraphGRUDescriptor : MPSGraphObject<NSCopying>
-/// If set then the input sequence is passed in reverse time order to the layer.
-/// Note: Ignored when ``bidirectional = YES``.
-/// Default value: ``NO``.
+/// A parameter that defines time direction of the input sequence.
+///
+/// If set to `YES` then the input sequence is passed in reverse time order to the layer.
+/// Note: Ignored when `bidirectional = YES`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL reverse;
-/// If set then the input sequence is traversed in both directions and the two results
-/// are concatenated together on the channel-axis.
-/// Default value: ``NO``.
+/// A parameter that defines a bidirectional GRU layer.
+///
+/// If set to `YES` then the input sequence is traversed in both directions and the two results
+/// are concatenated together on the channel-axis.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL bidirectional;
-/// If set then the layer will produce training state tensor as a secondary or third output.
-/// Default value: ``NO``.
+/// A parameter that makes the GRU layer support training.
+///
+/// If set to `YES` then the layer will produce training state tensor as a secondary output.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL training;
-/// If set then the layer will use the gate-ordering `[ r, z, o ]` instead of default `[ z, r, o ]`.
-/// Default value: ``NO``.
+/// A parameter that controls the internal order of the GRU gates.
+///
+/// If set to `YES` then the layer will use the gate-ordering `[ r, z, o ]` instead of default `[ z, r, o ]`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL resetGateFirst;
-/// If set then the layer will compute the intermediate value as `c[t] = ( b + (h[t-1] m ) R^T) r[t]`.
-/// Otherwise it's computed as `c[t] = (h[t-1] r[t] m) R^T`.
-/// Default value: ``NO``.
+/// A parameter that chooses between two variants for the reset gate computation.
+///
+/// If set to `YES` then the layer will compute the intermediate value as `c[t] = ( b + (h[t-1] m ) R^T) r[t]`.
+/// Otherwise it's computed as `c[t] = (h[t-1] r[t] m) R^T`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL resetAfter;
-/// If set then the layer will compute the final value as `h[t] = z[t] h[t-1] + (1-z[t]) o[t]`.
-/// Otherwise it's computed as `h[t] = (1-z[t]) h[t-1] + z[t] o[t]`.
-/// Default value: ``NO``.
+/// A parameter that chooses between two variants for the final output computation.
+///
+/// If set to `YES` then the layer will compute the final value as `h[t] = z[t] h[t-1] + (1-z[t]) o[t]`.
+/// Otherwise it's computed as `h[t] = (1-z[t]) h[t-1] + z[t] o[t]`.
+/// Default value: `NO`.
@property (readwrite, nonatomic) BOOL flipZ;
-/// Activation function to use with the z-gate of the GRU op.
-/// Default value: ``MPSGraphRNNActivationSigmoid``.
+/// A parameter which defines the activation function to use with the z-gate of the GRU op.
+/// Default value: `MPSGraphRNNActivationSigmoid`.
@property (readwrite, nonatomic) MPSGraphRNNActivation updateGateActivation;
-/// Activation function to use with the r-gate of the GRU op.
-/// Default value: ``MPSGraphRNNActivationSigmoid``.
+/// A parameter which defines the activation function to use with the r-gate of the GRU op.
+/// Default value: `MPSGraphRNNActivationSigmoid`.
@property (readwrite, nonatomic) MPSGraphRNNActivation resetGateActivation;
-/// Activation function to use with the o-gate of the LSTM op.
-/// Default value: ``MPSGraphRNNActivationTanh``.
+/// A parameter which defines the activation function to use with the o-gate of the GRU op.
+/// Default value: `MPSGraphRNNActivationTanh`.
@property (readwrite, nonatomic) MPSGraphRNNActivation outputGateActivation;
/// Creates an GRU descriptor with default values.
@@ -160,7 +214,7 @@
MPS_CLASS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))
@interface MPSGraph(MPSGraphRNNOps)
-/// Creates a single-gate RNN operation and returns the value and optionally training state tensor.
+/// Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
///
/// This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
/// ```md
@@ -168,21 +222,23 @@
/// z[t] = x[t] W^T + (h[t-1]m) R^T + b
/// h[t] = activation( z[t] ), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
/// See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO``
-/// then the layout is [T,N,H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [2H,I] and otherwise it is [H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [2H] and otherwise it is [H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. This is useful for dropout support.
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of ``descriptor.training``. The layout of the both outputs are [T,N,H] or [T,N,2H] for bidirectional.
+/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of `descriptor.training`. The layout of the both outputs is [T,N,H] or [T,N,2H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) singleGateRNNWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
inputWeight:(MPSGraphTensor * _Nullable) inputWeight
@@ -202,19 +258,22 @@
/// z[t] = x[t] W^T + (h[t-1]m) R^T + b
/// h[t] = activation( z[t] ), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
/// See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [2H,I] and otherwise it is [H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [2H] and otherwise it is [H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of ``descriptor.training``. The layout of the both outputs are [T,N,H] or [T,N,2H] for bidirectional.
+/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of `descriptor.training`. The layout of the both outputs is [T,N,H] or [T,N,2H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) singleGateRNNWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
inputWeight:(MPSGraphTensor * _Nullable) inputWeight
@@ -233,17 +292,19 @@
/// z[t] = x[t] W^T + (h[t-1]m) R^T + b
/// h[t] = activation( z[t] ), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
/// See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of ``descriptor.training``. The layout of the both outputs are [T,N,H] or [T,N,2H] for bidirectional.
+/// - Returns: A valid MPSGraphTensor array of size 1 or 2, depending on value of `descriptor.training`. The layout of the both outputs is [T,N,H] or [T,N,2H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) singleGateRNNWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
initState:(MPSGraphTensor * _Nullable) initState
@@ -254,21 +315,30 @@
/// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case `inputWeight = nil` and ``bidirectional = NO`` then the layout is [T,N,H] and for `inputWeight = nil` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H]. Note: For ``bidirectional`` this tensor must have a static shape.
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``singleGateRNNWithSourceTensor`` with ``descriptor.training = true``.
-/// - stateGradient: Input gradient coming from the future timestep - optional, if missing assumes zeroes.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// Note: For `bidirectional` this tensor must have a static shape.
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - stateGradient: The input gradient coming from the future timestep - optional, if missing the operation assumes zeroes.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [2H,I] and otherwise it is [H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [2H] and otherwise it is [H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. This is useful for dropout support.
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is `nil`, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias` and finally for `initState`.
-(NSArray<MPSGraphTensor *> *) singleGateRNNGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -285,20 +355,29 @@
/// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case `inputWeight = nil` and ``bidirectional = NO`` then the layout is [T,N,H] and for `inputWeight = nil` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H]. Note: For ``bidirectional`` this tensor must have a static shape.
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``singleGateRNNWithSourceTensor`` with ``descriptor.training = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// Note: For `bidirectional` this tensor must have a static shape.
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [2H,I] and otherwise it is [H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [2H] and otherwise it is [H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. This is useful for dropout support.
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is `nil`, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias` and finally for `initState`.
-(NSArray<MPSGraphTensor *> *) singleGateRNNGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -314,19 +393,28 @@
/// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case `inputWeight = nil` and ``bidirectional = NO`` then the layout is [T,N,H] and for `inputWeight = nil` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H]. Note: For ``bidirectional`` this tensor must have a static shape.
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``singleGateRNNWithSourceTensor`` with ``descriptor.training = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// Note: For `bidirectional` this tensor must have a static shape.
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [2H,I] and otherwise it is [H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [2H] and otherwise it is [H].
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is `nil`, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias` and finally for `initState`.
-(NSArray<MPSGraphTensor *> *) singleGateRNNGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -341,19 +429,25 @@
/// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case `inputWeight = nil` and ``bidirectional = NO`` then the layout is [T,N,H] and for `inputWeight = nil` and ``bidirectional = YES`` the layout is [T,N,2H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,H,H] and otherwise it is [H,H]. Note: For ``bidirectional`` this tensor must have a static shape.
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``singleGateRNNWithSourceTensor`` with ``descriptor.training = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [2H,I] and otherwise it is [H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [2H] and otherwise it is [H].
-/// - initState: Initial internal state of the RNN `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The RNN op definition.
+/// - source: A tensor that contains the source data `x[t]` with the data layout [T,N,I].
+/// In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,H] and
+/// for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,2H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,H,H] and otherwise it is [H,H].
+/// Note: For `bidirectional` this tensor must have a static shape.
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/singleGateRNNWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - initState: The initial internal state of the RNN `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the RNN operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is `nil`, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias` and finally for `initState`.
-(NSArray<MPSGraphTensor *> *) singleGateRNNGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -374,24 +468,26 @@
/// c[t] = f[t]c[t-1] + i[t]z[t]
/// h[t] = o[t]g(c[t]), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `c[t]` is the second output (optional),
-/// `z[t]` is either the second or third output (optional), `h[-1]` is ``initCell``. and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `c[t]` is the second output (optional),
+/// `z[t]` is either the second or third output (optional), `h[-1]` is `initCell`. and `h[-1]` is `initState`.
/// `p` is an optional peephole vector.
-/// See ``MPSGraphLSTMDescriptor`` for different ``activation`` options for `f()` and `g()`.
+/// See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - peephole: Tensor containing the peephole vector `v` - optional, if missing assumes zeroes. Shape is [4H], ie. a vector for each gate, or [2,4H] for bidirectional.
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix. For `bidirectional` the layout is [8H,I] and otherwise it is [4H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [8H] and otherwise it is [4H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. Useful for dropout.
+/// - peephole: A tensor containing the peephole vector `v` - optional, if missing the operation assumes zeroes. Shape is [4H], ie. a vector for each gate, or [2,4H] for bidirectional.
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 or 3, depending on values of ``descriptor.produceCell`` and ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 or 3, depending on values of `descriptor.produceCell` and `descriptor.training`.
/// The layout of the both state and cell outputs are [T,N,H] or [T,N,2H] for bidirectional, and the layout of the trainingState output is [T,N,4H] or [T,N,8H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) LSTMWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
@@ -416,22 +512,24 @@
/// c[t] = f[t]c[t-1] + i[t]z[t]
/// h[t] = o[t]g(c[t]), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `c[t]` is the second output (optional),
-/// `z[t]` is either the second or third output (optional), `h[-1]` is ``initCell``. and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `c[t]` is the second output (optional),
+/// `z[t]` is either the second or third output (optional), `h[-1]` is `initCell`. and `h[-1]` is `initState`.
/// `p` is an optional peephole vector.
-/// See ``MPSGraphLSTMDescriptor`` for different ``activation`` options for `f()` and `g()`.
+/// See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix. For `bidirectional` the layout is [8H,I] and otherwise it is [4H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [8H] and otherwise it is [4H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 or 3, depending on values of ``descriptor.produceCell`` and ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 or 3, depending on values of `descriptor.produceCell` and `descriptor.training`.
/// The layout of the both state and cell outputs are [T,N,H] or [T,N,2H] for bidirectional, and the layout of the trainingState output is [T,N,4H] or [T,N,8H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) LSTMWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
@@ -454,20 +552,22 @@
/// c[t] = f[t]c[t-1] + i[t]z[t]
/// h[t] = o[t]g(c[t]), where
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `c[t]` is the second output (optional),
-/// `z[t]` is either the second or third output (optional), `h[-1]` is ``initCell``. and `h[-1]` is ``initState``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `c[t]` is the second output (optional),
+/// `z[t]` is either the second or third output (optional), `h[-1]` is `initCell`. and `h[-1]` is `initState`.
/// `p` is an optional peephole vector.
-/// See ``MPSGraphLSTMDescriptor`` for different ``activation`` options for `f()` and `g()`.
+/// See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 or 3, depending on values of ``descriptor.produceCell`` and ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 or 3, depending on values of `descriptor.produceCell` and `descriptor.training`.
/// The layout of the both state and cell outputs are [T,N,H] or [T,N,2H] for bidirectional, and the layout of the trainingState output is [T,N,4H] or [T,N,8H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) LSTMWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
@@ -480,25 +580,34 @@
/// Creates an LSTM gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The third output of ``LSTMWithSourceTensor`` with ``descriptor.training = true``.
-/// - cellOutputFwd: The second output of ``LSTMWithSourceTensor`` with ``descriptor.training = true`` or ``descriptor.produceCell = true``.
-/// - stateGradient: Input gradient for state coming from the future timestep - optional, if missing assumes zeroes.
-/// - cellGradient: Input gradient for cell coming from the future timestep - optional, if missing assumes zeroes.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - peephole: Tensor containing the peephole vector `v` - optional, if missing assumes zeroes. Shape is [8H], ie. a vector for each gate.
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The third output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - cellOutputFwd: The second output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES` or `descriptor.produceCell = YES`.
+/// - stateGradient: The input gradient for state coming from the future timestep - optional, if missing the operation assumes zeroes.
+/// - cellGradient: Input gradient for cell coming from the future timestep - optional, if missing the operation assumes zeroes.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix. For `bidirectional` the layout is [8H,I] and otherwise it is [4H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [8H] and otherwise it is [4H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. Useful for dropout.
+/// - peephole: A tensor containing the peephole vector `v` - optional, if missing the operation assumes zeroes. Shape is [4H], ie. a vector for each gate, or [2,4H] for bidirectional.
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for peephole, for initState and for initCell.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is nil, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias`, for `peephole`, for `initState` and for `initCell`.
-(NSArray<MPSGraphTensor *> *) LSTMGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -519,22 +628,31 @@
/// Creates an LSTM gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The third output of ``LSTMWithSourceTensor`` with ``descriptor.training = true``.
-/// - cellOutputFwd: The second output of ``LSTMWithSourceTensor`` with ``descriptor.training = true`` or ``descriptor.produceCell = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The third output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - cellOutputFwd: The second output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES` or `descriptor.produceCell = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix. For `bidirectional` the layout is [8H,I] and otherwise it is [4H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [8H] and otherwise it is [4H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. Useful for dropout.
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState and for initCell.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias`, for `peephole`, for `initState` and for `initCell`.
-(NSArray<MPSGraphTensor *> *) LSTMGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -552,21 +670,30 @@
/// Creates an LSTM gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The third output of ``LSTMWithSourceTensor`` with ``descriptor.training = true``.
-/// - cellOutputFwd: The second output of ``LSTMWithSourceTensor`` with ``descriptor.training = true`` or ``descriptor.produceCell = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The third output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - cellOutputFwd: The second output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES` or `descriptor.produceCell = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix. For `bidirectional` the layout is [8H,I] and otherwise it is [4H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [8H] and otherwise it is [4H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - initCell: The initial internal cell of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes.
+/// For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState and for initCell.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias`, for `initState` and for `initCell`.
-(NSArray<MPSGraphTensor *> *) LSTMGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -583,21 +710,24 @@
/// Creates an LSTM gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:mask:peephole:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,4H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,8H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,4H,H] and otherwise it is [4H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The third output of ``LSTMWithSourceTensor`` with ``descriptor.training = true``.
-/// - cellOutputFwd: The second output of ``LSTMWithSourceTensor`` with ``descriptor.training = true`` or ``descriptor.produceCell = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [8H,I] and otherwise it is [4H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [8H] and otherwise it is [4H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - initCell: Initial internal cell of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The LSTM op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,4H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,8H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,4H,H] and otherwise it is [4H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The third output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - cellOutputFwd: The second output of
+/// ``MPSGraph/LSTMWithSourceTensor:recurrentWeight:inputWeight:bias:initState:initCell:descriptor:name:``
+/// with `descriptor.training = YES` or `descriptor.produceCell = YES`.
+/// - descriptor: A descriptor that defines the parameters for the LSTM operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for ``sourceGradient`` and ``mask``.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState and for initCell.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias`, for `initState` and for `initCell`.
-(NSArray<MPSGraphTensor *> *) LSTMGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -608,7 +738,7 @@
MPS_SWIFT_NAME( LSTMGradients(_:recurrentWeight:sourceGradient:zState:cellOutputFwd:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates a GRU operation and return the value and optionally the training state tensor.
+/// Creates a GRU operation and returns the value and optionally the training state tensor.
///
/// This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
/// ```md
@@ -619,32 +749,33 @@
/// o[t] = fo( c[t] + x[t] W^T + b )
/// h[t] = z[t]h[t-1] + (1-z[t])o[t]
/// ```
-/// If ``resetAfter = YES`` then `c[t]` is replaced by
+/// If `resetAfter = YES` then `c[t]` is replaced by
/// ```md
/// c[t] = ( (h[t-1] m) R^T + b2 ) r[t]
/// ```
-/// If ``flipZ = YES`` then `h[t]` is replaced by
+/// If `flipZ = YES` then `h[t]` is replaced by
/// ```md
/// h[t] = (1-z[t])h[t-1] + z[t]o[t].
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
-/// `b2` is an optional ``resetBias`` vector, only used when ``resetAfter = YES``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
+/// `b2` is an optional `resetBias` vector, only used when `resetAfter = YES`.
/// See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - secondaryBias: Tensor containing the secondary bias vector `b2` - optional, if missing assumes zeroes. Only used with ``reset_after = YES``. Shape is [H], ie. a vector for each gate, or [2H] for bidirectional.
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. Useful for dropout.
+/// - secondaryBias: A tensor containing the secondary bias vector `b2` - optional, if missing the operation assumes zeroes. Only used with `reset_after = YES`. Shape is [H], ie. a vector for each gate, or [2H] for bidirectional.
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 depending on value of ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 depending on value of `descriptor.training`.
/// The layout of the state output is [T,N,H] or [T,N,2H] for bidirectional,
-/// and the layout of the trainingState output is [T,N,3H] or [T,N,6H] for bidirectional.
+/// and the layout of the `trainingState` output is [T,N,3H] or [T,N,6H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) GRUWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
inputWeight:(MPSGraphTensor * _Nullable) inputWeight
@@ -657,7 +788,7 @@
MPS_SWIFT_NAME( GRU(_:recurrentWeight:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Creates a GRU operation and return the value and optionally the training state tensor.
+/// Creates a GRU operation and returns the value and optionally the training state tensor.
///
/// This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
/// ```md
@@ -668,30 +799,31 @@
/// o[t] = fo( c[t] + x[t] W^T + b )
/// h[t] = z[t]h[t-1] + (1-z[t])o[t]
/// ```
-/// If ``resetAfter = YES`` then `c[t]` is replaced by
+/// If `resetAfter = YES` then `c[t]` is replaced by
/// ```md
/// c[t] = ( (h[t-1] m) R^T + b2 ) r[t]
/// ```
-/// If ``flipZ = YES`` then `h[t]` is replaced by
+/// If `flipZ = YES` then `h[t]` is replaced by
/// ```md
/// h[t] = (1-z[t])h[t-1] + z[t]o[t].
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
-/// `b2` is an optional ``resetBias`` vector, only used when ``resetAfter = YES``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
+/// `b2` is an optional `resetBias` vector, only used when `resetAfter = YES`.
/// See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 depending on value of ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 depending on value of `descriptor.training`.
/// The layout of the state output is [T,N,H] or [T,N,2H] for bidirectional,
-/// and the layout of the trainingState output is [T,N,3H] or [T,N,6H] for bidirectional.
+/// and the layout of the `trainingState` output is [T,N,3H] or [T,N,6H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) GRUWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
inputWeight:(MPSGraphTensor * _Nullable) inputWeight
@@ -702,7 +834,7 @@
MPS_SWIFT_NAME( GRU(_:recurrentWeight:inputWeight:bias:initState:descriptor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Creates a GRU operation and return the value and optionally the training state tensor.
+/// Creates a GRU operation and returns the value and optionally the training state tensor.
///
/// This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
/// ```md
@@ -713,29 +845,30 @@
/// o[t] = fo( c[t] + x[t] W^T + b )
/// h[t] = z[t]h[t-1] + (1-z[t])o[t]
/// ```
-/// If ``resetAfter = YES`` then `c[t]` is replaced by
+/// If `resetAfter = YES` then `c[t]` is replaced by
/// ```md
/// c[t] = ( (h[t-1] m) R^T + b2 ) r[t]
/// ```
-/// If ``flipZ = YES`` then `h[t]` is replaced by
+/// If `flipZ = YES` then `h[t]` is replaced by
/// ```md
/// h[t] = (1-z[t])h[t-1] + z[t]o[t].
/// ```
-/// `W` is optional ``inputWeight``, `R` is ``recurrentWeight``, `b` is optional ``bias``, `m` is optional ``mask``,
-/// `x[t]` is ``source`` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is ``initState``.
-/// `b2` is an optional ``resetBias`` vector, only used when ``resetAfter = YES``.
+/// `W` is optional `inputWeight`, `R` is `recurrentWeight`, `b` is optional `bias`, `m` is optional `mask`,
+/// `x[t]` is `source` `h[t]` is the first output, `z[t]` is the second output (optional) and `h[-1]` is `initState`.
+/// `b2` is an optional `resetBias` vector, only used when `resetAfter = YES`.
/// See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`.
///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array of size 1 or 2 depending on value of ``descriptor.training``.
+/// - Returns: A valid `MPSGraphTensor` array of size 1 or 2 depending on value of `descriptor.training`.
/// The layout of the state output is [T,N,H] or [T,N,2H] for bidirectional,
-/// and the layout of the trainingState output is [T,N,3H] or [T,N,6H] for bidirectional.
+/// and the layout of the `trainingState` output is [T,N,3H] or [T,N,6H] for bidirectional.
-(NSArray<MPSGraphTensor *> *) GRUWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
inputWeight:(MPSGraphTensor * _Nullable) inputWeight
@@ -747,23 +880,31 @@
/// Creates a GRU gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - outputFwd: The first output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - stateGradient: Input gradient for state coming from the future timestep - optional, if missing assumes zeroes.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - mask: Tensor containing the mask `m` - optional, if missing assumes ones. Useful for dropout.
-/// - secondaryBias: Tensor containing the secondary bias vector `b2` - optional, if missing assumes zeroes. Only used with ``reset_after = YES``. Shape is [H], ie. a vector for each gate, or [2H] for bidirectional.
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - outputFwd: The first output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - stateGradient: The input gradient for state coming from the future timestep - optional, if missing the operation assumes zeroes.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - mask: A tensor containing the mask `m` - optional, if missing the operation assumes ones. Useful for dropout.
+/// - secondaryBias: A tensor containing the secondary bias vector `b2` - optional, if missing the operation assumes zeroes. Only used with `reset_after = YES`. Shape is [H], ie. a vector for each gate, or [2H] for bidirectional.
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
-/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState, for secondaryBias.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// In case an input is nil, no gradient will be returned for it.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias`, for `initState` and for `secondaryBias`.
-(NSArray<MPSGraphTensor *> *) GRUGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -782,20 +923,28 @@
/// Creates a GRU gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - outputFwd: The first output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - initState: Initial internal state of the LSTM `h[-1]` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [N,2H] and otherwise it is [N,H].
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - outputFwd: The first output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - initState: The initial internal state of the LSTM `h[-1]` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [N,2H] and otherwise it is [N,H].
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias, for initState.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight`, for `bias` and for `initState`.
-(NSArray<MPSGraphTensor *> *) GRUGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
@@ -811,19 +960,27 @@
/// Creates a GRU gradient operation and returns the gradient tensor values.
///
+/// For details of this operation and parameters, refer to documentation of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:mask:secondaryBias:descriptor:name:``.
+///
/// - Parameters:
-/// - source: Tensor containing the source data `x[t]` - shape should be [T,N,I]. In case ``inputWeight = nil`` and ``bidirectional = NO`` then the layout is [T,N,3H] and for ``inputWeight = nil`` and ``bidirectional = YES`` the layout is [T,N,6H].
-/// - recurrentWeight: Tensor containing the recurrent weights `R`. For ``bidirectional`` the layout is [2,3H,H] and otherwise it is [3H,H].
-/// - sourceGradient: Input gradient, that is gradient of a tensor wrt. to first output of the forward pass.
-/// - zState: The second output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - outputFwd: The first output of ``GRUWithSourceTensor`` with ``descriptor.training = true``.
-/// - inputWeight: Tensor containing the input weights matrix `W` - optional, if missing assumes diagonal unit-matrix. For ``bidirectional`` the layout is [6H,I] and otherwise it is [3H,I].
-/// - bias: Tensor containing the bias `b` - optional, if missing assumes zeroes. For ``bidirectional`` the layout is [6H] and otherwise it is [3H].
-/// - descriptor: The GRU op definition.
+/// - source: A tensor containing the source data `x[t]` with the data layout [T,N,I]. In case `inputWeight = nil` and `bidirectional = NO` then the layout is [T,N,3H] and for `inputWeight = nil` and `bidirectional = YES` the layout is [T,N,6H].
+/// - recurrentWeight: A tensor containing the recurrent weights `R`. For `bidirectional` the layout is [2,3H,H] and otherwise it is [3H,H].
+/// - sourceGradient: The input gradient, that is the gradient of a tensor with respect to the first output of the forward pass.
+/// - zState: The second output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - outputFwd: The first output of
+/// ``MPSGraph/GRUWithSourceTensor:recurrentWeight:inputWeight:bias:initState:descriptor:name:``
+/// with `descriptor.training = YES`.
+/// - inputWeight: A tensor containing the input weights matrix `W` - optional, if missing the operation assumes a diagonal unit-matrix.
+/// For `bidirectional` the layout is [6H,I] and otherwise it is [3H,I].
+/// - bias: A tensor containing the bias `b` - optional, if missing the operation assumes zeroes. For `bidirectional` the layout is [6H] and otherwise it is [3H].
+/// - descriptor: A descriptor that defines the parameters for the GRU operation.
/// - name: The name for the operation.
-/// - Returns: A valid MPSGraphTensor array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
+/// - Returns: A valid `MPSGraphTensor` array containing gradients for each input tensor, except for `sourceGradient` and `mask`.
/// In case an input is nil, no gradient will be returned for it.
-/// The order of the gradients will be: for source, for recurrentWeight, for inputWeight, for bias.
+/// The order of the gradients will be: for `source`, for `recurrentWeight`, for `inputWeight` and for `bias`.
-(NSArray<MPSGraphTensor *> *) GRUGradientsWithSourceTensor:(MPSGraphTensor *) source
recurrentWeight:(MPSGraphTensor *) recurrentWeight
sourceGradient:(MPSGraphTensor *) sourceGradient
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h 2023-05-13 17:15:32
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h 2023-07-14 00:00:20
@@ -2,7 +2,7 @@
// MPSGraphSortOps.h
// MPSGraph
//
-// Created by Matteo Franciolini on 6/30/22.
+// Created on 6/30/22.
// Copyright © 2022 Apple Inc. All rights reserved.
//
@@ -16,14 +16,14 @@
MPS_CLASS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@interface MPSGraph(MPSGraphSortOps)
-/// Sort the elements of the input tensor along a specified axis.
+/// Sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension over which you sort the tensor
-/// - descending: if true, reverse the sort direction
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension over which you sort the tensor
+/// - descending: If true, reverse the sort direction
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sortWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
descending:(BOOL) descending
@@ -31,14 +31,14 @@
MPS_SWIFT_NAME( sort(_:axis:descending:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Sort the elements of the input tensor along a specified axis.
+/// Sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension over which you sort the tensor
-/// - descending: if true, reverse the sort direction
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension over which you sort the tensor
+/// - descending: If true, reverse the sort direction
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sortWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
descending:(BOOL) descending
@@ -46,40 +46,40 @@
MPS_SWIFT_NAME( sort(_:axisTensor:descending:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Sort the elements of the input tensor along a specified axis.
+/// Sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension over which you sort the tensor
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axis: The tensor dimension over which you sort the tensor
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sortWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( sort(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Sort the elements of the input tensor along a specified axis.
+/// Sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension over which you sort the tensor
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension over which you sort the tensor
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sortWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( sort(_:axisTensor:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
-/// Compute the indices that sort the elements of an input tensor along a specified axis.
+/// Compute the indices that sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension over which you sort the tensor
-/// - descending: if true, reverse the sort direction
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object with 32-bit integer data type
+/// - tensor: The input tensor
+/// - axis: The tensor dimension over which you sort the tensor
+/// - descending: If true, reverse the sort direction
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object with 32-bit integer data type
-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
descending:(BOOL) descending
@@ -87,14 +87,14 @@
MPS_SWIFT_NAME( argSort(_:axis:descending:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Compute the indices that sort the elements of an input tensor along a specified axis.
+/// Compute the indices that sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension over which you sort the tensor
-/// - descending: if true, reverse the sort direction
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object with 32-bit integer data type
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension over which you sort the tensor
+/// - descending: If true, reverse the sort direction
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object with 32-bit integer data type
-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
descending:(BOOL) descending
@@ -102,26 +102,26 @@
MPS_SWIFT_NAME( argSort(_:axisTensor:descending:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Compute the indices that sort the elements of an input tensor along a specified axis.
+/// Compute the indices that sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axis: the tensor dimension over which you sort the tensor
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object with 32-bit integer data type
+/// - tensor: The input tensor
+/// - axis: The tensor dimension over which you sort the tensor
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object with 32-bit integer data type
-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
axis:(NSInteger) axis
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( argSort(_:axis:name:))
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
-/// Compute the indices that sort the elements of an input tensor along a specified axis.
+/// Compute the indices that sort the elements of the input tensor along the specified axis.
///
/// - Parameters:
-/// - tensor: input tensor
-/// - axisTensor: the tensor dimension over which you sort the tensor
-/// - name: name for the operation
-/// - Returns: a valid MPSGraphTensor object with 32-bit integer data type
+/// - tensor: The input tensor
+/// - axisTensor: The tensor dimension over which you sort the tensor
+/// - name: The name for the operation
+/// - Returns: A valid MPSGraphTensor object with 32-bit integer data type
-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
axisTensor:(MPSGraphTensor *) axisTensor
name:(NSString * _Nullable) name
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphStencilOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphStencilOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphStencilOps.h 2023-06-23 17:39:54
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphStencilOps.h 2023-07-13 23:25:37
@@ -13,50 +13,68 @@
NS_ASSUME_NONNULL_BEGIN
-/// Defines a stencil operation. Use this descriptor with ``MPSGraph/stencilWithSourceTensor:weightsTensor:descriptor:name:``.
+/// This class defines parameters for a stencil operation.
+///
+/// Use this descriptor with the following ``MPSGraph`` methods:
+/// - ``MPSGraph/stencilWithSourceTensor:weightsTensor:descriptor:name:``.
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraphStencilOpDescriptor : MPSGraphObject<NSCopying>
-/// Reduction mode to use withing the stecil window. Default value: ``MPSGraphReductionModeSum``.
+/// The reduction mode to use within the stecil window. Default value: `MPSGraphReductionModeSum`.
@property (readwrite, nonatomic) MPSGraphReductionMode reductionMode;
-/// Array of length 4 that determines from which offset to start reading the ``input``. Only used when ``paddingStyle`` is ``MPSGraphPaddingStyleExplicitOffset``.
+
+/// An array of length four that determines from which offset to start reading the `input` tensor.
+///
+/// Only used when `paddingStyle` is `MPSGraphPaddingStyleExplicitOffset`.
/// For example zero offset means that the first stencil window will align its top-left corner (in 4 dimensions) to the top-left corner of the input tensor.
/// Default value: `@[ @0, @0, @0, @0 ]`
@property (readwrite, nonatomic, copy) MPSShape * offsets;
-/// Defines strides for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
+
+/// The property that defines strides for spatial dimensions.
+///
+/// Must be four numbers, one for each spatial dimension, fastest running index last.
/// Default value: `@[ @1, @1, @1, @1 ]`
@property (readwrite, nonatomic, copy) MPSShape * strides;
-/// Defines dilation rates for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
+
+/// The property that defines dilation rates for spatial dimensions.
+///
+/// Must be four numbers, one for each spatial dimension, fastest running index last.
/// Default value: `@[ @1, @1, @1, @1 ]`
@property (readwrite, nonatomic, copy) MPSShape * dilationRates;
-/// Defines padding values for spatial dimensions. Must be eight numbers, two for each spatial dimension.
-/// For example ``paddingValues[0]`` defines the explicit padding
+
+/// The property that defines padding values for spatial dimensions.
+///
+/// Must be eight numbers, two for each spatial dimension.
+/// For example `paddingValues[0]` defines the explicit padding
/// amount before the first spatial dimension (slowest running index of spatial dimensions),
-/// ``paddingValues[1]`` defines the padding amount after the first spatial dimension etc.
-/// Used only when ``paddingStyle`` = ``MPSGraphPaddingStyleExplicit``.
+/// `paddingValues[1]` defines the padding amount after the first spatial dimension etc.
+/// Used only when `paddingStyle = MPSGraphPaddingStyleExplicit`.
/// Default value: `@[ @0, @0, @0, @0, @0, @0, @0, @0 ]`
@property (readwrite, nonatomic, copy) MPSShape * explicitPadding;
-/// Determines which values to use for padding the input tensor.
-/// Default value: ``MPSGraphPaddingModeZero``.
+
+/// The property that determines which values to use for padding the input tensor.
+/// Default value: `MPSGraphPaddingModeZero`.
@property (readwrite, nonatomic) MPSGraphPaddingMode boundaryMode;
-/// Defines what kind of padding to apply to operation.
-/// Default value: ``MPSGraphPaddingStyleExplicit``.
+
+/// The property that defines what kind of padding to apply to the stencil operation.
+/// Default value: `MPSGraphPaddingStyleExplicit`.
@property (readwrite, nonatomic) MPSGraphPaddingStyle paddingStyle;
-/// Specifies the value to pad the input tensor with when using ``boundaryMode`` = ``MPSGraphPaddingModeConstant``.
+
+/// The padding value for `boundaryMode = MPSGraphPaddingModeConstant`.
/// Default value: 0.
@property (readwrite, nonatomic) float paddingConstant;
/// Creates a stencil operation descriptor with given values.
///
/// - Parameters:
-/// - reductionMode: See ``reductionMode`` property.
-/// - offsets: See ``offsets`` property.
-/// - strides: See ``strides`` property.
-/// - dilationRates: See ``dilationRates`` property.
-/// - explicitPadding: See ``explicitPadding`` property.
-/// - boundaryMode: See ``boundaryMode`` property.
-/// - paddingStyle: See ``paddingStyle`` property.
-/// - paddingConstant: See ``paddingConstant`` property.
+/// - reductionMode: See `reductionMode` property.
+/// - offsets: See `offsets` property.
+/// - strides: See `strides` property.
+/// - dilationRates: See `dilationRates` property.
+/// - explicitPadding: See `explicitPadding` property.
+/// - boundaryMode: See `boundaryMode` property.
+/// - paddingStyle: See `paddingStyle` property.
+/// - paddingConstant: See `paddingConstant` property.
/// - Returns: A valid MPSGraphStencilOpDescriptor object
+(nullable instancetype) descriptorWithReductionMode:(MPSGraphReductionMode) reductionMode
offsets:(MPSShape *) offsets
@@ -70,8 +88,8 @@
/// Creates a stencil operation descriptor with default values.
///
/// - Parameters:
-/// - offsets: See ``offsets`` property.
-/// - explicitPadding: See ``explicitPadding`` property.
+/// - offsets: See `offsets` property.
+/// - explicitPadding: See `explicitPadding` property.
/// - Returns: A valid MPSGraphStencilOpDescriptor object
+(nullable instancetype) descriptorWithOffsets:(MPSShape *) offsets
explicitPadding:(MPSShape *) explicitPadding;
@@ -79,14 +97,14 @@
/// Creates a stencil operation descriptor with default values.
///
/// - Parameters:
-/// - explicitPadding: See ``explicitPadding`` property.
+/// - explicitPadding: See `explicitPadding` property.
/// - Returns: A valid MPSGraphStencilOpDescriptor object
+(nullable instancetype) descriptorWithExplicitPadding:(MPSShape *) explicitPadding;
/// Creates a stencil operation descriptor with default values.
///
/// - Parameters:
-/// - paddingStyle: See ``paddingStyle`` property.
+/// - paddingStyle: See `paddingStyle` property.
/// - Returns: A valid MPSGraphStencilOpDescriptor object
+(nullable instancetype) descriptorWithPaddingStyle:(MPSGraphPaddingStyle) paddingStyle;
@@ -97,16 +115,16 @@
/// Creates a stencil operation and returns the result tensor.
///
-/// Performs a weighted reduction operation (See ``MPSGraphStencilOpDescriptor/reductionMode``) on the last 4 dimensions of the ``source``
-/// over the window determined by ``weights``, according to the value defined in ``descriptor``.
+/// Performs a weighted reduction operation (See ``MPSGraphStencilOpDescriptor/reductionMode``) on the last 4 dimensions of the `source`
+/// over the window determined by `weights`, according to the value defined in `descriptor`.
/// ```md
/// y[i] = reduction{j \in w} ( x[ i + j ]w[j] )
/// ```
///
/// - Parameters:
-/// - source: Tensor containing source data. Must be of rank 4 or greater.
-/// - weights: 4-D Tensor containing the weights data.
-/// - descriptor: ``MPSGraphStencilOpDescriptor`` object that specifies strides, dilationRates etc.
+/// - source: The tensor containing the source data. Must be of rank 4 or greater.
+/// - weights: A 4-D tensor containing the weights data.
+/// - descriptor: The descriptor object that specifies the parameters for the stencil operation.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) stencilWithSourceTensor:(MPSGraphTensor *) source
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h 2023-06-23 18:00:07
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h 2023-07-13 16:14:32
@@ -19,12 +19,12 @@
/// Creates a reshape operation and returns the result tensor.
///
-/// Reshapes the input tensor to the target shape.
-/// The shape must be compatible with the input tensor shape, specifically the volume of the input tensor has to match the volume define by the shape.
+/// This operation reshapes the input tensor to the target shape.
+/// The shape must be compatible with the input tensor shape, specifically the volume of the input tensor has to match the volume defined by the shape.
/// The shape is allowed to contain dynamic dimensions (-1) when the result type can be inferred unambiguously.
///
/// - Parameters:
-/// - tensor: Tensor to be reshaped.
+/// - tensor: The tensor to be reshaped.
/// - shape: The result tensor shape.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -35,13 +35,13 @@
/// Creates a reshape operation and returns the result tensor.
///
-/// Reshapes the input tensor to the target shape.
-/// The shape tensor must be compatible with the input tensor shape, specifically the volume of the input tensor has to match the volume define by the shape tensor.
+/// This operation reshapes the input tensor to the target shape.
+/// The shape tensor must be compatible with the input tensor shape, specifically the volume of the input tensor has to match the volume defined by the shape tensor.
/// The shape tensor is allowed to contain dynamic dimensions (-1) when the result type can be inferred unambiguously.
///
/// - Parameters:
-/// - tensor: Tensor to be reshaped.
-/// - shapeTensor: 1D Int32 or Int64 tensor. The result tensor shape.
+/// - tensor: The tensor to be reshaped.
+/// - shapeTensor: A 1D tensor of type `MPSDataTypeInt32` or `MPSDataTypeInt64`, that contains the target shape values.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) reshapeTensor:(MPSGraphTensor *) tensor
@@ -52,10 +52,10 @@
/// Creates a transpose operation and returns the result tensor.
///
-/// Transposes the dimensions ``dimensionIndex`` and ``dimensionIndex2`` of the input tensor.
+/// Transposes the dimensions `dimensionIndex` and `dimensionIndex2` of the input tensor.
///
/// - Parameters:
-/// - tensor: Tensor to be transposed.
+/// - tensor: The tensor to be transposed.
/// - dimensionIndex: The first dimension index to be transposed.
/// - dimensionIndex2: The second dimension index to be transposed.
/// - name: The name for the operation.
@@ -67,11 +67,11 @@
/// Creates a permutation operation and returns the result tensor.
///
-/// Permutes the dimensions of the input tensor according to values in ``permutation``.
+/// Permutes the dimensions of the input tensor according to values in `permutation`.
///
/// - Parameters:
-/// - tensor: Tensor to be transposed.
-/// - permutation: Array of numbers defining the permutation, must be of length `rank(tensor)`.
+/// - tensor: The tensor to be permuted.
+/// - permutation: An array of numbers defining the permutation, must be of length `rank(tensor)` and define a valid permutation.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) transposeTensor:(MPSGraphTensor *) tensor
@@ -83,13 +83,12 @@
/// Creates a slice operation and returns the result tensor.
///
/// - Parameters:
-/// - tensor: Tensor to be sliced.
-/// - dimensionIndex: Which dimension to slice.
-/// - start: Starting index of the slice, can be negative to count from the end of the tensor dimension.
-/// - length: Length of the slice.
+/// - tensor: The tensor to be sliced.
+/// - dimensionIndex: The dimension to slice.
+/// - start: The starting index of the slice, can be negative to count from the end of the tensor dimension.
+/// - length: The length of the slice.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-
-(MPSGraphTensor *) sliceTensor:(MPSGraphTensor *) tensor
dimension:(NSUInteger) dimensionIndex
start:(NSInteger) start
@@ -98,15 +97,15 @@
/// Creates a strided slice operation and returns the result tensor.
///
-/// Slices a tensor starting from ``starts``, stopping short before ``ends`` stepping
-/// ``strides`` paces between each value. Semantics based on
+/// Slices a tensor starting from `starts`, stopping short before `ends` stepping
+/// `strides` paces between each value. Semantics based on
/// [TensorFlow Strided Slice Op](https://www.tensorflow.org/api_docs/python/tf/strided_slice).
///
/// - Parameters:
-/// - tensor: Tensor to be sliced.
-/// - starts: Array of numbers specifying starting point per dimension.
-/// - ends: Array of numbers specifying ending point per dimension.
-/// - strides: Array of numbers specifying strides per dimension.
+/// - tensor: The tensor to be sliced.
+/// - starts: An array of numbers that specify the starting points for each dimension.
+/// - ends: An array of numbers that specify the ending points for each dimension.
+/// - strides: An array of numbers that specify the strides for each dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) sliceTensor:(MPSGraphTensor *) tensor
@@ -115,20 +114,20 @@
strides:(NSArray<NSNumber *> *) strides
name:(NSString * _Nullable) name;
-/// Creates strided slice operation and returns the result tensor.
+/// Creates a strided slice operation and returns the result tensor.
///
-/// Slices a tensor starting from ``starts``, stopping short before ``ends`` stepping
-/// ``strides`` paces between each value. Semantics based on
+/// Slices a tensor starting from `starts`, stopping short before `ends` stepping
+/// `strides` paces between each value. Semantics based on
/// [TensorFlow Strided Slice Op](https://www.tensorflow.org/api_docs/python/tf/strided_slice).
///
/// - Parameters:
-/// - tensor: Tensor to be sliced.
-/// - starts: Array of numbers specifying starting point per dimension.
-/// - ends: Array of numbers specifying ending point per dimension.
-/// - strides: Array of numbers specifying strides per dimension.
-/// - startMask: Bitmask indicating dimensions whose ``starts`` values should be ignored.
-/// - endMask: Bitmask indicating dimensions whose ``ends`` values should be ignored.
-/// - squeezeMask: Bitmask indicating dimensions that should be squeezed out from the result.
+/// - tensor: The Tensor to be sliced.
+/// - starts: An array of numbers that specify the starting points for each dimension.
+/// - ends: An array of numbers that specify the ending points for each dimension.
+/// - strides: An array of numbers that specify the strides for each dimension.
+/// - startMask: A bitmask that indicates dimensions whose `starts` values the operation should ignore.
+/// - endMask: A bitmask that indicates dimensions whose `ends` values the operation should ignore.
+/// - squeezeMask: A bitmask that indicates dimensions the operation will squeeze out from the result.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) sliceTensor:(MPSGraphTensor *) tensor
@@ -140,14 +139,14 @@
squeezeMask:(uint32_t) squeezeMask
name:(NSString * _Nullable) name;
-/// Creates strided slice gradient operation and returns the result tensor.
+/// Creates a strided slice gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - inputGradientTensor: Input gradient.
-/// - fwdInShapeTensor: Shape of the forward pass input = shape of gradient output.
-/// - starts: Array of numbers specifying starting point per dimension.
-/// - ends: Array of numbers specifying ending point per dimension.
-/// - strides: Array of numbers specifying strides per dimension.
+/// - inputGradientTensor: The input gradient.
+/// - fwdInShapeTensor: The shape of the forward pass input, that is the shape of the gradient output.
+/// - starts: An array of numbers that specify the starting points for each dimension.
+/// - ends: An array of numbers that specify the ending points for each dimension.
+/// - strides: An array of numbers that specify the strides for each dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sliceGradientTensor:(MPSGraphTensor *) inputGradientTensor
@@ -157,17 +156,17 @@
strides:(NSArray<NSNumber *> *) strides
name:(NSString * _Nullable) name;
-/// Creates strided slice gradient operation and returns the result tensor.
+/// Creates a strided slice gradient operation and returns the result tensor.
///
/// - Parameters:
-/// - inputGradientTensor: Input gradient.
-/// - fwdInShapeTensor: Shape of the forward pass input = shape of gradient output.
-/// - starts: Array of numbers specifying starting point per dimension.
-/// - ends: Array of numbers specifying ending point per dimension.
-/// - strides: Array of numbers specifying strides per dimension.
-/// - startMask: Bitmask indicating dimensions whose `starts` values should be ignored.
-/// - endMask: Bitmask indicating dimensions whose `ends` values should be ignored.
-/// - squeezeMask: Bitmask indicating dimensions that should be squeezed out from the result.
+/// - inputGradientTensor: The input gradient.
+/// - fwdInShapeTensor: The shape of the forward pass input, that is the shape of the gradient output.
+/// - starts: An array of numbers that specify the starting points for each dimension.
+/// - ends: An array of numbers that specify the ending points for each dimension.
+/// - strides: An array of numbers that specify the strides for each dimension.
+/// - startMask: A bitmask that indicates dimensions whose `starts` values the operation should ignore.
+/// - endMask: A bitmask that indicates dimensions whose `ends` values the operation should ignore.
+/// - squeezeMask: A bitmask that indicates dimensions the operation will squeeze out from the result.
/// - name: The name for the operation
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) sliceGradientTensor:(MPSGraphTensor *) inputGradientTensor
@@ -180,15 +179,15 @@
squeezeMask:(uint32_t) squeezeMask
name:(NSString * _Nullable) name;
-/// Creates concatenation operation and returns the result tensor.
+/// Creates a concatenation operation and returns the result tensor.
///
/// Concatenates two input tensors along the specified dimension. Tensors must be broadcast
-/// compatible along all other dimensions, and have the same type.
+/// compatible along all other dimensions, and have the same datatype.
///
/// - Parameters:
-/// - tensor: First tensor to concatenate.
-/// - tensor2: Second tensor to concatenate.
-/// - dimensionIndex: The dimension to concatenate across, must be in range `- rank <= dimension < rank`.
+/// - tensor: The first tensor to concatenate.
+/// - tensor2: The second tensor to concatenate.
+/// - dimensionIndex: The dimension to concatenate across, must be in range: `-rank <= dimension < rank`.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) concatTensor:(MPSGraphTensor *) tensor
@@ -196,21 +195,21 @@
dimension:(NSInteger) dimensionIndex
name:(NSString * _Nullable) name;
-/// Creates concatenation operation and returns the result tensor.
+/// Creates a concatenation operation and returns the result tensor.
///
/// Concatenates all input tensors along the specified dimension. All inputs must be broadcast
-/// compatible along all other dimensions, and have the same type.
+/// compatible along all other dimensions, and have the same datatype.
///
/// - Parameters:
-/// - tensors: Tensors to concatenate.
-/// - dimensionIndex: The dimension to concatenate across, must be in range `- rank <= dimension < rank`.
+/// - tensors: The tensors to concatenate.
+/// - dimensionIndex: The dimension to concatenate across, must be in range: `-rank <= dimension < rank`.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) concatTensors:(NSArray<MPSGraphTensor *> *) tensors
dimension:(NSInteger) dimensionIndex
name:(NSString * _Nullable) name;
-/// Creates concatenation operation and returns the result tensor.
+/// Creates a concatenation operation and returns the result tensor.
///
/// Concatenates all input tensors along specified dimension. All inputs must be broadcast
/// compatible along all other dimensions, and have the same type.
@@ -224,9 +223,9 @@
/// ```
///
/// - Parameters:
-/// - tensors: Tensors to concatenate.
-/// - dimensionIndex: The dimension to concatenate across, must be in range `- rank <= dimension < rank`.
-/// - interleave: Interleave input tensors,
+/// - tensors: The tensors to concatenate.
+/// - dimensionIndex: The dimension to concatenate across, must be in range: `-rank <= dimension < rank`.
+/// - interleave: A boolean value that specifies whether the operation interleaves input tensors.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) concatTensors:(NSArray<MPSGraphTensor *> *) tensors
@@ -234,25 +233,25 @@
interleave:(BOOL) interleave
name:(NSString * _Nullable) name;
-/// Creates tile operation and returns the result tensor.
+/// Creates a tile operation and returns the result tensor.
///
/// Creates a tensor which contains multiple copies of the input tensor along each dimension of the tensor.
///
/// - Parameters:
/// - tensor: The input tensor
-/// - multiplier: How many copies per dimension MPSGraph produces.
+/// - multiplier: An array of numbers that specifies how many copies per dimension MPSGraph produces.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) tileTensor:(MPSGraphTensor *) tensor
withMultiplier:(MPSShape *) multiplier
name:(NSString * _Nullable) name;
-/// Creates tile gradient operation and returns the result tensor.
+/// Creates a tile gradient operation and returns the result tensor.
///
/// - Parameters:
/// - incomingGradientTensor: The input gradient tensor.
/// - sourceTensor: The input tensor of the forward pass.
-/// - multiplier: How many copies per dimension were done in the forward pass (see ``tileTensor:withMultiplier:name:``).
+/// - multiplier: An array of numbers that specifies how many copies per dimension MPSGraph produced in the forward pass.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) tileGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradientTensor
@@ -260,14 +259,14 @@
withMultiplier:(MPSShape *) multiplier
name:(NSString * _Nullable) name;
-/// Creates padding operation and returns the result tensor.
+/// Creates a padding operation and returns the result tensor.
///
/// - Parameters:
-/// - tensor: The input tensor
-/// - paddingMode: What kind of padding to apply.
-/// - leftPadding: How much padding to apply to the input tensor before each dimension - must be of size `rank(tensor)`.
-/// - rightPadding: How much padding to apply to the input tensor after each dimension - must be of size `rank(tensor)`.
-/// - constantValue: Constant value to be used when ``paddingMode`` = ``MPSGraphPaddingModeConstant``.
+/// - tensor: The input tensor.
+/// - paddingMode: The parameter that defines the padding mode.
+/// - leftPadding: The parameter that defines how much padding the operation applies to the input tensor before each dimension - must be of size `rank(tensor)`.
+/// - rightPadding: The parameter that defines how much padding the operation applies to the input tensor after each dimension - must be of size `rank(tensor)`.
+/// - constantValue: The constant value the operation uses when `paddingMode = MPSGraphPaddingModeConstant`.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)padTensor:(MPSGraphTensor *) tensor
@@ -277,14 +276,14 @@
constantValue:(double)constantValue
name:(NSString * _Nullable) name;
-/// Creates padding gradient operation and returns the result tensor.
+/// Creates a padding gradient operation and returns the result tensor.
///
/// - Parameters:
/// - incomingGradientTensor: The input gradient tensor.
/// - sourceTensor: The input tensor of the forward pass.
-/// - paddingMode: What kind of padding to apply.
-/// - leftPadding: How much padding to apply to the input tensor before each dimension - must be of size `rank(tensor)`.
-/// - rightPadding: How much padding to apply to the input tensor after each dimension - must be of size `rank(tensor)`.
+/// - paddingMode: The parameter that defines the padding mode.
+/// - leftPadding: The parameter that defines how much padding the operation applies to the input tensor before each dimension - must be of size `rank(tensor)`.
+/// - rightPadding: The parameter that defines how much padding the operation applies to the input tensor after each dimension - must be of size `rank(tensor)`.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)padGradientWithIncomingGradientTensor:(MPSGraphTensor *) incomingGradientTensor
@@ -294,24 +293,23 @@
rightPadding:(MPSShape *) rightPadding
name:(NSString * _Nullable) name;
-/// Creates space-to-depth2d operation and returns the result tensor.
+/// Creates a space-to-depth2d operation and returns the result tensor.
///
-/// This operation outputs a copy of the ``input`` tensor, where values from the
-/// ``widthAxis`` and ``heightAxis`` dimensions are moved in spatial blocks of size
-/// ``blockSize`` to the ``depthAxis`` dimension. Use ``usePixelShuffleOrder``
+/// This operation outputs a copy of the `input` tensor, where values from the
+/// `widthAxis` and `heightAxis` dimensions are moved in spatial blocks of size
+/// `blockSize` to the `depthAxis` dimension. Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``depthAxis`` dimension: with ``usePixelShuffleOrder=YES`` MPSGraph stores the
-/// values of the spatial blocks contiguosly within the ``depthAxis`` dimension, whereas
-/// otherwise they are stored interleaved with existing values in the ``depthAxis`` dimension.
-/// This operation is the inverse of ``depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
-///
+/// `depthAxis` dimension: with `usePixelShuffleOrder=YES` MPSGraph stores the
+/// values of the spatial blocks contiguosly within the `depthAxis` dimension, whereas
+/// otherwise they are stored interleaved with existing values in the `depthAxis` dimension.
+/// This operation is the inverse of `MPSGraph/depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:`.
/// - Parameters:
/// - tensor: The input tensor.
-/// - widthAxis: Axis that defines the fastest running dimension within the block.
-/// - heightAxis: Axis that defines the 2nd fastest running dimension within the block.
-/// - depthAxis: Axis that defines the destination dimension, where to copy the blocks.
-/// - blockSize: Size of the square spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the depth dimension.
+/// - widthAxis: The axis that defines the fastest running dimension within the block.
+/// - heightAxis: The axis that defines the 2nd fastest running dimension within the block.
+/// - depthAxis: The axis that defines the destination dimension, where to copy the blocks.
+/// - blockSize: The size of the square spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls the layout of the sub-blocks within the depth dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
@@ -323,24 +321,24 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates space-to-depth2d operation and returns the result tensor.
+/// Creates a space-to-depth2d operation and returns the result tensor.
///
-/// This operation outputs a copy of the ``input`` tensor, where values from the
-/// ``widthAxisTensor`` and ``heightAxisTensor`` dimensions are moved in spatial blocks of size
-/// ``blockSize`` to the ``depthAxisTensor`` dimension. Use ``usePixelShuffleOrder``
+/// This operation outputs a copy of the `input` tensor, where values from the
+/// `widthAxisTensor` and `heightAxisTensor` dimensions are moved in spatial blocks of size
+/// `blockSize` to the `depthAxisTensor` dimension. Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``depthAxisTensor`` dimension: with ``usePixelShuffleOrder=YES`` MPSGraph stores the
-/// values of the spatial blocks contiguosly within the ``depthAxisTensor`` dimension, whereas
-/// otherwise they are stored interleaved with existing values in the ``depthAxisTensor`` dimension.
-/// This operation is the inverse of ``depthToSpace2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
+/// `depthAxisTensor` dimension: with `usePixelShuffleOrder=YES` MPSGraph stores the
+/// values of the spatial blocks contiguosly within the `depthAxisTensor` dimension, whereas
+/// otherwise they are stored interleaved with existing values in the `depthAxisTensor` dimension.
+/// This operation is the inverse of ``MPSGraph/depthToSpace2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - widthAxisTensor: Axis that defines the fastest running dimension within the block.
-/// - heightAxisTensor: Axis that defines the 2nd fastest running dimension within the block.
-/// - depthAxisTensor: Axis that defines the destination dimension, where to copy the blocks.
-/// - blockSize: Size of the square spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the depth dimension.
+/// - widthAxisTensor: A scalar tensor that contains the axis that defines the fastest running dimension within the block.
+/// - heightAxisTensor: A scalar tensor that contains the axis that defines the 2nd fastest running dimension within the block.
+/// - depthAxisTensor: A scalar tensor that contains the axis that defines the destination dimension, where to copy the blocks.
+/// - blockSize: The size of the square spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls the layout of the sub-blocks within the depth dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
@@ -352,24 +350,25 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates depth-to-space2d operation and returns the result tensor.
+/// Creates a depth-to-space2d operation and returns the result tensor.
///
/// This operation outputs a copy of the input tensor, where values from the
-/// ``depthAxis`` dimension are moved in spatial blocks of size ``blockSize`` to the
-/// ``heightAxis`` and ``widthAxis`` dimensions. Use ``usePixelShuffleOrder``
+/// `depthAxis` dimension are moved in spatial blocks of size `blockSize` to the
+/// `heightAxis` and `widthAxis` dimensions. Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``depthAxis`` dimension: with ``usePixelShuffleOrder = YES`` MPSGraph stores the values
-/// of the spatial block contiguosly within the ``depthAxis`` dimension, whereas
-/// without it they are stored interleaved with existing values in the ``depthAxisTensor`` dimension.
-/// This operation is the inverse of ``spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
+/// `depthAxis` dimension: with `usePixelShuffleOrder = YES` MPSGraph stores the values
+/// of the spatial block contiguosly within the `depthAxis` dimension, whereas
+/// without it they are stored interleaved with existing values in the `depthAxisTensor` dimension.
+/// This operation is the inverse of
+/// ``MPSGraph/spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - widthAxis: Axis that defines the fastest running dimension within the block.
-/// - heightAxis: Axis that defines the 2nd fastest running dimension within the block.
-/// - depthAxis: Axis that defines the source dimension, from which to copy the blocks.
-/// - blockSize: Size of the square spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the depth dimension.
+/// - widthAxis: The axis that defines the fastest running dimension within the block.
+/// - heightAxis: The axis that defines the 2nd fastest running dimension within the block.
+/// - depthAxis: The axis that defines the destination dimension, where to copy the blocks.
+/// - blockSize: The size of the square spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls the layout of the sub-blocks within the depth dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
@@ -381,24 +380,24 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates depth-to-space2d operation and returns the result tensor.
+/// Creates a depth-to-space2d operation and returns the result tensor.
///
/// This operation outputs a copy of the input tensor, where values from the
-/// ``depthAxisTensor`` dimension are moved in spatial blocks of size ``blockSize`` to the
-/// ``heightAxisTensor`` and ``widthAxisTensor`` dimensions. Use ``usePixelShuffleOrder``
+/// `depthAxisTensor` dimension are moved in spatial blocks of size `blockSize` to the
+/// `heightAxisTensor` and `widthAxisTensor` dimensions. Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``depthAxisTensor`` dimension: with ``usePixelShuffleOrder = YES`` MPSGraph stores the values
-/// of the spatial block contiguosly within the ``depthAxisTensor`` dimension, whereas
-/// without it they are stored interleaved with existing values in the ``depthAxisTensor`` dimension.
-/// This operation is the inverse of ``spaceToDepth2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
+/// `depthAxisTensor` dimension: with `usePixelShuffleOrder = YES` MPSGraph stores the values
+/// of the spatial block contiguosly within the `depthAxisTensor` dimension, whereas
+/// without it they are stored interleaved with existing values in the `depthAxisTensor` dimension.
+/// This operation is the inverse of ``MPSGraph/spaceToDepth2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - widthAxisTensor: Axis that defines the fastest running dimension within the block.
-/// - heightAxisTensor: Axis that defines the 2nd fastest running dimension within the block.
-/// - depthAxisTensor: Axis that defines the source dimension, from which to copy the blocks.
-/// - blockSize: Size of the square spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the depth dimension.
+/// - widthAxisTensor: A scalar tensor that contains the axis that defines the fastest running dimension within the block.
+/// - heightAxisTensor: A scalar tensor that contains the axis that defines the 2nd fastest running dimension within the block.
+/// - depthAxisTensor: A scalar tensor that contains the axis that defines the destination dimension, where to copy the blocks.
+/// - blockSize: The size of the square spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls the layout of the sub-blocks within the depth dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
@@ -412,23 +411,25 @@
/// Creates a space-to-batch operation and returns the result tensor.
///
-/// This operation outputs a copy of the ``input`` tensor, where values from the
-/// ``spatialAxes`` (for ``usePixelShuffleOrder=YES`` 1,2 or 3 axes supported, otherwise
-/// limited only by ``MPSNDArray`` rank limitations) dimensions are moved in spatial blocks with
-/// rectangular size defined by ``blockDimensions`` to the ``batchAxis`` dimension.
-/// Use ``usePixelShuffleOrder`` to control how the data within spatial blocks is ordered
-/// in the ``batchAxis`` dimension: with ``usePixelShuffleOrder=YES`` MPSGraph stores
-/// the values of the spatial blocks contiguosly within the ``batchAxis`` dimension, whereas
-/// otherwise they are stored interleaved with existing values in the ``batchAxis`` dimension.
-/// Note: This operation is the inverse of ``batchToSpaceTensor:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:``.
-/// Note: This operation is a generalization of ``spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
+/// This operation outputs a copy of the `input` tensor, where values from the
+/// `spatialAxes` (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported, otherwise
+/// limited only by `MPSNDArray` rank limitations) dimensions are moved in spatial blocks with
+/// rectangular size defined by `blockDimensions` to the `batchAxis` dimension.
+/// Use the `usePixelShuffleOrder` parameter to control how the data within spatial blocks is ordered
+/// in the `batchAxis` dimension: with `usePixelShuffleOrder=YES` MPSGraph stores
+/// the values of the spatial blocks contiguosly within the `batchAxis` dimension, whereas
+/// otherwise they are stored interleaved with existing values in the `batchAxis` dimension.
+/// Note: This operation is the inverse of
+/// ``MPSGraph/batchToSpaceTensor:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:``.
+/// Note: This operation is a generalization of
+/// ``MPSGraph/spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - spatialAxes: Axes that define the dimensions containing the spatial blocks.
-/// - batchAxis: Axis that defines the destination dimension, where to copy the blocks.
-/// - blockDimensions: Defines the size of the rectangular spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the batch dimension.
+/// - spatialAxes: The axes that define the dimensions containing the spatial blocks.
+/// - batchAxis: The axis that defines the destination dimension, where to copy the blocks.
+/// - blockDimensions: An array of numbers that defines the size of the rectangular spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls layout of the sub-blocks within the batch dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
@@ -442,23 +443,25 @@
/// Creates a space-to-batch operation and returns the result tensor.
///
-/// This operation outputs a copy of the ``input`` tensor, where values from the
-/// ``spatialAxesTensor`` (for ``usePixelShuffleOrder=YES`` 1,2 or 3 axes supported, otherwise
-/// limited only by ``MPSNDArray`` rank limitations) dimensions are moved in spatial blocks with
-/// rectangular size defined by ``blockDimensionsTensor`` to the ``batchAxisTensor`` dimension.
-/// Use ``usePixelShuffleOrder`` to control how the data within spatial blocks is ordered
-/// in the ``batchAxisTensor`` dimension: with ``usePixelShuffleOrder=YES`` MPSGraph stores
-/// the values of the spatial blocks contiguosly within the ``batchAxisTensor`` dimension, whereas
-/// otherwise they are stored interleaved with existing values in the ``batchAxisTensor`` dimension.
-/// Note: This operation is the inverse of ``batchToSpaceTensor:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:``.
-/// Note: This operation is a generalization of ``spaceToDepth2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
+/// This operation outputs a copy of the `input` tensor, where values from the
+/// `spatialAxesTensor` (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported, otherwise
+/// limited only by `MPSNDArray` rank limitations) dimensions are moved in spatial blocks with
+/// rectangular size defined by `blockDimensionsTensor` to the `batchAxisTensor` dimension.
+/// Use the `usePixelShuffleOrder` parameter to control how the data within spatial blocks is ordered
+/// in the `batchAxisTensor` dimension: with `usePixelShuffleOrder=YES` MPSGraph stores
+/// the values of the spatial blocks contiguosly within the `batchAxisTensor` dimension, whereas
+/// otherwise they are stored interleaved with existing values in the `batchAxisTensor` dimension.
+/// Note: This operation is the inverse of
+/// ``MPSGraph/batchToSpaceTensor:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:``.
+/// Note: This operation is a generalization of
+/// ``MPSGraph/spaceToDepth2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - spatialAxesTensor: Axes that define the dimensions containing the spatial blocks.
-/// - batchAxisTensor: Axis that defines the destination dimension, where to copy the blocks.
-/// - blockDimensionsTensor: Defines the size of the rectangular spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the batch dimension.
+/// - spatialAxesTensor: A tensor that contains the axes that define the dimensions containing the spatial blocks.
+/// - batchAxisTensor: A tensor that contains the axis that defines the destination dimension, where to copy the blocks.
+/// - blockDimensionsTensor: A tensor that defines the size of the rectangular spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls layout of the sub-blocks within the batch dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
@@ -473,22 +476,24 @@
/// Creates a batch-to-space operation and returns the result tensor.
///
/// This operation outputs a copy of the input tensor, where values from the
-/// ``batchAxis`` dimension are moved in spatial blocks of size ``blockDimensions`` to the
-/// ``spatialAxes`` dimensions (for ``usePixelShuffleOrder=YES`` 1,2 or 3 axes supported,
-/// otherwise limited only by ``MPSNDArray`` rank limitations). Use ``usePixelShuffleOrder``
+/// `batchAxis` dimension are moved in spatial blocks of size `blockDimensions` to the
+/// `spatialAxes` dimensions (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported,
+/// otherwise limited only by `MPSNDArray` rank limitations). Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``batchAxis`` dimension: with ``usePixelShuffleOrder = YES`` MPSGraph stores
-/// the values of the spatial block contiguosly within the ``batchAxis`` dimension whereas
-/// without it they are stored interleaved with existing values in the ``batchAxis`` dimension.
-/// Note: This operation is the inverse of ``spaceToBatchTensor:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:``.
-/// Note: This operation is a generalization of ``depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
+/// `batchAxis` dimension: with `usePixelShuffleOrder = YES` MPSGraph stores
+/// the values of the spatial block contiguosly within the `batchAxis` dimension whereas
+/// without it they are stored interleaved with existing values in the `batchAxis` dimension.
+/// Note: This operation is the inverse of
+/// ``MPSGraph/spaceToBatchTensor:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:``.
+/// Note: This operation is a generalization of
+/// ``MPSGraph/depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - spatialAxes: Axes that define the dimensions containing the spatial blocks.
-/// - batchAxis: Axis that defines the source dimension, from which to copy the blocks.
-/// - blockDimensions: Defines the size of the rectangular spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the batch dimension.
+/// - spatialAxes: The axes that define the dimensions containing the spatial blocks.
+/// - batchAxis: The axis that defines the destination dimension, where to copy the blocks.
+/// - blockDimensions: An array of numbers that defines the size of the rectangular spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls layout of the sub-blocks within the batch dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)batchToSpaceTensor:(MPSGraphTensor *) tensor
@@ -503,22 +508,24 @@
/// Creates a batch-to-space operation and returns the result tensor.
///
/// This operation outputs a copy of the input tensor, where values from the
-/// ``batchAxisTensor`` dimension are moved in spatial blocks of size ``blockDimensionsTensor`` to the
-/// ``spatialAxesTensor`` dimensions (for ``usePixelShuffleOrder=YES`` 1,2 or 3 axes supported,
-/// otherwise limited only by ``MPSNDArray`` rank limitations). Use ``usePixelShuffleOrder``
+/// `batchAxisTensor` dimension are moved in spatial blocks of size `blockDimensionsTensor` to the
+/// `spatialAxesTensor` dimensions (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported,
+/// otherwise limited only by `MPSNDArray` rank limitations). Use the `usePixelShuffleOrder` parameter
/// to control how the data within spatial blocks is ordered in the
-/// ``batchAxisTensor`` dimension: with ``usePixelShuffleOrder = YES`` MPSGraph stores
-/// the values of the spatial block contiguosly within the ``batchAxisTensor`` dimension whereas
-/// without it they are stored interleaved with existing values in the ``batchAxisTensor`` dimension.
-/// Note: This operation is the inverse of ``spaceToBatchTensor:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:``.
-/// Note: This operation is a generalization of ``depthToSpace2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
+/// `batchAxisTensor` dimension: with `usePixelShuffleOrder = YES` MPSGraph stores
+/// the values of the spatial block contiguosly within the `batchAxisTensor` dimension whereas
+/// without it they are stored interleaved with existing values in the `batchAxisTensor` dimension.
+/// Note: This operation is the inverse of
+/// ``MPSGraph/spaceToBatchTensor:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:``.
+/// Note: This operation is a generalization of
+/// ``MPSGraph/depthToSpace2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``.
///
/// - Parameters:
/// - tensor: The input tensor.
-/// - spatialAxesTensor: Axes that define the dimensions containing the spatial blocks.
-/// - batchAxisTensor: Axis that defines the source dimension, from which to copy the blocks.
-/// - blockDimensionsTensor: Defines the size of the rectangular spatial sub-block.
-/// - usePixelShuffleOrder: Controls layout of the sub-blocks within the batch dimension.
+/// - spatialAxesTensor: A tensor that contains the axes that define the dimensions containing the spatial blocks.
+/// - batchAxisTensor: A tensor that contains the axis that defines the destination dimension, where to copy the blocks.
+/// - blockDimensionsTensor: A tensor that defines the size of the rectangular spatial sub-block.
+/// - usePixelShuffleOrder: A parameter that controls layout of the sub-blocks within the batch dimension.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -531,14 +538,14 @@
MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
MPS_SWIFT_NAME( batchToSpace(_:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:));
-/// Creates a reverse operation and return the result tensor.
+/// Creates a reverse operation and returns the result tensor.
///
/// Reverses a tensor on given axes.
/// Semantics based on [TensorFlow reverse op](https://www.tensorflow.org/api_docs/python/tf/reverse).
///
/// - Parameters:
-/// - tensor: Tensor to be reversed.
-/// - axesTensor: Tensor that specifies axes to be reversed (Axes must be unique and within normal axis range).
+/// - tensor: The tensor to be reversed.
+/// - axesTensor: A tensor that specifies axes to be reversed (Axes must be unique and within normal axis range).
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) reverseTensor:(MPSGraphTensor *) tensor
@@ -546,29 +553,28 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates a reverse operation and return the result tensor.
+/// Creates a reverse operation and returns the result tensor.
///
/// Reverses a tensor on given axes.
/// Semantics based on [TensorFlow reverse op](https://www.tensorflow.org/api_docs/python/tf/reverse).
///
/// - Parameters:
-/// - tensor: Tensor to be reversed.
-/// - axes: Axes to be reversed (Axes must be unique and within normal axis range).
+/// - tensor: The tensor to be reversed.
+/// - axes: A tensor that specifies axes to be reversed (Axes must be unique and within normal axis range).
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-
-(MPSGraphTensor *) reverseTensor:(MPSGraphTensor *) tensor
axes:(NSArray<NSNumber *> *) axes
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates a reverse operation and return the result tensor.
+/// Creates a reverse operation and returns the result tensor.
///
/// Reverses a tensor on all axes.
/// Semantics based on [TensorFlow reverse op](https://www.tensorflow.org/api_docs/python/tf/reverse).
///
/// - Parameters:
-/// - tensor: Tensor to be reversed.
+/// - tensor: The tensor to be reversed.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -579,12 +585,12 @@
/// Creates a flatten2d operation and returns the result tensor.
///
-/// Flattens dimensions before ``axis`` to ``result[0]`` and dimensions starting
-/// from ``axis`` to ``result[1]`` and returns a rank-2 tensor as result.
+/// Flattens dimensions before `axis` to `result[0]` and dimensions starting
+/// from `axis` to `result[1]` and returns a rank-2 tensor as result.
///
/// - Parameters:
-/// - tensor: Tensor to be flattened.
-/// - axis: Axis around which to flatten.
+/// - tensor: The tensor to be flattened.
+/// - axis: The axis around which to flatten.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) flatten2DTensor:(MPSGraphTensor *) tensor
@@ -595,12 +601,12 @@
/// Creates a flatten2d operation and returns the result tensor.
///
-/// Flattens dimensions before ``axis`` to ``result[0]`` and dimensions starting
-/// from ``axis`` to ``result[1]`` and returns a rank-2 tensor as result.
+/// Flattens dimensions before `axis` to `result[0]` and dimensions starting
+/// from `axis` to `result[1]` and returns a rank-2 tensor as result.
///
/// - Parameters:
-/// - tensor: Tensor to be flattened.
-/// - axisTensor: Axis around which to flatten.
+/// - tensor: The tensor to be flattened.
+/// - axisTensor: A scalar tensor that contains the axis around which to flatten.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) flatten2DTensor:(MPSGraphTensor *) tensor
@@ -615,8 +621,8 @@
/// This is equivalent to the broadcasting for arithmetic operations when operands have different shapes.
///
/// - Parameters:
-/// - tensor: Tensor to be broadcasted
-/// - shape: Shape of the result tensor
+/// - tensor: The tensor to be broadcasted
+/// - shape: The shape of the result tensor
/// - name: The name for the operation
/// - Returns: A valid MPSGraphTensor object
-(MPSGraphTensor *) broadcastTensor:(MPSGraphTensor *) tensor
@@ -631,8 +637,8 @@
/// This is equivalent to the broadcasting for arithmetic operations when operands have different shapes.
///
/// - Parameters:
-/// - tensor: Tensor to be broadcasted.
-/// - shapeTensor: 1D Int32 or Int64 tensor. Shape of the result tensor.
+/// - tensor: The Tensor to be broadcasted.
+/// - shapeTensor: A rank-1 tensor of type `MPSDataTypeInt32` or `MPSDataTypeInt64` that defines the shape of the result tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) broadcastTensor:(MPSGraphTensor *) tensor
@@ -641,12 +647,12 @@
MPS_SWIFT_NAME( broadcast(_:shapeTensor:name:) )
MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
-/// Creates shapeOf operation and returns the result tensor.
+/// Creates a shape-of operation and returns the result tensor.
///
-/// Returns a 1D Int32 tensor with value the static shape of the input tensor.
+/// Returns a rank-1 tensor of type `MPSDataTypeInt32` with the values of the static shape of the input tensor.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) shapeOfTensor:(MPSGraphTensor *) tensor
@@ -656,11 +662,11 @@
/// Creates a cast operation and returns the result tensor.
///
-/// Returns input tensor casted to the dataType passed in.
+/// Returns the input tensor casted to the specied data type.
///
/// - Parameters:
-/// - tensor: Input tensor.
-/// - type: Input tensor.
+/// - tensor: The input tensor.
+/// - type: The datatype to which MPSGraph casts the input.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *)castTensor:(MPSGraphTensor *)tensor
@@ -670,13 +676,13 @@
/// Creates a reinterpret cast operation and returns the result tensor.
///
-/// Returns input tensor (with element type `tensor_type`) reinterpreted to element type ``type``
+/// Returns input tensor (with element type `tensor_type`) reinterpreted to element type
/// passed in with the last dimension scaled by `sizeof(tensor_type) / sizeof(type)`.
-/// This operation is endianness agnostic and data will be reinterpreted with the endianness of the
+/// This operation is endianness agnostic and MPSGraph reinterprets the data with the endianness of the
/// system.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - type: The element type of the returned tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -685,14 +691,14 @@
name:(NSString *_Nullable)name
MPS_AVAILABLE_STARTING(macos(13.2), ios(16.3), tvos(16.3));
-/// Creates a stack operation and returns the result.
+/// Creates a stack operation and returns the result tensor.
///
-/// Stacks all input tensors along ``axis`` into a result tensor of rank + 1. Tensors must be broadcast
-/// compatible along all dimensions, and have the same type.
+/// Stacks all input tensors along `axis` into a result tensor of `rank + 1`. Tensors must be broadcast
+/// compatible along all dimensions except `axis`, and have the same type.
///
/// - Parameters:
-/// - inputTensors: Input tensors.
-/// - axis: The dimension to stack tensors into result. Must be in range `- rank + 1 <= dimension < rank + 1`.
+/// - inputTensors: The input tensors.
+/// - axis: The dimension to stack tensors into result. Must be in range: `-rank + 1 <= dimension < rank + 1`.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) stackTensors:(NSArray<MPSGraphTensor *> *) inputTensors
@@ -701,15 +707,15 @@
MPS_SWIFT_NAME( stack(_:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates a split operation and returns the result.
+/// Creates a split operation and returns the result tensor.
///
-/// Splits the input tensor along ``axis`` into multiple result tensors of size determined by ``splitSizes``.
-/// Requires that the sum of ``splitSizes`` is equal to the lenth of the input along ``axis``.
+/// Splits the input tensor along `axis` into multiple result tensors of size determined by `splitSizes`.
+/// Requires that the sum of `splitSizes` is equal to the lenth of the input along `axis`.
///
/// - Parameters:
-/// - tensor: Input tensor.
-/// - splitSizes: The length of the result tensors along the split axis.
-/// - axis: The dimension to split the input along.
+/// - tensor: The input tensor.
+/// - splitSizes: The lengths of the result tensors along the split axis.
+/// - axis: The dimension along which MPSGraph splits the input tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(NSArray<MPSGraphTensor *> *) splitTensor:(MPSGraphTensor *) tensor
@@ -719,15 +725,15 @@
MPS_SWIFT_NAME( split(_:splitSizes:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates a split operation and returns the result.
+/// Creates a split operation and returns the result tensor.
///
-/// Splits the input tensor along ``axis`` into multiple result tensors of size determined by ``splitSizesTensor``.
-/// Requires that the sum of ``splitSizesTensor`` is equal to the lenth of the input along ``axis``.
+/// Splits the input tensor along `axis` into multiple result tensors of size determined by `splitSizesTensor`.
+/// Requires that the sum of the elements of `splitSizesTensor` is equal to the lenth of the input along `axis`.
///
/// - Parameters:
-/// - tensor: Input tensor
-/// - splitSizesTensor: The length of the result tensors along the split axis
-/// - axis: The dimension to split the input along
+/// - tensor: The input tensor
+/// - splitSizesTensor: The lengths of the result tensors along the split axis.
+/// - axis: The dimension along which MPSGraph splits the input tensor.
/// - name: The name for the operation
/// - Returns: A valid MPSGraphTensor object
-(NSArray<MPSGraphTensor *> *) splitTensor:(MPSGraphTensor *) tensor
@@ -737,15 +743,15 @@
MPS_SWIFT_NAME( split(_:splitSizesTensor:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates a split operation and returns the result.
+/// Creates a split operation and returns the result tensor.
///
-/// Splits the input tensor along ``axis`` into ``numsplits`` result tensors of equal size.
-/// Requires that the lenth of the input along ``axis`` is divisible by ``numSplits``.
+/// Splits the input tensor along `axis` into `numsplits` result tensors of equal size.
+/// Requires that the lenth of the input along `axis` is divisible by `numSplits`.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - numSplits: The number of result tensors to split to.
-/// - axis: The dimension to split the input along.
+/// - axis: The dimension along which MPSGraph splits the input tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(NSArray<MPSGraphTensor *> *) splitTensor:(MPSGraphTensor *) tensor
@@ -755,12 +761,12 @@
MPS_SWIFT_NAME( split(_:numSplits:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates squeeze operation and returns the result.
+/// Creates a squeeze operation and returns the result tensor.
///
-/// Squeezes the tensor, removing any dimensions with size 1.
+/// Squeezes the tensor, removing all dimensions with size 1.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) squeezeTensor:(MPSGraphTensor *) tensor
@@ -768,13 +774,13 @@
MPS_SWIFT_NAME( squeeze(_:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates squeeze operation and returns the result.
+/// Creates a squeeze operation and returns the result tensor.
///
/// Squeezes the tensor, removing a dimension with size 1 at the specified axis.
-/// Size must be 1 at specified axis.
+/// The size of the input tensor must be 1 at the specified axis.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axis: The axis to squeeze.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -784,13 +790,13 @@
MPS_SWIFT_NAME( squeeze(_:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates squeeze operation and returns the result.
+/// Creates a squeeze operation and returns the result tensor.
///
/// Squeezes the tensor, removing dimensions with size 1 at specified axes.
-/// Size must be 1 at all specified axes.
+/// The size of the input tensor must be 1 at all specified axes.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axes: The axes to squeeze.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
@@ -800,13 +806,13 @@
MPS_SWIFT_NAME( squeeze(_:axes:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates squeeze operation and returns the result.
+/// Creates a squeeze operation and returns the result tensor.
///
/// Squeezes the tensor, removing dimensions with size 1 at specified axes.
-/// Size must be 1 at all specified axes.
+/// The size of the input tensor must be 1 at all specified axes.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axesTensor: The tensor containing the axes to squeeze.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object
@@ -816,12 +822,12 @@
MPS_SWIFT_NAME( squeeze(_:axesTensor:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates expand dimensions operation and returns the result.
+/// Creates an expand dimensions operation and returns the result tensor.
///
/// Expands the tensor, inserting a dimension with size 1 at the specified axis.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axis: The axis to expand.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -831,12 +837,12 @@
MPS_SWIFT_NAME( expandDims(_:axis:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates expand dimensions operation and returns the result.
+/// Creates an expand dimensions operation and returns the result tensor.
///
/// Expands the tensor, inserting dimensions with size 1 at specified axes.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axes: The axes to expand.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -846,12 +852,12 @@
MPS_SWIFT_NAME( expandDims(_:axes:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates expand dimensions operation and returns the result.
+/// Creates an expand dimensions operation and returns the result tensor.
///
/// Expands the tensor, inserting dimensions with size 1 at specified axes.
///
/// - Parameters:
-/// - tensor: Input tensor.
+/// - tensor: The input tensor.
/// - axesTensor: The tensor containing the axes to expand.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -862,9 +868,9 @@
MPS_SWIFT_NAME( expandDims(_:axesTensor:name:) )
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates get coordindate operation and returns the result.
+/// Creates a get-coordindate operation and returns the result tensor.
///
-/// Creates a tensor of specified shape with value at index ```md [i_0, i_1, ... , i_N] = i_axis ```
+/// Creates a tensor of specified shape with value at index `[i_0, i_1, ... , i_N] = i_axis`
/// For example,
/// ```md
/// coordinateAlongAxis(0, withShape=[5]) = [0, 1, 2, 3, 4]
@@ -883,12 +889,12 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates get coordindate operation and returns the result.
+/// Creates a get-coordindate operation and returns the result tensor.
///
-/// See ``coordinateAlongAxis:withShape:name:``.
+/// See ``MPSGraph/coordinateAlongAxis:withShape:name:``.
///
/// - Parameters:
-/// - axisTensor: Scalar Int32 tensor. The coordinate axis an element's value is set to. Negative values wrap around.
+/// - axisTensor: A Scalar tensor of type `MPSDataTypeInt32`, that specifies the coordinate axis an element's value is set to. Negative values wrap around.
/// - shape: The shape of the result tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
@@ -897,13 +903,13 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates get coordindate operation and returns the result.
+/// Creates a get-coordindate operation and returns the result tensor.
///
/// See ``coordinateAlongAxis:withShape:name:``.
///
/// - Parameters:
/// - axis: The coordinate axis an element's value is set to. Negative values wrap around.
-/// - shapeTensor: 1D Int32 or Int64 tensor. The shape of the result tensor.
+/// - shapeTensor: A rank-1 tensor of type `MPSDataTypeInt32` or `MPSDataTypeInt64` that defines the shape of the result tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) coordinateAlongAxis:(NSInteger) axis
@@ -911,13 +917,13 @@
name:(NSString * _Nullable) name
MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
-/// Creates get coordindate operation and returns the result.
+/// Creates a get-coordindate operation and returns the result tensor.
///
/// See ``coordinateAlongAxis:withShape:name:``.
///
/// - Parameters:
-/// - axisTensor: Scalar Int32 tensor. The coordinate axis an element's value is set to. Negative values wrap around
-/// - shapeTensor: 1D Int32 or Int64 tensor. The shape of the result tensor.
+/// - axisTensor: A Scalar tensor of type `MPSDataTypeInt32`, that specifies the coordinate axis an element's value is set to. Negative values wrap around.
+/// - shapeTensor: A rank-1 tensor of type `MPSDataTypeInt32` or `MPSDataTypeInt64` that defines the shape of the result tensor.
/// - name: The name for the operation.
/// - Returns: A valid MPSGraphTensor object.
-(MPSGraphTensor *) coordinateAlongAxisTensor:(MPSGraphTensor *) axisTensor
diff -ruN /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTopKOps.h /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTopKOps.h
--- /Applications/Xcode_15.0.0-beta4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTopKOps.h 2023-05-13 17:15:32
+++ /Applications/Xcode_15.0.0-beta5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTopKOps.h 2023-07-13 23:25:38
@@ -2,7 +2,7 @@
// MPSGraphTopKOps.h
// MPSGraph
//
-// Created by Chris Bayley on 9/21/20.
+// Created on 9/21/20.
// Copyright © 2020 Apple Inc. All rights reserved.
//
@@ -16,12 +16,12 @@
MPS_CLASS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
@interface MPSGraph(MPSGraphTopKOps)
-/// Create TopK op and return the value and indices tensors
+/// Creates TopK op and return the value and indices tensors
///
/// Finds the k largest values along the minor dimension of the input. The source must have
/// at least k elements along its minor dimension.
-/// The first element of the result array corresponds to the top values, and the second
-/// array corresponds to the indices of the top values.
+/// The first element of the result array corresponds to the top values, and the second element of
+/// the result array corresponds to the indices of the top values.
///
/// - Parameters:
/// - source: Tensor containing source data
@@ -33,12 +33,12 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( topK(_:k:name:) );
-/// Create TopK op and return the result tensor
+/// Creates TopK op and return the result tensor.
///
/// Finds the k largest values along the minor dimension of the input. The source must have
/// at least k elements along its minor dimension.
-/// The first element of the result array corresponds to the top values, and the second
-/// array corresponds to the indices of the top values.
+/// The first element of the result array corresponds to the top values, and the second element of
+/// the result array corresponds to the indices of the top values.
///
/// - Parameters:
/// - source: Tensor containing source data.
@@ -50,7 +50,7 @@
name:(NSString * _Nullable) name
MPS_SWIFT_NAME( topK(_:kTensor:name:) );
-/// Create TopK op and return the value and indices tensors.
+/// Creates TopK op and return the value and indices tensors.
///
/// Finds the k largest values along the minor dimension of the input. The source must have
/// at least k elements along its minor dimension.
@@ -90,7 +90,7 @@
MPS_SWIFT_NAME( bottomK(_:axis:k:name:) )
MPS_AVAILABLE_STARTING(macos(14.0), ios(17.0), tvos(17.0));
-/// Create TopK op and return the result tensor.
+/// Creates TopK op and return the result tensor..
///
/// Finds the k largest values along the minor dimension of the input. The source must have
/// at least k elements along its minor dimension.
- README
- xcode13.0 Binding Status
- xcode13.1 Binding Status
- xcode13.2 Binding Status
- xcode13.3 Binding Status
- xcode13.4 Binding Status
- xcode14.0 Binding Status
- xcode14.1 Binding Status
- xcode14.2 Binding Status
- xcode14.3 Binding Status
- xcode15.0 Binding Status
- xcode15.1 Binding Status
- xcode15.3 Binding Status
- xcode15.4 Binding Status
- xcode16.0 Binding Status
- xcode16.1 Binding Status
- xcode16.2 Binding Status