| Modifier and Type | Class and Description |
|---|---|
static interface |
MPSGraph.Block_controlDependencyWithOperationsDependentBlockName |
static interface |
MPSGraph.Block_forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName |
static interface |
MPSGraph.Block_forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName |
static interface |
MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_1 |
static interface |
MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_2 |
static interface |
MPSGraph.Block_whileWithInitialInputsBeforeAfterName_1 |
static interface |
MPSGraph.Block_whileWithInitialInputsBeforeAfterName_2 |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
MPSGraph(org.moe.natj.general.Pointer peer) |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic MPSGraphTensor L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor L2NormPooling4DWithSourceTensorDescriptorName(MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor absoluteWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public static boolean accessInstanceVariablesDirectly()
public MPSGraphTensor acosWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor acoshWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor additionWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = primaryTensor + secondaryTensor [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic static MPSGraph alloc()
public static MPSGraph allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public MPSGraphOperation applyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(MPSGraphTensor learningRateTensor, MPSGraphVariableOp variable, MPSGraphTensor gradientTensor, java.lang.String name)
public MPSGraphTensor asinWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor asinhWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphOperation assignVariableWithValueOfTensorName(MPSGraphTensor variable, MPSGraphTensor tensor, java.lang.String name)
variable - variable resource tensor to read fromtensor - tensor to assign to variablename - name for the operationpublic MPSGraphTensor atan2WithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor atanWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor atanhWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public MPSGraphTensor avgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphPooling2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor avgPooling2DWithSourceTensorDescriptorName(MPSGraphTensor source, MPSGraphPooling2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor avgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor avgPooling4DWithSourceTensorDescriptorName(MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor broadcastTensorToShapeTensorName(MPSGraphTensor tensor, MPSGraphTensor shapeTensor, java.lang.String name)
Broadcast 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.
tensor - Tensor to be broadcastedshapeTensor - 1D Int32 or Int64 tensor. Shape of the result tensorname - The name for the operationpublic static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public MPSGraphTensor castTensorToTypeName(MPSGraphTensor tensor, int type, java.lang.String name)
Returns input tensor casted to the dataType passed in
tensor - Input tensortype - Input tensorname - The name for the operationpublic MPSGraphTensor ceilWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor clampWithTensorMinValueTensorMaxValueTensorName(MPSGraphTensor tensor, MPSGraphTensor minValueTensor, MPSGraphTensor maxValueTensor, java.lang.String name)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public MPSGraphTensor concatTensorWithTensorDimensionName(MPSGraphTensor tensor, MPSGraphTensor tensor2, long dimensionIndex, java.lang.String name)
Concatenate two input tensors along sepecified dimension. Tensors must be broadcast compatible along all other dimensions, and have the same type.
tensor - First tensor to concatenatetensor2 - Second tensor to concatenatedimensionIndex - The dimension to concatenate across, must be in range - rank <= dimension < rankname - The name for the operationpublic MPSGraphTensor concatTensorsDimensionInterleaveName(NSArray<? extends MPSGraphTensor> tensors, long dimensionIndex, boolean interleave, java.lang.String name)
Concatenate 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, all inputs must be broadcast compatible along the specified dimension as well. Example, [@code] operand0 = [1, 2, 3] operand1 = [4, 5, 6] concat([operand0, operand1], axis = 0, interleave = YES) = [1, 4, 2, 5, 3, 6] [@endcode]
tensors - Tensors to concatenatedimensionIndex - The dimension to concatenate across, must be in range - rank <= dimension < rankinterleave - Interleave input tensorsname - The name for the operationpublic MPSGraphTensor concatTensorsDimensionName(NSArray<? extends MPSGraphTensor> tensors, long dimensionIndex, java.lang.String name)
Concatenate all input tensors along specified dimension. All inputs must be broadcast compatible along all other dimensions, and have the same type.
tensors - Tensors to concatenatedimensionIndex - The dimension to concatenate across, must be in range - rank <= dimension < rankname - The name for the operationpublic MPSGraphTensor constantWithScalarDataType(double scalar, int dataType)
scalar - scalar to fill the entire tensor values withdataType - dataType of the constant tensorpublic NSArray<? extends MPSGraphTensor> controlDependencyWithOperationsDependentBlockName(NSArray<? extends MPSGraphOperation> operations, MPSGraph.Block_controlDependencyWithOperationsDependentBlockName dependentBlock, java.lang.String name)
operations - Operations maked as control dependency for all ops created inside the dependent blockdependentBlock - MPSGraphControlFlowDependencyBlock which is provided by caller to create dependent opsname - name of scopepublic MPSGraphTensor convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(MPSGraphTensor gradient, MPSGraphTensor weights, MPSGraphTensor outputShapeTensor, MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor, java.lang.String name)
Computes the gradient of source input for the forward pass Convolution op with identical parameters. See discussion of convolution2DWithSourceTensor for more in depth description of paramters.
gradient - Incoming gradient tensorweights - Forward pass weights tensoroutputShapeTensor - 1D Int32 or Int64 Tensor. Shape of the forward pass source tensorforwardConvolutionDescriptor - Forward pass op descriptorname - The name for the operationpublic MPSGraphTensor convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphTensor outputShapeTensor, MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor, java.lang.String name)
Computes the gradient of weights input for the forward pass Convolution op with identical parameters. See discussion of convolution2DWithSourceTensor for more in depth description of paramters.
gradient - Incoming gradient tensorsource - Forward pass source tensoroutputShapeTensor - 1D int32 or Int64 Tensor. Shape of the forward pass weights tensorforwardConvolutionDescriptor - Forward pass op descriptorname - The name for the operationpublic MPSGraphTensor convolution2DWithSourceTensorWeightsTensorDescriptorName(MPSGraphTensor source, MPSGraphTensor weights, MPSGraphConvolution2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor convolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(MPSGraphTensor incomingGradient, MPSGraphTensor weights, MPSGraphTensor outputShape, MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor, java.lang.String name)
Computes the gradient of source input for the forward pass ConvolutionTranspose op with identical parameters. See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
incomingGradient - Incoming gradient tensorweights - Forward pass weights tensoroutputShape - 1D Int32 or Int64 Tensor. Shape of the forward pass source tensorforwardConvolutionDescriptor - Forward pass op descriptorname - The name for the operationpublic MPSGraphTensor convolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(MPSGraphTensor incomingGradientTensor, MPSGraphTensor source, MPSGraphTensor outputShape, MPSGraphConvolution2DOpDescriptor forwardConvolutionDescriptor, java.lang.String name)
Computes the gradient of weights input for the forward pass ConvolutionTranspose op with identical parameters. See discussion of convolutionTranspose2DWithSourceTensor for more in depth description of paramters.
incomingGradientTensor - Incoming gradient tensorsource - Forward pass source tensoroutputShape - 1D Int32 or Int64 Tensor. Shape of the forward pass source weights tensorforwardConvolutionDescriptor - Forward pass op descriptorname - The name for the operationpublic MPSGraphTensor convolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(MPSGraphTensor source, MPSGraphTensor weights, MPSGraphTensor outputShape, MPSGraphConvolution2DOpDescriptor descriptor, java.lang.String name)
Convolution Tranpose op is exactly the same as convolution gradint with respect to input image (convolution2DDataGradient) Weights tensor and source tensors are interpreted as they are in convolution2DDataGradientWithIncomingGradient. For example if weightsTensor layout is HWIO, inner most (fastest moving) dimension, denoted by O here should be equal to inputFeatureChannels i.e. number of channels in source tensor and next fasted moving dimension denoated by I is equal to number of channels in returns (destination) tensor outputFeatureChannels. TensorFlow interprets the weights tensor same way excpet that it states weights are in HWOI format. We dont define another weights format enum rather we reinterpret HWIO just like TensorFlow does for gradient with data. Normally in auto encoder, convoluton transpose is associated with regular convolution i.e. convolution downsamples by stride s and convolution tranpose upsamples by factor s. In that case, convolution transpose can map same source size to multiple destination sizes. The relationship between sourceWidth and destinationWidth is (sourceWidth - 1) * stride + 1 + (kernelWidth - 1) * dilationRate <= destinationWidth + paddingLeft + paddingRight so there are stride -1 destinationWidth that give same sourceWidth. In order to disambiguate, outputShape parameter is used. This is what TensorFlow does. PyTourch takes additional outputPadding that is applied to destination size.
source - input tensorweights - weights tensoroutputShape - 1D Int32 or Int64 tensor. shape of the result tensordescriptor - descriptor for the corresponding forward Conv2d operationname - name for the operationpublic MPSGraphTensor cosWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor coshWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public static java.lang.String debugDescription_static()
public MPSGraphTensor depthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(MPSGraphTensor tensor, long widthAxis, long heightAxis, long depthAxis, long blockSize, boolean usePixelShuffleOrder, java.lang.String name)
public MPSGraphTensor depthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(MPSGraphTensor tensor, MPSGraphTensor widthAxisTensor, MPSGraphTensor heightAxisTensor, MPSGraphTensor depthAxisTensor, long blockSize, boolean usePixelShuffleOrder, java.lang.String name)
public MPSGraphTensor depthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(MPSGraphTensor source, MPSGraphTensor weights, MPSGraphDepthwiseConvolution2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor depthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(MPSGraphTensor source, MPSGraphTensor weights, MPSGraphDepthwiseConvolution3DOpDescriptor descriptor, java.lang.String name)
* @param source 3d Image source as tensor - must be at least rank=4 (CDHW when channelDimensionIndex = -4). * @param weights Weights tensor, must be rank=4 - axes are interpreted as CDHW when channelDimensionIndex = -4 . * @param descriptor Specifies strides, dilation rates and paddings. * @param name The name for the operation. * * @return A valid MPSGraphTensor object
public static java.lang.String description_static()
public MPSGraphTensor divisionNoNaNWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor divisionWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = primaryTensor / secondaryTensor [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic MPSGraphTensor dropoutTensorRateName(MPSGraphTensor tensor, double rate, java.lang.String name)
public MPSGraphTensor dropoutTensorRateTensorName(MPSGraphTensor tensor, MPSGraphTensor rate, java.lang.String name)
public MPSGraphTensor equalWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor erfWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor exponentBase10WithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor exponentBase2WithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor exponentWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor flatten2DTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
Flattens dimensions before `axis` to `result[0]` and dimensions starting from `axis` to `result[1]` and returns a rank-2 tensor as result.
tensor - Tensor to be flattenedaxis - Axis around which to flattenname - The name for the operationpublic MPSGraphTensor flatten2DTensorAxisTensorName(MPSGraphTensor tensor, MPSGraphTensor axisTensor, java.lang.String name)
Flattens dimensions before `axis` to `result[0]` and dimensions starting from `axis` to `result[1]` and returns a rank-2 tensor as result.
tensor - Tensor to be flattenedaxisTensor - Axis around which to flattenname - The name for the operationpublic MPSGraphTensor floorModuloWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor floorWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public NSArray<? extends MPSGraphTensor> forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName(MPSGraphTensor lowerBound, MPSGraphTensor upperBound, MPSGraphTensor step, NSArray<? extends MPSGraphTensor> initialBodyArguments, MPSGraph.Block_forLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName body, java.lang.String name)
lowerBound - lowerBound value of the loop, this is a scalar tensor, this is the index the loop will start withupperBound - upperBound value of the loop, this is a scalar tensorstep - step value of the loop, this is a scalar tensor and must be positiveinitialBodyArguments - initial set of iteration arguments passed to the bodyBlock of the for loopbody - bodyBlock, this will execute the body of the forLoopname - name of operationpublic NSArray<? extends MPSGraphTensor> forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName(MPSGraphTensor numberOfIterations, NSArray<? extends MPSGraphTensor> initialBodyArguments, MPSGraph.Block_forLoopWithNumberOfIterationsInitialBodyArgumentsBodyName body, java.lang.String name)
numberOfIterations - tensor with number of iterations the loop will executeinitialBodyArguments - initial set of iteration arguments passed to the bodyBlock of the for loopbody - bodyBlock, this will execute the body of the forLoop, index will go from 0 to numberOfIterations-1name - name of operationpublic MPSGraphTensor gatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(MPSGraphTensor updatesTensor, MPSGraphTensor indicesTensor, long batchDimensions, java.lang.String name)
Gathers the slices in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as [@code] 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]] [@endcode] The tensors have the following shape requirements [@code] 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] [@endcode]
updatesTensor - Tensor containing slices to be inserted into the result tensorindicesTensor - Tensor containg the updates indices to read slices frombatchDimensions - The number of batch dimensionsname - The name for the operationpublic MPSGraphTensor gatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(MPSGraphTensor updatesTensor, MPSGraphTensor indicesTensor, long axis, long batchDimensions, java.lang.String name)
Gathers the values in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as [@code] 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}]
[@endcode] The tensors have the following shape requirements [@code] 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:] [@endcode]
updatesTensor - Tensor containing slices to be inserted into the result tensorindicesTensor - Tensor containg the updates indices to read slices fromaxis - The dimension on which to perform the gatherbatchDimensions - The number of batch dimensionsname - The name for the operationpublic NSDictionary<? extends MPSGraphTensor,? extends MPSGraphTensor> gradientForPrimaryTensorWithTensorsName(MPSGraphTensor primaryTensor, NSArray<? extends MPSGraphTensor> tensors, java.lang.String name)
primaryTensor - tensor to be differentiated (numerator)tensors - tensors to do the differentiation with (denominator)name - name for the gradient operationpublic MPSGraphTensor greaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor greaterThanWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public static long hash_static()
public MPSGraphTensor identityWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public NSArray<? extends MPSGraphTensor> ifWithPredicateTensorThenBlockElseBlockName(MPSGraphTensor predicateTensor, MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_1 thenBlock, MPSGraph.Block_ifWithPredicateTensorThenBlockElseBlockName_2 elseBlock, java.lang.String name)
predicateTensor - Tensor must have a single scalar value, used to decide between then/else branchesthenBlock - If predicate is true operations in this block are executedelseBlock - If predicate is false operations in this block are executedname - name of operationpublic MPSGraph init()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public MPSGraphTensor isFiniteWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor isInfiniteWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor isNaNWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public MPSGraphTensor leakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphTensor alphaTensor, java.lang.String name)
public MPSGraphTensor leakyReLUWithTensorAlphaName(MPSGraphTensor tensor, double alpha, java.lang.String name)
Specifies the leaky ReLU activation tensor. For each pixel, applies the following function: f(x) = max(x, alpha * x)
public MPSGraphTensor leakyReLUWithTensorAlphaTensorName(MPSGraphTensor tensor, MPSGraphTensor alphaTensor, java.lang.String name)
public MPSGraphTensor lessThanOrEqualToWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor lessThanWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logarithmBase10WithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor logarithmBase2WithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor logarithmWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor logicalANDWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logicalNANDWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logicalNORWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logicalORWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logicalXNORWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor logicalXORWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor matrixMultiplicationWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = matmul(primaryTensor, secondaryTensor) [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic MPSGraphTensor maxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphPooling2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor maxPooling2DWithSourceTensorDescriptorName(MPSGraphTensor source, MPSGraphPooling2DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor maxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor maxPooling4DWithSourceTensorDescriptorName(MPSGraphTensor source, MPSGraphPooling4DOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor maximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = isNaN(primaryTensor) || isNan(secondaryTensor) ? NaN : max(primaryTensor, secondaryTensor) [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic MPSGraphTensor maximumWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor meanOfTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
axes - A list of axes over which to perform the reduction. The order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.name - name for the placeholder operationpublic MPSGraphTensor minimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = isNaN(primaryTensor) || isNan(secondaryTensor) ? NaN : min(primaryTensor, secondaryTensor) [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic MPSGraphTensor minimumWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor moduloWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor multiplicationWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = primaryTensor * secondaryTensor [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic MPSGraphTensor negativeWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public static MPSGraph new_objc()
public MPSGraphTensor normalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(MPSGraphTensor incomingGradientTensor, MPSGraphTensor sourceTensor, NSArray<? extends NSNumber> axes, java.lang.String name)
public MPSGraphTensor normalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(MPSGraphTensor incomingGradientTensor, MPSGraphTensor sourceTensor, MPSGraphTensor meanTensor, MPSGraphTensor varianceTensor, NSArray<? extends NSNumber> axes, float epsilon, java.lang.String name)
public MPSGraphTensor normalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(MPSGraphTensor incomingGradientTensor, MPSGraphTensor sourceTensor, MPSGraphTensor meanTensor, MPSGraphTensor varianceTensor, MPSGraphTensor gamma, MPSGraphTensor gammaGradient, MPSGraphTensor betaGradient, NSArray<? extends NSNumber> axes, float epsilon, java.lang.String name)
public MPSGraphTensor normalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(MPSGraphTensor tensor, MPSGraphTensor mean, MPSGraphTensor variance, MPSGraphTensor gamma, MPSGraphTensor beta, float epsilon, java.lang.String name)
The mean and variance tensors should be outputs of meanWithTensor:axes:name and varianceWithTensor:meanTensor:axes:name. Use the axes parameter to achieve different types of normalizations. For example (assuming your data is in NxHxWxC format) Batch normalization: axes = [0, 1, 2] 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.
mean - meanvariance - variancegamma - Tensor used to scale the normalized resultbeta - Tensor used to bias the normalized resultepsilon - A small value to add to the variance when normalizing the inputs.name - name for the placeholder operationpublic MPSGraphTensor notEqualWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor notWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor oneHotWithIndicesTensorDepthAxisDataTypeName(MPSGraphTensor indicesTensor, long depth, long axis, int dataType, java.lang.String name)
public MPSGraphTensor oneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName(MPSGraphTensor indicesTensor, long depth, long axis, int dataType, double onValue, double offValue, java.lang.String name)
Creates a tensor of rank equal to the indicesTensor rank + 1. A new axis is inserted 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.
indicesTensor - Tensor of indices for on valuesdepth - Depth of the oneHot vector along the axisaxis - The axis to insert the new oneHot vector at.
Defaults to -1, the minor axisdataType - MPSDataType of the result tensor
Defaults to MPSDataTypeFloatonValue - The value for indices designated by the indicesTensor. This value must match the specified data type.
Defaults to 1.0foffValue - The value for indices not designated by the indicesTensor. This value must match the specified data type.
Defaults to 0.0fname - Name for the operationpublic MPSGraphTensor oneHotWithIndicesTensorDepthAxisName(MPSGraphTensor indicesTensor, long depth, long axis, java.lang.String name)
public MPSGraphTensor oneHotWithIndicesTensorDepthDataTypeName(MPSGraphTensor indicesTensor, long depth, int dataType, java.lang.String name)
public MPSGraphTensor oneHotWithIndicesTensorDepthDataTypeOnValueOffValueName(MPSGraphTensor indicesTensor, long depth, int dataType, double onValue, double offValue, java.lang.String name)
public MPSGraphTensor oneHotWithIndicesTensorDepthName(MPSGraphTensor indicesTensor, long depth, java.lang.String name)
public long options()
options for the graph, default value is MPSGraphOptionsDefault
public NSArray<? extends MPSGraphTensor> placeholderTensors()
an array of all the placeholderTensors
public MPSGraphTensor powerWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
public MPSGraphTensor reLUGradientWithIncomingGradientSourceTensorName(MPSGraphTensor gradient, MPSGraphTensor source, java.lang.String name)
public MPSGraphTensor reLUWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor readVariableName(MPSGraphTensor variable, java.lang.String name)
variable - variable resource tensor to read fromname - name for the operationpublic MPSGraphTensor reciprocalWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor reductionArgMaximumWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionArgMinimumWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionMaximumWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionMaximumWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionMinimumWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionMinimumWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionProductWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionProductWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionSumWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionSumWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reshapeTensorWithShapeTensorName(MPSGraphTensor tensor, MPSGraphTensor shapeTensor, java.lang.String name)
Reshape the input tensor to the target shapeTensor The shape must be compatible with the input tensor shape shapeTensor is allowed to contain dynamic dimensions (-1) when the result type can be inferred unambiguously
tensor - Tensor to be reshaped.shapeTensor - 1D Int32 or Int64 tensor. The result tensor shapename - The name for the operationpublic MPSGraphTensor resizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(MPSGraphTensor imagesTensor, MPSGraphTensor size, long mode, boolean centerResult, boolean alignCorners, long layout, java.lang.String name)
Resamples input images to given size. Result images will be distorted if size is of different aspect ratio. Resize supports the following modes: Nearest Neighnor - 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, [@code] centerResult = YES; alginCorners = NO; [@endcode]
To achieve the same behavior as TensorFlowV1 resize [@code] centerResult = NO; [@endcode]
imagesTensor - Tensor containing input images.size - 1D Int32 or Int64 tensor. A 2-element shape as [newHeight, newWidth]mode - The resampling mode to use.centerResult - Controls if the result image is centered on the input image. When NO, the result will have the top left corner alignedalignCorners - When YES, the result image will have the same value as the input image in the cornerslayout - 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 operationpublic MPSGraphTensor resizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(MPSGraphTensor gradient, MPSGraphTensor input, long mode, boolean centerResult, boolean alignCorners, long layout, java.lang.String name)
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
gradient - Incoming gradient tensorinput - Forward pass input tensormode - The resampling mode to use.centerResult - Controls if the result image is centered on the input image. When NO, the result will have the top left corner alignedalignCorners - When YES, the result image will have the same value as the input image in the cornerslayout - 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 operationpublic static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public MPSGraphTensor reverseSquareRootWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor reverseTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
Reverses a tensor on given axes https://www.tensorflow.org/api_docs/python/tf/reverse.
tensor - Tensor to be reversedaxes - Axes to be reversed (Axes must be unique and within normal axis range).name - The name for the operationpublic MPSGraphTensor reverseTensorAxesTensorName(MPSGraphTensor tensor, MPSGraphTensor axesTensor, java.lang.String name)
Reverses a tensor on given axes https://www.tensorflow.org/api_docs/python/tf/reverse.
tensor - Tensor to be reversedaxesTensor - Tensor that specifies axes to be reversed (Axes must be unique and within normal axis range).name - The name for the operationpublic MPSGraphTensor reverseTensorName(MPSGraphTensor tensor, java.lang.String name)
Reverses a tensor on all axes https://www.tensorflow.org/api_docs/python/tf/reverse.
tensor - Tensor to be reversedname - The name for the operationpublic MPSGraphTensor rintWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor roundWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor scatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(MPSGraphTensor dataTensor, MPSGraphTensor updatesTensor, MPSGraphTensor indicesTensor, long batchDimensions, long mode, java.lang.String name)
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as [@code] 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 [@endcode] Collsions will be updated according to mode, and slices not set by indices are set to 0. The tensors have the following shape requirements [@code] 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] [@endcode]
dataTensor - Tensor containing inital values of same shape as result tensorupdatesTensor - Tensor containing slices to be inserted into the result tensorindicesTensor - Tensor containg the result indices to insert slices atbatchDimensions - The number of batch dimensionsmode - The type of update to use on the destinationname - The name for the operationpublic MPSGraphTensor scatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(MPSGraphTensor dataTensor, MPSGraphTensor updatesTensor, MPSGraphTensor indicesTensor, long axis, long mode, java.lang.String name)
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as [@code] 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 [@endcode] Collsions will be updated according to mode. The tensors have the following shape requirements [@code] 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] [@endcode]
dataTensor - Tensor containing inital values of same shape as result tensorupdatesTensor - Tensor containing values to be inserted into the result tensorindicesTensor - Tensor containg the result indices to insert values ataxis - The axis of the result tensor to scatter values alongmode - The type of update to use on the destinationname - The name for the operationpublic MPSGraphTensor selectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(MPSGraphTensor predicateTensor, MPSGraphTensor truePredicateTensor, MPSGraphTensor falseSelectTensor, java.lang.String name)
public void setOptions(long value)
options for the graph, default value is MPSGraphOptionsDefault
public static void setVersion_static(long aVersion)
public MPSGraphTensor shapeOfTensorName(MPSGraphTensor tensor, java.lang.String name)
Returns a 1D Int32 tensor with value the static shape of the input tensor
tensor - Input tensorname - The name for the operationpublic MPSGraphTensor sigmoidGradientWithIncomingGradientSourceTensorName(MPSGraphTensor gradient, MPSGraphTensor source, java.lang.String name)
public MPSGraphTensor sigmoidWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor signWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor signbitWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor sinWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor sinhWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor sliceGradientTensorFwdInShapeTensorStartsEndsStridesName(MPSGraphTensor inputGradientTensor, MPSGraphTensor fwdInShapeTensor, NSArray<? extends NSNumber> starts, NSArray<? extends NSNumber> ends, NSArray<? extends NSNumber> strides, java.lang.String name)
inputGradientTensor - Input gradientfwdInShapeTensor - Shape of the forward pass input = shape of gradient outputstarts - Array of numbers specifying starting point per dimensionends - Array of numbers specifying ending point per dimensionstrides - Array of numbers specifying strides per dimensionname - The name for the operationpublic MPSGraphTensor sliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(MPSGraphTensor inputGradientTensor, MPSGraphTensor fwdInShapeTensor, NSArray<? extends NSNumber> starts, NSArray<? extends NSNumber> ends, NSArray<? extends NSNumber> strides, int startMask, int endMask, int squeezeMask, java.lang.String name)
inputGradientTensor - Input gradientfwdInShapeTensor - Shape of the forward pass input = shape of gradient outputstarts - Array of numbers specifying starting point per dimensionends - Array of numbers specifying ending point per dimensionstrides - Array of numbers specifying strides per dimensionstartMask - Bitmask indicating dimensions whose `starts` values should be ignored.endMask - Bitmask indicating dimensions whose `ends` values should be ignored.squeezeMask - Bitmask indicating dimensions that should be squeezed out from the result.name - The name for the operationpublic MPSGraphTensor sliceTensorDimensionStartLengthName(MPSGraphTensor tensor, long dimensionIndex, long start, long length, java.lang.String name)
public MPSGraphTensor sliceTensorStartsEndsStridesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> starts, NSArray<? extends NSNumber> ends, NSArray<? extends NSNumber> strides, java.lang.String name)
Slices a tensor starting from `starts`, stopping short before `ends` stepping `strides` paces between each value. Semantics based on https://www.tensorflow.org/api_docs/python/tf/strided_slice.
tensor - Tensor to be slicedstarts - Array of numbers specifying starting point per dimensionends - Array of numbers specifying ending point per dimensionstrides - Array of numbers specifying strides per dimensionname - The name for the operationpublic MPSGraphTensor sliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(MPSGraphTensor tensor, NSArray<? extends NSNumber> starts, NSArray<? extends NSNumber> ends, NSArray<? extends NSNumber> strides, int startMask, int endMask, int squeezeMask, java.lang.String name)
Slices a tensor starting from `starts`, stopping short before `ends` stepping `strides` paces between each value. Semantics based on https://www.tensorflow.org/api_docs/python/tf/strided_slice.
tensor - Tensor to be slicedstarts - Array of numbers specifying starting point per dimensionends - Array of numbers specifying ending point per dimensionstrides - Array of numbers specifying strides per dimensionstartMask - Bitmask indicating dimensions whose `starts` values should be ignored.endMask - Bitmask indicating dimensions whose `ends` values should be ignored.squeezeMask - Bitmask indicating dimensions that should be squeezed out from the result.name - The name for the operationpublic MPSGraphTensor softMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(MPSGraphTensor gradientTensor, MPSGraphTensor sourceTensor, MPSGraphTensor labelsTensor, long axis, long reductionType, java.lang.String name)
gradientTensor - gradientTensorsourceTensor - sourceTensorlabelsTensor - labelsTensoraxis - axis over which loss reuction happensreductionType - reductionType which reduces across all other axesname - name for the operationpublic MPSGraphTensor softMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(MPSGraphTensor sourceTensor, MPSGraphTensor labelsTensor, long axis, long reductionType, java.lang.String name)
sourceTensor - sourceTensorlabelsTensor - labelsTensoraxis - axis over which loss reuction happensreductionType - reductionType which reduces across all other axesname - name for the operationpublic MPSGraphTensor softMaxGradientWithIncomingGradientSourceTensorAxisName(MPSGraphTensor gradient, MPSGraphTensor source, long axis, java.lang.String name)
public MPSGraphTensor softMaxWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
public MPSGraphTensor spaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(MPSGraphTensor tensor, long widthAxis, long heightAxis, long depthAxis, long blockSize, boolean usePixelShuffleOrder, java.lang.String name)
public MPSGraphTensor spaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(MPSGraphTensor tensor, MPSGraphTensor widthAxisTensor, MPSGraphTensor heightAxisTensor, MPSGraphTensor depthAxisTensor, long blockSize, boolean usePixelShuffleOrder, java.lang.String name)
public MPSGraphTensor squareRootWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor squareWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor stencilWithSourceTensorWeightsTensorDescriptorName(MPSGraphTensor source, MPSGraphTensor weights, MPSGraphStencilOpDescriptor descriptor, java.lang.String name)
Performs a weighted reduction operation (`reductionMode`) on the last 4 dimensions of the `source` over the window determined by `weights`, acc. to the given `strides` and `dilationRates` and `paddingStyle`. `boundaryMode` determines what values to pad the `input` with. `offsets` are used to determine where to start reading the `input` from. `explicitPadding` can also be provided when using relevant paddingStyles.
y[i] = reduction { x[ i + j ] * w[j] }
source - Tensor containing source data. Must be of rank 4 or greater.weights - 4-D Tensor containing the weights data.descriptor - Descriptor object that specifies strides, dilationRates etc.name - The name for the operation.public MPSGraphTensor stochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(MPSGraphTensor learningRateTensor, MPSGraphTensor valuesTensor, MPSGraphTensor gradientTensor, java.lang.String name)
The StochasticGradientDescent performs a gradient descent
variable = variable - (learningRate * g)
where, g is gradient of error wrt variable
public MPSGraphTensor subtractionWithPrimaryTensorSecondaryTensorName(MPSGraphTensor primaryTensor, MPSGraphTensor secondaryTensor, java.lang.String name)
[@code] resultTensor = primaryTensor - secondaryTensor [@endcode]
primaryTensor - LHS tensor of the binary OpsecondaryTensor - RHS tensor of the binary Opname - name for the operationpublic static org.moe.natj.objc.Class superclass_static()
public MPSGraphTensor tanWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor tanhWithTensorName(MPSGraphTensor tensor, java.lang.String name)
public MPSGraphTensor topKWithGradientTensorSourceKName(MPSGraphTensor gradient, MPSGraphTensor source, long k, java.lang.String name)
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. To perform a vertical TopK a transpose can be inserted at the minor dimension of the incoming tensor.
gradient - Tensor containing the incoming gradientsource - Tensor containing source datak - The number of largest values to returnname - The name for the operationpublic MPSGraphTensor topKWithGradientTensorSourceKTensorName(MPSGraphTensor gradient, MPSGraphTensor source, MPSGraphTensor kTensor, java.lang.String name)
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension. To perform a vertical TopK a transpose can be inserted at the minor dimension of the incoming tensor.
gradient - Tensor containing the incoming gradientsource - Tensor containing source datakTensor - Tensor of the number of largest values to returnname - The name for the operationpublic NSArray<? extends MPSGraphTensor> topKWithSourceTensorKName(MPSGraphTensor source, long k, java.lang.String name)
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. To perform a vertical TopK a transpose can be inserted at the minor dimension of the incoming tensor.
source - Tensor containing source datak - The number of largest values to returnname - The name for the operationpublic NSArray<? extends MPSGraphTensor> topKWithSourceTensorKTensorName(MPSGraphTensor source, MPSGraphTensor kTensor, java.lang.String name)
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. To perform a vertical TopK a transpose can be inserted at the minor dimension of the incoming tensor.
source - Tensor containing source datakTensor - Tensor of the number of largest values to returnname - The name for the operationpublic MPSGraphTensor transposeTensorDimensionWithDimensionName(MPSGraphTensor tensor, long dimensionIndex, long dimensionIndex2, java.lang.String name)
public MPSGraphTensor varianceOfTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
axes - A list of axes over which to perform the reduction. Tthe order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.name - name for the placeholder operationpublic MPSGraphTensor varianceOfTensorMeanTensorAxesName(MPSGraphTensor tensor, MPSGraphTensor meanTensor, NSArray<? extends NSNumber> axes, java.lang.String name)
axes - A list of axes over which to perform the reduction such that the order of dimensions goes from the slowest moving at axis=0 to the fastest moving dimension.name - name for the placeholder operationpublic static long version_static()
public NSArray<? extends MPSGraphTensor> whileWithInitialInputsBeforeAfterName(NSArray<? extends MPSGraphTensor> initialInputs, MPSGraph.Block_whileWithInitialInputsBeforeAfterName_1 before, MPSGraph.Block_whileWithInitialInputsBeforeAfterName_2 after, java.lang.String name)
initialInputs - inputTensors to the whileBeforeBlock, for the 1st iteration will be same as initialInputs passed to the whileLoopbefore - beforeBlock, this will be run first and then call the afterBlock with results or return results from the loopafter - afterBlock, this will execute after the condition evaluationname - name of operationpublic MPSGraphTensor randomPhiloxStateTensorWithCounterLowCounterHighKeyName(long counterLow, long counterHigh, long key, java.lang.String name)
See randomPhiloxStateTensorWithSeed.
counterLow - The value to initilaize lower 64 bits of counter to. Philox utilizes a 128 bit countercounterHigh - The value to initilaize upper 64 bits of counter to. Philox utilizes a 128 bit counterkey - The value to initialize the key to in Philox algorithm.public MPSGraphTensor randomPhiloxStateTensorWithSeedName(long seed, java.lang.String name)
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.
[@code]
MPSGraph *graph = [MPSGraph new];
MPSGraphTensor *stateTensor = [graph randomPhiloxStateTensorWithSeed: seed name: nil];
NSArray
[@endcode]
seed - Initial counter and key values will be generated using seed.public MPSGraphTensor randomTensorWithShapeTensorDescriptorName(MPSGraphTensor shapeTensor, MPSGraphRandomOpDescriptor descriptor, java.lang.String name)
public MPSGraphTensor randomTensorWithShapeTensorDescriptorSeedName(MPSGraphTensor shapeTensor, MPSGraphRandomOpDescriptor descriptor, long seed, java.lang.String name)
public NSArray<? extends MPSGraphTensor> randomTensorWithShapeTensorDescriptorStateTensorName(MPSGraphTensor shapeTensor, MPSGraphRandomOpDescriptor descriptor, MPSGraphTensor state, java.lang.String name)
public MPSGraphTensor randomUniformTensorWithShapeTensorName(MPSGraphTensor shapeTensor, java.lang.String name)
public MPSGraphTensor randomUniformTensorWithShapeTensorSeedName(MPSGraphTensor shapeTensor, long seed, java.lang.String name)
public NSArray<? extends MPSGraphTensor> randomUniformTensorWithShapeTensorStateTensorName(MPSGraphTensor shapeTensor, MPSGraphTensor state, java.lang.String name)
public MPSGraphTensor reductionMaximumPropagateNaNWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionMaximumPropagateNaNWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operationpublic MPSGraphTensor reductionMinimumPropagateNaNWithTensorAxesName(MPSGraphTensor tensor, NSArray<? extends NSNumber> axes, java.lang.String name)
tensor - input tensoraxes - axes of reductionname - name for the operationpublic MPSGraphTensor reductionMinimumPropagateNaNWithTensorAxisName(MPSGraphTensor tensor, long axis, java.lang.String name)
tensor - input tensoraxis - axis of reductionname - name for the operation