Skip to content

MetalPerformanceShadersGraph macOS xcode14.1 b3

Israel Soto edited this page Sep 27, 2022 · 1 revision

#MetalPerformanceShadersGraph.framework

diff -ruN /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h
--- /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-09-07 13:40:09.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-09-23 14:00:56.000000000 -0500
@@ -91,8 +91,9 @@
 typedef void (^MPSGraphCompletionHandler)(MPSGraphTensorDataDictionary * resultsDictionary,
                                           NSError * _Nullable error);
 
-/*! @abstract   A notification when graph execution: has finished
+/*! @abstract   A notification when graph execution: has been scheduled
  *  @param      resultsDictionary  If no error, the results dictionary produced by the graph operation.
+ *                                If Graph has not yet allocated the results will be NSNull
  *  @param      error   If an error occurs, more information might be found here.
  */
 typedef void (^MPSGraphScheduledHandler)(MPSGraphTensorDataDictionary * resultsDictionary,
diff -ruN /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h
--- /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h	2022-09-07 13:40:09.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphArithmeticOps.h	2022-09-21 15:18:52.000000000 -0500
@@ -161,6 +161,32 @@
 MPS_SWIFT_NAME( truncate(_:name:) )
 MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
 
+/*!
+ *  @abstract   Return bitwise not of tensor, takes in only integer dataTypes
+ *
+ *  @param      tensor                          input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
+/*!
+ *  @abstract   Return population count of a tensor, takes in only integer dataTypes
+ *
+ *  @param      tensor                          input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
 #pragma mark - BinaryArithmeticOps
 
 /*!
@@ -394,7 +420,80 @@
                            secondaryTensor:(MPSGraphTensor *) secondaryTensor
                                       name:(NSString * _Nullable) name;
 
+/*!
+ *  @abstract   Return bitwise AND of binary representations of 2 integer tensors
+ *
+ *  @param      primaryTensor          primary input tensor, must be integer dataType
+ *  @param      secondaryTensor     secondary input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
 
+/*!
+ *  @abstract   Return bitwise OR of binary representations of 2 integer tensors
+ *
+ *  @param      primaryTensor          primary input tensor, must be integer dataType
+ *  @param      secondaryTensor     secondary input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
+/*!
+ *  @abstract   Return bitwise XOR of binary representations of 2 integer tensors
+ *
+ *  @param      primaryTensor          primary input tensor, must be integer dataType
+ *  @param      secondaryTensor     secondary input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
+/*!
+ *  @abstract   Return bitwise left shifted binary representations of primary integer tensor by secondary tensor amount
+ *
+ *  @param      primaryTensor          primary input tensor, must be integer dataType
+ *  @param      secondaryTensor     secondary input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
+/*!
+ *  @abstract   Return bitwise right shifted binary representations of primary integer tensor by secondary tensor amount
+ *
+ *  @param      primaryTensor          primary input tensor, must be integer dataType
+ *  @param      secondaryTensor     secondary input tensor, must be integer dataType
+ *  @param      name                              name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *) bitwiseRightShiftWithPrimaryTensor:(MPSGraphTensor *) primaryTensor
+                                       secondaryTensor:(MPSGraphTensor *) secondaryTensor
+                                                  name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( bitwiseRightShift(_:_:name:) )
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
 
 
 #pragma mark - TernaryArithmeticOps
diff -ruN /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h
--- /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h	2022-09-07 13:40:08.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h	2022-09-22 09:18:56.000000000 -0500
@@ -14,14 +14,14 @@
 NS_ASSUME_NONNULL_BEGIN
 
 /*! @abstract   A notification when graph executable execution: has finished
- *  @param      results  If no error, the results produced by the graph operation.
+ *  @param      results  If no error, the results produced by the graph operation. If Graph has not yet allocated the results this will be NSNull
  *  @param      error   If an error occurs, more information might be found here.
  */
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
 typedef void (^MPSGraphExecutableCompletionHandler)(NSArray<MPSGraphTensorData *> * results,
                                                     NSError * _Nullable error);
 
-/*! @abstract   A notification when graph executable execution: has finished
+/*! @abstract   A notification when graph executable execution: has been scheduled
  *  @param      results  If no error, the results produced by the graph operation.
  *  @param      error   If an error occurs, more information might be found here.
  */
@@ -124,7 +124,7 @@
 
 /*!
  *  @abstract   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.
+ *              This call  is asynchronous and will return immediately.
  *
  *  @param      commandQueue                                      CommandQueue passed to exectute the graph on
  *  @param      inputsArray                                         Feeds tensorData for the placeholder tensors, same order as arguments of main function
@@ -141,7 +141,7 @@
 
 /*!
  *  @abstract   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.
+ *              This call  is asynchronous and will return immediately after finishing encoding.
  *
  *  @param      commandBuffer                                     commandBuffer passed to exectute the graph on, commitAndContinue might be called, please don't rely on underlying MTLCommandBuffer to remain uncommitted
  *  @param      inputsArray                                         Feeds tensorData for the placeholder tensors, same order as arguments of main function
diff -ruN /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h
--- /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h	2022-09-07 13:40:09.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphSortOps.h	2022-09-21 15:18:51.000000000 -0500
@@ -80,8 +80,76 @@
 MPS_SWIFT_NAME( sort(_:axisTensor:name:))
 MPS_AVAILABLE_STARTING(macos(13.0), ios(16.0), tvos(16.0));
 
+/*!
+ *  @abstract   Create an argSort operation and return the result tensor of signed
+ *              32-bit integers.
+ *
+ *  @param      tensor              input tensor
+ *  @param      axis                  the tensor dimension over which the sort occurs
+ *  @param      descending     whether or not to sort in descending order
+ *  @param      name                  name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
+                                 axis:(NSInteger) axis
+                           descending:(BOOL) descending
+                                 name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( argSort(_:axis:descending:name:))
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
+
+/*!
+ *  @abstract   Create an argSort operation and return the result tensor of signed
+ *              32-bit integers.
+ *
+ *  @param      tensor              input tensor
+ *  @param      axisTensor     the tensor dimension over which the sort occurs
+ *  @param      descending     whether or not to sort in descending order
+ *  @param      name                  name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
+                           axisTensor:(MPSGraphTensor *) axisTensor
+                           descending:(BOOL) descending
+                                 name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( argSort(_:axisTensor:descending:name:))
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
+
+/*!
+ *  @abstract   Create an argSort operation and return the result tensor of signed
+ *              32-bit integers.
+ *
+ *  @param      tensor        input tensor
+ *  @param      axis            the tensor dimension over which the sort occurs
+ *  @param      name            name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(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));
+
+/*!
+ *  @abstract   Create an argSort operation and return the result tensor of signed
+ *              32-bit integers.
+ *
+ *  @param      tensor            input tensor
+ *  @param      axisTensor   the tensor dimension over which the sort occurs
+ *  @param      name                name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *) argSortWithTensor:(MPSGraphTensor *) tensor
+                           axisTensor:(MPSGraphTensor *) axisTensor
+                                 name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( argSort(_:axisTensor:name:))
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
+
 @end
 
 NS_ASSUME_NONNULL_END
 
-#endif /* MPSGraphSortOps_h */
+#endif /* MPSGraphArgSortOps_h */
diff -ruN /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h
--- /Applications/Xcode_14.1.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-09-07 13:40:09.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-09-22 09:18:58.000000000 -0500
@@ -245,16 +245,38 @@
                                             rightPadding:(MPSShape *) rightPadding
                                                     name:(NSString * _Nullable) name;
 
+/*!
+ *  @abstract   Create space-to-depth2d op and return the result tensor
+ *  @discussion 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. `usePixelShuffleOrder` can be
+ *              used to control how the data within spatial blocks is ordered in the
+ *              `depthAxis` dimension: with `usePixelShuffleOrder=YES` the values within the
+ *              spatial blocks are stored contiguosly within the `depthAxis` dimension whereas
+ *              otherwise they are stored interleaved with existing values in the `depthAxis`
+ *              dimension.
+ *              This operation is the inverse of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      widthAxis                               Axis that defines the fastest running dimension within the block.
+ *  @param      heightAxis                             Axis that defines the 2nd fastest running dimension within the block.
+ *  @param      depthAxis                               Axis that defines the destination dimension, where to copy the blocks.
+ *  @param      blockSize                               Size of the square spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the depth dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
 -(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
-                        widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
-                       heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
-                        depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
-                              blockSize:(NSUInteger)blockSize
+                              widthAxis:(NSUInteger) widthAxis
+                             heightAxis:(NSUInteger) heightAxis
+                              depthAxis:(NSUInteger) depthAxis
+                              blockSize:(NSUInteger) blockSize
                    usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
--(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
+-(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
                         widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
                        heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
                         depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
@@ -263,7 +285,29 @@
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
--(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
+/*!
+ *  @abstract   Create depth-to-space2d op and return the result tensor
+ *  @discussion 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. `usePixelShuffleOrder` can be
+ *              used to control how the data within spatial blocks is ordered in the
+ *              `depthAxis` dimension: with `usePixelShuffleOrder = YES` the values within the
+ *              spatial block are stored 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 `spaceToDepth2D`
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      widthAxis                               Axis that defines the fastest running dimension within the block.
+ *  @param      heightAxis                             Axis that defines the 2nd fastest running dimension within the block.
+ *  @param      depthAxis                               Axis that defines the source dimension, from which to copy the blocks.
+ *  @param      blockSize                               Size of the square spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the depth dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
                               widthAxis:(NSUInteger) widthAxis
                              heightAxis:(NSUInteger) heightAxis
                               depthAxis:(NSUInteger) depthAxis
@@ -273,15 +317,97 @@
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
 -(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
-                              widthAxis:(NSUInteger) widthAxis
-                             heightAxis:(NSUInteger) heightAxis
-                              depthAxis:(NSUInteger) depthAxis
+                        widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
+                       heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
+                        depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
                               blockSize:(NSUInteger)blockSize
                    usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
 /*!
+ *  @abstract   Create space-to-batch op and return the result tensor.
+ *  @discussion 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.
+ *              `usePixelShuffleOrder` can be used to control how the data within spatial blocks is ordered
+ *              in the `batchAxis` dimension: with `usePixelShuffleOrder=YES` the values within the
+ *              spatial blocks are stored 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 `batchToSpace`.
+ *              Note: This operation is a generalization of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      spatialAxes                           Axes that define the dimensions containing the spatial blocks.
+ *  @param      batchAxis                               Axis that defines the destination dimension, where to copy the blocks.
+ *  @param      blockDimensions                  Defines the size of the rectangular spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the batch dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
+                          spatialAxes:(NSArray<NSNumber *> *) spatialAxes
+                            batchAxis:(NSInteger) batchAxis
+                      blockDimensions:(NSArray<NSNumber *> *) blockDimensions
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( spaceToBatch(_:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:));
+
+-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
+                    spatialAxesTensor:(MPSGraphTensor *) spatialAxesTensor
+                      batchAxisTensor:(MPSGraphTensor *) batchAxisTensor
+                blockDimensionsTensor:(MPSGraphTensor *) blockDimensionsTensor
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( spaceToBatch(_:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:));
+
+/*!
+ *  @abstract   Create a batch-to-space3d op and return the result tensor.
+ *  @discussion 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). `usePixelShuffleOrder`
+ *              can be used to control how the data within spatial blocks is ordered in the
+ *              `batchAxis` dimension: with `usePixelShuffleOrder = YES` the values within the
+ *              spatial block are stored 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 `spaceToBatch`.
+ *              Note: This operation is a generalization of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      spatialAxes                           Axes that define the dimensions containing the spatial blocks.
+ *  @param      batchAxis                               Axis that defines the source dimension, from which to copy the blocks.
+ *  @param      blockDimensions                  Defines the size of the rectangular spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the batch dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)batchToSpaceTensor:(MPSGraphTensor *) tensor
+                          spatialAxes:(NSArray<NSNumber *> *) spatialAxes
+                            batchAxis:(NSInteger) batchAxis
+                      blockDimensions:(NSArray<NSNumber *> *) blockDimensions
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( batchToSpace(_:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:));
+
+-(MPSGraphTensor *)batchToSpaceTensor:(MPSGraphTensor *) tensor
+                    spatialAxesTensor:(MPSGraphTensor *) spatialAxesTensor
+                      batchAxisTensor:(MPSGraphTensor *) batchAxisTensor
+                blockDimensionsTensor:(MPSGraphTensor *) blockDimensionsTensor
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( batchToSpace(_:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:));
+
+/*!
  *  @abstract   Create reverse op and return the result tensor
  *  @discussion Reverses a tensor on given axes
  *              https://www.tensorflow.org/api_docs/python/tf/reverse.
Clone this wiki locally