Class MPSGraph

  • All Implemented Interfaces:
    NSObject

    public class MPSGraph
    extends MPSGraphObject
    Optimized representation of a compute graph of MPSGraphOperations and MPSGraphTensors. An MPSGraph is a symbolic representation of operations to be utilized to execute compute graphs on a device. API-Since: 14.0
    • Constructor Detail

      • MPSGraph

        protected MPSGraph​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName​(@NotNull
                                                                                                           @NotNull MPSGraphTensor gradient,
                                                                                                           @NotNull
                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                           @NotNull
                                                                                                           @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                                           @Nullable
                                                                                                           @Nullable java.lang.String name)
        Creates a L2-Norm pooling gradient operation and returns the result tensor. - Parameters: - 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. API-Since: 15.0
      • L2NormPooling4DWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor L2NormPooling4DWithSourceTensorDescriptorName​(@NotNull
                                                                                     @NotNull MPSGraphTensor source,
                                                                                     @NotNull
                                                                                     @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String name)
        Creates a 4d L2-Norm pooling operation and returns the result tensor. - Parameters: - 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 API-Since: 15.0
      • absoluteWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor absoluteWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        Returns the absolute values of the input tensor elements. - Parameters: - 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.
      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • acosWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor acosWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the inverse cosine operation to the input tensor elements. - Parameters: - 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.
      • acoshWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor acoshWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        Applies the inverse hyperbolic cosine operation to the input tensor elements. - Parameters: - 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.
      • additionWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor additionWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                    @NotNull MPSGraphTensor primaryTensor,
                                                                                    @NotNull
                                                                                    @NotNull MPSGraphTensor secondaryTensor,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        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: 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.
      • alloc

        public static MPSGraph alloc()
      • allocWithZone

        public static MPSGraph allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • applyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName

        @NotNull
        public @NotNull MPSGraphOperation applyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName​(@NotNull
                                                                                                                         @NotNull MPSGraphTensor learningRateTensor,
                                                                                                                         @NotNull
                                                                                                                         @NotNull MPSGraphVariableOp variable,
                                                                                                                         @NotNull
                                                                                                                         @NotNull MPSGraphTensor gradientTensor,
                                                                                                                         @Nullable
                                                                                                                         @Nullable java.lang.String name)
        The StochasticGradientDescent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable this op directly writes to the variable - Parameters: - learningRateTensor: scalar tensor which indicates the learning rate to use with the optimizer - variable: variable operation with trainable parameters - gradientTensor: partial gradient of the trainable parameters with respect to loss - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • asinWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor asinWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the inverse sine operation to the input tensor elements. - Parameters: - 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.
      • asinhWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor asinhWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        Applies the inverse hyperbolic sine operation to the input tensor elements. - Parameters: - 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.
      • assignVariableWithValueOfTensorName

        @NotNull
        public @NotNull MPSGraphOperation assignVariableWithValueOfTensorName​(@NotNull
                                                                              @NotNull MPSGraphTensor variable,
                                                                              @NotNull
                                                                              @NotNull MPSGraphTensor tensor,
                                                                              @Nullable
                                                                              @Nullable java.lang.String name)
        Creates an assign op which writes at this point of execution of the graph. - Parameters: - 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.
      • atan2WithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor atan2WithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor primaryTensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor secondaryTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        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: 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.
      • atanWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor atanWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the inverse tangent operation to the input tensor elements. - Parameters: - 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.
      • atanhWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor atanhWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        Applies the inverse hyperbolic tangent operation to the input tensor elements. - Parameters: - 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.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • avgPooling2DGradientWithGradientTensorSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor avgPooling2DGradientWithGradientTensorSourceTensorDescriptorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Creates a 2d average pooling gradient operation and returns the result tensor. - Parameters: - 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
      • avgPooling2DWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor avgPooling2DWithSourceTensorDescriptorName​(@NotNull
                                                                                  @NotNull MPSGraphTensor source,
                                                                                  @NotNull
                                                                                  @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Creates a 2d average-pooling operation and returns the result tensor. - Parameters: - 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
      • avgPooling4DGradientWithGradientTensorSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor avgPooling4DGradientWithGradientTensorSourceTensorDescriptorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Creates an average pooling gradient operation and returns the result tensor. - Parameters: - 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. API-Since: 15.0
      • avgPooling4DWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor avgPooling4DWithSourceTensorDescriptorName​(@NotNull
                                                                                  @NotNull MPSGraphTensor source,
                                                                                  @NotNull
                                                                                  @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Creates a 4d average pooling operation and returns the result tensor. - Parameters: - 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 API-Since: 15.0
      • broadcastTensorToShapeTensorName

        @NotNull
        public @NotNull MPSGraphTensor broadcastTensorToShapeTensorName​(@NotNull
                                                                        @NotNull MPSGraphTensor tensor,
                                                                        @NotNull
                                                                        @NotNull MPSGraphTensor shapeTensor,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        Creates a broadcast operation and returns the result tensor. Broadcasts values inside the tensor, starting from the trailing dimensions, to give it the correct shape. This is equivalent to the broadcasting for arithmetic operations when operands have different shapes. - Parameters: - 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. API-Since: 15.0
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • castTensorToTypeName

        @NotNull
        public @NotNull MPSGraphTensor castTensorToTypeName​(@NotNull
                                                            @NotNull MPSGraphTensor tensor,
                                                            int type,
                                                            @Nullable
                                                            @Nullable java.lang.String name)
        Creates a cast operation and returns the result tensor. Returns the input tensor casted to the specied data type. - Parameters: - tensor: The input tensor. - type: The datatype to which MPSGraph casts the input. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • ceilWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor ceilWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the ceiling operation to the input tensor elements. - Parameters: - 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.
      • clampWithTensorMinValueTensorMaxValueTensorName

        @NotNull
        public @NotNull MPSGraphTensor clampWithTensorMinValueTensorMaxValueTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor minValueTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor maxValueTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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: - 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.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • concatTensorWithTensorDimensionName

        @NotNull
        public @NotNull MPSGraphTensor concatTensorWithTensorDimensionName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           @NotNull
                                                                           @NotNull MPSGraphTensor tensor2,
                                                                           long dimensionIndex,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        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 datatype. - Parameters: - 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.
      • concatTensorsDimensionInterleaveName

        @NotNull
        public @NotNull MPSGraphTensor concatTensorsDimensionInterleaveName​(@NotNull
                                                                            @NotNull NSArray<? extends MPSGraphTensor> tensors,
                                                                            long dimensionIndex,
                                                                            boolean interleave,
                                                                            @Nullable
                                                                            @Nullable java.lang.String name)
        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. When interleave is specified, all tensors will be interleaved. To interleave, make sure to provide broadcast compatible inputs along the specified dimension as well. For example: ```md operand0 = [1, 2, 3] operand1 = [4, 5, 6] concat([operand0, operand1], axis = 0, interleave = YES) = [1, 4, 2, 5, 3, 6] ``` - Parameters: - 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.
      • concatTensorsDimensionName

        @NotNull
        public @NotNull MPSGraphTensor concatTensorsDimensionName​(@NotNull
                                                                  @NotNull NSArray<? extends MPSGraphTensor> tensors,
                                                                  long dimensionIndex,
                                                                  @Nullable
                                                                  @Nullable java.lang.String name)
        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 datatype. - Parameters: - 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
      • constantWithScalarDataType

        @NotNull
        public @NotNull MPSGraphTensor constantWithScalarDataType​(double scalar,
                                                                  int dataType)
        Creates a constant op and returns the result tensor. - Parameters: - scalar: The scalar value to fill the entire tensor values with. - dataType: The dataType of the constant tensor. - Returns: A valid MPSGraphTensor object.
      • controlDependencyWithOperationsDependentBlockName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> controlDependencyWithOperationsDependentBlockName​(@NotNull
                                                                                                            @NotNull NSArray<? extends MPSGraphOperation> operations,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraph.Block_controlDependencyWithOperationsDependentBlockName dependentBlock,
                                                                                                            @Nullable
                                                                                                            @Nullable java.lang.String name)
        Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed. This call blocks till execution has completed. - Parameters: - operations: Operations maked as control dependency for all ops created inside the dependent block - dependentBlock: MPSGraphControlFlowDependencyBlock which is provided by caller to create dependent ops - name: name of scope - Returns: A valid MPSGraphTensor array with results returned from dependentBlock forwarded
      • convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                         @NotNull MPSGraphTensor gradient,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphTensor weights,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphTensor outputShapeTensor,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable java.lang.String name)
        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. - Parameters: - incomingGradient: Incoming loss gradient tensor - weights: Forward pass weights tensor - outputShapeTensor: 4D Int32 or Int64 tensor. Shape of the forward pass source tensor - forwardConvolutionDescriptor: Forward convolution 2d op ``descriptor`` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                           @NotNull MPSGraphTensor gradient,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor outputShapeTensor,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                           @Nullable
                                                                                                                                                           @Nullable java.lang.String name)
        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. - Parameters: - incomingGradient: Incoming loss gradient tensor - weights: Forward pass weights tensor - outputShapeTensor: 4D int32 or Int64 Tensor. Shape of the forward pass source tensor - forwardConvolutionDescriptor: Forward convolution 2d op ``descriptor`` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • convolution2DWithSourceTensorWeightsTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution2DWithSourceTensorWeightsTensorDescriptorName​(@NotNull
                                                                                                @NotNull MPSGraphTensor source,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor weights,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphConvolution2DOpDescriptor descriptor,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        Creates a 2d (forward) convolution operation and returns the result tensor. - Parameters: - 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. - Returns: A valid MPSGraphTensor object
      • convolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                                  @NotNull MPSGraphTensor incomingGradient,
                                                                                                                                                                  @NotNull
                                                                                                                                                                  @NotNull MPSGraphTensor weights,
                                                                                                                                                                  @NotNull
                                                                                                                                                                  @NotNull MPSGraphTensor outputShape,
                                                                                                                                                                  @NotNull
                                                                                                                                                                  @NotNull MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                                  @Nullable
                                                                                                                                                                  @Nullable java.lang.String name)
        Creates a convolution transpose gradient operation with respect of source tensor of convolution transpose operation and returns the result tensor. 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 - weights: Forward pass weights tensor - outputShape: 1D Int32 or Int64 Tensor. Shape of the forward pass source tensor - forwardConvolutionDescriptor: Forward pass op descriptor - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • convolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                                    @NotNull MPSGraphTensor incomingGradientTensor,
                                                                                                                                                                    @NotNull
                                                                                                                                                                    @NotNull MPSGraphTensor source,
                                                                                                                                                                    @NotNull
                                                                                                                                                                    @NotNull MPSGraphTensor outputShape,
                                                                                                                                                                    @NotNull
                                                                                                                                                                    @NotNull MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                                    @Nullable
                                                                                                                                                                    @Nullable java.lang.String name)
        Creates a convolution transpose gradient operation with respect of the weights tensor of convolution transpose operation and returns the result tensor. 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 - source: Forward pass source tensor - outputShape: 1D Int32 or Int64 Tensor. Shape of the forward pass source weights tensor - forwardConvolutionDescriptor: Forward pass op descriptor - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • convolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor source,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor weights,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor outputShape,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphConvolution2DOpDescriptor descriptor,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        Creates a convolution transpose operation and return the result tensor. - Parameters: - source: input tensor - weights: weights tensor - outputShape: 1D Int32 or Int64 tensor. shape of the result tensor - descriptor: descriptor for the corresponding forward Conv2d operation - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • cosWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor cosWithTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Applies the cosine operation to the input tensor elements. - Parameters: - 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.
      • coshWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor coshWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the hyperbolic cosine operation to the input tensor elements. - Parameters: - 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.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • depthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor depthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName​(@NotNull
                                                                                                                         @NotNull MPSGraphTensor tensor,
                                                                                                                         long widthAxis,
                                                                                                                         long heightAxis,
                                                                                                                         long depthAxis,
                                                                                                                         long blockSize,
                                                                                                                         boolean usePixelShuffleOrder,
                                                                                                                         @Nullable
                                                                                                                         @Nullable java.lang.String name)
        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 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 ``MPSGraph/spaceToDepth2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:``. - Parameters: - tensor: The input tensor. - 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. API-Since: 15.0
      • depthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor depthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName​(@NotNull
                                                                                                                                           @NotNull MPSGraphTensor tensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor widthAxisTensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor heightAxisTensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor depthAxisTensor,
                                                                                                                                           long blockSize,
                                                                                                                                           boolean usePixelShuffleOrder,
                                                                                                                                           @Nullable
                                                                                                                                           @Nullable java.lang.String name)
        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 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 ``MPSGraph/spaceToDepth2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``. - Parameters: - tensor: The input tensor. - 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. API-Since: 15.0
      • depthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor depthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName​(@NotNull
                                                                                                         @NotNull MPSGraphTensor source,
                                                                                                         @NotNull
                                                                                                         @NotNull MPSGraphTensor weights,
                                                                                                         @NotNull
                                                                                                         @NotNull MPSGraphDepthwiseConvolution2DOpDescriptor descriptor,
                                                                                                         @Nullable
                                                                                                         @Nullable java.lang.String name)
        Creates a 2d depthwise convolution operation and returns the result tensor. - Parameters: - 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
      • depthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor depthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName​(@NotNull
                                                                                                         @NotNull MPSGraphTensor source,
                                                                                                         @NotNull
                                                                                                         @NotNull MPSGraphTensor weights,
                                                                                                         @NotNull
                                                                                                         @NotNull MPSGraphDepthwiseConvolution3DOpDescriptor descriptor,
                                                                                                         @Nullable
                                                                                                         @Nullable java.lang.String name)
        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 ``MPSGraphDepthwiseConvolution3DOpDescriptor/channelDimensionIndex`` property. If your weights need a different layout add a permute operation on them before this operation. - Parameters: - 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 API-Since: 15.0
      • description_static

        public static java.lang.String description_static()
      • divisionNoNaNWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor divisionNoNaNWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                         @NotNull MPSGraphTensor primaryTensor,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor secondaryTensor,
                                                                                         @Nullable
                                                                                         @Nullable java.lang.String name)
        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: 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.
      • divisionWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor divisionWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                    @NotNull MPSGraphTensor primaryTensor,
                                                                                    @NotNull
                                                                                    @NotNull MPSGraphTensor secondaryTensor,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        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: 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.
      • dropoutTensorRateName

        @NotNull
        public @NotNull MPSGraphTensor dropoutTensorRateName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             double rate,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        Creates a dropout op and return the result Removes values in the `tensor` with a percentage chance equal to `rate`. Removed values are set to 0 - Parameters: - tensor: Input tensor - rate: The rate of values to be set to 0 - name: The name for the operation - Returns: A valid MPSGraphTensor object
      • dropoutTensorRateTensorName

        @NotNull
        public @NotNull MPSGraphTensor dropoutTensorRateTensorName​(@NotNull
                                                                   @NotNull MPSGraphTensor tensor,
                                                                   @NotNull
                                                                   @NotNull MPSGraphTensor rate,
                                                                   @Nullable
                                                                   @Nullable java.lang.String name)
        Creates a dropout op and return the result Removes values in the `tensor` with a percentage chance equal to `rate`. Removed values are set to 0 - Parameters: - tensor: Input tensor - rate: The rate of values to be set to 0 - name: The name for the operation - Returns: A valid MPSGraphTensor object
      • equalWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor equalWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor primaryTensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor secondaryTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        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: 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.
      • erfWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor erfWithTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Applies the error function to the input tensor elements. - Parameters: - 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.
      • exponentBase10WithTensorName

        @NotNull
        public @NotNull MPSGraphTensor exponentBase10WithTensorName​(@NotNull
                                                                    @NotNull MPSGraphTensor tensor,
                                                                    @Nullable
                                                                    @Nullable java.lang.String name)
        Applies an exponent with base ten to the input tensor elements. - Parameters: - 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.
      • exponentBase2WithTensorName

        @NotNull
        public @NotNull MPSGraphTensor exponentBase2WithTensorName​(@NotNull
                                                                   @NotNull MPSGraphTensor tensor,
                                                                   @Nullable
                                                                   @Nullable java.lang.String name)
        Applies an exponent with base two to the input tensor elements. - Parameters: - 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.
      • exponentWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor exponentWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        Applies the natural exponent to the input tensor elements. - Parameters: - 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.
      • flatten2DTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor flatten2DTensorAxisName​(@NotNull
                                                               @NotNull MPSGraphTensor tensor,
                                                               long axis,
                                                               @Nullable
                                                               @Nullable java.lang.String name)
        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. - Parameters: - tensor: The tensor to be flattened. - axis: The axis around which to flatten. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • flatten2DTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor flatten2DTensorAxisTensorName​(@NotNull
                                                                     @NotNull MPSGraphTensor tensor,
                                                                     @NotNull
                                                                     @NotNull MPSGraphTensor axisTensor,
                                                                     @Nullable
                                                                     @Nullable java.lang.String name)
        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. - Parameters: - 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. API-Since: 15.0
      • floorModuloWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor floorModuloWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor primaryTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor secondaryTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String 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: 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.
      • floorWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor floorWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        Applies the floor operation to the input tensor elements. - Parameters: - 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.
      • forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor lowerBound,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor upperBound,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor step,
                                                                                                                          @NotNull
                                                                                                                          @NotNull NSArray<? extends MPSGraphTensor> initialBodyArguments,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraph.Block_forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName body,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        Adds a forLoop operation, The lower and upper bounds specify a half-open range: the range includes the lower bound but does not include the upper bound. - Parameters: - lowerBound: lowerBound value of the loop, this is a scalar tensor, this is the index the loop will start with - upperBound: upperBound value of the loop, this is a scalar tensor - step: step value of the loop, this is a scalar tensor and must be positive - initialBodyArguments: initial set of iteration arguments passed to the bodyBlock of the for loop - body: bodyBlock, this will execute the body of the forLoop - name: name of operation - Returns: A valid MPSGraphTensor array with same count and corresponding elementTypes as initialIterationArguments and return types of the forLoop
      • forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName​(@NotNull
                                                                                                                    @NotNull MPSGraphTensor numberOfIterations,
                                                                                                                    @NotNull
                                                                                                                    @NotNull NSArray<? extends MPSGraphTensor> initialBodyArguments,
                                                                                                                    @NotNull
                                                                                                                    @NotNull MPSGraph.Block_forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName body,
                                                                                                                    @Nullable
                                                                                                                    @Nullable java.lang.String name)
        Adds a forLoop operation, with a specific number of iterations - Parameters: - numberOfIterations: tensor with number of iterations the loop will execute - initialBodyArguments: initial set of iteration arguments passed to the bodyBlock of the for loop - body: bodyBlock, this will execute the body of the forLoop, index will go from 0 to numberOfIterations-1 - name: name of operation - Returns: A valid MPSGraphTensor array with same count and corresponding elementTypes as initialIterationArguments and return types of the forLoop
      • gatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName

        @NotNull
        public @NotNull MPSGraphTensor gatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName​(@NotNull
                                                                                                 @NotNull MPSGraphTensor updatesTensor,
                                                                                                 @NotNull
                                                                                                 @NotNull MPSGraphTensor indicesTensor,
                                                                                                 long batchDimensions,
                                                                                                 @Nullable
                                                                                                 @Nullable java.lang.String name)
        Create GatherND op and return the result tensor Gathers the slices in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as ```md B = batchDims U = updates.rank - B P = res.rank - B Q = inds.rank - B K = inds.shape[-1] index_slice = indices[i_{b0},...,i_{bB},i_{0},..,i_{Q-1}] res[i_{b0},...,i_{bB},i_{0},...,i_{Q-1}] = updates[i_{b0},...,i_{bB},index_slice[0],...,index_slice[K-1]] ``` The tensors have the following shape requirements ```md U > 0; P > 0; Q > 0 K <= U P = (U-K) + Q-1 indices.shape[0:Q-1] = res.shape[0:Q-1] res.shape[Q:P] = updates.shape[K:U] ``` - Parameters: - updatesTensor: Tensor containing slices to be inserted into the result tensor - indicesTensor: Tensor containg the updates indices to read slices from - batchDimensions: The number of batch dimensions - name: The name for the operation - Returns: A valid MPSGraphTensor object
      • gatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName

        @NotNull
        public @NotNull MPSGraphTensor gatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName​(@NotNull
                                                                                                   @NotNull MPSGraphTensor updatesTensor,
                                                                                                   @NotNull
                                                                                                   @NotNull MPSGraphTensor indicesTensor,
                                                                                                   long axis,
                                                                                                   long batchDimensions,
                                                                                                   @Nullable
                                                                                                   @Nullable java.lang.String name)
        Create Gather op and return the result tensor Gathers the values in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as ```md B = batchDims U = updates.rank P = res.rank Q = inds.rank res[p_{0},...p_{axis-1}, i_{B},...,i_{Q}, ...,p_{axis+1},...,p{U-1}] = updates[p_{0},...p_{axis-1}, indices[p_{0},...,p_{B-1},i_{B},...,i_{Q}, ...,p_{axis+1},...,p{U-1}] ``` The tensors have the following shape requirements ```md P = Q-B + U-1 indices.shape[0:B] = updates.shape[0:B] = res.shape[0:B] res.shape[0:axis] = updates.shape[0:axis] res.shape[axis:axis+Q-B] = indices.shape[B:] res.shape[axis+1+Q-B:] = updates.shape[axis+1:] ``` - Parameters: - updatesTensor: Tensor containing slices to be inserted into the result tensor - indicesTensor: Tensor containg the updates indices to read slices from - axis: The dimension on which to perform the gather - batchDimensions: The number of batch dimensions - name: The name for the operation - Returns: A valid MPSGraphTensor object
      • gradientForPrimaryTensorWithTensorsName

        @NotNull
        public @NotNull NSDictionary<? extends MPSGraphTensor,​? extends MPSGraphTensor> gradientForPrimaryTensorWithTensorsName​(@NotNull
                                                                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                                                                      @NotNull
                                                                                                                                      @NotNull NSArray<? extends MPSGraphTensor> tensors,
                                                                                                                                      @Nullable
                                                                                                                                      @Nullable java.lang.String name)
        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.
      • greaterThanOrEqualToWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor greaterThanOrEqualToWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                                @NotNull MPSGraphTensor primaryTensor,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor secondaryTensor,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        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: 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.
      • greaterThanWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor greaterThanWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor primaryTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor secondaryTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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: 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.
      • hash_static

        public static long hash_static()
      • identityWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor identityWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        Copies the input tensor values into the output, behaving as an identity operation. - Parameters: - 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.
      • ifWithPredicateTensorThenBlockElseBlockName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> ifWithPredicateTensorThenBlockElseBlockName​(@NotNull
                                                                                                      @NotNull MPSGraphTensor predicateTensor,
                                                                                                      @NotNull
                                                                                                      @NotNull MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_1 thenBlock,
                                                                                                      @Nullable
                                                                                                      @Nullable MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_2 elseBlock,
                                                                                                      @Nullable
                                                                                                      @Nullable java.lang.String name)
        Add an if/then/else op to the graph - Parameters: - predicateTensor: Tensor must have a single scalar value, used to decide between then/else branches - thenBlock: If predicate is true operations in this block are executed - elseBlock: If predicate is false operations in this block are executed - name: name of operation - Returns: results If no error, the tensors returned by user. If not empty, user must define both then/else block, both should have same number of arguments and each corresponding argument should have same elementTypes.
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isFiniteWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor isFiniteWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        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: 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.
      • isInfiniteWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor isInfiniteWithTensorName​(@NotNull
                                                                @NotNull MPSGraphTensor tensor,
                                                                @Nullable
                                                                @Nullable java.lang.String name)
        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: 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.
      • isNaNWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor isNaNWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        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: 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.
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • leakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName

        @NotNull
        public @NotNull MPSGraphTensor leakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor alphaTensor,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        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: The alpha tensor - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object API-Since: 15.0
      • leakyReLUWithTensorAlphaName

        @NotNull
        public @NotNull MPSGraphTensor leakyReLUWithTensorAlphaName​(@NotNull
                                                                    @NotNull MPSGraphTensor tensor,
                                                                    double alpha,
                                                                    @Nullable
                                                                    @Nullable java.lang.String name)
        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: The scalar value alpha used by all elements in the input tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object API-Since: 15.0
      • leakyReLUWithTensorAlphaTensorName

        @NotNull
        public @NotNull MPSGraphTensor leakyReLUWithTensorAlphaTensorName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          @NotNull
                                                                          @NotNull MPSGraphTensor alphaTensor,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        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: The input tensor. - alpha: The alpha tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object API-Since: 15.0
      • lessThanOrEqualToWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor lessThanOrEqualToWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                             @NotNull MPSGraphTensor primaryTensor,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor secondaryTensor,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String name)
        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: 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.
      • lessThanWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor lessThanWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                    @NotNull MPSGraphTensor primaryTensor,
                                                                                    @NotNull
                                                                                    @NotNull MPSGraphTensor secondaryTensor,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        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: 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.
      • logarithmBase10WithTensorName

        @NotNull
        public @NotNull MPSGraphTensor logarithmBase10WithTensorName​(@NotNull
                                                                     @NotNull MPSGraphTensor tensor,
                                                                     @Nullable
                                                                     @Nullable java.lang.String name)
        Computes the logarithm with base ten to the input tensor elements. - Parameters: - 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.
      • logarithmBase2WithTensorName

        @NotNull
        public @NotNull MPSGraphTensor logarithmBase2WithTensorName​(@NotNull
                                                                    @NotNull MPSGraphTensor tensor,
                                                                    @Nullable
                                                                    @Nullable java.lang.String name)
        Computes the logarithm with base two to the input tensor elements. - Parameters: - 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.
      • logarithmWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor logarithmWithTensorName​(@NotNull
                                                               @NotNull MPSGraphTensor tensor,
                                                               @Nullable
                                                               @Nullable java.lang.String name)
        Computes the natural logarithm to the input tensor elements. - Parameters: - 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.
      • logicalANDWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalANDWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor secondaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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: 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.
      • logicalNANDWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalNANDWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor primaryTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor secondaryTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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: 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.
      • logicalNORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalNORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor secondaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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: 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.
      • logicalORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                     @NotNull MPSGraphTensor primaryTensor,
                                                                                     @NotNull
                                                                                     @NotNull MPSGraphTensor secondaryTensor,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String name)
        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: 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.
      • logicalXNORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalXNORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor primaryTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor secondaryTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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: 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.
      • logicalXORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor logicalXORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor secondaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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: 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.
      • matrixMultiplicationWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor matrixMultiplicationWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                                @NotNull MPSGraphTensor primaryTensor,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor secondaryTensor,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        Computes the matrix multiplication of 2 input tensors with support for broadcasting. - Parameters: - 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.
      • maxPooling2DGradientWithGradientTensorSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling2DGradientWithGradientTensorSourceTensorDescriptorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Creates a max pooling gradient operation and returns the result tensor. - Parameters: - 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
      • maxPooling2DWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling2DWithSourceTensorDescriptorName​(@NotNull
                                                                                  @NotNull MPSGraphTensor source,
                                                                                  @NotNull
                                                                                  @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Creates a 2d max-pooling operation and returns the result tensor. - Parameters: - 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
      • maxPooling4DGradientWithGradientTensorSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling4DGradientWithGradientTensorSourceTensorDescriptorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Creates a max pooling gradient operation and returns the result tensor. - Parameters: - 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. API-Since: 15.0
      • maxPooling4DWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling4DWithSourceTensorDescriptorName​(@NotNull
                                                                                  @NotNull MPSGraphTensor source,
                                                                                  @NotNull
                                                                                  @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Creates a 4d max-pooling operation and returns the result tensor. - Parameters: - 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 API-Since: 15.0
      • maximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor maximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                                     @NotNull MPSGraphTensor primaryTensor,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor secondaryTensor,
                                                                                                     @Nullable
                                                                                                     @Nullable java.lang.String name)
        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: 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. API-Since: 15.0
      • maximumWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor maximumWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                   @NotNull MPSGraphTensor primaryTensor,
                                                                                   @NotNull
                                                                                   @NotNull MPSGraphTensor secondaryTensor,
                                                                                   @Nullable
                                                                                   @Nullable java.lang.String name)
        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: 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.
      • meanOfTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor meanOfTensorAxesName​(@NotNull
                                                            @NotNull MPSGraphTensor tensor,
                                                            @NotNull
                                                            @NotNull NSArray<? extends NSNumber> axes,
                                                            @Nullable
                                                            @Nullable java.lang.String name)
        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: An optional name for the operation. - Returns: A valid `MPSGraphTensor` object.
      • minimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor minimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                                     @NotNull MPSGraphTensor primaryTensor,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor secondaryTensor,
                                                                                                     @Nullable
                                                                                                     @Nullable java.lang.String name)
        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: 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. API-Since: 15.0
      • minimumWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor minimumWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                   @NotNull MPSGraphTensor primaryTensor,
                                                                                   @NotNull
                                                                                   @NotNull MPSGraphTensor secondaryTensor,
                                                                                   @Nullable
                                                                                   @Nullable java.lang.String name)
        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: 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.
      • moduloWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor moduloWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                  @NotNull MPSGraphTensor primaryTensor,
                                                                                  @NotNull
                                                                                  @NotNull MPSGraphTensor secondaryTensor,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        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: 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.
      • multiplicationWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor multiplicationWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                          @NotNull MPSGraphTensor primaryTensor,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor secondaryTensor,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String name)
        Multiplies two input tensors. This operation creates a multiply op and returns the result tensor. It supports broadcasting as well. ```md resultTensor = primaryTensor * secondaryTensor ``` - Parameters: - 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.
      • negativeWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor negativeWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        Applies negative to the input tensor elements. - Parameters: - 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.
      • new_objc

        public static MPSGraph new_objc()
        Create a new MPSGraph to insert nodes in.
      • normalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName

        @NotNull
        public @NotNull MPSGraphTensor normalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName​(@NotNull
                                                                                                                        @NotNull MPSGraphTensor incomingGradientTensor,
                                                                                                                        @NotNull
                                                                                                                        @NotNull MPSGraphTensor sourceTensor,
                                                                                                                        @NotNull
                                                                                                                        @NotNull NSArray<? extends NSNumber> axes,
                                                                                                                        @Nullable
                                                                                                                        @Nullable java.lang.String name)
        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. For example (assuming your data is in `NxHxWxC` format) Batch normalization: axes = [0, 1, 2] Instance normalization: axes = [1, 2] - Parameters: - 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.
      • normalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName

        @NotNull
        public @NotNull MPSGraphTensor normalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName​(@NotNull
                                                                                                                                                        @NotNull MPSGraphTensor incomingGradientTensor,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull MPSGraphTensor sourceTensor,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull MPSGraphTensor meanTensor,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull MPSGraphTensor varianceTensor,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull NSArray<? extends NSNumber> axes,
                                                                                                                                                        float epsilon,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable java.lang.String name)
        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. For example (assuming your data is in `NxHxWxC` format) Batch normalization: axes = [0, 1, 2] Instance normalization: axes = [1, 2] - Parameters: - 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: An optional name for the operation. - Returns: A valid `MPSGraphTensor` object.
      • normalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName

        @NotNull
        public @NotNull MPSGraphTensor normalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName​(@NotNull
                                                                                                                                                                                                   @NotNull MPSGraphTensor incomingGradientTensor,
                                                                                                                                                                                                   @NotNull
                                                                                                                                                                                                   @NotNull MPSGraphTensor sourceTensor,
                                                                                                                                                                                                   @NotNull
                                                                                                                                                                                                   @NotNull MPSGraphTensor meanTensor,
                                                                                                                                                                                                   @NotNull
                                                                                                                                                                                                   @NotNull MPSGraphTensor varianceTensor,
                                                                                                                                                                                                   @Nullable
                                                                                                                                                                                                   @Nullable MPSGraphTensor gamma,
                                                                                                                                                                                                   @Nullable
                                                                                                                                                                                                   @Nullable MPSGraphTensor gammaGradient,
                                                                                                                                                                                                   @Nullable
                                                                                                                                                                                                   @Nullable MPSGraphTensor betaGradient,
                                                                                                                                                                                                   @NotNull
                                                                                                                                                                                                   @NotNull NSArray<? extends NSNumber> axes,
                                                                                                                                                                                                   float epsilon,
                                                                                                                                                                                                   @Nullable
                                                                                                                                                                                                   @Nullable java.lang.String name)
        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. For example (assuming your data is in `NxHxWxC` format) Batch normalization: axes = [0, 1, 2] Instance normalization: axes = [1, 2] - Parameters: - 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: An optional name for the operation.
      • normalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName

        @NotNull
        public @NotNull MPSGraphTensor normalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName​(@NotNull
                                                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor mean,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor variance,
                                                                                                                       @Nullable
                                                                                                                       @Nullable MPSGraphTensor gamma,
                                                                                                                       @Nullable
                                                                                                                       @Nullable MPSGraphTensor beta,
                                                                                                                       float epsilon,
                                                                                                                       @Nullable
                                                                                                                       @Nullable java.lang.String name)
        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`. 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] Instance normalization: axes = [1, 2] Shapes for gamma and beta must match the input data along at least one dimension and will be broadcast along the rest. For batch normalization, gamma and beta would typically be 1x1x1xC i.e. one value per channel. - Parameters: - 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: An optional name for the operation. - Returns: A valid `MPSGraphTensor` object.
      • notEqualWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor notEqualWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                    @NotNull MPSGraphTensor primaryTensor,
                                                                                    @NotNull
                                                                                    @NotNull MPSGraphTensor secondaryTensor,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        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: 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.
      • notWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor notWithTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Applies the logical not operation to the input tensor elements. - Parameters: - 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.
      • oneHotWithIndicesTensorDepthAxisDataTypeName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthAxisDataTypeName​(@NotNull
                                                                                    @NotNull MPSGraphTensor indicesTensor,
                                                                                    long depth,
                                                                                    long axis,
                                                                                    int dataType,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the rank of `indicesTensor` + 1. Inserts a new axis at the axis specified, or the minor axis if `axis` is -1. The values at the indices in the indicesTensor will be set to 1, and all other values will be set to 0. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - axis: The axis to insert the new oneHot vector at - dataType: MPSDataType of the result tensor - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • oneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName​(@NotNull
                                                                                                   @NotNull MPSGraphTensor indicesTensor,
                                                                                                   long depth,
                                                                                                   long axis,
                                                                                                   int dataType,
                                                                                                   double onValue,
                                                                                                   double offValue,
                                                                                                   @Nullable
                                                                                                   @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the indicesTensor rank + 1. Inserts a new axis at the axis specified, or the minor axis if axis is -1. The values at the indices in the indicesTensor will have the onValue, and all other values will be set to the offValue. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - axis: The axis to insert the new oneHot vector at. Defaults to -1, the minor axis - dataType: MPSDataType of the result tensor Defaults to MPSDataTypeFloat - onValue: The value for indices designated by the indicesTensor. This value must match the specified data type. Defaults to 1.0f - offValue: The value for indices not designated by the indicesTensor. This value must match the specified data type. Defaults to 0.0f - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • oneHotWithIndicesTensorDepthAxisName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthAxisName​(@NotNull
                                                                            @NotNull MPSGraphTensor indicesTensor,
                                                                            long depth,
                                                                            long axis,
                                                                            @Nullable
                                                                            @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the rank of `indicesTensor` + 1, of type MPSDataTypeFloat32. Inserts a new axis at the axis specified, or the minor axis if `axis` is -1. The values at the indices in the indicesTensor will be set to 1, and all other values will be set to 0. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - axis: The axis to insert the new oneHot vector at - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • oneHotWithIndicesTensorDepthDataTypeName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthDataTypeName​(@NotNull
                                                                                @NotNull MPSGraphTensor indicesTensor,
                                                                                long depth,
                                                                                int dataType,
                                                                                @Nullable
                                                                                @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the rank of `indicesTensor` + 1. Inserts a new axis at the minor dimension. The values at the indices in the indicesTensor will be set to 1, and all other values will be set to 0. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - dataType: MPSDataType of the result tensor - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • oneHotWithIndicesTensorDepthDataTypeOnValueOffValueName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthDataTypeOnValueOffValueName​(@NotNull
                                                                                               @NotNull MPSGraphTensor indicesTensor,
                                                                                               long depth,
                                                                                               int dataType,
                                                                                               double onValue,
                                                                                               double offValue,
                                                                                               @Nullable
                                                                                               @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the rank of `indicesTensor` + 1. Inserts a new axis at the minor dimension. The values at the indices in the indicesTensor will have the onValue, and all other values will be set to the offValue. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - dataType: MPSDataType of the result tensor - onValue: The value for indices designated by the indicesTensor. This value must match the specified data type. - offValue: The value for indices not designated by the indicesTensor. This value must match the specified data type. - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • oneHotWithIndicesTensorDepthName

        @NotNull
        public @NotNull MPSGraphTensor oneHotWithIndicesTensorDepthName​(@NotNull
                                                                        @NotNull MPSGraphTensor indicesTensor,
                                                                        long depth,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        Create oneHot op and return the result tensor Creates a tensor of rank equal to the rank of `indicesTensor` + 1, of type MPSDataTypeFloat32. Inserts a new axis at the minor dimension. The values at the indices in the indicesTensor will be set to 1, and all other values will be set to 0. - Parameters: - indicesTensor: Tensor of indices for on values - depth: Depth of the oneHot vector along the axis - name: Name for the operation - Returns: A valid MPSGraphTensor object.
      • options

        public long options()
        Options for the graph, the default value is MPSGraphOptionsDefault.
      • placeholderTensors

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> placeholderTensors()
        Array of all the placeholder tensors.
      • powerWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor powerWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor primaryTensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor secondaryTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        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: 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.
      • reLUGradientWithIncomingGradientSourceTensorName

        @NotNull
        public @NotNull MPSGraphTensor reLUGradientWithIncomingGradientSourceTensorName​(@NotNull
                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                        @NotNull
                                                                                        @NotNull MPSGraphTensor source,
                                                                                        @Nullable
                                                                                        @Nullable java.lang.String name)
        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: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object.
      • reLUWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor reLUWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Computes the ReLU (rectified linear activation unit) function with the input tensor. The operation is: f(x) = max(x, 0). - Parameters: - tensor: The input tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object.
      • readVariableName

        @NotNull
        public @NotNull MPSGraphTensor readVariableName​(@NotNull
                                                        @NotNull MPSGraphTensor variable,
                                                        @Nullable
                                                        @Nullable java.lang.String name)
        Creates a read op which reads at this point of execution of the graph and returns the result tensor. - Parameters: - variable: The variable resource tensor to read from. - name: The name for the operation. - Returns: A valid MPSGraphTensor object.
      • reciprocalWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor reciprocalWithTensorName​(@NotNull
                                                                @NotNull MPSGraphTensor tensor,
                                                                @Nullable
                                                                @Nullable java.lang.String name)
        Applies the reciprocal operation to the input tensor elements. - Parameters: - 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.
      • reductionArgMaximumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionArgMaximumWithTensorAxisName​(@NotNull
                                                                             @NotNull MPSGraphTensor tensor,
                                                                             long axis,
                                                                             @Nullable
                                                                             @Nullable java.lang.String name)
        Create reduction argMax op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • reductionArgMinimumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionArgMinimumWithTensorAxisName​(@NotNull
                                                                             @NotNull MPSGraphTensor tensor,
                                                                             long axis,
                                                                             @Nullable
                                                                             @Nullable java.lang.String name)
        Create reduction argMin op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • reductionMaximumWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionMaximumWithTensorAxesName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          @Nullable
                                                                          @Nullable NSArray<? extends NSNumber> axes,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction max op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMaximumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionMaximumWithTensorAxisName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          long axis,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction max op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMinimumWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionMinimumWithTensorAxesName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          @Nullable
                                                                          @Nullable NSArray<? extends NSNumber> axes,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction min op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMinimumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionMinimumWithTensorAxisName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          long axis,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction minimum op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionProductWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionProductWithTensorAxesName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          @Nullable
                                                                          @Nullable NSArray<? extends NSNumber> axes,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction product op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionProductWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionProductWithTensorAxisName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          long axis,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        Create reduction product op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionSumWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionSumWithTensorAxesName​(@NotNull
                                                                      @NotNull MPSGraphTensor tensor,
                                                                      @Nullable
                                                                      @Nullable NSArray<? extends NSNumber> axes,
                                                                      @Nullable
                                                                      @Nullable java.lang.String name)
        Create reduction sum op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionSumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionSumWithTensorAxisName​(@NotNull
                                                                      @NotNull MPSGraphTensor tensor,
                                                                      long axis,
                                                                      @Nullable
                                                                      @Nullable java.lang.String name)
        Create reduction sum op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reshapeTensorWithShapeTensorName

        @NotNull
        public @NotNull MPSGraphTensor reshapeTensorWithShapeTensorName​(@NotNull
                                                                        @NotNull MPSGraphTensor tensor,
                                                                        @NotNull
                                                                        @NotNull MPSGraphTensor shapeTensor,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        Creates a reshape operation and returns the result 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: 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. API-Since: 15.0
      • resizeTensorSizeTensorModeCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeTensorSizeTensorModeCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                    @NotNull MPSGraphTensor imagesTensor,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor size,
                                                                                                    long mode,
                                                                                                    boolean centerResult,
                                                                                                    boolean alignCorners,
                                                                                                    long layout,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size. Result images will be distorted if size is of different aspect ratio. Resize supports the following modes: Nearest Neighbor - values are interpolated using the closest neighbor pixel Bilinear - values are computed using bilinear interpolation of 4 neighboring pixels Destination indices are computed using direct index scaling by default, with no offset added. If the centerResult parameter is true, the destination indices will be scaled and shifted to be centered on the input image. If the alignCorners parameter is true, the corners of the result images will match the input images. Scaling will be modified to a factor of (size - 1) / (inputSize - 1). When alignCorners is true, the centerResult parameter does nothing. In order to achieve the same behavior as OpenCV's resize and TensorFlowV2's resize, ```md centerResult = YES; alginCorners = NO; ``` To achieve the same behavior as TensorFlowV1 resize ```md centerResult = NO; ``` - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • resizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                           @NotNull MPSGraphTensor gradient,
                                                                                                           @NotNull
                                                                                                           @NotNull MPSGraphTensor input,
                                                                                                           long mode,
                                                                                                           boolean centerResult,
                                                                                                           boolean alignCorners,
                                                                                                           long layout,
                                                                                                           @Nullable
                                                                                                           @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • reverseSquareRootWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor reverseSquareRootWithTensorName​(@NotNull
                                                                       @NotNull MPSGraphTensor tensor,
                                                                       @Nullable
                                                                       @Nullable java.lang.String name)
        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: 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.
      • reverseTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reverseTensorAxesName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             @NotNull
                                                             @NotNull NSArray<? extends NSNumber> axes,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        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: 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. API-Since: 15.0
      • reverseTensorAxesTensorName

        @NotNull
        public @NotNull MPSGraphTensor reverseTensorAxesTensorName​(@NotNull
                                                                   @NotNull MPSGraphTensor tensor,
                                                                   @NotNull
                                                                   @NotNull MPSGraphTensor axesTensor,
                                                                   @Nullable
                                                                   @Nullable java.lang.String name)
        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: 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. API-Since: 15.0
      • reverseTensorName

        @NotNull
        public @NotNull MPSGraphTensor reverseTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        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: The tensor to be reversed. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • rintWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor rintWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Rounds the input tensor elements using "round to nearest even" rounding mode. - Parameters: - 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.
      • roundWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor roundWithTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor tensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        Rounds the input tensor elements. - Parameters: - 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.
      • scatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName

        @NotNull
        public @NotNull MPSGraphTensor scatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName​(@NotNull
                                                                                                                @NotNull MPSGraphTensor dataTensor,
                                                                                                                @NotNull
                                                                                                                @NotNull MPSGraphTensor updatesTensor,
                                                                                                                @NotNull
                                                                                                                @NotNull MPSGraphTensor indicesTensor,
                                                                                                                long batchDimensions,
                                                                                                                long mode,
                                                                                                                @Nullable
                                                                                                                @Nullable java.lang.String name)
        Create ScatterND op and return the result tensor Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as ```md B = batchDims U = updates.rank - B P = res.rank - B Q = inds.rank - B K = inds.shape[-1] index_slice = indices[i_{b0},...,i_{bB},i_{0},..,i_{Q-1}] res[...] = data[...] res[i_{b0},...,i_{bB},index_slice[0],...,index_slice[K-1]] += updates[i_{b0},...,i_{bB},i_{0},...,i_{Q-1}] // Note += is used but this depends on mode ``` Collisions will be updated according to mode, and slices not set by indices are set to 0. The tensors have the following shape requirements ```md K <= P U = (P-K) + Q-1 data.shape = res.shape indices.shape[0:Q-1] = updates.shape[0:Q-1] updates.shape[Q:U] = res.shape[K:P] ``` - Parameters: - dataTensor: Tensor containing inital values of same shape as result tensor - updatesTensor: Tensor containing slices to be inserted into the result tensor - indicesTensor: Tensor containg the result indices to insert slices at - batchDimensions: The number of batch dimensions - mode: The type of update to use on the destination - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • scatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName

        @NotNull
        public @NotNull MPSGraphTensor scatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName​(@NotNull
                                                                                                   @NotNull MPSGraphTensor dataTensor,
                                                                                                   @NotNull
                                                                                                   @NotNull MPSGraphTensor updatesTensor,
                                                                                                   @NotNull
                                                                                                   @NotNull MPSGraphTensor indicesTensor,
                                                                                                   long axis,
                                                                                                   long mode,
                                                                                                   @Nullable
                                                                                                   @Nullable java.lang.String name)
        Create Scatter op and return the result tensor Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as ```md U = updates.rank P = res.rank res[...] = data[...] res[i_{0},...,i_{axis-1},indices[i_{axis}],i_{axis+1},...,i_{U-1}] += updates[i_{0},...,i_{axis-1},i_{axis},i_{axis+1},...,i_{U-1}] // Note += is used but this depends on mode ``` Collisions will be updated according to mode. The tensors have the following shape requirements ```md U = P indices.rank = 1 data.shape = res.shape updates.shape[0:axis-1] = res.shape[0:axis-1] updates.shape[axis] = indices.shape[0] updates.shape[axis+1:U] = res.shape[0:P] ``` - Parameters: - dataTensor: Tensor containing inital values of same shape as result tensor - updatesTensor: Tensor containing values to be inserted into the result tensor - indicesTensor: Tensor containg the result indices to insert values at - axis: The axis of the result tensor to scatter values along - mode: The type of update to use on the destination - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.0
      • selectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName

        @NotNull
        public @NotNull MPSGraphTensor selectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName​(@NotNull
                                                                                                            @NotNull MPSGraphTensor predicateTensor,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraphTensor truePredicateTensor,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraphTensor falseSelectTensor,
                                                                                                            @Nullable
                                                                                                            @Nullable java.lang.String name)
        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: 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.
      • setOptions

        public void setOptions​(long value)
        Options for the graph, the default value is MPSGraphOptionsDefault.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • shapeOfTensorName

        @NotNull
        public @NotNull MPSGraphTensor shapeOfTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Creates a shape-of operation and returns the result tensor. Returns a rank-1 tensor of type `MPSDataTypeInt32` with the values of the static shape of the input tensor. - Parameters: - tensor: The input tensor. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.0
      • sigmoidGradientWithIncomingGradientSourceTensorName

        @NotNull
        public @NotNull MPSGraphTensor sigmoidGradientWithIncomingGradientSourceTensorName​(@NotNull
                                                                                           @NotNull MPSGraphTensor gradient,
                                                                                           @NotNull
                                                                                           @NotNull MPSGraphTensor source,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String name)
        Computes the gradient of the sigmoid function using the incoming gradient tensor. - Parameters: - gradient: The incoming gradient tensor. - source: The input tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object
      • sigmoidWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor sigmoidWithTensorName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        Computes the sigmoid operation on an input tensor. - Parameters: - tensor: The input tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object.
      • signWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor signWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        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: 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.
      • signbitWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor signbitWithTensorName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        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: 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.
      • sinWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor sinWithTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Applies the sine operation to the input tensor elements. - Parameters: - 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.
      • sinhWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor sinhWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the hyperbolic sine operation to the input tensor elements. - Parameters: - 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.
      • sliceGradientTensorFwdInShapeTensorStartsEndsStridesName

        @NotNull
        public @NotNull MPSGraphTensor sliceGradientTensorFwdInShapeTensorStartsEndsStridesName​(@NotNull
                                                                                                @NotNull MPSGraphTensor inputGradientTensor,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor fwdInShapeTensor,
                                                                                                @NotNull
                                                                                                @NotNull NSArray<? extends NSNumber> starts,
                                                                                                @NotNull
                                                                                                @NotNull NSArray<? extends NSNumber> ends,
                                                                                                @NotNull
                                                                                                @NotNull NSArray<? extends NSNumber> strides,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        Creates a strided slice gradient operation and returns the result tensor. - Parameters: - 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
      • sliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName

        @NotNull
        public @NotNull MPSGraphTensor sliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName​(@NotNull
                                                                                                                           @NotNull MPSGraphTensor inputGradientTensor,
                                                                                                                           @NotNull
                                                                                                                           @NotNull MPSGraphTensor fwdInShapeTensor,
                                                                                                                           @NotNull
                                                                                                                           @NotNull NSArray<? extends NSNumber> starts,
                                                                                                                           @NotNull
                                                                                                                           @NotNull NSArray<? extends NSNumber> ends,
                                                                                                                           @NotNull
                                                                                                                           @NotNull NSArray<? extends NSNumber> strides,
                                                                                                                           int startMask,
                                                                                                                           int endMask,
                                                                                                                           int squeezeMask,
                                                                                                                           @Nullable
                                                                                                                           @Nullable java.lang.String name)
        Creates a strided slice gradient operation and returns the result tensor. - Parameters: - 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
      • sliceTensorDimensionStartLengthName

        @NotNull
        public @NotNull MPSGraphTensor sliceTensorDimensionStartLengthName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           long dimensionIndex,
                                                                           long start,
                                                                           long length,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Creates a slice operation and returns the result tensor. - Parameters: - 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.
      • sliceTensorStartsEndsStridesName

        @NotNull
        public @NotNull MPSGraphTensor sliceTensorStartsEndsStridesName​(@NotNull
                                                                        @NotNull MPSGraphTensor tensor,
                                                                        @NotNull
                                                                        @NotNull NSArray<? extends NSNumber> starts,
                                                                        @NotNull
                                                                        @NotNull NSArray<? extends NSNumber> ends,
                                                                        @NotNull
                                                                        @NotNull NSArray<? extends NSNumber> strides,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        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 [TensorFlow Strided Slice Op](https://www.tensorflow.org/api_docs/python/tf/strided_slice). - Parameters: - 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.
      • sliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName

        @NotNull
        public @NotNull MPSGraphTensor sliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName​(@NotNull
                                                                                                   @NotNull MPSGraphTensor tensor,
                                                                                                   @NotNull
                                                                                                   @NotNull NSArray<? extends NSNumber> starts,
                                                                                                   @NotNull
                                                                                                   @NotNull NSArray<? extends NSNumber> ends,
                                                                                                   @NotNull
                                                                                                   @NotNull NSArray<? extends NSNumber> strides,
                                                                                                   int startMask,
                                                                                                   int endMask,
                                                                                                   int squeezeMask,
                                                                                                   @Nullable
                                                                                                   @Nullable java.lang.String name)
        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 [TensorFlow Strided Slice Op](https://www.tensorflow.org/api_docs/python/tf/strided_slice). - Parameters: - 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.
      • softMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName

        @NotNull
        public @NotNull MPSGraphTensor softMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName​(@NotNull
                                                                                                                                          @NotNull MPSGraphTensor gradientTensor,
                                                                                                                                          @NotNull
                                                                                                                                          @NotNull MPSGraphTensor sourceTensor,
                                                                                                                                          @NotNull
                                                                                                                                          @NotNull MPSGraphTensor labelsTensor,
                                                                                                                                          long axis,
                                                                                                                                          long reductionType,
                                                                                                                                          @Nullable
                                                                                                                                          @Nullable java.lang.String name)
        Creates the gradient of a softmax cross entropy loss operation and returns the result tensor. - Parameters: - 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: 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.
      • softMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName

        @NotNull
        public @NotNull MPSGraphTensor softMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName​(@NotNull
                                                                                                            @NotNull MPSGraphTensor sourceTensor,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraphTensor labelsTensor,
                                                                                                            long axis,
                                                                                                            long reductionType,
                                                                                                            @Nullable
                                                                                                            @Nullable java.lang.String name)
        Creates a softmax cross entropy loss operation and returns the result tensor. 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: 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.
      • softMaxGradientWithIncomingGradientSourceTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor softMaxGradientWithIncomingGradientSourceTensorAxisName​(@NotNull
                                                                                               @NotNull MPSGraphTensor gradient,
                                                                                               @NotNull
                                                                                               @NotNull MPSGraphTensor source,
                                                                                               long axis,
                                                                                               @Nullable
                                                                                               @Nullable java.lang.String name)
        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: The axis along which softmax is computed. - name: The name for the operation - Returns: A valid ``MPSGraphTensor`` object
      • softMaxWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor softMaxWithTensorAxisName​(@NotNull
                                                                 @NotNull MPSGraphTensor tensor,
                                                                 long axis,
                                                                 @Nullable
                                                                 @Nullable java.lang.String name)
        Computes the softmax function on the input tensor along the specified axis. - Parameters: - tensor: The input tensor. - axis: The axis along which softmax is computed. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object
      • spaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor spaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName​(@NotNull
                                                                                                                         @NotNull MPSGraphTensor tensor,
                                                                                                                         long widthAxis,
                                                                                                                         long heightAxis,
                                                                                                                         long depthAxis,
                                                                                                                         long blockSize,
                                                                                                                         boolean usePixelShuffleOrder,
                                                                                                                         @Nullable
                                                                                                                         @Nullable java.lang.String name)
        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 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 `MPSGraph/depthToSpace2DTensor:widthAxis:heightAxis:depthAxis:blockSize:usePixelShuffleOrder:name:`. - Parameters: - tensor: The input tensor. - 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 API-Since: 15.0
      • spaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor spaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName​(@NotNull
                                                                                                                                           @NotNull MPSGraphTensor tensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor widthAxisTensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor heightAxisTensor,
                                                                                                                                           @NotNull
                                                                                                                                           @NotNull MPSGraphTensor depthAxisTensor,
                                                                                                                                           long blockSize,
                                                                                                                                           boolean usePixelShuffleOrder,
                                                                                                                                           @Nullable
                                                                                                                                           @Nullable java.lang.String name)
        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 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 ``MPSGraph/depthToSpace2DTensor:widthAxisTensor:heightAxisTensor:depthAxisTensor:blockSize:usePixelShuffleOrder:name:``. - Parameters: - tensor: The input tensor. - 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 API-Since: 15.0
      • squareRootWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor squareRootWithTensorName​(@NotNull
                                                                @NotNull MPSGraphTensor tensor,
                                                                @Nullable
                                                                @Nullable java.lang.String name)
        Applies the square root operation to the input tensor elements. - Parameters: - 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.
      • squareWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor squareWithTensorName​(@NotNull
                                                            @NotNull MPSGraphTensor tensor,
                                                            @Nullable
                                                            @Nullable java.lang.String name)
        Applies the square operation to the input tensor elements. - Parameters: - 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.
      • stencilWithSourceTensorWeightsTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor stencilWithSourceTensorWeightsTensorDescriptorName​(@NotNull
                                                                                          @NotNull MPSGraphTensor source,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor weights,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphStencilOpDescriptor descriptor,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String name)
        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`. ```md y[i] = reduction{j \in w} ( x[ i + j ]w[j] ) ``` - Parameters: - 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.
      • stochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName

        @NotNull
        public @NotNull MPSGraphTensor stochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName​(@NotNull
                                                                                                                     @NotNull MPSGraphTensor learningRateTensor,
                                                                                                                     @NotNull
                                                                                                                     @NotNull MPSGraphTensor valuesTensor,
                                                                                                                     @NotNull
                                                                                                                     @NotNull MPSGraphTensor gradientTensor,
                                                                                                                     @Nullable
                                                                                                                     @Nullable java.lang.String name)
        The StochasticGradientDescent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable - Parameters: - learningRateTensor: scalar tensor which indicates the learning rate to use with the optimizer - valuesTensor: values tensor, usually representing the trainable parameters - gradientTensor: partial gradient of the trainable parameters with respect to loss - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • subtractionWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor subtractionWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                       @NotNull MPSGraphTensor primaryTensor,
                                                                                       @NotNull
                                                                                       @NotNull MPSGraphTensor secondaryTensor,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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: 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.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • tanWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor tanWithTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Applies the tangent operation to the input tensor elements. - Parameters: - 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.
      • tanhWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor tanhWithTensorName​(@NotNull
                                                          @NotNull MPSGraphTensor tensor,
                                                          @Nullable
                                                          @Nullable java.lang.String name)
        Applies the hyperbolic tangent operation to the input tensor elements. - Parameters: - 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.
      • topKWithGradientTensorSourceKName

        @NotNull
        public @NotNull MPSGraphTensor topKWithGradientTensorSourceKName​(@NotNull
                                                                         @NotNull MPSGraphTensor gradient,
                                                                         @NotNull
                                                                         @NotNull MPSGraphTensor source,
                                                                         long k,
                                                                         @Nullable
                                                                         @Nullable java.lang.String name)
        Create TopKGradient op and return the result tensor. Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - k: The number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object.
      • topKWithGradientTensorSourceKTensorName

        @NotNull
        public @NotNull MPSGraphTensor topKWithGradientTensorSourceKTensorName​(@NotNull
                                                                               @NotNull MPSGraphTensor gradient,
                                                                               @NotNull
                                                                               @NotNull MPSGraphTensor source,
                                                                               @NotNull
                                                                               @NotNull MPSGraphTensor kTensor,
                                                                               @Nullable
                                                                               @Nullable java.lang.String name)
        Create TopKGradient op and return the result tensor. Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object.
      • topKWithSourceTensorKName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> topKWithSourceTensorKName​(@NotNull
                                                                                    @NotNull MPSGraphTensor source,
                                                                                    long k,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        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 element of the result array corresponds to the indices of the top values. - Parameters: - source: Tensor containing source data - k: The number of largest values to return - name: The name for the operation - Returns: A valid MPSGraphTensor array of size 2
      • topKWithSourceTensorKTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> topKWithSourceTensorKTensorName​(@NotNull
                                                                                          @NotNull MPSGraphTensor source,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor kTensor,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String name)
        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 element of the result array corresponds to the indices of the top values. - Parameters: - source: Tensor containing source data. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor array of size 2.
      • transposeTensorDimensionWithDimensionName

        @NotNull
        public @NotNull MPSGraphTensor transposeTensorDimensionWithDimensionName​(@NotNull
                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                 long dimensionIndex,
                                                                                 long dimensionIndex2,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Creates a transpose operation and returns the result tensor. Transposes the dimensions `dimensionIndex` and `dimensionIndex2` of the input tensor. - Parameters: - 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. - Returns: A valid MPSGraphTensor object.
      • varianceOfTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor varianceOfTensorAxesName​(@NotNull
                                                                @NotNull MPSGraphTensor tensor,
                                                                @NotNull
                                                                @NotNull NSArray<? extends NSNumber> axes,
                                                                @Nullable
                                                                @Nullable java.lang.String name)
        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: An optional name for the operation. - Returns: A valid `MPSGraphTensor` object.
      • varianceOfTensorMeanTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor varianceOfTensorMeanTensorAxesName​(@NotNull
                                                                          @NotNull MPSGraphTensor tensor,
                                                                          @NotNull
                                                                          @NotNull MPSGraphTensor meanTensor,
                                                                          @NotNull
                                                                          @NotNull NSArray<? extends NSNumber> axes,
                                                                          @Nullable
                                                                          @Nullable java.lang.String name)
        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: An optional name for the operation. - Returns: A valid `MPSGraphTensor` object.
      • version_static

        public static long version_static()
      • whileWithInitialInputsBeforeAfterName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> whileWithInitialInputsBeforeAfterName​(@NotNull
                                                                                                @NotNull NSArray<? extends MPSGraphTensor> initialInputs,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraph.Block_whileWithInitialInputsBeforeAfterName_1 before,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraph.Block_whileWithInitialInputsBeforeAfterName_2 after,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        Adds a whileLoop operation - Parameters: - initialInputs: inputTensors to the whileBeforeBlock, for the 1st iteration will be same as initialInputs passed to the whileLoop - before: beforeBlock, this will be run first and then call the afterBlock with results or return results from the loop - after: afterBlock, this will execute after the condition evaluation - name: name of operation - Returns: A valid MPSGraphTensor array with results returned from the conditionBlock depending on the predicateTensor
      • randomPhiloxStateTensorWithCounterLowCounterHighKeyName

        @NotNull
        public @NotNull MPSGraphTensor randomPhiloxStateTensorWithCounterLowCounterHighKeyName​(long counterLow,
                                                                                               long counterHigh,
                                                                                               long key,
                                                                                               @Nullable
                                                                                               @Nullable java.lang.String name)
        Creates an MPSGraphTensor representing state using the Philox algorithm with given counter and key values. See randomPhiloxStateTensorWithSeed. - Parameters: - counterLow: The value to initilaize lower 64 bits of counter to. Philox utilizes a 128 bit counter - counterHigh: The value to initilaize upper 64 bits of counter to. Philox utilizes a 128 bit counter - key: The value to initialize the key to in Philox algorithm. - name: Name for the operation - Returns: An MPSGraphTensor representing a random state, to be passed as an input to a random op.
      • randomPhiloxStateTensorWithSeedName

        @NotNull
        public @NotNull MPSGraphTensor randomPhiloxStateTensorWithSeedName​(long seed,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Creates an MPSGraphTensor representing state using the Philox algorithm with given counter and key values. Generates random numbers using the Philox counter-based algorithm, for further details see: John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw. Parallel Random Numbers: As Easy as 1, 2, 3. A stateTensor generated with this API can be used in MPSGraph Random APIs which accept a stateTensor. The updated stateTensor is returned alongside the random values, and can be fed to the following random layer. In most use cases, a stateTensor should only need to be initialized once at the start of the graph. A stateTensor can be set as a target tensor of an MPSGraph execution to obtain a stateTensor serialized as an NDArray. This can be used as input to a placeholder in the graph to avoid ever needing to have a state intilization layer in an MPSGraph. This can allow for a continued stream through multiple executions of a single MPSGraph by having the final stateTensor as a target tensor passed into the following MPSGraph execution as a placeholder input. This may be helpful for training graphs in particular. ```md MPSGraph *graph = [MPSGraph new]; MPSGraphTensor *stateTensor = [graph randomPhiloxStateTensorWithSeed: seed name: nil]; NSArray *resultTensors0 = [graph randomUniformTensorWithShape: - Parameters: - seed: Initial counter and key values will be generated using seed. - name: Name for the operation - Returns: An MPSGraphTensor representing a random state, to be passed as an input to a random op.
      • randomTensorWithShapeTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor randomTensorWithShapeTensorDescriptorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor shapeTensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphRandomOpDescriptor descriptor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Create Random op of type matching distribution in descriptor and return random values Returns a tensor of provided shape of random values in the distribution specified. Uses a random seed value to initalize state. No state is preserved, and subsequent calls are not guaranteed to result in a unique stream of random values. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - descriptor: The descriptor of the distribution. See MPSGraphRandomOpDescriptor. - name: The name for the operation - Returns: An MPSGraphTensor of shape containing random values in the defined range.
      • randomTensorWithShapeTensorDescriptorSeedName

        @NotNull
        public @NotNull MPSGraphTensor randomTensorWithShapeTensorDescriptorSeedName​(@NotNull
                                                                                     @NotNull MPSGraphTensor shapeTensor,
                                                                                     @NotNull
                                                                                     @NotNull MPSGraphRandomOpDescriptor descriptor,
                                                                                     long seed,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String name)
        Create Random op of type matching distribution in descriptor and return random values Returns a tensor of provided shape of random values in the distribution specified. Uses the provided seed value to initalize state. No state is preserved, and all calls with equal seed yield an identical stream of random values. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - descriptor: The descriptor of the distribution. See MPSGraphRandomOpDescriptor. - seed: The seed to use to initialize state. All calls with equal seed yield an identical stream of random values. - name: The name for the operation - Returns: An MPSGraphTensor of shape containing random values in the defined range.
      • randomTensorWithShapeTensorDescriptorStateTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> randomTensorWithShapeTensorDescriptorStateTensorName​(@NotNull
                                                                                                               @NotNull MPSGraphTensor shapeTensor,
                                                                                                               @NotNull
                                                                                                               @NotNull MPSGraphRandomOpDescriptor descriptor,
                                                                                                               @NotNull
                                                                                                               @NotNull MPSGraphTensor state,
                                                                                                               @Nullable
                                                                                                               @Nullable java.lang.String name)
        Create Random op of type matching distribution in descriptor, and return random values and updated state Returns an array of 2 tensors, where the first is of provided shape of random values in the distribution specified, and the second is the updated state tensor. Uses the provided state to define a stream of random values. No state is preserved, and all calls with equal state yield an identical stream of random values. The initial stateTensor provided should be created using the MPSGraph randomPhiloxStateTensor APIs. The resulting stateTensor from this op can be passed as an argument to the following random calls to continue sampling from the stream. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - descriptor: The descriptor of the distribution. See MPSGraphRandomOpDescriptor. - state: The state to define a stream of random values. All calls with equal state yield an identical stream of random values. - name: The name for the operation - Returns: An array of MPSGraphTensor of size 2. The first MPSGraphTensor is of shape containing random values in the defined range. The second MPSGraphTensor is the updated state tensor.
      • randomUniformTensorWithShapeTensorName

        @NotNull
        public @NotNull MPSGraphTensor randomUniformTensorWithShapeTensorName​(@NotNull
                                                                              @NotNull MPSGraphTensor shapeTensor,
                                                                              @Nullable
                                                                              @Nullable java.lang.String name)
        Create RandomUniform op and return random uniform values Returns a tensor of provided shape of random uniform values in the range [0.0, 1.0). Uses a random seed value to initalize state. No state is preserved, and subsequent calls are not guaranteed to result in a unique stream of random values. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - name: The name for the operation - Returns: An MPSGraphTensor of shape containing random values in the defined range.
      • randomUniformTensorWithShapeTensorSeedName

        @NotNull
        public @NotNull MPSGraphTensor randomUniformTensorWithShapeTensorSeedName​(@NotNull
                                                                                  @NotNull MPSGraphTensor shapeTensor,
                                                                                  long seed,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Create RandomUniform op and return random uniform values Returns a tensor of provided shape of random uniform values in the range [0.0, 1.0). Uses the provided seed value to initalize state. No state is preserved, and all calls with equal seed yield an identical stream of random values. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - seed: The seed to use to initialize state. All calls with equal seed yield an identical stream of random values. - name: The name for the operation - Returns: An MPSGraphTensor of shape containing random values in the defined range.
      • randomUniformTensorWithShapeTensorStateTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> randomUniformTensorWithShapeTensorStateTensorName​(@NotNull
                                                                                                            @NotNull MPSGraphTensor shapeTensor,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraphTensor state,
                                                                                                            @Nullable
                                                                                                            @Nullable java.lang.String name)
        Create RandomUniform op and return random uniform values and updated state Returns an array of 2 tensors, where the first is a tensor of provided shape of random uniform values in the range [0.0, 1.0), and the second is the updated state tensor. The provided state is used to define a stream of random values. No state is preserved, and all calls with equal state yield an identical stream of random values. The initial stateTensor provided should be created using the MPSGraph randomPhiloxStateTensor APIs. The resulting stateTensor from this op can be passed as an argument to the following random calls to continue sampling from the stream. - Parameters: - shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated - state: The state to define a stream of random values. All calls with equal state yield an identical stream of random values. - name: The name for the operation - Returns: An array of MPSGraphTensor of size 2. The first MPSGraphTensor is of shape containing random values in the defined range. The second MPSGraphTensor is the updated state tensor.
      • reductionMaximumPropagateNaNWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionMaximumPropagateNaNWithTensorAxesName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      @Nullable
                                                                                      @Nullable NSArray<? extends NSNumber> axes,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Create reduction max propagate NaN op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMaximumPropagateNaNWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionMaximumPropagateNaNWithTensorAxisName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      long axis,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Create reduction max propagate NaN op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMinimumPropagateNaNWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionMinimumPropagateNaNWithTensorAxesName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      @Nullable
                                                                                      @Nullable NSArray<? extends NSNumber> axes,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Create reduction min propagate NaN op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • reductionMinimumPropagateNaNWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionMinimumPropagateNaNWithTensorAxisName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      long axis,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Create reduction min propagate NaN op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object.
      • GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName​(@NotNull
                                                                                                                                                                @NotNull MPSGraphTensor source,
                                                                                                                                                                @NotNull
                                                                                                                                                                @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                @NotNull
                                                                                                                                                                @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                @NotNull
                                                                                                                                                                @NotNull MPSGraphTensor zState,
                                                                                                                                                                @NotNull
                                                                                                                                                                @NotNull MPSGraphTensor outputFwd,
                                                                                                                                                                @Nullable
                                                                                                                                                                @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                @Nullable
                                                                                                                                                                @Nullable MPSGraphTensor bias,
                                                                                                                                                                @NotNull
                                                                                                                                                                @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                                                                @Nullable
                                                                                                                                                                @Nullable java.lang.String name)
        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: 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`. 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` and for `bias`. API-Since: 16.0
      • GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName​(@NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor source,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor zState,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor outputFwd,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         @Nullable MPSGraphTensor bias,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         @Nullable MPSGraphTensor initState,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         @Nullable java.lang.String name)
        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: 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`. 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 for `initState`. API-Since: 16.0
      • GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName​(@NotNull
                                                                                                                                                                                                       @NotNull MPSGraphTensor source,
                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                       @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                       @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                       @NotNull MPSGraphTensor zState,
                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                       @NotNull MPSGraphTensor outputFwd,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor stateGradient,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor bias,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor initState,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor mask,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable MPSGraphTensor secondaryBias,
                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                       @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                       @Nullable java.lang.String name)
        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: 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` and for `secondaryBias`. API-Since: 16.0
      • GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor source,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                          @Nullable
                                                                                                                          @Nullable MPSGraphTensor inputWeight,
                                                                                                                          @Nullable
                                                                                                                          @Nullable MPSGraphTensor bias,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        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 for t = 0 to T-1 z[t] = fz( (h[t-1] m) R^T + x[t] W^T + b ), r[t] = fr( (h[t-1] m) R^T + x[t] W^T + b ), c[t] = (h[t-1] r[t] m) R^T 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 ```md c[t] = ( (h[t-1] m) R^T + b2 ) r[t] ``` 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`. See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`. - Parameters: - 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`. 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. API-Since: 16.0
      • GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName​(@NotNull
                                                                                                                                   @NotNull MPSGraphTensor source,
                                                                                                                                   @NotNull
                                                                                                                                   @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                   @Nullable
                                                                                                                                   @Nullable MPSGraphTensor inputWeight,
                                                                                                                                   @Nullable
                                                                                                                                   @Nullable MPSGraphTensor bias,
                                                                                                                                   @Nullable
                                                                                                                                   @Nullable MPSGraphTensor initState,
                                                                                                                                   @NotNull
                                                                                                                                   @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                                   @Nullable
                                                                                                                                   @Nullable java.lang.String name)
        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 for t = 0 to T-1 z[t] = fz( (h[t-1] m) R^T + x[t] W^T + b ), r[t] = fr( (h[t-1] m) R^T + x[t] W^T + b ), c[t] = (h[t-1] r[t] m) R^T 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 ```md c[t] = ( (h[t-1] m) R^T + b2 ) r[t] ``` 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`. See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`. - Parameters: - 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`. 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. API-Since: 16.0
      • GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName​(@NotNull
                                                                                                                                                    @NotNull MPSGraphTensor source,
                                                                                                                                                    @NotNull
                                                                                                                                                    @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable MPSGraphTensor bias,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable MPSGraphTensor initState,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable MPSGraphTensor mask,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable MPSGraphTensor secondaryBias,
                                                                                                                                                    @NotNull
                                                                                                                                                    @NotNull MPSGraphGRUDescriptor descriptor,
                                                                                                                                                    @Nullable
                                                                                                                                                    @Nullable java.lang.String name)
        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 for t = 0 to T-1 z[t] = fz( (h[t-1] m) R^T + x[t] W^T + b ), r[t] = fr( (h[t-1] m) R^T + x[t] W^T + b ), c[t] = (h[t-1] r[t] m) R^T 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 ```md c[t] = ( (h[t-1] m) R^T + b2 ) r[t] ``` 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`. See ``MPSGraphGRUDescriptor`` for different `activation` options for `f()`. - Parameters: - 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`. 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. API-Since: 16.0
      • HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName

        @NotNull
        public @NotNull MPSGraphTensor HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName​(@NotNull
                                                                                                         @NotNull MPSGraphTensor primaryTensor,
                                                                                                         @NotNull
                                                                                                         @NotNull MPSGraphTensor secondaryTensor,
                                                                                                         int resultDataType,
                                                                                                         @Nullable
                                                                                                         @Nullable java.lang.String name)
        Computes the hamming distance of 2 input tensors with support for broadcasting. 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: 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. API-Since: 16.0
      • LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName​(@NotNull
                                                                                                                                                      @NotNull MPSGraphTensor source,
                                                                                                                                                      @NotNull
                                                                                                                                                      @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                      @NotNull
                                                                                                                                                      @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                      @NotNull
                                                                                                                                                      @NotNull MPSGraphTensor zState,
                                                                                                                                                      @NotNull
                                                                                                                                                      @NotNull MPSGraphTensor cellOutputFwd,
                                                                                                                                                      @NotNull
                                                                                                                                                      @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                                      @Nullable
                                                                                                                                                      @Nullable java.lang.String name)
        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: 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`. 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`. API-Since: 15.4
      • LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName​(@NotNull
                                                                                                                                                                                      @NotNull MPSGraphTensor source,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      @NotNull MPSGraphTensor zState,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      @NotNull MPSGraphTensor cellOutputFwd,
                                                                                                                                                                                      @Nullable
                                                                                                                                                                                      @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                                      @Nullable
                                                                                                                                                                                      @Nullable MPSGraphTensor bias,
                                                                                                                                                                                      @Nullable
                                                                                                                                                                                      @Nullable MPSGraphTensor initState,
                                                                                                                                                                                      @Nullable
                                                                                                                                                                                      @Nullable MPSGraphTensor initCell,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                                                                      @Nullable
                                                                                                                                                                                      @Nullable java.lang.String name)
        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: 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`. 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`. API-Since: 15.4
      • LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName​(@NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor source,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor zState,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor cellOutputFwd,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable MPSGraphTensor bias,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable MPSGraphTensor initState,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable MPSGraphTensor initCell,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable MPSGraphTensor mask,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable java.lang.String name)
        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: 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`. 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`. API-Since: 15.4
      • LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName​(@NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                                                                                                                                           @NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                                                                           @NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                                                                           @NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphTensor zState,
                                                                                                                                                                                                                           @NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphTensor cellOutputFwd,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor stateGradient,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor cellGradient,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor bias,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor initState,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor initCell,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor mask,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable MPSGraphTensor peephole,
                                                                                                                                                                                                                           @NotNull
                                                                                                                                                                                                                           @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                                                                                                           @Nullable
                                                                                                                                                                                                                           @Nullable java.lang.String name)
        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: 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`. API-Since: 15.4
      • LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName​(@NotNull
                                                                                                                             @NotNull MPSGraphTensor source,
                                                                                                                             @NotNull
                                                                                                                             @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                             @Nullable
                                                                                                                             @Nullable MPSGraphTensor initState,
                                                                                                                             @Nullable
                                                                                                                             @Nullable MPSGraphTensor initCell,
                                                                                                                             @NotNull
                                                                                                                             @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                             @Nullable
                                                                                                                             @Nullable java.lang.String name)
        Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and optionally the training state tensor. This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows: ```md for t = 0 to T-1 z[t] = [i, f, z, o][t] = f( (h[t-1] m) R^T + x'[t] + p c[t-1] ) x'[t] = x[t] W^T + b 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`. `p` is an optional peephole vector. See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`. - Parameters: - 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`. 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. API-Since: 15.4
      • LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName​(@NotNull
                                                                                                                                            @NotNull MPSGraphTensor source,
                                                                                                                                            @NotNull
                                                                                                                                            @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                            @Nullable
                                                                                                                                            @Nullable MPSGraphTensor inputWeight,
                                                                                                                                            @Nullable
                                                                                                                                            @Nullable MPSGraphTensor bias,
                                                                                                                                            @Nullable
                                                                                                                                            @Nullable MPSGraphTensor initState,
                                                                                                                                            @Nullable
                                                                                                                                            @Nullable MPSGraphTensor initCell,
                                                                                                                                            @NotNull
                                                                                                                                            @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                            @Nullable
                                                                                                                                            @Nullable java.lang.String name)
        Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and optionally the training state tensor. This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows: ```md for t = 0 to T-1 z[t] = [i, f, z, o][t] = f( (h[t-1] m) R^T + x'[t] + p c[t-1] ) x'[t] = x[t] W^T + b 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`. `p` is an optional peephole vector. See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`. - Parameters: - 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`. 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. API-Since: 15.4
      • LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName​(@NotNull
                                                                                                                                                        @NotNull MPSGraphTensor source,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor bias,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor initState,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor initCell,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor mask,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable MPSGraphTensor peephole,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull MPSGraphLSTMDescriptor descriptor,
                                                                                                                                                        @Nullable
                                                                                                                                                        @Nullable java.lang.String name)
        Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and optionally the training state tensor. This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows: ```md for t = 0 to T-1 z[t] = [i, f, z, o][t] = f( (h[t-1] m) R^T + x'[t] + p c[t-1] ) x'[t] = x[t] W^T + b 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`. `p` is an optional peephole vector. See ``MPSGraphLSTMDescriptor`` for different `activation` options for `f()` and `g()`. - Parameters: - 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`. 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. API-Since: 15.4
      • adamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> adamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName​(@NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor currentLearningRateTensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor beta1Tensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor beta2Tensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor epsilonTensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor valuesTensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor momentumTensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor velocityTensor,
                                                                                                                                                                                                              @Nullable
                                                                                                                                                                                                              @Nullable MPSGraphTensor maximumVelocityTensor,
                                                                                                                                                                                                              @NotNull
                                                                                                                                                                                                              @NotNull MPSGraphTensor gradientTensor,
                                                                                                                                                                                                              @Nullable
                                                                                                                                                                                                              @Nullable java.lang.String name)
        Adam The adam update ops are added ```md m[t] = beta1m[t-1] + (1 - beta1) * g v[t] = beta2v[t-1] + (1 - beta2) * (g ^ 2) maxVel[t] = max(maxVel[t-1],v[t]) variable = variable - lr[t] * m[t] / (sqrt(maxVel) + epsilon) ``` - Parameters: - learningRateTensor: scalar tensor which indicates the learning rate to use with the optimizer - beta1Tensor: beta1Tensor - beta2Tensor: beta2Tensor - epsilonTensor: epsilon tensor - valuesTensor: values to update with optimization - momentumTensor: momentum tensor - velocityTensor: velocity tensor - maximumVelocityTensor: optional maximum velocity tensor - gradientTensor: partial gradient of the trainable parameters with respect to loss - name: name for the operation - Returns: if maximumVelocity is nil array of 3 tensors (update, newMomentum, newVelocity) else array of 4 tensors (update, newMomentum, newVelocity, newMaximumVelocity)
      • adamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> adamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName​(@NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor learningRateTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor beta1Tensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor beta2Tensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor epsilonTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor beta1PowerTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor beta2PowerTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor valuesTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor momentumTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor velocityTensor,
                                                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                                                       @Nullable MPSGraphTensor maximumVelocityTensor,
                                                                                                                                                                                                                                       @NotNull
                                                                                                                                                                                                                                       @NotNull MPSGraphTensor gradientTensor,
                                                                                                                                                                                                                                       @Nullable
                                                                                                                                                                                                                                       @Nullable java.lang.String name)
        Adam The adam update ops are added current learning rate: ```md lr[t] = learningRate * sqrt(1 - beta2^t) / (1 - beta1^t) m[t] = beta1 * m[t-1] + (1 - beta1) * g v[t] = beta2 * v[t-1] + (1 - beta2) * (g ^ 2) maxVel[t] = max(maxVel[t-1], v[t]) variable = variable - lr[t] * m[t] / (sqrt(maxVel) + epsilon) ``` - Parameters: - learningRateTensor: scalar tensor which indicates the learning rate to use with the optimizer - beta1Tensor: beta1Tensor - beta2Tensor: beta2Tensor - beta1PowerTensor: `beta1^t` beta1 power tensor - beta2PowerTensor: `beta2^t` beta2 power tensor - valuesTensor: values to update with optimization - momentumTensor: momentum tensor - velocityTensor: velocity tensor - maximumVelocityTensor: optional maximum velocity tensor - gradientTensor: partial gradient of the trainable parameters with respect to loss - name: name for the operation - Returns: if maximumVelocity is nil array of 3 tensors (update, newMomentum, newVelocity) else array of 4 tensors (update, newMomentum, newVelocity, newMaximumVelocity)
      • argSortWithTensorAxisDescendingName

        @NotNull
        public @NotNull MPSGraphTensor argSortWithTensorAxisDescendingName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           long axis,
                                                                           boolean descending,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Compute the indices that sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.1
      • argSortWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor argSortWithTensorAxisName​(@NotNull
                                                                 @NotNull MPSGraphTensor tensor,
                                                                 long axis,
                                                                 @Nullable
                                                                 @Nullable java.lang.String name)
        Compute the indices that sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.1
      • argSortWithTensorAxisTensorDescendingName

        @NotNull
        public @NotNull MPSGraphTensor argSortWithTensorAxisTensorDescendingName​(@NotNull
                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                 boolean descending,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Compute the indices that sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.1
      • argSortWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor argSortWithTensorAxisTensorName​(@NotNull
                                                                       @NotNull MPSGraphTensor tensor,
                                                                       @NotNull
                                                                       @NotNull MPSGraphTensor axisTensor,
                                                                       @Nullable
                                                                       @Nullable java.lang.String name)
        Compute the indices that sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.1
      • bandPartWithTensorNumLowerNumUpperName

        @NotNull
        public @NotNull MPSGraphTensor bandPartWithTensorNumLowerNumUpperName​(@NotNull
                                                                              @NotNull MPSGraphTensor inputTensor,
                                                                              long numLower,
                                                                              long numUpper,
                                                                              @Nullable
                                                                              @Nullable java.lang.String name)
        Computes the band part of an input tensor. 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) ``` 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.
      • bandPartWithTensorNumLowerTensorNumUpperTensorName

        @NotNull
        public @NotNull MPSGraphTensor bandPartWithTensorNumLowerTensorNumUpperTensorName​(@NotNull
                                                                                          @NotNull MPSGraphTensor inputTensor,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor numLowerTensor,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor numUpperTensor,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String name)
        Creates band part op and return the result. See above discussion of bandPartWithTensor: numLower: numUpper: name: - Parameters: - 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.
      • batchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor batchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName​(@NotNull
                                                                                                                     @NotNull MPSGraphTensor tensor,
                                                                                                                     @NotNull
                                                                                                                     @NotNull NSArray<? extends NSNumber> spatialAxes,
                                                                                                                     long batchAxis,
                                                                                                                     @NotNull
                                                                                                                     @NotNull NSArray<? extends NSNumber> blockDimensions,
                                                                                                                     boolean usePixelShuffleOrder,
                                                                                                                     @Nullable
                                                                                                                     @Nullable java.lang.String name)
        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 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 ``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: 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. API-Since: 16.1
      • batchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor batchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName​(@NotNull
                                                                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor spatialAxesTensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor batchAxisTensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor blockDimensionsTensor,
                                                                                                                                       boolean usePixelShuffleOrder,
                                                                                                                                       @Nullable
                                                                                                                                       @Nullable java.lang.String name)
        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 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 ``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: 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. API-Since: 16.1
      • bitwiseANDWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseANDWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor secondaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Returns the elementwise bitwise AND of binary representations of two integer tensors. - Parameters: - 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. API-Since: 16.1
      • bitwiseLeftShiftWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseLeftShiftWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                            @NotNull MPSGraphTensor primaryTensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor secondaryTensor,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String name)
        Returns the elementwise left shifted binary representations of the primary integer by the secondary tensor amount. - Parameters: - 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. API-Since: 16.1
      • bitwiseNOTWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseNOTWithTensorName​(@NotNull
                                                                @NotNull MPSGraphTensor tensor,
                                                                @Nullable
                                                                @Nullable java.lang.String name)
        Applies the bitwise not operation to the input tensor element. This operation only accepts integer tensors. - Parameters: - 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. API-Since: 16.1
      • bitwiseORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                     @NotNull MPSGraphTensor primaryTensor,
                                                                                     @NotNull
                                                                                     @NotNull MPSGraphTensor secondaryTensor,
                                                                                     @Nullable
                                                                                     @Nullable java.lang.String name)
        Returns the elementwise bitwise OR of binary representations of two integer tensors. - Parameters: - 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. API-Since: 16.1
      • bitwisePopulationCountWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwisePopulationCountWithTensorName​(@NotNull
                                                                            @NotNull MPSGraphTensor tensor,
                                                                            @Nullable
                                                                            @Nullable java.lang.String name)
        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: 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. API-Since: 16.1
      • bitwiseRightShiftWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseRightShiftWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                             @NotNull MPSGraphTensor primaryTensor,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor secondaryTensor,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String name)
        Returns the elementwise right shifted binary representations of the primary integer by the secondary tensor amount. - Parameters: - 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. API-Since: 16.1
      • bitwiseXORWithPrimaryTensorSecondaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor bitwiseXORWithPrimaryTensorSecondaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor primaryTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor secondaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        Returns the elementwise bitwise XOR of binary representations of two integer tensors. - Parameters: - 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. API-Since: 16.1
      • coordinateAlongAxisWithShapeTensorName

        @NotNull
        public @NotNull MPSGraphTensor coordinateAlongAxisWithShapeTensorName​(long axis,
                                                                              @NotNull
                                                                              @NotNull MPSGraphTensor shapeTensor,
                                                                              @Nullable
                                                                              @Nullable java.lang.String name)
        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: 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. API-Since: 15.4
      • coordinateAlongAxisTensorWithShapeTensorName

        @NotNull
        public @NotNull MPSGraphTensor coordinateAlongAxisTensorWithShapeTensorName​(@NotNull
                                                                                    @NotNull MPSGraphTensor axisTensor,
                                                                                    @NotNull
                                                                                    @NotNull MPSGraphTensor shapeTensor,
                                                                                    @Nullable
                                                                                    @Nullable java.lang.String name)
        Creates a get-coordindate operation and returns the result tensor. See ``coordinateAlongAxis:withShape:name:``. - Parameters: - 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. API-Since: 15.4
      • cumulativeMaximumWithTensorAxisExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMaximumWithTensorAxisExclusiveReverseName​(@NotNull
                                                                                           @NotNull MPSGraphTensor tensor,
                                                                                           long axis,
                                                                                           boolean exclusive,
                                                                                           boolean reverse,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String name)
        Compute the cumulative maximum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMaximumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMaximumWithTensorAxisName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           long axis,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Compute the cumulative maximum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMaximumWithTensorAxisTensorExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMaximumWithTensorAxisTensorExclusiveReverseName​(@NotNull
                                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                                 @NotNull
                                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                                 boolean exclusive,
                                                                                                 boolean reverse,
                                                                                                 @Nullable
                                                                                                 @Nullable java.lang.String name)
        Compute the cumulative maximum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMaximumWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMaximumWithTensorAxisTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Compute the cumulative maximum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMinimumWithTensorAxisExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMinimumWithTensorAxisExclusiveReverseName​(@NotNull
                                                                                           @NotNull MPSGraphTensor tensor,
                                                                                           long axis,
                                                                                           boolean exclusive,
                                                                                           boolean reverse,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String name)
        Compute the cumulative minimum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMinimumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMinimumWithTensorAxisName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           long axis,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Compute the cumulative minimum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMinimumWithTensorAxisTensorExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMinimumWithTensorAxisTensorExclusiveReverseName​(@NotNull
                                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                                 @NotNull
                                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                                 boolean exclusive,
                                                                                                 boolean reverse,
                                                                                                 @Nullable
                                                                                                 @Nullable java.lang.String name)
        Compute the cumulative minimum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeMinimumWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeMinimumWithTensorAxisTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Compute the cumulative minimum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeProductWithTensorAxisExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeProductWithTensorAxisExclusiveReverseName​(@NotNull
                                                                                           @NotNull MPSGraphTensor tensor,
                                                                                           long axis,
                                                                                           boolean exclusive,
                                                                                           boolean reverse,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String name)
        Compute the cumulative product of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeProductWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeProductWithTensorAxisName​(@NotNull
                                                                           @NotNull MPSGraphTensor tensor,
                                                                           long axis,
                                                                           @Nullable
                                                                           @Nullable java.lang.String name)
        Compute the cumulative product of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeProductWithTensorAxisTensorExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeProductWithTensorAxisTensorExclusiveReverseName​(@NotNull
                                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                                 @NotNull
                                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                                 boolean exclusive,
                                                                                                 boolean reverse,
                                                                                                 @Nullable
                                                                                                 @Nullable java.lang.String name)
        Compute the cumulative product of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeProductWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeProductWithTensorAxisTensorName​(@NotNull
                                                                                 @NotNull MPSGraphTensor tensor,
                                                                                 @NotNull
                                                                                 @NotNull MPSGraphTensor axisTensor,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.String name)
        Compute the cumulative product of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeSumWithTensorAxisExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeSumWithTensorAxisExclusiveReverseName​(@NotNull
                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                       long axis,
                                                                                       boolean exclusive,
                                                                                       boolean reverse,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        Compute the cumulative sum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeSumWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeSumWithTensorAxisName​(@NotNull
                                                                       @NotNull MPSGraphTensor tensor,
                                                                       long axis,
                                                                       @Nullable
                                                                       @Nullable java.lang.String name)
        Compute the cumulative sum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeSumWithTensorAxisTensorExclusiveReverseName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeSumWithTensorAxisTensorExclusiveReverseName​(@NotNull
                                                                                             @NotNull MPSGraphTensor tensor,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor axisTensor,
                                                                                             boolean exclusive,
                                                                                             boolean reverse,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String name)
        Compute the cumulative sum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • cumulativeSumWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor cumulativeSumWithTensorAxisTensorName​(@NotNull
                                                                             @NotNull MPSGraphTensor tensor,
                                                                             @NotNull
                                                                             @NotNull MPSGraphTensor axisTensor,
                                                                             @Nullable
                                                                             @Nullable java.lang.String name)
        Compute the cumulative sum of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • dequantizeTensorScaleZeroPointDataTypeName

        @NotNull
        public @NotNull MPSGraphTensor dequantizeTensorScaleZeroPointDataTypeName​(@NotNull
                                                                                  @NotNull MPSGraphTensor tensor,
                                                                                  double scale,
                                                                                  double zeroPoint,
                                                                                  int dataType,
                                                                                  @Nullable
                                                                                  @Nullable java.lang.String name)
        Create Dequantize op and return the result tensor Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scale(tensor - zeroPoint) - Parameters: - tensor: Input tensor to be dequantized - scale: Scale scalar parameter - zeroPoint: Bias scalar parameter (converted to dataType of tensor) - dataType: Float data type of the result tensor - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • dequantizeTensorScaleTensorZeroPointDataTypeAxisName

        @NotNull
        public @NotNull MPSGraphTensor dequantizeTensorScaleTensorZeroPointDataTypeAxisName​(@NotNull
                                                                                            @NotNull MPSGraphTensor tensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor scaleTensor,
                                                                                            double zeroPoint,
                                                                                            int dataType,
                                                                                            long axis,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String name)
        Create Dequantize op and return the result tensor Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scaleTensor(tensor - zeroPoint) - Parameters: - tensor: Input tensor to be dequantized - scaleTensor: Scale scalar or 1D Tensor parameter with size == tensor.shape[axis] - zeroPoint: Bias scalar parameter (converted to dataType of tensor) - dataType: Float data type of the result tensor - axis: Axis on which the scale 1D value is being broadcasted - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • dequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName

        @NotNull
        public @NotNull MPSGraphTensor dequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName​(@NotNull
                                                                                                  @NotNull MPSGraphTensor tensor,
                                                                                                  @NotNull
                                                                                                  @NotNull MPSGraphTensor scaleTensor,
                                                                                                  @NotNull
                                                                                                  @NotNull MPSGraphTensor zeroPointTensor,
                                                                                                  int dataType,
                                                                                                  long axis,
                                                                                                  @Nullable
                                                                                                  @Nullable java.lang.String name)
        Create Dequantize op and return the result tensor Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scaleTensor(tensor - zeroPointTensor) - Parameters: - tensor: Input tensor to be dequantized - scaleTensor: Scale scalar or 1D Tensor parameter with size == tensor.shape[axis] - zeroPointTensor: Bias scalar or 1D Tensor parameter with size == tensor.shape[axis] - dataType: Float data type of the result tensor - axis: Axis on which the scale 1D value is being broadcasted - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • expandDimsOfTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor expandDimsOfTensorAxesName​(@NotNull
                                                                  @NotNull MPSGraphTensor tensor,
                                                                  @NotNull
                                                                  @NotNull NSArray<? extends NSNumber> axes,
                                                                  @Nullable
                                                                  @Nullable java.lang.String name)
        Creates an expand dimensions operation and returns the result tensor. Expands the tensor, inserting dimensions with size 1 at specified axes. - Parameters: - tensor: The input tensor. - axes: The axes to expand. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • expandDimsOfTensorAxesTensorName

        @NotNull
        public @NotNull MPSGraphTensor expandDimsOfTensorAxesTensorName​(@NotNull
                                                                        @NotNull MPSGraphTensor tensor,
                                                                        @NotNull
                                                                        @NotNull MPSGraphTensor axesTensor,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        Creates an expand dimensions operation and returns the result tensor. Expands the tensor, inserting dimensions with size 1 at specified axes. - Parameters: - tensor: The input tensor. - axesTensor: The tensor containing the axes to expand. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • expandDimsOfTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor expandDimsOfTensorAxisName​(@NotNull
                                                                  @NotNull MPSGraphTensor tensor,
                                                                  long axis,
                                                                  @Nullable
                                                                  @Nullable java.lang.String name)
        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: The input tensor. - axis: The axis to expand. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • gatherAlongAxisWithUpdatesTensorIndicesTensorName

        @NotNull
        public @NotNull MPSGraphTensor gatherAlongAxisWithUpdatesTensorIndicesTensorName​(long axis,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor updatesTensor,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor indicesTensor,
                                                                                         @Nullable
                                                                                         @Nullable java.lang.String name)
        Create GatherAlongAxis op and return the result tensor Gather values from `updatesTensor` along the specified `axis` at indices in `indicesTensor`. The shape of `updatesTensor` and `indicesTensor` must match except at `axis`. The shape of the result tensor is equal to the shape of `indicesTensor`. If an index is out of bounds of the `updatesTensor` along `axis` a 0 is inserted. - Parameters: - axis: The axis to gather from. Negative values wrap around - updatesTensor: The input tensor to gather values from - indicesTensor: Int32 or Int64 tensor used to index `updatesTensor` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • gatherAlongAxisTensorWithUpdatesTensorIndicesTensorName

        @NotNull
        public @NotNull MPSGraphTensor gatherAlongAxisTensorWithUpdatesTensorIndicesTensorName​(@NotNull
                                                                                               @NotNull MPSGraphTensor axisTensor,
                                                                                               @NotNull
                                                                                               @NotNull MPSGraphTensor updatesTensor,
                                                                                               @NotNull
                                                                                               @NotNull MPSGraphTensor indicesTensor,
                                                                                               @Nullable
                                                                                               @Nullable java.lang.String name)
        Create GatherAlongAxis op and return the result tensor Gather values from `updatesTensor` along the specified `axis` at indices in `indicesTensor`. The shape of `updatesTensor` and `indicesTensor` must match except at `axis`. The shape of the result tensor is equal to the shape of `indicesTensor`. If an index is out of bounds of the `updatesTensor` along `axis` a 0 is inserted. - Parameters: - axisTensor: Scalar Int32 tensor. The axis to gather from. Negative values wrap around - updatesTensor: The input tensor to gather values from - indicesTensor: Int32 or Int64 tensor used to index `updatesTensor` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • inverseOfTensorName

        @NotNull
        public @NotNull MPSGraphTensor inverseOfTensorName​(@NotNull
                                                           @NotNull MPSGraphTensor inputTensor,
                                                           @Nullable
                                                           @Nullable java.lang.String name)
        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. Results are undefined for ill conditioned matrices. - Parameters: - inputTensor: The input tensor. - name: The name for the operation. - Returns: A valid ``MPSGraphTensor`` object containing the inverse of the input tensor. API-Since: 16.1
      • maxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor gradient,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor indices,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor outputShape,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        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. - Parameters: - 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. API-Since: 16.0
      • maxPooling2DReturnIndicesWithSourceTensorDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> maxPooling2DReturnIndicesWithSourceTensorDescriptorName​(@NotNull
                                                                                                                  @NotNull MPSGraphTensor source,
                                                                                                                  @NotNull
                                                                                                                  @NotNull MPSGraphPooling2DOpDescriptor descriptor,
                                                                                                                  @Nullable
                                                                                                                  @Nullable java.lang.String name)
        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 MPSGraph returns will be valid and using the second result will assert. - Parameters: - 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: An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices API-Since: 15.3
      • maxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor maxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor gradient,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor indices,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor outputShape,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        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. - Parameters: - 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. API-Since: 16.0
      • maxPooling4DReturnIndicesWithSourceTensorDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> maxPooling4DReturnIndicesWithSourceTensorDescriptorName​(@NotNull
                                                                                                                  @NotNull MPSGraphTensor source,
                                                                                                                  @NotNull
                                                                                                                  @NotNull MPSGraphPooling4DOpDescriptor descriptor,
                                                                                                                  @Nullable
                                                                                                                  @Nullable java.lang.String name)
        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 MPSGraph returns will be valid and using the second result will assert. - Parameters: - 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: An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices. API-Since: 15.3
      • quantizeTensorScaleZeroPointDataTypeName

        @NotNull
        public @NotNull MPSGraphTensor quantizeTensorScaleZeroPointDataTypeName​(@NotNull
                                                                                @NotNull MPSGraphTensor tensor,
                                                                                double scale,
                                                                                double zeroPoint,
                                                                                int dataType,
                                                                                @Nullable
                                                                                @Nullable java.lang.String name)
        Create Quantize op and return the result tensor Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scale) + zeroPoint - Parameters: - tensor: Input tensor to be quantized - scale: Scale scalar parameter - zeroPoint: Bias scalar parameter (converted to dataType of resultTensor) - dataType: Integer data type of the result tensor - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • quantizeTensorScaleTensorZeroPointDataTypeAxisName

        @NotNull
        public @NotNull MPSGraphTensor quantizeTensorScaleTensorZeroPointDataTypeAxisName​(@NotNull
                                                                                          @NotNull MPSGraphTensor tensor,
                                                                                          @NotNull
                                                                                          @NotNull MPSGraphTensor scaleTensor,
                                                                                          double zeroPoint,
                                                                                          int dataType,
                                                                                          long axis,
                                                                                          @Nullable
                                                                                          @Nullable java.lang.String name)
        Create Quantize op and return the result tensor Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scaleTensor) + zeroPoint - Parameters: - tensor: Input tensor to be quantized - scaleTensor: Scale 1D Tensor parameter with size == tensor.shape[axis] - zeroPoint: Bias scalar parameter (converted to dataType of resultTensor) - dataType: Integer data type of the result tensor - axis: Axis on which the scale 1D value is being broadcasted - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • quantizeTensorScaleTensorZeroPointTensorDataTypeAxisName

        @NotNull
        public @NotNull MPSGraphTensor quantizeTensorScaleTensorZeroPointTensorDataTypeAxisName​(@NotNull
                                                                                                @NotNull MPSGraphTensor tensor,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor scaleTensor,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor zeroPointTensor,
                                                                                                int dataType,
                                                                                                long axis,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        Create Quantize op and return the result tensor Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scaleTensor) + zeroPointTensor - Parameters: - tensor: Input tensor to be quantized - scaleTensor: Scale scalar or 1D Tensor parameter with size == tensor.shape[axis] - zeroPointTensor: Bias scalar or 1D Tensor parameter with size == tensor.shape[axis] - dataType: Integer data type of the result tensor - axis: Axis on which the scale 1D value is being broadcasted - name: The name for the operation - Returns: A valid MPSGraphTensor array of datatype dataType API-Since: 16.2
      • reductionAndWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionAndWithTensorAxesName​(@NotNull
                                                                      @NotNull MPSGraphTensor tensor,
                                                                      @Nullable
                                                                      @Nullable NSArray<? extends NSNumber> axes,
                                                                      @Nullable
                                                                      @Nullable java.lang.String name)
        Create reduction and op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.3
      • reductionAndWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionAndWithTensorAxisName​(@NotNull
                                                                      @NotNull MPSGraphTensor tensor,
                                                                      long axis,
                                                                      @Nullable
                                                                      @Nullable java.lang.String name)
        Create reduction and op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.3
      • reductionOrWithTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor reductionOrWithTensorAxesName​(@NotNull
                                                                     @NotNull MPSGraphTensor tensor,
                                                                     @Nullable
                                                                     @Nullable NSArray<? extends NSNumber> axes,
                                                                     @Nullable
                                                                     @Nullable java.lang.String name)
        Create reduction or op and return the result tensor. - Parameters: - tensor: input tensor - axes: axes of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.3
      • reductionOrWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor reductionOrWithTensorAxisName​(@NotNull
                                                                     @NotNull MPSGraphTensor tensor,
                                                                     long axis,
                                                                     @Nullable
                                                                     @Nullable java.lang.String name)
        Create reduction or op and return the result tensor. - Parameters: - tensor: input tensor - axis: axis of reduction - name: name for the operation - Returns: A valid MPSGraphTensor object. API-Since: 15.3
      • resizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                               @NotNull MPSGraphTensor gradient,
                                                                                                               @NotNull
                                                                                                               @NotNull MPSGraphTensor input,
                                                                                                               boolean centerResult,
                                                                                                               boolean alignCorners,
                                                                                                               long layout,
                                                                                                               @Nullable
                                                                                                               @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor input,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor scaleOffset,
                                                                                                        long layout,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with bilinear sampling and identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                            @NotNull MPSGraphTensor imagesTensor,
                                                                                                            @NotNull
                                                                                                            @NotNull MPSGraphTensor size,
                                                                                                            boolean centerResult,
                                                                                                            boolean alignCorners,
                                                                                                            long layout,
                                                                                                            @Nullable
                                                                                                            @Nullable java.lang.String name)
        Resamples input images to given size using bilinear sampling. See above discussion for more details. - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName​(@NotNull
                                                                                                     @NotNull MPSGraphTensor imagesTensor,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor size,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor scaleOffset,
                                                                                                     long layout,
                                                                                                     @Nullable
                                                                                                     @Nullable java.lang.String name)
        Resamples input images to given size using the provided scale and offset and bilinear sampling See above discussion for more details. - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - nearestRoundingMode: The rounding mode to use when using nearest resampling. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                                                 @NotNull MPSGraphTensor gradient,
                                                                                                                                 @NotNull
                                                                                                                                 @NotNull MPSGraphTensor input,
                                                                                                                                 long nearestRoundingMode,
                                                                                                                                 boolean centerResult,
                                                                                                                                 boolean alignCorners,
                                                                                                                                 long layout,
                                                                                                                                 @Nullable
                                                                                                                                 @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - nearestRoundingMode: The rounding mode to use when using nearest resampling. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor gradient,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor input,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor scaleOffset,
                                                                                                                          long nearestRoundingMode,
                                                                                                                          long layout,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - nearestRoundingMode: The rounding mode to use when using nearest resampling. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName​(@NotNull
                                                                                                                              @NotNull MPSGraphTensor imagesTensor,
                                                                                                                              @NotNull
                                                                                                                              @NotNull MPSGraphTensor size,
                                                                                                                              long nearestRoundingMode,
                                                                                                                              boolean centerResult,
                                                                                                                              boolean alignCorners,
                                                                                                                              long layout,
                                                                                                                              @Nullable
                                                                                                                              @Nullable java.lang.String name)
        Resamples input images to given size using nearest neighbor sampling. This API allows for the rounding mode to be specified. See above discussion for more details. - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - nearestRoundingMode: The rounding mode to use when using nearest resampling. Default is roundPreferCeil. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName​(@NotNull
                                                                                                                       @NotNull MPSGraphTensor imagesTensor,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor size,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor scaleOffset,
                                                                                                                       long nearestRoundingMode,
                                                                                                                       long layout,
                                                                                                                       @Nullable
                                                                                                                       @Nullable java.lang.String name)
        Resamples input images to given size using the provided scale and offset and nearest neighbor sampling See above discussion for more details. - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - nearestRoundingMode: The rounding mode to use when using nearest resampling. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeTensorSizeTensorScaleOffsetTensorModeLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeTensorSizeTensorScaleOffsetTensorModeLayoutName​(@NotNull
                                                                                             @NotNull MPSGraphTensor imagesTensor,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor size,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor scaleOffset,
                                                                                             long mode,
                                                                                             long layout,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String name)
        Resamples input images to given size using the provided scale and offset. Destination indices are computed using ```md dst_indices = (src_indicesscale) + offset ``` For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners. - Parameters: - imagesTensor: Tensor containing input images. - size: 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth] - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • resizeWithGradientTensorInputScaleOffsetTensorModeLayoutName

        @NotNull
        public @NotNull MPSGraphTensor resizeWithGradientTensorInputScaleOffsetTensorModeLayoutName​(@NotNull
                                                                                                    @NotNull MPSGraphTensor gradient,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor input,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor scaleOffset,
                                                                                                    long mode,
                                                                                                    long layout,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scaleOffset: 1D float tensor. A 4-element shape as [scaleY, scaleX, offsetY, offsetX] - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC, NCHW, HWC, CHW, and HW. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.0
      • sampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName

        @NotNull
        public @NotNull MPSGraphTensor sampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName​(@NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor source,
                                                                                                                                                                                          @NotNull
                                                                                                                                                                                          @NotNull MPSGraphTensor coordinates,
                                                                                                                                                                                          long layout,
                                                                                                                                                                                          boolean normalizeCoordinates,
                                                                                                                                                                                          boolean relativeCoordinates,
                                                                                                                                                                                          boolean alignCorners,
                                                                                                                                                                                          long paddingMode,
                                                                                                                                                                                          long nearestRoundingMode,
                                                                                                                                                                                          double constantValue,
                                                                                                                                                                                          @Nullable
                                                                                                                                                                                          @Nullable java.lang.String name)
        Samples a tensor using the coordinates provided, using nearest neighbor sampling with specified rounding mode. Given an input tensor (N, H1, W1, C) or (N, C, H1, W1) and coordinates tensor (N, H2, W2, 2) this operation outputs a tensor of size (N, H2, W2, C) or (N, C, H2, W2) by sampling the input tensor at the coordinates provided by the coordinates tensor. - Parameters: - source: Tensor containing source data - coordinates: a tensor (N, Hout, Wout, 2) that contains the coordinates of the samples in the source tensor that constitute the output tensor. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC and NCHW. - normalizeCoordinates: If true, coordinates are within [-1, 1] x [-1, 1] otherwise they are in pixels in the input tensor. - relativeCoordinates: If true, coordinates are relative to the postion of the pixel in the output tensor and scaled back to the input tensor size - alignCorners: If true, coordinate extrema are equal to the center of edge pixels, otherwise extrema are equal to outer edge of edge pixels - paddingMode: determines how samples outside the inputTensor are evaluated (only constant, reflect, symmetric and clampToEdge are supported) - nearestRoundingMode: The rounding mode to use for determining the nearest neighbor. Valid modes are roundPreferCeil, roundPreferFloor, ceil, and floor. - constantValue: If paddingMode is MPSGraphPaddingModeConstant, then this constant is used for samples outside the input tensor. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.2
      • sampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName

        @NotNull
        public @NotNull MPSGraphTensor sampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName​(@NotNull
                                                                                                                                                                                   @NotNull MPSGraphTensor source,
                                                                                                                                                                                   @NotNull
                                                                                                                                                                                   @NotNull MPSGraphTensor coordinates,
                                                                                                                                                                                   long layout,
                                                                                                                                                                                   boolean normalizeCoordinates,
                                                                                                                                                                                   boolean relativeCoordinates,
                                                                                                                                                                                   boolean alignCorners,
                                                                                                                                                                                   long paddingMode,
                                                                                                                                                                                   long samplingMode,
                                                                                                                                                                                   double constantValue,
                                                                                                                                                                                   @Nullable
                                                                                                                                                                                   @Nullable java.lang.String name)
        Samples a tensor using the coordinates provided. Given an input tensor (N, H1, W1, C) or (N, C, H1, W1) and coordinates tensor (N, H2, W2, 2) this operation outputs a tensor of size (N, H2, W2, C) or (N, C, H2, W2) by sampling the input tensor at the coordinates provided by the coordinates tensor. - Parameters: - source: Tensor containing source data - coordinates: a tensor (N, Hout, Wout, 2) that contains the coordinates of the samples in the source tensor that constitute the output tensor. - layout: Specifies what layout the provided tensor is in. The returned tensor will follow the same layout. Valid layouts are NHWC and NCHW. - normalizeCoordinates: If true, coordinates are within [-1, 1] x [-1, 1] otherwise they are in pixels in the input tensor. - relativeCoordinates: If true, coordinates are relative to the postion of the pixel in the output tensor and scaled back to the input tensor size - alignCorners: If true, coordinate extrema are equal to the center of edge pixels, otherwise extrema are equal to outer edge of edge pixels - paddingMode: determines how samples outside the inputTensor are evaluated (only constant, reflect, symmetric and clampToEdge are supported) - samplingMode: Can be either MPSGraphResizeNearest or MPSGraphResizeBilinear. Nearest sampling will use roundPreferCeil. - constantValue: If paddingMode is MPSGraphPaddingModeConstant, then this constant is used for samples outside the input tensor. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.2
      • scatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName

        @NotNull
        public @NotNull MPSGraphTensor scatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName​(long axis,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor dataTensor,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor updatesTensor,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor indicesTensor,
                                                                                                        long mode,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Create ScatterAlongAxis op and return the result tensor Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` onto `dataTensor`. Values in `dataTensor` are updated following `mode`. See MPSGraphScatterMode. The shape of `updatesTensor` and `indicesTensor` must match. The shape of `dataTensor` must match except at `axis`. If an index is out of bounds of `shape` along `axis` the update value is skipped. For example, ```md data = [ [0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3] ] updates = [ [1, 2, 3], [4, 5, 6] ] indices = [ [2, 1, 0], [1, 3, 2] ] axis = 0 result = scatterAlongAxis(axis, data, updates, indices, MPSGraphScatterModeAdd, "scatter") result = [ [0, 0, 3], [5, 3, 1], [3, 2, 8], [3, 8, 3] ] ``` - Parameters: - axis: The axis to scatter to. Negative values wrap around - dataTensor: The input tensor to scatter values onto - updatesTensor: The input tensor to scatter values from - indicesTensor: Int32 or Int64 tensor used to index the result tensor - mode: The type of update to use - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • scatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName

        @NotNull
        public @NotNull MPSGraphTensor scatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName​(@NotNull
                                                                                                              @NotNull MPSGraphTensor axisTensor,
                                                                                                              @NotNull
                                                                                                              @NotNull MPSGraphTensor dataTensor,
                                                                                                              @NotNull
                                                                                                              @NotNull MPSGraphTensor updatesTensor,
                                                                                                              @NotNull
                                                                                                              @NotNull MPSGraphTensor indicesTensor,
                                                                                                              long mode,
                                                                                                              @Nullable
                                                                                                              @Nullable java.lang.String name)
        Create ScatterAlongAxis op and return the result tensor Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` onto `dataTensor`. Values in `dataTensor` are updated following `mode`. See MPSGraphScatterMode. The shape of `updatesTensor` and `indicesTensor` must match. The shape of `dataTensor` must match except at `axis`. If an index is out of bounds of `shape` along `axis` the update value is skipped. For example, ```md data = [ [0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3] ] updates = [ [1, 2, 3], [4, 5, 6] ] indices = [ [2, 1, 0], [1, 3, 2] ] axis = 0 result = scatterAlongAxis(axis, data, updates, indices, MPSGraphScatterModeAdd, "scatter") result = [ [0, 0, 3], [5, 3, 1], [3, 2, 8], [3, 8, 3] ] ``` - Parameters: - axisTensor: Scalar Int32 tensor. The axis to scatter to. Negative values wrap around - dataTensor: The input tensor to scatter values onto - updatesTensor: The input tensor to scatter values from - indicesTensor: Int32 or Int64 tensor used to index the result tensor - mode: The type of update to use - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName​(@NotNull
                                                                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor zState,
                                                                                                                                                           @Nullable
                                                                                                                                                           @Nullable MPSGraphTensor initState,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                                           @Nullable
                                                                                                                                                           @Nullable java.lang.String name)
        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: 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` and finally for `initState`. API-Since: 15.4
      • singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName​(@NotNull
                                                                                                                                                                          @NotNull MPSGraphTensor source,
                                                                                                                                                                          @NotNull
                                                                                                                                                                          @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                          @NotNull
                                                                                                                                                                          @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                          @NotNull
                                                                                                                                                                          @NotNull MPSGraphTensor zState,
                                                                                                                                                                          @Nullable
                                                                                                                                                                          @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                          @Nullable
                                                                                                                                                                          @Nullable MPSGraphTensor bias,
                                                                                                                                                                          @Nullable
                                                                                                                                                                          @Nullable MPSGraphTensor initState,
                                                                                                                                                                          @NotNull
                                                                                                                                                                          @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                                                          @Nullable
                                                                                                                                                                          @Nullable java.lang.String name)
        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: 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` and finally for `initState`. API-Since: 15.4
      • singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName​(@NotNull
                                                                                                                                                                              @NotNull MPSGraphTensor source,
                                                                                                                                                                              @NotNull
                                                                                                                                                                              @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                              @NotNull
                                                                                                                                                                              @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                              @NotNull
                                                                                                                                                                              @NotNull MPSGraphTensor zState,
                                                                                                                                                                              @Nullable
                                                                                                                                                                              @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                              @Nullable
                                                                                                                                                                              @Nullable MPSGraphTensor bias,
                                                                                                                                                                              @Nullable
                                                                                                                                                                              @Nullable MPSGraphTensor initState,
                                                                                                                                                                              @Nullable
                                                                                                                                                                              @Nullable MPSGraphTensor mask,
                                                                                                                                                                              @NotNull
                                                                                                                                                                              @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                                                              @Nullable
                                                                                                                                                                              @Nullable java.lang.String name)
        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: 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` and finally for `initState`. API-Since: 15.4
      • singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName​(@NotNull
                                                                                                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                                                                                                           @NotNull
                                                                                                                                                                                           @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                                                           @NotNull
                                                                                                                                                                                           @NotNull MPSGraphTensor sourceGradient,
                                                                                                                                                                                           @NotNull
                                                                                                                                                                                           @NotNull MPSGraphTensor zState,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable MPSGraphTensor stateGradient,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable MPSGraphTensor bias,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable MPSGraphTensor initState,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable MPSGraphTensor mask,
                                                                                                                                                                                           @NotNull
                                                                                                                                                                                           @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                                                                           @Nullable
                                                                                                                                                                                           @Nullable java.lang.String name)
        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: 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` and finally for `initState`. API-Since: 15.4
      • singleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName​(@NotNull
                                                                                                                              @NotNull MPSGraphTensor source,
                                                                                                                              @NotNull
                                                                                                                              @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                              @Nullable
                                                                                                                              @Nullable MPSGraphTensor initState,
                                                                                                                              @NotNull
                                                                                                                              @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                              @Nullable
                                                                                                                              @Nullable java.lang.String name)
        Creates a single-gate RNN operation and returns the value and optionally training state tensor. This operation returns tensors `h` and optionally `z` that are defined recursively as follows: ```md for t = 0 to T-1 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`. See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options. - Parameters: - 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 is [T,N,H] or [T,N,2H] for bidirectional. API-Since: 15.4
      • singleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName​(@NotNull
                                                                                                                                             @NotNull MPSGraphTensor source,
                                                                                                                                             @NotNull
                                                                                                                                             @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                             @Nullable
                                                                                                                                             @Nullable MPSGraphTensor inputWeight,
                                                                                                                                             @Nullable
                                                                                                                                             @Nullable MPSGraphTensor bias,
                                                                                                                                             @Nullable
                                                                                                                                             @Nullable MPSGraphTensor initState,
                                                                                                                                             @NotNull
                                                                                                                                             @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                             @Nullable
                                                                                                                                             @Nullable java.lang.String name)
        Creates a single-gate RNN operation and returns the value and optionally training state tensor. This operation returns tensors `h` and optionally `z` that are defined recursively as follows: ```md for t = 0 to T-1 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`. See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options. - Parameters: - 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 is [T,N,H] or [T,N,2H] for bidirectional. API-Since: 15.4
      • singleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> singleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName​(@NotNull
                                                                                                                                                 @NotNull MPSGraphTensor source,
                                                                                                                                                 @NotNull
                                                                                                                                                 @NotNull MPSGraphTensor recurrentWeight,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable MPSGraphTensor inputWeight,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable MPSGraphTensor bias,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable MPSGraphTensor initState,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable MPSGraphTensor mask,
                                                                                                                                                 @NotNull
                                                                                                                                                 @NotNull MPSGraphSingleGateRNNDescriptor descriptor,
                                                                                                                                                 @Nullable
                                                                                                                                                 @Nullable java.lang.String name)
        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 for t = 0 to T-1 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`. See ``MPSGraphSingleGateRNNDescriptor`` for different `activation` options. - Parameters: - 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 is [T,N,H] or [T,N,2H] for bidirectional. API-Since: 15.4
      • sortWithTensorAxisDescendingName

        @NotNull
        public @NotNull MPSGraphTensor sortWithTensorAxisDescendingName​(@NotNull
                                                                        @NotNull MPSGraphTensor tensor,
                                                                        long axis,
                                                                        boolean descending,
                                                                        @Nullable
                                                                        @Nullable java.lang.String name)
        Sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • sortWithTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor sortWithTensorAxisName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              long axis,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        Sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • sortWithTensorAxisTensorDescendingName

        @NotNull
        public @NotNull MPSGraphTensor sortWithTensorAxisTensorDescendingName​(@NotNull
                                                                              @NotNull MPSGraphTensor tensor,
                                                                              @NotNull
                                                                              @NotNull MPSGraphTensor axisTensor,
                                                                              boolean descending,
                                                                              @Nullable
                                                                              @Nullable java.lang.String name)
        Sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • sortWithTensorAxisTensorName

        @NotNull
        public @NotNull MPSGraphTensor sortWithTensorAxisTensorName​(@NotNull
                                                                    @NotNull MPSGraphTensor tensor,
                                                                    @NotNull
                                                                    @NotNull MPSGraphTensor axisTensor,
                                                                    @Nullable
                                                                    @Nullable java.lang.String name)
        Sort the elements of the input tensor along the specified axis. - Parameters: - 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 API-Since: 16.0
      • spaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor spaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName​(@NotNull
                                                                                                                     @NotNull MPSGraphTensor tensor,
                                                                                                                     @NotNull
                                                                                                                     @NotNull NSArray<? extends NSNumber> spatialAxes,
                                                                                                                     long batchAxis,
                                                                                                                     @NotNull
                                                                                                                     @NotNull NSArray<? extends NSNumber> blockDimensions,
                                                                                                                     boolean usePixelShuffleOrder,
                                                                                                                     @Nullable
                                                                                                                     @Nullable java.lang.String name)
        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 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: 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. API-Since: 16.1
      • spaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName

        @NotNull
        public @NotNull MPSGraphTensor spaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName​(@NotNull
                                                                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor spatialAxesTensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor batchAxisTensor,
                                                                                                                                       @NotNull
                                                                                                                                       @NotNull MPSGraphTensor blockDimensionsTensor,
                                                                                                                                       boolean usePixelShuffleOrder,
                                                                                                                                       @Nullable
                                                                                                                                       @Nullable java.lang.String name)
        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 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: 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. API-Since: 16.1
      • splitTensorNumSplitsAxisName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> splitTensorNumSplitsAxisName​(@NotNull
                                                                                       @NotNull MPSGraphTensor tensor,
                                                                                       long numSplits,
                                                                                       long axis,
                                                                                       @Nullable
                                                                                       @Nullable java.lang.String name)
        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`. - Parameters: - tensor: The input tensor. - numSplits: The number of result tensors to split to. - axis: The dimension along which MPSGraph splits the input tensor. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • splitTensorSplitSizesAxisName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> splitTensorSplitSizesAxisName​(@NotNull
                                                                                        @NotNull MPSGraphTensor tensor,
                                                                                        @NotNull
                                                                                        @NotNull NSArray<? extends NSNumber> splitSizes,
                                                                                        long axis,
                                                                                        @Nullable
                                                                                        @Nullable java.lang.String name)
        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`. - Parameters: - 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. API-Since: 15.4
      • splitTensorSplitSizesTensorAxisName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> splitTensorSplitSizesTensorAxisName​(@NotNull
                                                                                              @NotNull MPSGraphTensor tensor,
                                                                                              @NotNull
                                                                                              @NotNull MPSGraphTensor splitSizesTensor,
                                                                                              long axis,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String name)
        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 the elements of `splitSizesTensor` is equal to the lenth of the input along `axis`. - Parameters: - 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 API-Since: 15.4
      • squeezeTensorAxesName

        @NotNull
        public @NotNull MPSGraphTensor squeezeTensorAxesName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             @NotNull
                                                             @NotNull NSArray<? extends NSNumber> axes,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        Creates a squeeze operation and returns the result tensor. Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes. - Parameters: - tensor: The input tensor. - axes: The axes to squeeze. - name: The name for the operation. - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • squeezeTensorAxesTensorName

        @NotNull
        public @NotNull MPSGraphTensor squeezeTensorAxesTensorName​(@NotNull
                                                                   @NotNull MPSGraphTensor tensor,
                                                                   @NotNull
                                                                   @NotNull MPSGraphTensor axesTensor,
                                                                   @Nullable
                                                                   @Nullable java.lang.String name)
        Creates a squeeze operation and returns the result tensor. Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes. - Parameters: - tensor: The input tensor. - axesTensor: The tensor containing the axes to squeeze. - name: The name for the operation. - Returns: A valid MPSGraphTensor object API-Since: 15.4
      • squeezeTensorAxisName

        @NotNull
        public @NotNull MPSGraphTensor squeezeTensorAxisName​(@NotNull
                                                             @NotNull MPSGraphTensor tensor,
                                                             long axis,
                                                             @Nullable
                                                             @Nullable java.lang.String name)
        Creates a squeeze operation and returns the result tensor. Squeezes the tensor, removing a dimension with size 1 at the specified axis. The size of the input tensor must be 1 at the specified axis. - Parameters: - tensor: The input tensor. - axis: The axis to squeeze. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • squeezeTensorName

        @NotNull
        public @NotNull MPSGraphTensor squeezeTensorName​(@NotNull
                                                         @NotNull MPSGraphTensor tensor,
                                                         @Nullable
                                                         @Nullable java.lang.String name)
        Creates a squeeze operation and returns the result tensor. Squeezes the tensor, removing all dimensions with size 1. - Parameters: - tensor: The input tensor. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 15.4
      • stackTensorsAxisName

        @NotNull
        public @NotNull MPSGraphTensor stackTensorsAxisName​(@NotNull
                                                            @NotNull NSArray<? extends MPSGraphTensor> inputTensors,
                                                            long axis,
                                                            @Nullable
                                                            @Nullable java.lang.String name)
        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 except `axis`, and have the same type. - Parameters: - 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. API-Since: 15.4
      • transposeTensorPermutationName

        @NotNull
        public @NotNull MPSGraphTensor transposeTensorPermutationName​(@NotNull
                                                                      @NotNull MPSGraphTensor tensor,
                                                                      @NotNull
                                                                      @NotNull NSArray<? extends NSNumber> permutation,
                                                                      @Nullable
                                                                      @Nullable java.lang.String name)
        Creates a permutation operation and returns the result tensor. Permutes the dimensions of the input tensor according to values in `permutation`. - Parameters: - 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. API-Since: 16.0
      • truncateWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor truncateWithTensorName​(@NotNull
                                                              @NotNull MPSGraphTensor tensor,
                                                              @Nullable
                                                              @Nullable java.lang.String name)
        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 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. API-Since: 16.0
      • HermiteanToRealFFTWithTensorAxesDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor HermiteanToRealFFTWithTensorAxesDescriptorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      @NotNull
                                                                                      @NotNull NSArray<? extends NSNumber> axes,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) in'[nu], where ``` `in'[nu] = conjugate(in[n - nu])`, for the last dimension defined by `axes` when `nu` is out of range of the input dimension. `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used 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 `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 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: 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). API-Since: 17.0
      • HermiteanToRealFFTWithTensorAxesTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor HermiteanToRealFFTWithTensorAxesTensorDescriptorName​(@NotNull
                                                                                            @NotNull MPSGraphTensor tensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor axesTensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) in'[nu], where ``` `in'[nu] = conjugate(in[n - nu])`, for the last dimension defined by `axes` when `nu` is out of range of the input dimension. `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used 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 `x = 1` when ``MPSGraphFFTDescriptor/roundToOddHermitean`` = `YES` and `x = 0` otherwise. > 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: 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). API-Since: 17.0
      • absoluteSquareWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor absoluteSquareWithTensorName​(@NotNull
                                                                    @NotNull MPSGraphTensor tensor,
                                                                    @Nullable
                                                                    @Nullable java.lang.String name)
        Returns the absolute square of the input tensor elements. - Parameters: - 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. API-Since: 17.0
      • bottomKWithGradientTensorSourceAxisKName

        @NotNull
        public @NotNull MPSGraphTensor bottomKWithGradientTensorSourceAxisKName​(@NotNull
                                                                                @NotNull MPSGraphTensor gradient,
                                                                                @NotNull
                                                                                @NotNull MPSGraphTensor source,
                                                                                long axis,
                                                                                long k,
                                                                                @Nullable
                                                                                @Nullable java.lang.String name)
        Create BottomKGradient op and return the result tensor. Finds the K smallest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - axis: The dimension along which to compute the BottomK values. - k: The number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • bottomKWithGradientTensorSourceAxisTensorKTensorName

        @NotNull
        public @NotNull MPSGraphTensor bottomKWithGradientTensorSourceAxisTensorKTensorName​(@NotNull
                                                                                            @NotNull MPSGraphTensor gradient,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor source,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor axisTensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor kTensor,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String name)
        Create BottomKGradient op and return the result tensor. Finds the K smallest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - axisTensor: Tensor containing the dimension along which to compute the BottomK values. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • bottomKWithSourceTensorAxisKName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> bottomKWithSourceTensorAxisKName​(@NotNull
                                                                                           @NotNull MPSGraphTensor source,
                                                                                           long axis,
                                                                                           long k,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String name)
        Create BottomK op and return the value and indices tensors. Finds the k smallest 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 bottom values, and the second array corresponds to the indices of the bottom values. - Parameters: - source: Tensor containing source data. - axis: The dimension along which to compute the BottomK values. - k: The number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor array of size 2. API-Since: 17.0
      • bottomKWithSourceTensorAxisTensorKTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> bottomKWithSourceTensorAxisTensorKTensorName​(@NotNull
                                                                                                       @NotNull MPSGraphTensor source,
                                                                                                       @NotNull
                                                                                                       @NotNull MPSGraphTensor axisTensor,
                                                                                                       @NotNull
                                                                                                       @NotNull MPSGraphTensor kTensor,
                                                                                                       @Nullable
                                                                                                       @Nullable java.lang.String name)
        Create BottomK op and return the result tensor. Finds the k smallest 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 bottom values, and the second array corresponds to the indices of the bottom values. - Parameters: - source: Tensor containing source data. - axisTensor: Tensor containing the dimension along which to compute the BottomK values. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor array of size 2. API-Since: 17.0
      • complexTensorWithRealTensorImaginaryTensorName

        @NotNull
        public @NotNull MPSGraphTensor complexTensorWithRealTensorImaginaryTensorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor realTensor,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphTensor imaginaryTensor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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: An optional string which serves as an identifier for the operation.. - Returns: A valid `MPSGraphTensor` object containing the elementwise result of the applied operation. API-Since: 17.0
      • conjugateWithTensorName

        @NotNull
        public @NotNull MPSGraphTensor conjugateWithTensorName​(@NotNull
                                                               @NotNull MPSGraphTensor tensor,
                                                               @Nullable
                                                               @Nullable java.lang.String name)
        Returns the complex conjugate of the input tensor elements. - Parameters: - 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. API-Since: 17.0
      • constantWithRealPartImaginaryPart

        @NotNull
        public @NotNull MPSGraphTensor constantWithRealPartImaginaryPart​(double realPart,
                                                                         double imaginaryPart)
        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: The dataType of the constant tensor. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • constantWithRealPartImaginaryPartDataType

        @NotNull
        public @NotNull MPSGraphTensor constantWithRealPartImaginaryPartDataType​(double realPart,
                                                                                 double imaginaryPart,
                                                                                 int dataType)
        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: The dataType of the constant tensor. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                         @NotNull MPSGraphTensor gradient,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphTensor weights,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphTensor outputShapeTensor,
                                                                                                                                                         @NotNull
                                                                                                                                                         @NotNull MPSGraphConvolution3DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                         @Nullable
                                                                                                                                                         @Nullable java.lang.String name)
        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. - Parameters: - incomingGradient: Incoming loss gradient tensor - weights: Forward pass weights tensor - outputShapeTensor: 4D Int32 or Int64 tensor. Shape of the forward pass source tensor - forwardConvolutionDescriptor: Forward convolution 2d op ``descriptor`` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.3
      • convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName​(@NotNull
                                                                                                                                                           @NotNull MPSGraphTensor gradient,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor source,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphTensor outputShapeTensor,
                                                                                                                                                           @NotNull
                                                                                                                                                           @NotNull MPSGraphConvolution3DOpDescriptor forwardConvolutionDescriptor,
                                                                                                                                                           @Nullable
                                                                                                                                                           @Nullable java.lang.String name)
        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. - Parameters: - incomingGradient: Incoming loss gradient tensor - weights: Forward pass weights tensor - outputShapeTensor: 4D int32 or Int64 Tensor. Shape of the forward pass source tensor - forwardConvolutionDescriptor: Forward convolution 2d op ``descriptor`` - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 16.3
      • convolution3DWithSourceTensorWeightsTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor convolution3DWithSourceTensorWeightsTensorDescriptorName​(@NotNull
                                                                                                @NotNull MPSGraphTensor source,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphTensor weights,
                                                                                                @NotNull
                                                                                                @NotNull MPSGraphConvolution3DOpDescriptor descriptor,
                                                                                                @Nullable
                                                                                                @Nullable java.lang.String name)
        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``. - weights: weights tensor, must be rank 5. The layout is defined by ``descriptor.weightsLayout``. - descriptor: Specifies strides, dilation rates, paddings and layouts. - name: The name for the operation. - Returns: A valid MPSGraphTensor object API-Since: 16.3
      • fastFourierTransformWithTensorAxesDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor fastFourierTransformWithTensorAxesDescriptorName​(@NotNull
                                                                                        @NotNull MPSGraphTensor tensor,
                                                                                        @NotNull
                                                                                        @NotNull NSArray<? extends NSNumber> axes,
                                                                                        @NotNull
                                                                                        @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                        @Nullable
                                                                                        @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where ``` `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used and the sum is done separately over each dimension in `axes` and `n` is the dimension length of that axis. > 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: 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`. API-Since: 17.0
      • fastFourierTransformWithTensorAxesTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor fastFourierTransformWithTensorAxesTensorDescriptorName​(@NotNull
                                                                                              @NotNull MPSGraphTensor tensor,
                                                                                              @NotNull
                                                                                              @NotNull MPSGraphTensor axesTensor,
                                                                                              @NotNull
                                                                                              @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where ``` `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used and the sum is done separately over each dimension in `axes` and `n` is the dimension length of that axis. > 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: 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`. API-Since: 17.0
      • imToColWithSourceTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor imToColWithSourceTensorDescriptorName​(@NotNull
                                                                             @NotNull MPSGraphTensor source,
                                                                             @NotNull
                                                                             @NotNull MPSGraphImToColOpDescriptor descriptor,
                                                                             @Nullable
                                                                             @Nullable java.lang.String name)
        Creates an imToCol operation and returns the result tensor. - Parameters: - 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
      • imaginaryPartOfTensorName

        @NotNull
        public @NotNull MPSGraphTensor imaginaryPartOfTensorName​(@NotNull
                                                                 @NotNull MPSGraphTensor tensor,
                                                                 @Nullable
                                                                 @Nullable java.lang.String name)
        Returns the imaginary part of a tensor. - Parameters: - 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. API-Since: 17.0
      • nonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName

        @NotNull
        public @NotNull MPSGraphTensor nonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName​(@NotNull
                                                                                                                                                       @NotNull MPSGraphTensor boxesTensor,
                                                                                                                                                       @NotNull
                                                                                                                                                       @NotNull MPSGraphTensor scoresTensor,
                                                                                                                                                       float IOUThreshold,
                                                                                                                                                       float scoreThreshold,
                                                                                                                                                       boolean perClassSuppression,
                                                                                                                                                       long coordinateMode,
                                                                                                                                                       @Nullable
                                                                                                                                                       @Nullable java.lang.String name)
        Create a nonMaximumumSuppression op and return the result tensor - Parameters: - boxesTensor: A tensor containing the coordinates of the input boxes. Must be a rank 3 tensor of shape [N,B,4] of type ``MPSDataTypeFloat32`` - scoresTensor: A tensor containing the scores of the input boxes. Must be a rank 3 tensor of shape [N,B,K] of type ``MPSDataTypeFloat32`` - IOUThreshold: The threshold for when to reject boxes based on their Intersection Over Union. Valid range is [0,1]. - scoreThreshold: The threshold for when to reject boxes based on their score, before IOU suppression. - perClassSuppression: When this is specified a box will only suppress another box if they have the same class. - coordinateMode: The coordinate mode the box coordinates are provided in. - name: The name for the operation.
      • nonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName

        @NotNull
        public @NotNull MPSGraphTensor nonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName​(@NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor boxesTensor,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor scoresTensor,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         @NotNull MPSGraphTensor classIndicesTensor,
                                                                                                                                                                         float IOUThreshold,
                                                                                                                                                                         float scoreThreshold,
                                                                                                                                                                         boolean perClassSuppression,
                                                                                                                                                                         long coordinateMode,
                                                                                                                                                                         @Nullable
                                                                                                                                                                         @Nullable java.lang.String name)
        Create a nonMaximumumSuppression op and return the result tensor - Parameters: - boxesTensor: A tensor containing the coordinates of the input boxes. Must be a rank 3 tensor of shape [N,B,4] of type ``MPSDataTypeFloat32`` - scoresTensor: A tensor containing the scores of the input boxes. Must be a rank 3 tensor of shape [N,B,1] of type ``MPSDataTypeFloat32`` - classIndicesTensor: A tensor containing the class indices of the input boxes. Must be a rank 2 tensor of shape [N,B] of type ``MPSDataTypeInt32`` - IOUThreshold: The threshold for when to reject boxes based on their Intersection Over Union. Valid range is [0,1]. - scoreThreshold: The threshold for when to reject boxes based on their score, before IOU suppression. - perClassSuppression: When this is specified a box will only suppress another box if they have the same class. - coordinateMode: The coordinate mode the box coordinates are provided in. - name: The name for the operation.
      • nonZeroIndicesOfTensorName

        @NotNull
        public @NotNull MPSGraphTensor nonZeroIndicesOfTensorName​(@NotNull
                                                                  @NotNull MPSGraphTensor tensor,
                                                                  @Nullable
                                                                  @Nullable java.lang.String name)
        Compute the indices of the non-zero elements of the input tensor. The indices are returned as a two-dimensional tensor of size `[number_of_nonzeros, input_rank]`. Each row in the result contains indices of a nonzero elements in input. For example: ```md tensor = [[ 1, 0, 3], [ 0, 10, 0]] indices = [[ 0, 0], [ 0, 2], [ 1, 1]] ``` - Parameters: - tensor: An MPSGraphTensor of which to compute the non-zero indices. - Returns: A valid MPSGraphTensor containing indices in signed int32 data type. API-Since: 17.0
      • realPartOfTensorName

        @NotNull
        public @NotNull MPSGraphTensor realPartOfTensorName​(@NotNull
                                                            @NotNull MPSGraphTensor tensor,
                                                            @Nullable
                                                            @Nullable java.lang.String name)
        Returns the real part of a tensor. - Parameters: - 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. API-Since: 17.0
      • realToHermiteanFFTWithTensorAxesDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor realToHermiteanFFTWithTensorAxesDescriptorName​(@NotNull
                                                                                      @NotNull MPSGraphTensor tensor,
                                                                                      @NotNull
                                                                                      @NotNull NSArray<? extends NSNumber> axes,
                                                                                      @NotNull
                                                                                      @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                      @Nullable
                                                                                      @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where ``` `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used and the sum is done separately over each dimension in `axes` and `n` is the 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 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: 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). API-Since: 17.0
      • realToHermiteanFFTWithTensorAxesTensorDescriptorName

        @NotNull
        public @NotNull MPSGraphTensor realToHermiteanFFTWithTensorAxesTensorDescriptorName​(@NotNull
                                                                                            @NotNull MPSGraphTensor tensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphTensor axesTensor,
                                                                                            @NotNull
                                                                                            @NotNull MPSGraphFFTDescriptor descriptor,
                                                                                            @Nullable
                                                                                            @Nullable java.lang.String name)
        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. ```md output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], where ``` `scale = 1` for `scaling_mode = none`, `scale = 1/V_f` for `scaling_mode = size`, `scale = 1/sqrt(V_f)` for `scaling_mode = unitary`, where `V_f` is the volume of the transformation defined by the dimensions included in `axes` (`V_f = prod_{i \in axes} shape(input)[i]`) (see ``MPSGraphFFTDescriptor/scalingMode``), `+` is selected in `+/-` when `inverse` is specified, otherwise `-` is used and the sum is done separately over each dimension in `axes` and `n` is the 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 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: 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). API-Since: 17.0
      • reinterpretCastTensorToTypeName

        @NotNull
        public @NotNull MPSGraphTensor reinterpretCastTensorToTypeName​(@NotNull
                                                                       @NotNull MPSGraphTensor tensor,
                                                                       int type,
                                                                       @Nullable
                                                                       @Nullable java.lang.String name)
        Creates a reinterpret cast operation and returns the result tensor. 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 MPSGraph reinterprets the data with the endianness of the system. - Parameters: - tensor: The input tensor. - type: The element type of the returned tensor. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 16.3
      • resizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName​(@NotNull
                                                                                                        @NotNull MPSGraphTensor gradient,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor input,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor scale,
                                                                                                        @NotNull
                                                                                                        @NotNull MPSGraphTensor offset,
                                                                                                        @Nullable
                                                                                                        @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with bilinear sampling and identical parameters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeBilinearWithTensorSizeTensorCenterResultAlignCornersName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithTensorSizeTensorCenterResultAlignCornersName​(@NotNull
                                                                                                      @NotNull MPSGraphTensor imagesTensor,
                                                                                                      @NotNull
                                                                                                      @NotNull MPSGraphTensor size,
                                                                                                      boolean centerResult,
                                                                                                      boolean alignCorners,
                                                                                                      @Nullable
                                                                                                      @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size using bilinear sampling. Result images will be distorted if size is of different aspect ratio. Destination indices are computed using direct index scaling by default, with no offset added. If the centerResult parameter is true, the destination indices will be scaled and shifted to be centered on the input image. If the alignCorners parameter is true, the corners of the result images will match the input images. Scaling will be modified to a factor of (size - 1) / (inputSize - 1). When alignCorners is true, the centerResult parameter does nothing. In order to achieve the same behavior as OpenCV's resize and TensorFlowV2's resize, ```md centerResult = YES; alginCorners = NO; ``` To achieve the same behavior as TensorFlowV1 resize ```md centerResult = NO; ``` - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName

        @NotNull
        public @NotNull MPSGraphTensor resizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName​(@NotNull
                                                                                                     @NotNull MPSGraphTensor imagesTensor,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor size,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor scale,
                                                                                                     @NotNull
                                                                                                     @NotNull MPSGraphTensor offset,
                                                                                                     @Nullable
                                                                                                     @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size using the provided scale and offset and bilinear sampling. Destination indices are computed using ```md dst_indices = (src_indices * scale) + offset ``` For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners. - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName​(@NotNull
                                                                                                                          @NotNull MPSGraphTensor gradient,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor input,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor scale,
                                                                                                                          @NotNull
                                                                                                                          @NotNull MPSGraphTensor offset,
                                                                                                                          long nearestRoundingMode,
                                                                                                                          @Nullable
                                                                                                                          @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with nearest neighbor sampling and identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - nearestRoundingMode: The rounding mode to use when using nearest resampling. Default is roundPreferCeil. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName​(@NotNull
                                                                                                                        @NotNull MPSGraphTensor imagesTensor,
                                                                                                                        @NotNull
                                                                                                                        @NotNull MPSGraphTensor size,
                                                                                                                        long nearestRoundingMode,
                                                                                                                        boolean centerResult,
                                                                                                                        boolean alignCorners,
                                                                                                                        @Nullable
                                                                                                                        @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size using nearest neighbor sampling. Result images will be distorted if size is of different aspect ratio. Destination indices are computed using direct index scaling by default, with no offset added. If the centerResult parameter is true, the destination indices will be scaled and shifted to be centered on the input image. If the alignCorners parameter is true, the corners of the result images will match the input images. Scaling will be modified to a factor of (size - 1) / (inputSize - 1). When alignCorners is true, the centerResult parameter does nothing. In order to achieve the same behavior as OpenCV's resize and TensorFlowV2's resize, ```md centerResult = YES; alginCorners = NO; ``` To achieve the same behavior as TensorFlowV1 resize ```md centerResult = NO; ``` - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - nearestRoundingMode: The rounding mode to use when using nearest resampling. Default is roundPreferCeil. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName

        @NotNull
        public @NotNull MPSGraphTensor resizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName​(@NotNull
                                                                                                                       @NotNull MPSGraphTensor imagesTensor,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor size,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor scale,
                                                                                                                       @NotNull
                                                                                                                       @NotNull MPSGraphTensor offset,
                                                                                                                       long nearestRoundingMode,
                                                                                                                       @Nullable
                                                                                                                       @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size using the provided scale and offset and nearest neighbor sampling. Destination indices are computed using ```md dst_indices = (src_indices * scale) + offset ``` For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners. - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - nearestRoundingMode: The rounding mode to use when using nearest resampling. Default is roundPreferCeil. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeTensorSizeTensorModeCenterResultAlignCornersName

        @NotNull
        public @NotNull MPSGraphTensor resizeTensorSizeTensorModeCenterResultAlignCornersName​(@NotNull
                                                                                              @NotNull MPSGraphTensor imagesTensor,
                                                                                              @NotNull
                                                                                              @NotNull MPSGraphTensor size,
                                                                                              long mode,
                                                                                              boolean centerResult,
                                                                                              boolean alignCorners,
                                                                                              @Nullable
                                                                                              @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size. Result images will be distorted if size is of different aspect ratio. Resize supports the following modes: Nearest Neighbor - values are interpolated using the closest neighbor pixel Bilinear - values are computed using bilinear interpolation of 4 neighboring pixels Destination indices are computed using direct index scaling by default, with no offset added. If the centerResult parameter is true, the destination indices will be scaled and shifted to be centered on the input image. If the alignCorners parameter is true, the corners of the result images will match the input images. Scaling will be modified to a factor of (size - 1) / (inputSize - 1). When alignCorners is true, the centerResult parameter does nothing. In order to achieve the same behavior as OpenCV's resize and TensorFlowV2's resize, ```md centerResult = YES; alginCorners = NO; ``` To achieve the same behavior as TensorFlowV1 resize ```md centerResult = NO; ``` - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - centerResult: Controls if the result image is centered on the input image. When NO, the result will have the top left corner aligned - alignCorners: When YES, the result image will have the same value as the input image in the corners - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeTensorSizeTensorScaleTensorOffsetTensorModeName

        @NotNull
        public @NotNull MPSGraphTensor resizeTensorSizeTensorScaleTensorOffsetTensorModeName​(@NotNull
                                                                                             @NotNull MPSGraphTensor imagesTensor,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor size,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor scale,
                                                                                             @NotNull
                                                                                             @NotNull MPSGraphTensor offset,
                                                                                             long mode,
                                                                                             @Nullable
                                                                                             @Nullable java.lang.String name)
        Create Resize op and return the result tensor Resamples input images to given size using the provided scale and offset. Destination indices are computed using ```md dst_indices = (src_indices * scale) + offset ``` For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners. - Parameters: - imagesTensor: Tensor containing input images. - size: The target size of the result tensor. 1D Int32 or Int64 tensor of size equal to rank of input. - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • resizeWithGradientTensorInputScaleTensorOffsetTensorModeName

        @NotNull
        public @NotNull MPSGraphTensor resizeWithGradientTensorInputScaleTensorOffsetTensorModeName​(@NotNull
                                                                                                    @NotNull MPSGraphTensor gradient,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor input,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor scale,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor offset,
                                                                                                    long mode,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String name)
        Create Resize gradient op and return the result tensor Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters. - Parameters: - gradient: Incoming gradient tensor - input: Forward pass input tensor - scale: 1D float tensor of size equal to rank of input. - offset: 1D float tensor of size equal to rank of input. - mode: The resampling mode to use. If nearest sampling is specifed, RoundPreferCeil mode will be used. - name: The name for the operation - Returns: A valid MPSGraphTensor object API-Since: 17.0
      • topKWithGradientTensorSourceAxisKName

        @NotNull
        public @NotNull MPSGraphTensor topKWithGradientTensorSourceAxisKName​(@NotNull
                                                                             @NotNull MPSGraphTensor gradient,
                                                                             @NotNull
                                                                             @NotNull MPSGraphTensor source,
                                                                             long axis,
                                                                             long k,
                                                                             @Nullable
                                                                             @Nullable java.lang.String name)
        Create TopKGradient op and return the result tensor. Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - axis: The dimension along which to compute the TopK values.. - k: The number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • topKWithGradientTensorSourceAxisTensorKTensorName

        @NotNull
        public @NotNull MPSGraphTensor topKWithGradientTensorSourceAxisTensorKTensorName​(@NotNull
                                                                                         @NotNull MPSGraphTensor gradient,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor source,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor axisTensor,
                                                                                         @NotNull
                                                                                         @NotNull MPSGraphTensor kTensor,
                                                                                         @Nullable
                                                                                         @Nullable java.lang.String name)
        Create TopKGradient op and return the result tensor. Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. - Parameters: - gradient: Tensor containing the incoming gradient. - source: Tensor containing source data. - axisTensor: Tensor containing the dimension along which to compute the TopK values. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor object. API-Since: 17.0
      • topKWithSourceTensorAxisKName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> topKWithSourceTensorAxisKName​(@NotNull
                                                                                        @NotNull MPSGraphTensor source,
                                                                                        long axis,
                                                                                        long k,
                                                                                        @Nullable
                                                                                        @Nullable java.lang.String name)
        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. - Parameters: - source: Tensor containing source data. - axis: The dimension along which to compute the TopK values. - k: The number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor array of size 2. API-Since: 17.0
      • topKWithSourceTensorAxisTensorKTensorName

        @NotNull
        public @NotNull NSArray<? extends MPSGraphTensor> topKWithSourceTensorAxisTensorKTensorName​(@NotNull
                                                                                                    @NotNull MPSGraphTensor source,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor axisTensor,
                                                                                                    @NotNull
                                                                                                    @NotNull MPSGraphTensor kTensor,
                                                                                                    @Nullable
                                                                                                    @Nullable java.lang.String name)
        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. - Parameters: - source: Tensor containing source data. - axisTensor: Tensor containing the dimension along which to compute the TopK values. - kTensor: Tensor of the number of largest values to return. - name: The name for the operation. - Returns: A valid MPSGraphTensor array of size 2. API-Since: 17.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.