Documentation
¶
Overview ¶
Package metalperformanceshadersgraph provides Go bindings for the MetalPerformanceShadersGraph framework.
Build, compile, and execute compute graphs utilizing all the different compute devices on the platform, including GPU, CPU, and Neural Engine.
Metal Performance Shaders Graph provides high-performance, energy-efficient computation on Apple platforms by leveraging different hardware compute blocks. You can use this framework to generate a symbolic compute graph of operations, where each operation can output a set of tensors used as edges of the graph. The tensors represent multidimensional data that objects like [MTLBuffer] or [MTLTexture] can back. After you construct the graph, you can compile it into an executable to optimize for performance and subsequently run the executable on your input data. This framework also provides the ability to serialize the executables and load executables from a serialized `XCUIElementTypeMpsgraphpackage`.
Essentials ¶
- Adding custom functions to a shader graph: Run your own graph functions on the GPU by building the function programmatically.
- Training a neural network using MPSGraph: Train a simple neural network digit classifier.
- Filtering images with MPSGraph FFT operations: Filter an image with MPSGraph fast Fourier transforms using the convolutional theorem.
Classes ¶
- MPSGraph: The optimized representation of a compute graph of operations and tensors.
- MPSGraphCompilationDescriptor: A class that consists of all the levers for compiling graphs.
- MPSGraphConvolution2DOpDescriptor: A class that describes the properties of a 2D-convolution operator.
- MPSGraphConvolution3DOpDescriptor: A class that describes the properties of a 3D-convolution operator.
- MPSGraphCreateSparseOpDescriptor: A class that describes the properties of a create sparse operation.
- MPSGraphDepthwiseConvolution2DOpDescriptor: A class that defines the parameters for a 2D-depthwise convolution operation.
- MPSGraphDepthwiseConvolution3DOpDescriptor: The class that defines the parameters for a 3D-depthwise convolution operation.
- MPSGraphDevice: A class that describes the compute device.
- MPSGraphExecutable: The compiled representation of a compute graph executable.
- MPSGraphExecutableExecutionDescriptor: A class that consists of all the levers to synchronize and schedule executable execution.
- MPSGraphExecutableSerializationDescriptor: A class that consists of all the levers to serialize an executable.
- MPSGraphExecutionDescriptor: A class that consists of all the levers to synchronize and schedule graph execution.
- MPSGraphFFTDescriptor: The class that defines the parameters for a fast Fourier transform (FFT) operation.
- MPSGraphGRUDescriptor: The class that defines the parameters for a gated recurrent unit (GRU) operation.
- MPSGraphImToColOpDescriptor: The class that defines the parameters for an image to column or column to image operation.
- MPSGraphLSTMDescriptor: The class that defines the parameters for a long short-term memory (LSTM) operation.
- MPSGraphObject: The common base class for all Metal Performance Shaders Graph objects.
- MPSGraphOperation: A symbolic representation of a compute operation.
- MPSGraphPooling2DOpDescriptor: The class that defines the parameters for a 2D pooling operation.
- MPSGraphPooling4DOpDescriptor: The class that defines the parameters for a 4D pooling operation.
- MPSGraphRandomOpDescriptor: A class that describes the random operation.
- MPSGraphShapedType: The shaped type class for types on tensors with a shape and data type.
- MPSGraphSingleGateRNNDescriptor: The class that defines the parameters for a single gate RNN operation.
- MPSGraphStencilOpDescriptor: The class that defines the parameters for a stencil operation.
- MPSGraphTensor: The symbolic representation of a compute data type.
- MPSGraphTensorData: The representation of a compute data type.
- MPSGraphType: The base type class for types on tensors.
- MPSGraphVariableOp: The class that defines the parameters for a variable.
- MPSGraphSDPADescriptor: A descriptor that configures a scaled dot product attention (SDPA) operation.
Type Aliases ¶
- MPSGraphCallableMap: A dictionary of symbol names and the corresponding executables for them.
- MPSGraphCompilationCompletionHandler: A notification that appears when compilation finishes.
- MPSGraphCompletionHandler: A notification that appears when graph execution finishes.
- MPSGraphControlFlowDependencyBlock: The scope where all the operations defined in this block get control-dependency operations.
- MPSGraphExecutableCompletionHandler: A notification when graph executable execution finishes.
- MPSGraphExecutableScheduledHandler: A notification when graph executable execution schedules.
- MPSGraphForLoopBodyBlock: A block for the body in the for loop.
- MPSGraphIfThenElseBlock: A block of operations executed under either the if or else condition.
- MPSGraphScheduledHandler: A notification that appears when graph execution schedules.
- MPSGraphTensorDataDictionary: A dictionary of tensors and corresponding tensor data.
- MPSGraphTensorShapedTypeDictionary: A dictionary of tensors and corresponding shapes for them.
- MPSGraphWhileAfterBlock: The block that executes after the condition evaluates for each iteration.
- MPSGraphWhileBeforeBlock: The block that executes before the condition evaluates for each iteration.
Enumerations ¶
- MPSGraphDeploymentPlatform: The options available to a graph.
- MPSGraphDeviceType: The device type.
- MPSGraphExecutionStage: Execution events that can be used with shared events.
- MPSGraphFFTScalingMode: The scaling modes for Fourier transform operations.
- MPSGraphLossReductionType: The type of the reduction the graph applies in the loss operations.
- MPSGraphNonMaximumSuppressionCoordinateMode: The non-maximum suppression coordinate mode.
- MPSGraphOptimization: The optimization levels to trade compilation time for even more runtime performance by running more passes.
- MPSGraphOptimizationProfile: The optimization profile used as a heuristic as the graph compiler optimizes the network.
- MPSGraphOptions: The options available to a graph.
- MPSGraphPaddingMode: The tensor padding mode.
- MPSGraphPaddingStyle: The tensor padding style.
- MPSGraphPoolingReturnIndicesMode: The flattening mode for returned indices with max-pooling.
- MPSGraphRNNActivation: The activation modes for RNN operations.
- MPSGraphRandomDistribution: The distributions supported by random operations.
- MPSGraphRandomNormalSamplingMethod: The sampling method to use when generating values in the normal distribution.
- MPSGraphReducedPrecisionFastMath: MPSGraph could use these reduced precision paths to deliver faster math, but it is not guaranteed.
- MPSGraphReductionMode: The reduction mode.
- MPSGraphResizeMode: The resize mode to use for resizing.
- MPSGraphResizeNearestRoundingMode: The rounding mode to use when using nearest resize mode.
- MPSGraphScatterMode: The scatter mode.
- MPSGraphSparseStorageType: The sparse storage options in the Metal Performance Shaders Graph framework.
- MPSGraphTensorNamedDataLayout: The tensor layout.//
Key Types ¶
- MPSGraph - The optimized representation of a compute graph of operations and tensors.
- MPSGraphConvolution3DOpDescriptor - A class that describes the properties of a 3D-convolution operator.
- MPSGraphPooling2DOpDescriptor - The class that defines the parameters for a 2D pooling operation.
- MPSGraphConvolution2DOpDescriptor - A class that describes the properties of a 2D-convolution operator.
- MPSGraphDepthwiseConvolution2DOpDescriptor - A class that defines the parameters for a 2D-depthwise convolution operation.
- MPSGraphImToColOpDescriptor - The class that defines the parameters for an image to column or column to image operation.
- MPSGraphTensorData - The representation of a compute data type.
- MPSGraphStencilOpDescriptor - The class that defines the parameters for a stencil operation.
- MPSGraphExecutable - The compiled representation of a compute graph executable.
- MPSGraphLSTMDescriptor - The class that defines the parameters for a long short-term memory (LSTM) operation.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- func NewMPSGraphCompilationCompletionHandlerBlock(handler MPSGraphCompilationCompletionHandler) (objc.ID, func())
- func NewMPSGraphCompletionHandlerBlock(handler MPSGraphCompletionHandler) (objc.ID, func())
- func NewMPSGraphExecutableErrorBlock(handler MPSGraphExecutableErrorHandler) (objc.ID, func())
- func NewMPSGraphScheduledHandlerBlock(handler MPSGraphScheduledHandler) (objc.ID, func())
- func NewMPSGraphTensorDataArrayErrorBlock(handler MPSGraphTensorDataArrayErrorHandler) (objc.ID, func())
- type IMPSGraph
- type IMPSGraphCompilationDescriptor
- type IMPSGraphConvolution2DOpDescriptor
- type IMPSGraphConvolution3DOpDescriptor
- type IMPSGraphCreateSparseOpDescriptor
- type IMPSGraphDepthwiseConvolution2DOpDescriptor
- type IMPSGraphDepthwiseConvolution3DOpDescriptor
- type IMPSGraphDevice
- type IMPSGraphExecutable
- type IMPSGraphExecutableExecutionDescriptor
- type IMPSGraphExecutableSerializationDescriptor
- type IMPSGraphExecutionDescriptor
- type IMPSGraphFFTDescriptor
- type IMPSGraphGRUDescriptor
- type IMPSGraphImToColOpDescriptor
- type IMPSGraphLSTMDescriptor
- type IMPSGraphObject
- type IMPSGraphOperation
- type IMPSGraphPooling2DOpDescriptor
- type IMPSGraphPooling4DOpDescriptor
- type IMPSGraphRandomOpDescriptor
- type IMPSGraphSDPADescriptor
- type IMPSGraphShapedType
- type IMPSGraphSingleGateRNNDescriptor
- type IMPSGraphStencilOpDescriptor
- type IMPSGraphTensor
- type IMPSGraphTensorData
- type IMPSGraphType
- type IMPSGraphVariableOp
- type MPSGraph
- func (g MPSGraph) AbsoluteSquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AbsoluteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AcosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AcoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(currentLearningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(learningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) AdditionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(learningRateTensor IMPSGraphTensor, variable IMPSGraphVariableOp, ...) IMPSGraphOperation
- func (g MPSGraph) ArgSortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
- func (g MPSGraph) ArgSortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ArgSortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, ...) IMPSGraphTensor
- func (g MPSGraph) ArgSortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AsinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AsinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AssignVariableWithValueOfTensorName(variable IMPSGraphTensor, tensor IMPSGraphTensor, name string) IMPSGraphOperation
- func (g MPSGraph) Atan2WithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AtanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) AtanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) Autorelease() MPSGraph
- func (g MPSGraph) AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) AvgPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) AvgPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) BandPartWithTensorNumLowerNumUpperName(inputTensor IMPSGraphTensor, numLower int, numUpper int, name string) IMPSGraphTensor
- func (g MPSGraph) BandPartWithTensorNumLowerTensorNumUpperTensorName(inputTensor IMPSGraphTensor, numLowerTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, ...) IMPSGraphTensor
- func (g MPSGraph) BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) BitwiseANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwiseNOTWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwiseORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwisePopulationCountWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwiseRightShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BitwiseXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) BottomKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, ...) IMPSGraphTensor
- func (g MPSGraph) BottomKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) BottomKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
- func (g MPSGraph) BottomKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) BroadcastTensorToShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) BroadcastTensorToShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CallSymbolNameInputTensorsOutputTypesName(symbolName string, inputTensors []MPSGraphTensor, outputTypes []MPSGraphType, ...) []MPSGraphTensor
- func (g MPSGraph) CastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
- func (g MPSGraph) CeilWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ClampWithTensorMinValueTensorMaxValueTensorName(tensor IMPSGraphTensor, minValueTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ColToImWithSourceTensorOutputShapeDescriptorName(source IMPSGraphTensor, outputShape foundation.NSArray, ...) IMPSGraphTensor
- func (g MPSGraph) CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor(device IMPSGraphDevice, feeds MPSGraphTensorShapedTypeDictionary, ...) IMPSGraphExecutable
- func (g MPSGraph) ComplexTensorWithRealTensorImaginaryTensorName(realTensor IMPSGraphTensor, imaginaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ConcatTensorWithTensorDimensionName(tensor IMPSGraphTensor, tensor2 IMPSGraphTensor, dimensionIndex int, ...) IMPSGraphTensor
- func (g MPSGraph) ConcatTensorsDimensionInterleaveName(tensors []MPSGraphTensor, dimensionIndex int, interleave bool, name string) IMPSGraphTensor
- func (g MPSGraph) ConcatTensorsDimensionName(tensors []MPSGraphTensor, dimensionIndex int, name string) IMPSGraphTensor
- func (g MPSGraph) ConjugateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ConstantWithDataShapeDataType(data foundation.NSData, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
- func (g MPSGraph) ConstantWithRealPartImaginaryPart(realPart float64, imaginaryPart float64) IMPSGraphTensor
- func (g MPSGraph) ConstantWithRealPartImaginaryPartDataType(realPart float64, imaginaryPart float64, dataType uint32) IMPSGraphTensor
- func (g MPSGraph) ConstantWithRealPartImaginaryPartShapeDataType(realPart float64, imaginaryPart float64, shape foundation.NSArray, ...) IMPSGraphTensor
- func (g MPSGraph) ConstantWithScalarDataType(scalar float64, dataType uint32) IMPSGraphTensor
- func (g MPSGraph) ConstantWithScalarShapeDataType(scalar float64, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
- func (g MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Convolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, outputShape IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) CoordinateAlongAxisTensorWithShapeName(axisTensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) CoordinateAlongAxisTensorWithShapeTensorName(axisTensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CoordinateAlongAxisWithShapeName(axis int, shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) CoordinateAlongAxisWithShapeTensorName(axis int, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMaximumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMaximumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, ...) IMPSGraphTensor
- func (g MPSGraph) CumulativeMaximumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMinimumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeMinimumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, ...) IMPSGraphTensor
- func (g MPSGraph) CumulativeMinimumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeProductWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeProductWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, ...) IMPSGraphTensor
- func (g MPSGraph) CumulativeProductWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeSumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) CumulativeSumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, ...) IMPSGraphTensor
- func (g MPSGraph) CumulativeSumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, ...) IMPSGraphTensor
- func (g MPSGraph) DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorLUTTensorAxisName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorLUTTensorName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorScaleTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, dataType uint32, ...) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, ...) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) DequantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, ...) IMPSGraphTensor
- func (g MPSGraph) DivisionNoNaNWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) DivisionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) DropoutTensorRateName(tensor IMPSGraphTensor, rate float64, name string) IMPSGraphTensor
- func (g MPSGraph) DropoutTensorRateTensorName(tensor IMPSGraphTensor, rate IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, ...)
- func (g MPSGraph) EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, ...) MPSGraphTensorDataDictionary
- func (g MPSGraph) EqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ErfWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ExpandDimsOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ExpandDimsOfTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ExpandDimsOfTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ExponentBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ExponentBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ExponentWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) FastFourierTransformWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, ...) IMPSGraphTensor
- func (g MPSGraph) FastFourierTransformWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) Flatten2DTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) Flatten2DTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) FloorModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) FloorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) GatherAlongAxisWithUpdatesTensorIndicesTensorName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, axis uint, ...) IMPSGraphTensor
- func (g MPSGraph) GradientForPrimaryTensorWithTensorsName(primaryTensor IMPSGraphTensor, tensors []MPSGraphTensor, name string) foundation.INSDictionary
- func (g MPSGraph) GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) GreaterThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) HermiteanToRealFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, ...) IMPSGraphTensor
- func (g MPSGraph) HermiteanToRealFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) IdentityWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ImToColWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphImToColOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) ImaginaryPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) Init() MPSGraph
- func (g MPSGraph) InverseOfTensorName(inputTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) IsFiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) IsInfiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) IsNaNWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) L2NormPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, alphaTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) LeakyReLUWithTensorAlphaName(tensor IMPSGraphTensor, alpha float64, name string) IMPSGraphTensor
- func (g MPSGraph) LeakyReLUWithTensorAlphaTensorName(tensor IMPSGraphTensor, alphaTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LessThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LessThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogarithmBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogarithmBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogarithmWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalNANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalXNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) LogicalXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MatrixMultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling2DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) []MPSGraphTensor
- func (g MPSGraph) MaxPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) MaxPooling4DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) []MPSGraphTensor
- func (g MPSGraph) MaxPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MaximumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MeanOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MinimumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) MultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) NegativeWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NonZeroIndicesOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(tensor IMPSGraphTensor, mean IMPSGraphTensor, variance IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) NotEqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) NotWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, ...) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, ...) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthAxisName(indicesTensor IMPSGraphTensor, depth uint, axis uint, name string) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthDataTypeName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, name string) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, onValue float64, ...) IMPSGraphTensor
- func (g MPSGraph) OneHotWithIndicesTensorDepthName(indicesTensor IMPSGraphTensor, depth uint, name string) IMPSGraphTensor
- func (g MPSGraph) Options() MPSGraphOptions
- func (g MPSGraph) PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName(tensor IMPSGraphTensor, paddingMode MPSGraphPaddingMode, ...) IMPSGraphTensor
- func (g MPSGraph) PlaceholderTensors() []MPSGraphTensor
- func (g MPSGraph) PlaceholderWithShapeDataTypeName(shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
- func (g MPSGraph) PlaceholderWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) PowerWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) QuantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, ...) IMPSGraphTensor
- func (g MPSGraph) QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) QuantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, ...) IMPSGraphTensor
- func (g MPSGraph) RandomPhiloxStateTensorWithCounterLowCounterHighKeyName(counterLow uint, counterHigh uint, key uint, name string) IMPSGraphTensor
- func (g MPSGraph) RandomPhiloxStateTensorWithSeedName(seed uint, name string) IMPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeDescriptorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, name string) IMPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeDescriptorSeedName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, seed uint, ...) IMPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeDescriptorStateTensorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, ...) []MPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeTensorDescriptorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, ...) IMPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeTensorDescriptorSeedName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, seed uint, ...) IMPSGraphTensor
- func (g MPSGraph) RandomTensorWithShapeTensorDescriptorStateTensorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, ...) []MPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeSeedName(shape foundation.NSArray, seed uint, name string) IMPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeStateTensorName(shape foundation.NSArray, state IMPSGraphTensor, name string) []MPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeTensorName(shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeTensorSeedName(shapeTensor IMPSGraphTensor, seed uint, name string) IMPSGraphTensor
- func (g MPSGraph) RandomUniformTensorWithShapeTensorStateTensorName(shapeTensor IMPSGraphTensor, state IMPSGraphTensor, name string) []MPSGraphTensor
- func (g MPSGraph) ReLUGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ReLUWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ReadVariableName(variable IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RealPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RealToHermiteanFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, ...) IMPSGraphTensor
- func (g MPSGraph) RealToHermiteanFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ReciprocalSquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ReciprocalWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionAndWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionAndWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionArgMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionArgMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMaximumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMaximumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMaximumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMinimumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMinimumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMinimumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionOrWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionOrWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionProductWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionSumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReductionSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) ReinterpretCastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
- func (g MPSGraph) ReshapeTensorWithShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) ReshapeTensorWithShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, centerResult bool, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeTensorSizeModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size foundation.NSArray, mode MPSGraphResizeMode, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeTensorSizeTensorScaleTensorOffsetTensorModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, mode MPSGraphResizeMode, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ReverseTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) ReverseTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) ReverseTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RintWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RoundWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, ...) MPSGraphTensorDataDictionary
- func (g MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, ...)
- func (g MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, ...) MPSGraphTensorDataDictionary
- func (g MPSGraph) RunWithFeedsTargetTensorsTargetOperations(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, ...) MPSGraphTensorDataDictionary
- func (g MPSGraph) RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, ...)
- func (g MPSGraph) RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, ...) MPSGraphTensorDataDictionary
- func (g MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorDescriptorName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName(axisTensor IMPSGraphTensor, dataTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName(axis int, dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(predicateTensor IMPSGraphTensor, truePredicateTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SetOptions(value MPSGraphOptions)
- func (g MPSGraph) ShapeOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SigmoidGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SigmoidWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SignWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SignbitWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) SinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceTensorDimensionStartLengthName(tensor IMPSGraphTensor, dimensionIndex uint, start int, length int, ...) IMPSGraphTensor
- func (g MPSGraph) SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, endTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceTensorStartTensorSizeTensorSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceTensorStartsEndsStridesName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ...) IMPSGraphTensor
- func (g MPSGraph) SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ...) IMPSGraphTensor
- func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(gradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(sourceTensor IMPSGraphTensor, labelsTensor IMPSGraphTensor, axis int, ...) IMPSGraphTensor
- func (g MPSGraph) SoftMaxGradientWithIncomingGradientSourceTensorAxisName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) SoftMaxWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) SortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
- func (g MPSGraph) SortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) SortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, ...) IMPSGraphTensor
- func (g MPSGraph) SortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, ...) IMPSGraphTensor
- func (g MPSGraph) SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, ...) IMPSGraphTensor
- func (g MPSGraph) SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SparseTensorWithDescriptorTensorsShapeName(sparseDescriptor IMPSGraphCreateSparseOpDescriptor, ...) IMPSGraphTensor
- func (g MPSGraph) SparseTensorWithTypeTensorsShapeDataTypeName(sparseStorageType MPSGraphSparseStorageType, inputTensorArray []MPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SplitTensorNumSplitsAxisName(tensor IMPSGraphTensor, numSplits uint, axis int, name string) []MPSGraphTensor
- func (g MPSGraph) SplitTensorSplitSizesAxisName(tensor IMPSGraphTensor, splitSizes []foundation.NSNumber, axis int, ...) []MPSGraphTensor
- func (g MPSGraph) SplitTensorSplitSizesTensorAxisName(tensor IMPSGraphTensor, splitSizesTensor IMPSGraphTensor, axis int, ...) []MPSGraphTensor
- func (g MPSGraph) SquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SqueezeTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) SqueezeTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) SqueezeTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) SqueezeTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) StackTensorsAxisName(inputTensors []MPSGraphTensor, axis int, name string) IMPSGraphTensor
- func (g MPSGraph) StencilWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(learningRateTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) SubtractionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) TanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) TanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) TileTensorWithMultiplierName(tensor IMPSGraphTensor, multiplier foundation.NSArray, name string) IMPSGraphTensor
- func (g MPSGraph) TopKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, ...) IMPSGraphTensor
- func (g MPSGraph) TopKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) TopKWithGradientTensorSourceKName(gradient IMPSGraphTensor, source IMPSGraphTensor, k uint, name string) IMPSGraphTensor
- func (g MPSGraph) TopKWithGradientTensorSourceKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, kTensor IMPSGraphTensor, ...) IMPSGraphTensor
- func (g MPSGraph) TopKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
- func (g MPSGraph) TopKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, ...) []MPSGraphTensor
- func (g MPSGraph) TopKWithSourceTensorKName(source IMPSGraphTensor, k uint, name string) []MPSGraphTensor
- func (g MPSGraph) TopKWithSourceTensorKTensorName(source IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
- func (g MPSGraph) TransposeTensorDimensionWithDimensionName(tensor IMPSGraphTensor, dimensionIndex uint, dimensionIndex2 uint, name string) IMPSGraphTensor
- func (g MPSGraph) TransposeTensorPermutationName(tensor IMPSGraphTensor, permutation []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) TruncateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) VariableFromTensorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
- func (g MPSGraph) VariableWithDataShapeDataTypeName(data foundation.NSData, shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
- func (g MPSGraph) VarianceOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
- func (g MPSGraph) VarianceOfTensorMeanTensorAxesName(tensor IMPSGraphTensor, meanTensor IMPSGraphTensor, axes []foundation.NSNumber, ...) IMPSGraphTensor
- type MPSGraphCallableMap
- type MPSGraphClass
- type MPSGraphCompilationCompletionHandler
- type MPSGraphCompilationDescriptor
- func (g MPSGraphCompilationDescriptor) Autorelease() MPSGraphCompilationDescriptor
- func (g MPSGraphCompilationDescriptor) Callables() MPSGraphCallableMap
- func (g MPSGraphCompilationDescriptor) CompilationCompletionHandler() MPSGraphExecutableErrorHandler
- func (g MPSGraphCompilationDescriptor) DisableTypeInference()
- func (g MPSGraphCompilationDescriptor) DispatchQueue() dispatch.Queue
- func (g MPSGraphCompilationDescriptor) Init() MPSGraphCompilationDescriptor
- func (g MPSGraphCompilationDescriptor) OptimizationLevel() MPSGraphOptimization
- func (g MPSGraphCompilationDescriptor) OptimizationProfile() MPSGraphOptimizationProfile
- func (g MPSGraphCompilationDescriptor) ReducedPrecisionFastMath() MPSGraphReducedPrecisionFastMath
- func (g MPSGraphCompilationDescriptor) SetCallables(value MPSGraphCallableMap)
- func (g MPSGraphCompilationDescriptor) SetCompilationCompletionHandler(value MPSGraphExecutableErrorHandler)
- func (g MPSGraphCompilationDescriptor) SetDispatchQueue(value dispatch.Queue)
- func (g MPSGraphCompilationDescriptor) SetOptimizationLevel(value MPSGraphOptimization)
- func (g MPSGraphCompilationDescriptor) SetOptimizationProfile(value MPSGraphOptimizationProfile)
- func (g MPSGraphCompilationDescriptor) SetReducedPrecisionFastMath(value MPSGraphReducedPrecisionFastMath)
- func (g MPSGraphCompilationDescriptor) SetWaitForCompilationCompletion(value bool)
- func (g MPSGraphCompilationDescriptor) WaitForCompilationCompletion() bool
- type MPSGraphCompilationDescriptorClass
- type MPSGraphCompletionHandler
- type MPSGraphControlFlowDependencyBlock
- type MPSGraphConvolution2DOpDescriptor
- func MPSGraphConvolution2DOpDescriptorFromID(id objc.ID) MPSGraphConvolution2DOpDescriptor
- func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, ...) MPSGraphConvolution2DOpDescriptor
- func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, ...) MPSGraphConvolution2DOpDescriptor
- func NewMPSGraphConvolution2DOpDescriptor() MPSGraphConvolution2DOpDescriptor
- func (g MPSGraphConvolution2DOpDescriptor) Autorelease() MPSGraphConvolution2DOpDescriptor
- func (g MPSGraphConvolution2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
- func (g MPSGraphConvolution2DOpDescriptor) DilationRateInX() uint
- func (g MPSGraphConvolution2DOpDescriptor) DilationRateInY() uint
- func (g MPSGraphConvolution2DOpDescriptor) Groups() uint
- func (g MPSGraphConvolution2DOpDescriptor) Init() MPSGraphConvolution2DOpDescriptor
- func (g MPSGraphConvolution2DOpDescriptor) PaddingBottom() uint
- func (g MPSGraphConvolution2DOpDescriptor) PaddingLeft() uint
- func (g MPSGraphConvolution2DOpDescriptor) PaddingRight() uint
- func (g MPSGraphConvolution2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphConvolution2DOpDescriptor) PaddingTop() uint
- func (g MPSGraphConvolution2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphConvolution2DOpDescriptor) SetDilationRateInX(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetDilationRateInY(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetGroups(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetPaddingBottom(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetPaddingLeft(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetPaddingRight(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphConvolution2DOpDescriptor) SetPaddingTop(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetStrideInX(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetStrideInY(value uint)
- func (g MPSGraphConvolution2DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphConvolution2DOpDescriptor) StrideInX() uint
- func (g MPSGraphConvolution2DOpDescriptor) StrideInY() uint
- func (g MPSGraphConvolution2DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
- type MPSGraphConvolution2DOpDescriptorClass
- type MPSGraphConvolution3DOpDescriptor
- func MPSGraphConvolution3DOpDescriptorFromID(id objc.ID) MPSGraphConvolution3DOpDescriptor
- func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBackPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, strideInZ uint, dilationRateInX uint, ...) MPSGraphConvolution3DOpDescriptor
- func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, strideInZ uint, dilationRateInX uint, ...) MPSGraphConvolution3DOpDescriptor
- func NewMPSGraphConvolution3DOpDescriptor() MPSGraphConvolution3DOpDescriptor
- func (g MPSGraphConvolution3DOpDescriptor) Autorelease() MPSGraphConvolution3DOpDescriptor
- func (g MPSGraphConvolution3DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
- func (g MPSGraphConvolution3DOpDescriptor) DilationRateInX() uint
- func (g MPSGraphConvolution3DOpDescriptor) DilationRateInY() uint
- func (g MPSGraphConvolution3DOpDescriptor) DilationRateInZ() uint
- func (g MPSGraphConvolution3DOpDescriptor) Groups() uint
- func (g MPSGraphConvolution3DOpDescriptor) Init() MPSGraphConvolution3DOpDescriptor
- func (g MPSGraphConvolution3DOpDescriptor) PaddingBack() uint
- func (g MPSGraphConvolution3DOpDescriptor) PaddingBottom() uint
- func (g MPSGraphConvolution3DOpDescriptor) PaddingFront() uint
- func (g MPSGraphConvolution3DOpDescriptor) PaddingLeft() uint
- func (g MPSGraphConvolution3DOpDescriptor) PaddingRight() uint
- func (g MPSGraphConvolution3DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphConvolution3DOpDescriptor) PaddingTop() uint
- func (g MPSGraphConvolution3DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInX(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInY(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInZ(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, ...)
- func (g MPSGraphConvolution3DOpDescriptor) SetGroups(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingBack(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingBottom(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingFront(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingLeft(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingRight(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphConvolution3DOpDescriptor) SetPaddingTop(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetStrideInX(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetStrideInY(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetStrideInZ(value uint)
- func (g MPSGraphConvolution3DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphConvolution3DOpDescriptor) StrideInX() uint
- func (g MPSGraphConvolution3DOpDescriptor) StrideInY() uint
- func (g MPSGraphConvolution3DOpDescriptor) StrideInZ() uint
- func (g MPSGraphConvolution3DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
- type MPSGraphConvolution3DOpDescriptorClass
- type MPSGraphCreateSparseOpDescriptor
- func (g MPSGraphCreateSparseOpDescriptor) Autorelease() MPSGraphCreateSparseOpDescriptor
- func (g MPSGraphCreateSparseOpDescriptor) DataType() uint32
- func (g MPSGraphCreateSparseOpDescriptor) Init() MPSGraphCreateSparseOpDescriptor
- func (g MPSGraphCreateSparseOpDescriptor) SetDataType(value uint32)
- func (g MPSGraphCreateSparseOpDescriptor) SetSparseStorageType(value MPSGraphSparseStorageType)
- func (g MPSGraphCreateSparseOpDescriptor) SparseStorageType() MPSGraphSparseStorageType
- type MPSGraphCreateSparseOpDescriptorClass
- func (mc MPSGraphCreateSparseOpDescriptorClass) Alloc() MPSGraphCreateSparseOpDescriptor
- func (mc MPSGraphCreateSparseOpDescriptorClass) Class() objc.Class
- func (_MPSGraphCreateSparseOpDescriptorClass MPSGraphCreateSparseOpDescriptorClass) DescriptorWithStorageTypeDataType(sparseStorageType MPSGraphSparseStorageType, dataType uint32) MPSGraphCreateSparseOpDescriptor
- type MPSGraphDeploymentPlatform
- type MPSGraphDepthwiseConvolution2DOpDescriptor
- func MPSGraphDepthwiseConvolution2DOpDescriptorFromID(id objc.ID) MPSGraphDepthwiseConvolution2DOpDescriptor
- func NewGraphDepthwiseConvolution2DOpDescriptorWithDataLayoutWeightsLayout(dataLayout MPSGraphTensorNamedDataLayout, ...) MPSGraphDepthwiseConvolution2DOpDescriptor
- func NewGraphDepthwiseConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, ...) MPSGraphDepthwiseConvolution2DOpDescriptor
- func NewMPSGraphDepthwiseConvolution2DOpDescriptor() MPSGraphDepthwiseConvolution2DOpDescriptor
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) Autorelease() MPSGraphDepthwiseConvolution2DOpDescriptor
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInX() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInY() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) Init() MPSGraphDepthwiseConvolution2DOpDescriptor
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingBottom() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingLeft() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingRight() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingTop() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInX(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInY(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingBottom(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingLeft(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingRight(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingTop(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInX(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInY(value uint)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInX() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInY() uint
- func (g MPSGraphDepthwiseConvolution2DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
- type MPSGraphDepthwiseConvolution2DOpDescriptorClass
- type MPSGraphDepthwiseConvolution3DOpDescriptor
- func MPSGraphDepthwiseConvolution3DOpDescriptorFromID(id objc.ID) MPSGraphDepthwiseConvolution3DOpDescriptor
- func NewGraphDepthwiseConvolution3DOpDescriptorWithPaddingStyle(paddingStyle MPSGraphPaddingStyle) MPSGraphDepthwiseConvolution3DOpDescriptor
- func NewGraphDepthwiseConvolution3DOpDescriptorWithStridesDilationRatesPaddingValuesPaddingStyle(strides []foundation.NSNumber, dilationRates []foundation.NSNumber, ...) MPSGraphDepthwiseConvolution3DOpDescriptor
- func NewMPSGraphDepthwiseConvolution3DOpDescriptor() MPSGraphDepthwiseConvolution3DOpDescriptor
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Autorelease() MPSGraphDepthwiseConvolution3DOpDescriptor
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) ChannelDimensionIndex() int
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) DilationRates() []foundation.NSNumber
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Init() MPSGraphDepthwiseConvolution3DOpDescriptor
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingValues() []foundation.NSNumber
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetChannelDimensionIndex(value int)
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetDilationRates(value []foundation.NSNumber)
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingValues(value []foundation.NSNumber)
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetStrides(value []foundation.NSNumber)
- func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Strides() []foundation.NSNumber
- type MPSGraphDepthwiseConvolution3DOpDescriptorClass
- type MPSGraphDevice
- type MPSGraphDeviceClass
- type MPSGraphDeviceType
- type MPSGraphExecutable
- func MPSGraphExecutableFromID(id objc.ID) MPSGraphExecutable
- func NewGraphExecutableWithCoreMLPackageAtURLCompilationDescriptor(coreMLPackageURL foundation.NSURL, ...) MPSGraphExecutable
- func NewGraphExecutableWithMPSGraphPackageAtURLCompilationDescriptor(mpsgraphPackageURL foundation.NSURL, ...) MPSGraphExecutable
- func NewMPSGraphExecutable() MPSGraphExecutable
- func (g MPSGraphExecutable) Autorelease() MPSGraphExecutable
- func (g MPSGraphExecutable) EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, ...) []MPSGraphTensorData
- func (g MPSGraphExecutable) FeedTensors() []MPSGraphTensor
- func (g MPSGraphExecutable) GetOutputTypesWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, ...) []MPSGraphShapedType
- func (g MPSGraphExecutable) Init() MPSGraphExecutable
- func (g MPSGraphExecutable) InitWithCoreMLPackageAtURLCompilationDescriptor(coreMLPackageURL foundation.NSURL, ...) MPSGraphExecutable
- func (g MPSGraphExecutable) InitWithMPSGraphPackageAtURLCompilationDescriptor(mpsgraphPackageURL foundation.NSURL, ...) MPSGraphExecutable
- func (g MPSGraphExecutable) Options() MPSGraphOptions
- func (g MPSGraphExecutable) RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, ...) []MPSGraphTensorData
- func (g MPSGraphExecutable) RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, ...) []MPSGraphTensorData
- func (g MPSGraphExecutable) SerializeToMPSGraphPackageAtURLDescriptor(url foundation.NSURL, descriptor IMPSGraphExecutableSerializationDescriptor)
- func (g MPSGraphExecutable) SetOptions(value MPSGraphOptions)
- func (g MPSGraphExecutable) SpecializeWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, ...)
- func (g MPSGraphExecutable) TargetTensors() []MPSGraphTensor
- type MPSGraphExecutableClass
- type MPSGraphExecutableCompletionHandler
- type MPSGraphExecutableErrorHandler
- type MPSGraphExecutableExecutionDescriptor
- func (g MPSGraphExecutableExecutionDescriptor) Autorelease() MPSGraphExecutableExecutionDescriptor
- func (g MPSGraphExecutableExecutionDescriptor) CompletionHandler() MPSGraphTensorDataArrayErrorHandler
- func (g MPSGraphExecutableExecutionDescriptor) Init() MPSGraphExecutableExecutionDescriptor
- func (g MPSGraphExecutableExecutionDescriptor) ScheduledHandler() MPSGraphTensorDataArrayErrorHandler
- func (g MPSGraphExecutableExecutionDescriptor) SetCompletionHandler(value MPSGraphTensorDataArrayErrorHandler)
- func (g MPSGraphExecutableExecutionDescriptor) SetScheduledHandler(value MPSGraphTensorDataArrayErrorHandler)
- func (g MPSGraphExecutableExecutionDescriptor) SetWaitUntilCompleted(value bool)
- func (g MPSGraphExecutableExecutionDescriptor) SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, ...)
- func (g MPSGraphExecutableExecutionDescriptor) WaitForEventValue(event metal.MTLSharedEvent, value uint64)
- func (g MPSGraphExecutableExecutionDescriptor) WaitUntilCompleted() bool
- type MPSGraphExecutableExecutionDescriptorClass
- type MPSGraphExecutableScheduledHandler
- type MPSGraphExecutableSerializationDescriptor
- func (g MPSGraphExecutableSerializationDescriptor) Append() bool
- func (g MPSGraphExecutableSerializationDescriptor) Autorelease() MPSGraphExecutableSerializationDescriptor
- func (g MPSGraphExecutableSerializationDescriptor) DeploymentPlatform() MPSGraphDeploymentPlatform
- func (g MPSGraphExecutableSerializationDescriptor) Init() MPSGraphExecutableSerializationDescriptor
- func (g MPSGraphExecutableSerializationDescriptor) MinimumDeploymentTarget() string
- func (g MPSGraphExecutableSerializationDescriptor) SetAppend(value bool)
- func (g MPSGraphExecutableSerializationDescriptor) SetDeploymentPlatform(value MPSGraphDeploymentPlatform)
- func (g MPSGraphExecutableSerializationDescriptor) SetMinimumDeploymentTarget(value string)
- type MPSGraphExecutableSerializationDescriptorClass
- type MPSGraphExecutionDescriptor
- func (g MPSGraphExecutionDescriptor) Autorelease() MPSGraphExecutionDescriptor
- func (g MPSGraphExecutionDescriptor) CompilationDescriptor() IMPSGraphCompilationDescriptor
- func (g MPSGraphExecutionDescriptor) CompletionHandler() MPSGraphCompletionHandler
- func (g MPSGraphExecutionDescriptor) Init() MPSGraphExecutionDescriptor
- func (g MPSGraphExecutionDescriptor) ScheduledHandler() MPSGraphScheduledHandler
- func (g MPSGraphExecutionDescriptor) SetCompilationDescriptor(value IMPSGraphCompilationDescriptor)
- func (g MPSGraphExecutionDescriptor) SetCompletionHandler(value objc.ID)
- func (g MPSGraphExecutionDescriptor) SetScheduledHandler(value objc.ID)
- func (g MPSGraphExecutionDescriptor) SetWaitUntilCompleted(value bool)
- func (g MPSGraphExecutionDescriptor) SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, ...)
- func (g MPSGraphExecutionDescriptor) WaitForEventValue(event metal.MTLSharedEvent, value uint64)
- func (g MPSGraphExecutionDescriptor) WaitUntilCompleted() bool
- type MPSGraphExecutionDescriptorClass
- type MPSGraphExecutionStage
- type MPSGraphFFTDescriptor
- func (g MPSGraphFFTDescriptor) Autorelease() MPSGraphFFTDescriptor
- func (g MPSGraphFFTDescriptor) Init() MPSGraphFFTDescriptor
- func (g MPSGraphFFTDescriptor) Inverse() bool
- func (g MPSGraphFFTDescriptor) RoundToOddHermitean() bool
- func (g MPSGraphFFTDescriptor) ScalingMode() MPSGraphFFTScalingMode
- func (g MPSGraphFFTDescriptor) SetInverse(value bool)
- func (g MPSGraphFFTDescriptor) SetRoundToOddHermitean(value bool)
- func (g MPSGraphFFTDescriptor) SetScalingMode(value MPSGraphFFTScalingMode)
- type MPSGraphFFTDescriptorClass
- type MPSGraphFFTScalingMode
- type MPSGraphForLoopBodyBlock
- type MPSGraphGRUDescriptor
- func (g MPSGraphGRUDescriptor) Autorelease() MPSGraphGRUDescriptor
- func (g MPSGraphGRUDescriptor) Bidirectional() bool
- func (g MPSGraphGRUDescriptor) FlipZ() bool
- func (g MPSGraphGRUDescriptor) Init() MPSGraphGRUDescriptor
- func (g MPSGraphGRUDescriptor) OutputGateActivation() MPSGraphRNNActivation
- func (g MPSGraphGRUDescriptor) ResetAfter() bool
- func (g MPSGraphGRUDescriptor) ResetGateActivation() MPSGraphRNNActivation
- func (g MPSGraphGRUDescriptor) ResetGateFirst() bool
- func (g MPSGraphGRUDescriptor) Reverse() bool
- func (g MPSGraphGRUDescriptor) SetBidirectional(value bool)
- func (g MPSGraphGRUDescriptor) SetFlipZ(value bool)
- func (g MPSGraphGRUDescriptor) SetOutputGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphGRUDescriptor) SetResetAfter(value bool)
- func (g MPSGraphGRUDescriptor) SetResetGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphGRUDescriptor) SetResetGateFirst(value bool)
- func (g MPSGraphGRUDescriptor) SetReverse(value bool)
- func (g MPSGraphGRUDescriptor) SetTraining(value bool)
- func (g MPSGraphGRUDescriptor) SetUpdateGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphGRUDescriptor) Training() bool
- func (g MPSGraphGRUDescriptor) UpdateGateActivation() MPSGraphRNNActivation
- type MPSGraphGRUDescriptorClass
- type MPSGraphIfThenElseBlock
- type MPSGraphImToColOpDescriptor
- func MPSGraphImToColOpDescriptorFromID(id objc.ID) MPSGraphImToColOpDescriptor
- func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, ...) MPSGraphImToColOpDescriptor
- func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, ...) MPSGraphImToColOpDescriptor
- func NewMPSGraphImToColOpDescriptor() MPSGraphImToColOpDescriptor
- func (g MPSGraphImToColOpDescriptor) Autorelease() MPSGraphImToColOpDescriptor
- func (g MPSGraphImToColOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
- func (g MPSGraphImToColOpDescriptor) DilationRateInX() uint
- func (g MPSGraphImToColOpDescriptor) DilationRateInY() uint
- func (g MPSGraphImToColOpDescriptor) Init() MPSGraphImToColOpDescriptor
- func (g MPSGraphImToColOpDescriptor) KernelHeight() uint
- func (g MPSGraphImToColOpDescriptor) KernelWidth() uint
- func (g MPSGraphImToColOpDescriptor) PaddingBottom() uint
- func (g MPSGraphImToColOpDescriptor) PaddingLeft() uint
- func (g MPSGraphImToColOpDescriptor) PaddingRight() uint
- func (g MPSGraphImToColOpDescriptor) PaddingTop() uint
- func (g MPSGraphImToColOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphImToColOpDescriptor) SetDilationRateInX(value uint)
- func (g MPSGraphImToColOpDescriptor) SetDilationRateInY(value uint)
- func (g MPSGraphImToColOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
- func (g MPSGraphImToColOpDescriptor) SetKernelHeight(value uint)
- func (g MPSGraphImToColOpDescriptor) SetKernelWidth(value uint)
- func (g MPSGraphImToColOpDescriptor) SetPaddingBottom(value uint)
- func (g MPSGraphImToColOpDescriptor) SetPaddingLeft(value uint)
- func (g MPSGraphImToColOpDescriptor) SetPaddingRight(value uint)
- func (g MPSGraphImToColOpDescriptor) SetPaddingTop(value uint)
- func (g MPSGraphImToColOpDescriptor) SetStrideInX(value uint)
- func (g MPSGraphImToColOpDescriptor) SetStrideInY(value uint)
- func (g MPSGraphImToColOpDescriptor) StrideInX() uint
- func (g MPSGraphImToColOpDescriptor) StrideInY() uint
- type MPSGraphImToColOpDescriptorClass
- type MPSGraphLSTMDescriptor
- func (g MPSGraphLSTMDescriptor) Activation() MPSGraphRNNActivation
- func (g MPSGraphLSTMDescriptor) Autorelease() MPSGraphLSTMDescriptor
- func (g MPSGraphLSTMDescriptor) Bidirectional() bool
- func (g MPSGraphLSTMDescriptor) CellGateActivation() MPSGraphRNNActivation
- func (g MPSGraphLSTMDescriptor) ForgetGateActivation() MPSGraphRNNActivation
- func (g MPSGraphLSTMDescriptor) ForgetGateLast() bool
- func (g MPSGraphLSTMDescriptor) Init() MPSGraphLSTMDescriptor
- func (g MPSGraphLSTMDescriptor) InputGateActivation() MPSGraphRNNActivation
- func (g MPSGraphLSTMDescriptor) OutputGateActivation() MPSGraphRNNActivation
- func (g MPSGraphLSTMDescriptor) ProduceCell() bool
- func (g MPSGraphLSTMDescriptor) Reverse() bool
- func (g MPSGraphLSTMDescriptor) SetActivation(value MPSGraphRNNActivation)
- func (g MPSGraphLSTMDescriptor) SetBidirectional(value bool)
- func (g MPSGraphLSTMDescriptor) SetCellGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphLSTMDescriptor) SetForgetGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphLSTMDescriptor) SetForgetGateLast(value bool)
- func (g MPSGraphLSTMDescriptor) SetInputGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphLSTMDescriptor) SetOutputGateActivation(value MPSGraphRNNActivation)
- func (g MPSGraphLSTMDescriptor) SetProduceCell(value bool)
- func (g MPSGraphLSTMDescriptor) SetReverse(value bool)
- func (g MPSGraphLSTMDescriptor) SetTraining(value bool)
- func (g MPSGraphLSTMDescriptor) Training() bool
- type MPSGraphLSTMDescriptorClass
- type MPSGraphLossReductionType
- type MPSGraphNonMaximumSuppressionCoordinateMode
- type MPSGraphObject
- type MPSGraphObjectClass
- type MPSGraphOperation
- func (g MPSGraphOperation) Autorelease() MPSGraphOperation
- func (g MPSGraphOperation) ControlDependencies() []MPSGraphOperation
- func (g MPSGraphOperation) Graph() IMPSGraph
- func (g MPSGraphOperation) Init() MPSGraphOperation
- func (g MPSGraphOperation) InputTensors() []MPSGraphTensor
- func (g MPSGraphOperation) Name() string
- func (g MPSGraphOperation) OutputTensors() []MPSGraphTensor
- type MPSGraphOperationClass
- type MPSGraphOptimization
- type MPSGraphOptimizationProfile
- type MPSGraphOptions
- type MPSGraphPaddingMode
- type MPSGraphPaddingStyle
- type MPSGraphPooling2DOpDescriptor
- func MPSGraphPooling2DOpDescriptorFromID(id objc.ID) MPSGraphPooling2DOpDescriptor
- func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, ...) MPSGraphPooling2DOpDescriptor
- func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, ...) MPSGraphPooling2DOpDescriptor
- func NewMPSGraphPooling2DOpDescriptor() MPSGraphPooling2DOpDescriptor
- func (g MPSGraphPooling2DOpDescriptor) Autorelease() MPSGraphPooling2DOpDescriptor
- func (g MPSGraphPooling2DOpDescriptor) CeilMode() bool
- func (g MPSGraphPooling2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
- func (g MPSGraphPooling2DOpDescriptor) DilationRateInX() uint
- func (g MPSGraphPooling2DOpDescriptor) DilationRateInY() uint
- func (g MPSGraphPooling2DOpDescriptor) IncludeZeroPadToAverage() bool
- func (g MPSGraphPooling2DOpDescriptor) Init() MPSGraphPooling2DOpDescriptor
- func (g MPSGraphPooling2DOpDescriptor) KernelHeight() uint
- func (g MPSGraphPooling2DOpDescriptor) KernelWidth() uint
- func (g MPSGraphPooling2DOpDescriptor) PaddingBottom() uint
- func (g MPSGraphPooling2DOpDescriptor) PaddingLeft() uint
- func (g MPSGraphPooling2DOpDescriptor) PaddingRight() uint
- func (g MPSGraphPooling2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphPooling2DOpDescriptor) PaddingTop() uint
- func (g MPSGraphPooling2DOpDescriptor) ReturnIndicesDataType() uint32
- func (g MPSGraphPooling2DOpDescriptor) ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
- func (g MPSGraphPooling2DOpDescriptor) SetCeilMode(value bool)
- func (g MPSGraphPooling2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
- func (g MPSGraphPooling2DOpDescriptor) SetDilationRateInX(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetDilationRateInY(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
- func (g MPSGraphPooling2DOpDescriptor) SetIncludeZeroPadToAverage(value bool)
- func (g MPSGraphPooling2DOpDescriptor) SetKernelHeight(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetKernelWidth(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetPaddingBottom(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetPaddingLeft(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetPaddingRight(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphPooling2DOpDescriptor) SetPaddingTop(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetReturnIndicesDataType(value uint32)
- func (g MPSGraphPooling2DOpDescriptor) SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
- func (g MPSGraphPooling2DOpDescriptor) SetStrideInX(value uint)
- func (g MPSGraphPooling2DOpDescriptor) SetStrideInY(value uint)
- func (g MPSGraphPooling2DOpDescriptor) StrideInX() uint
- func (g MPSGraphPooling2DOpDescriptor) StrideInY() uint
- type MPSGraphPooling2DOpDescriptorClass
- type MPSGraphPooling4DOpDescriptor
- func MPSGraphPooling4DOpDescriptorFromID(id objc.ID) MPSGraphPooling4DOpDescriptor
- func NewGraphPooling4DOpDescriptorWithKernelSizesPaddingStyle(kernelSizes []foundation.NSNumber, paddingStyle MPSGraphPaddingStyle) MPSGraphPooling4DOpDescriptor
- func NewGraphPooling4DOpDescriptorWithKernelSizesStridesDilationRatesPaddingValuesPaddingStyle(kernelSizes []foundation.NSNumber, strides []foundation.NSNumber, ...) MPSGraphPooling4DOpDescriptor
- func NewMPSGraphPooling4DOpDescriptor() MPSGraphPooling4DOpDescriptor
- func (g MPSGraphPooling4DOpDescriptor) Autorelease() MPSGraphPooling4DOpDescriptor
- func (g MPSGraphPooling4DOpDescriptor) CeilMode() bool
- func (g MPSGraphPooling4DOpDescriptor) DilationRates() []foundation.NSNumber
- func (g MPSGraphPooling4DOpDescriptor) IncludeZeroPadToAverage() bool
- func (g MPSGraphPooling4DOpDescriptor) Init() MPSGraphPooling4DOpDescriptor
- func (g MPSGraphPooling4DOpDescriptor) KernelSizes() []foundation.NSNumber
- func (g MPSGraphPooling4DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphPooling4DOpDescriptor) PaddingValues() []foundation.NSNumber
- func (g MPSGraphPooling4DOpDescriptor) ReturnIndicesDataType() uint32
- func (g MPSGraphPooling4DOpDescriptor) ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
- func (g MPSGraphPooling4DOpDescriptor) SetCeilMode(value bool)
- func (g MPSGraphPooling4DOpDescriptor) SetDilationRates(value []foundation.NSNumber)
- func (g MPSGraphPooling4DOpDescriptor) SetIncludeZeroPadToAverage(value bool)
- func (g MPSGraphPooling4DOpDescriptor) SetKernelSizes(value []foundation.NSNumber)
- func (g MPSGraphPooling4DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphPooling4DOpDescriptor) SetPaddingValues(value []foundation.NSNumber)
- func (g MPSGraphPooling4DOpDescriptor) SetReturnIndicesDataType(value uint32)
- func (g MPSGraphPooling4DOpDescriptor) SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
- func (g MPSGraphPooling4DOpDescriptor) SetStrides(value []foundation.NSNumber)
- func (g MPSGraphPooling4DOpDescriptor) Strides() []foundation.NSNumber
- type MPSGraphPooling4DOpDescriptorClass
- type MPSGraphPoolingReturnIndicesMode
- type MPSGraphRNNActivation
- type MPSGraphRandomDistribution
- type MPSGraphRandomNormalSamplingMethod
- type MPSGraphRandomOpDescriptor
- func (g MPSGraphRandomOpDescriptor) Autorelease() MPSGraphRandomOpDescriptor
- func (g MPSGraphRandomOpDescriptor) DataType() uint32
- func (g MPSGraphRandomOpDescriptor) Distribution() MPSGraphRandomDistribution
- func (g MPSGraphRandomOpDescriptor) Init() MPSGraphRandomOpDescriptor
- func (g MPSGraphRandomOpDescriptor) Max() float32
- func (g MPSGraphRandomOpDescriptor) MaxInteger() int
- func (g MPSGraphRandomOpDescriptor) Mean() float32
- func (g MPSGraphRandomOpDescriptor) Min() float32
- func (g MPSGraphRandomOpDescriptor) MinInteger() int
- func (g MPSGraphRandomOpDescriptor) SamplingMethod() MPSGraphRandomNormalSamplingMethod
- func (g MPSGraphRandomOpDescriptor) SetDataType(value uint32)
- func (g MPSGraphRandomOpDescriptor) SetDistribution(value MPSGraphRandomDistribution)
- func (g MPSGraphRandomOpDescriptor) SetMax(value float32)
- func (g MPSGraphRandomOpDescriptor) SetMaxInteger(value int)
- func (g MPSGraphRandomOpDescriptor) SetMean(value float32)
- func (g MPSGraphRandomOpDescriptor) SetMin(value float32)
- func (g MPSGraphRandomOpDescriptor) SetMinInteger(value int)
- func (g MPSGraphRandomOpDescriptor) SetSamplingMethod(value MPSGraphRandomNormalSamplingMethod)
- func (g MPSGraphRandomOpDescriptor) SetStandardDeviation(value float32)
- func (g MPSGraphRandomOpDescriptor) StandardDeviation() float32
- type MPSGraphRandomOpDescriptorClass
- type MPSGraphReducedPrecisionFastMath
- type MPSGraphReductionMode
- type MPSGraphResizeMode
- type MPSGraphResizeNearestRoundingMode
- type MPSGraphSDPADescriptor
- func (g MPSGraphSDPADescriptor) Autorelease() MPSGraphSDPADescriptor
- func (g MPSGraphSDPADescriptor) Init() MPSGraphSDPADescriptor
- func (g MPSGraphSDPADescriptor) IsCausal() bool
- func (g MPSGraphSDPADescriptor) MaskTensor() IMPSGraphTensor
- func (g MPSGraphSDPADescriptor) Scale() float32
- func (g MPSGraphSDPADescriptor) SetIsCausal(value bool)
- func (g MPSGraphSDPADescriptor) SetMaskTensor(value IMPSGraphTensor)
- func (g MPSGraphSDPADescriptor) SetScale(value float32)
- func (g MPSGraphSDPADescriptor) SetSinksTensor(value IMPSGraphTensor)
- func (g MPSGraphSDPADescriptor) SinksTensor() IMPSGraphTensor
- type MPSGraphSDPADescriptorClass
- type MPSGraphScatterMode
- type MPSGraphScheduledHandler
- type MPSGraphShapedType
- func (g MPSGraphShapedType) Autorelease() MPSGraphShapedType
- func (g MPSGraphShapedType) DataType() uint32
- func (g MPSGraphShapedType) Init() MPSGraphShapedType
- func (g MPSGraphShapedType) InitWithShapeDataType(shape foundation.NSArray, dataType uint32) MPSGraphShapedType
- func (g MPSGraphShapedType) SetDataType(value uint32)
- func (g MPSGraphShapedType) SetShape(value foundation.NSArray)
- func (g MPSGraphShapedType) Shape() foundation.NSArray
- type MPSGraphShapedTypeClass
- type MPSGraphSingleGateRNNDescriptor
- func (g MPSGraphSingleGateRNNDescriptor) Activation() MPSGraphRNNActivation
- func (g MPSGraphSingleGateRNNDescriptor) Autorelease() MPSGraphSingleGateRNNDescriptor
- func (g MPSGraphSingleGateRNNDescriptor) Bidirectional() bool
- func (g MPSGraphSingleGateRNNDescriptor) Init() MPSGraphSingleGateRNNDescriptor
- func (g MPSGraphSingleGateRNNDescriptor) Reverse() bool
- func (g MPSGraphSingleGateRNNDescriptor) SetActivation(value MPSGraphRNNActivation)
- func (g MPSGraphSingleGateRNNDescriptor) SetBidirectional(value bool)
- func (g MPSGraphSingleGateRNNDescriptor) SetReverse(value bool)
- func (g MPSGraphSingleGateRNNDescriptor) SetTraining(value bool)
- func (g MPSGraphSingleGateRNNDescriptor) Training() bool
- type MPSGraphSingleGateRNNDescriptorClass
- type MPSGraphSparseStorageType
- type MPSGraphStencilOpDescriptor
- func MPSGraphStencilOpDescriptorFromID(id objc.ID) MPSGraphStencilOpDescriptor
- func NewGraphStencilOpDescriptorWithExplicitPadding(explicitPadding foundation.NSArray) MPSGraphStencilOpDescriptor
- func NewGraphStencilOpDescriptorWithOffsetsExplicitPadding(offsets foundation.NSArray, explicitPadding foundation.NSArray) MPSGraphStencilOpDescriptor
- func NewGraphStencilOpDescriptorWithPaddingStyle(paddingStyle MPSGraphPaddingStyle) MPSGraphStencilOpDescriptor
- func NewGraphStencilOpDescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant(reductionMode MPSGraphReductionMode, offsets foundation.NSArray, ...) MPSGraphStencilOpDescriptor
- func NewMPSGraphStencilOpDescriptor() MPSGraphStencilOpDescriptor
- func (g MPSGraphStencilOpDescriptor) Autorelease() MPSGraphStencilOpDescriptor
- func (g MPSGraphStencilOpDescriptor) BoundaryMode() MPSGraphPaddingMode
- func (g MPSGraphStencilOpDescriptor) DilationRates() foundation.NSArray
- func (g MPSGraphStencilOpDescriptor) ExplicitPadding() foundation.NSArray
- func (g MPSGraphStencilOpDescriptor) Init() MPSGraphStencilOpDescriptor
- func (g MPSGraphStencilOpDescriptor) Offsets() foundation.NSArray
- func (g MPSGraphStencilOpDescriptor) PaddingConstant() float32
- func (g MPSGraphStencilOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
- func (g MPSGraphStencilOpDescriptor) ReductionMode() MPSGraphReductionMode
- func (g MPSGraphStencilOpDescriptor) SetBoundaryMode(value MPSGraphPaddingMode)
- func (g MPSGraphStencilOpDescriptor) SetDilationRates(value foundation.NSArray)
- func (g MPSGraphStencilOpDescriptor) SetExplicitPadding(value foundation.NSArray)
- func (g MPSGraphStencilOpDescriptor) SetOffsets(value foundation.NSArray)
- func (g MPSGraphStencilOpDescriptor) SetPaddingConstant(value float32)
- func (g MPSGraphStencilOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
- func (g MPSGraphStencilOpDescriptor) SetReductionMode(value MPSGraphReductionMode)
- func (g MPSGraphStencilOpDescriptor) SetStrides(value foundation.NSArray)
- func (g MPSGraphStencilOpDescriptor) Strides() foundation.NSArray
- type MPSGraphStencilOpDescriptorClass
- type MPSGraphTensor
- type MPSGraphTensorArrayHandler
- type MPSGraphTensorClass
- type MPSGraphTensorData
- func MPSGraphTensorDataFromID(id objc.ID) MPSGraphTensorData
- func NewGraphTensorDataWithDeviceDataShapeDataType(device IMPSGraphDevice, data foundation.NSData, shape foundation.NSArray, ...) MPSGraphTensorData
- func NewGraphTensorDataWithMPSImageBatch(imageBatch foundation.NSArray) MPSGraphTensorData
- func NewGraphTensorDataWithMPSMatrix(matrix *metalperformanceshaders.MPSMatrix) MPSGraphTensorData
- func NewGraphTensorDataWithMPSMatrixRank(matrix *metalperformanceshaders.MPSMatrix, rank uint) MPSGraphTensorData
- func NewGraphTensorDataWithMPSNDArray(ndarray *metalperformanceshaders.MPSNDArray) MPSGraphTensorData
- func NewGraphTensorDataWithMPSVector(vector *metalperformanceshaders.MPSVector) MPSGraphTensorData
- func NewGraphTensorDataWithMPSVectorRank(vector *metalperformanceshaders.MPSVector, rank uint) MPSGraphTensorData
- func NewGraphTensorDataWithMTLBufferShapeDataType(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
- func NewGraphTensorDataWithMTLBufferShapeDataTypeRowBytes(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32, ...) MPSGraphTensorData
- func NewGraphTensorDataWithMTLTensor(tensor metal.MTLTensor) MPSGraphTensorData
- func NewMPSGraphTensorData() MPSGraphTensorData
- func (g MPSGraphTensorData) Autorelease() MPSGraphTensorData
- func (g MPSGraphTensorData) DataType() uint32
- func (g MPSGraphTensorData) Device() IMPSGraphDevice
- func (g MPSGraphTensorData) Init() MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithDeviceDataShapeDataType(device IMPSGraphDevice, data foundation.NSData, shape foundation.NSArray, ...) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSImageBatch(imageBatch foundation.NSArray) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSMatrix(matrix *metalperformanceshaders.MPSMatrix) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSMatrixRank(matrix *metalperformanceshaders.MPSMatrix, rank uint) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSNDArray(ndarray *metalperformanceshaders.MPSNDArray) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSVector(vector *metalperformanceshaders.MPSVector) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMPSVectorRank(vector *metalperformanceshaders.MPSVector, rank uint) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMTLBufferShapeDataType(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMTLBufferShapeDataTypeRowBytes(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32, ...) MPSGraphTensorData
- func (g MPSGraphTensorData) InitWithMTLTensor(tensor metal.MTLTensor) MPSGraphTensorData
- func (g MPSGraphTensorData) Mpsndarray() metalperformanceshaders.MPSNDArray
- func (g MPSGraphTensorData) Shape() foundation.NSArray
- type MPSGraphTensorDataArrayErrorHandler
- type MPSGraphTensorDataClass
- type MPSGraphTensorDataDictionary
- type MPSGraphTensorMPSGraphTensorArrayHandler
- type MPSGraphTensorMPSGraphTensorDataDictionaryErrorHandler
- type MPSGraphTensorNamedDataLayout
- type MPSGraphTensorShapedTypeDictionary
- type MPSGraphTensorVoidHandler
- type MPSGraphType
- type MPSGraphTypeClass
- type MPSGraphVariableOp
- type MPSGraphVariableOpClass
- type MPSGraphWhileAfterBlock
- type MPSGraphWhileBeforeBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMPSGraphCompilationCompletionHandlerBlock ¶
func NewMPSGraphCompilationCompletionHandlerBlock(handler MPSGraphCompilationCompletionHandler) (objc.ID, func())
NewMPSGraphCompilationCompletionHandlerBlock wraps a Go MPSGraphCompilationCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewMPSGraphCompletionHandlerBlock ¶
func NewMPSGraphCompletionHandlerBlock(handler MPSGraphCompletionHandler) (objc.ID, func())
NewMPSGraphCompletionHandlerBlock wraps a Go MPSGraphCompletionHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewMPSGraphExecutableErrorBlock ¶
func NewMPSGraphExecutableErrorBlock(handler MPSGraphExecutableErrorHandler) (objc.ID, func())
NewMPSGraphExecutableErrorBlock wraps a Go MPSGraphExecutableErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewMPSGraphScheduledHandlerBlock ¶
func NewMPSGraphScheduledHandlerBlock(handler MPSGraphScheduledHandler) (objc.ID, func())
NewMPSGraphScheduledHandlerBlock wraps a Go MPSGraphScheduledHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewMPSGraphTensorDataArrayErrorBlock ¶
func NewMPSGraphTensorDataArrayErrorBlock(handler MPSGraphTensorDataArrayErrorHandler) (objc.ID, func())
NewMPSGraphTensorDataArrayErrorBlock wraps a Go MPSGraphTensorDataArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Types ¶
type IMPSGraph ¶
type IMPSGraph interface {
IMPSGraphObject
// Options for the graph.
Options() MPSGraphOptions
SetOptions(value MPSGraphOptions)
// Array of all the placeholder tensors.
PlaceholderTensors() []MPSGraphTensor
// Creates a GRU operation and returns the value and optionally the training state tensor.
GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Creates a GRU operation and returns the value and optionally the training state tensor.
GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Creates a GRU operation and returns the value and optionally the training state tensor.
GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, secondaryBias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Creates a GRU gradient operation and returns the gradient tensor values.
GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Creates a GRU gradient operation and returns the gradient tensor values.
GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Creates a GRU gradient operation and returns the gradient tensor values.
GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, stateGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, secondaryBias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
// Computes the hamming distance of two input tensors with support for broadcasting.
HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, resultDataType uint32, name string) IMPSGraphTensor
// Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
HermiteanToRealFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
HermiteanToRealFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Creates a 4D L2-norm pooling operation and returns the result tensor.
L2NormPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates a L2-Norm pooling gradient operation and returns the result tensor.
L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, peephole IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM gradient operation and returns the gradient tensor values.
LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM gradient operation and returns the gradient tensor values.
LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM gradient operation and returns the gradient tensor values.
LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Creates an LSTM gradient operation and returns the gradient tensor values.
LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, stateGradient IMPSGraphTensor, cellGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, peephole IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
// Returns the absolute values of the input tensor elements.
AbsoluteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the absolute square of the input tensor elements.
AbsoluteSquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the inverse cosine operation to the input tensor elements.
AcosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the inverse hyperbolic cosine operation to the input tensor elements.
AcoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates operations to apply Adam optimization.
AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(currentLearningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, beta2Tensor IMPSGraphTensor, epsilonTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, momentumTensor IMPSGraphTensor, velocityTensor IMPSGraphTensor, maximumVelocityTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) []MPSGraphTensor
// Creates operations to apply Adam optimization.
AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(learningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, beta2Tensor IMPSGraphTensor, epsilonTensor IMPSGraphTensor, beta1PowerTensor IMPSGraphTensor, beta2PowerTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, momentumTensor IMPSGraphTensor, velocityTensor IMPSGraphTensor, maximumVelocityTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) []MPSGraphTensor
// Adds two input tensors.
AdditionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// The Stochastic gradient descent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable this op directly writes to the variable
ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(learningRateTensor IMPSGraphTensor, variable IMPSGraphVariableOp, gradientTensor IMPSGraphTensor, name string) IMPSGraphOperation
// Computes the indices that sort the elements of the input tensor along the specified axis.
ArgSortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
// Computes the indices that sort the elements of the input tensor along the specified axis.
ArgSortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Computes the indices that sort the elements of the input tensor along the specified axis.
ArgSortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, name string) IMPSGraphTensor
// Computes the indices that sort the elements of the input tensor along the specified axis.
ArgSortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the inverse sine operation to the input tensor elements.
AsinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the inverse hyperbolic sine operation to the input tensor elements.
AsinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates an assign operation which writes at this point of execution of the graph.
AssignVariableWithValueOfTensorName(variable IMPSGraphTensor, tensor IMPSGraphTensor, name string) IMPSGraphOperation
// Applies the inverse tangent operation to the input tensor elements.
AtanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise two-argument arctangent of the input tensors.
Atan2WithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the inverse hyperbolic tangent operation to the input tensor elements.
AtanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a 2D average-pooling operation and returns the result tensor.
AvgPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D average pooling gradient operation and returns the result tensor.
AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 4D average pooling operation and returns the result tensor.
AvgPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates an average pooling gradient operation and returns the result tensor.
AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Computes the band part of an input tensor.
BandPartWithTensorNumLowerNumUpperName(inputTensor IMPSGraphTensor, numLower int, numUpper int, name string) IMPSGraphTensor
// Creates the band part operation and returns the result.
BandPartWithTensorNumLowerTensorNumUpperTensorName(inputTensor IMPSGraphTensor, numLowerTensor IMPSGraphTensor, numUpperTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a batch-to-space operation and returns the result tensor.
BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, blockDimensions []foundation.NSNumber, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a batch-to-space operation and returns the result tensor.
BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, batchAxisTensor IMPSGraphTensor, blockDimensionsTensor IMPSGraphTensor, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Returns the elementwise bitwise AND of binary representations of two integer tensors.
BitwiseANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise left-shifted binary representations of the primary integer by the secondary tensor amount.
BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the bitwise NOT operation to the input tensor element.
BitwiseNOTWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise bitwise OR of binary representations of two integer tensors.
BitwiseORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the population count of the input tensor elements.
BitwisePopulationCountWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise right-shifted binary representations of the primary integer by the secondary tensor amount.
BitwiseRightShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise bitwise XOR of binary representations of two integer tensors.
BitwiseXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a BottomK operation and returns the value and indices tensors.
BottomKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
// Creates a BottomK operation and returns the result tensor.
BottomKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a BottomKGradient operation and returns the result tensor.
BottomKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, name string) IMPSGraphTensor
// Creates a BottomKGradient operation and returns the result tensor.
BottomKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a broadcast operation and returns the result tensor.
BroadcastTensorToShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a broadcast operation and returns the result tensor.
BroadcastTensorToShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates an operation which invokes another executable.
CallSymbolNameInputTensorsOutputTypesName(symbolName string, inputTensors []MPSGraphTensor, outputTypes []MPSGraphType, name string) []MPSGraphTensor
// Creates a cast operation and returns the result tensor.
CastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
// Applies the ceiling operation to the input tensor elements.
CeilWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Clamps the values in the first tensor between the corresponding values in the minimum and maximum value tensor.
ClampWithTensorMinValueTensorMaxValueTensorName(tensor IMPSGraphTensor, minValueTensor IMPSGraphTensor, maxValueTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a column to image operation and returns the result tensor.
ColToImWithSourceTensorOutputShapeDescriptorName(source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphImToColOpDescriptor, name string) IMPSGraphTensor
// Compiles the graph for the given feeds to returns the target tensor values, ensuring all target operations would be executed.
CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor(device IMPSGraphDevice, feeds MPSGraphTensorShapedTypeDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, compilationDescriptor IMPSGraphCompilationDescriptor) IMPSGraphExecutable
// Creates a complex constant op with the MPSDataTypeComplexFloat32 data type and returns the result tensor.
ConstantWithRealPartImaginaryPart(realPart float64, imaginaryPart float64) IMPSGraphTensor
// Creates a complex constant operation and returns the result tensor.
ConstantWithRealPartImaginaryPartDataType(realPart float64, imaginaryPart float64, dataType uint32) IMPSGraphTensor
// Creates a complex constant op with a given shape and returns the result tensor.
ConstantWithRealPartImaginaryPartShapeDataType(realPart float64, imaginaryPart float64, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
// Returns a complex tensor from the two input tensors.
ComplexTensorWithRealTensorImaginaryTensorName(realTensor IMPSGraphTensor, imaginaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a concatenation operation and returns the result tensor.
ConcatTensorWithTensorDimensionName(tensor IMPSGraphTensor, tensor2 IMPSGraphTensor, dimensionIndex int, name string) IMPSGraphTensor
// Creates a concatenation operation and returns the result tensor.
ConcatTensorsDimensionInterleaveName(tensors []MPSGraphTensor, dimensionIndex int, interleave bool, name string) IMPSGraphTensor
// Creates a concatenation operation and returns the result tensor.
ConcatTensorsDimensionName(tensors []MPSGraphTensor, dimensionIndex int, name string) IMPSGraphTensor
// Returns the complex conjugate of the input tensor elements.
ConjugateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a constant operation and returns the result tensor.
ConstantWithScalarDataType(scalar float64, dataType uint32) IMPSGraphTensor
// Creates a constant op with a given shape and returns the result tensor.
ConstantWithScalarShapeDataType(scalar float64, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
// Creates a constant op with a given shape and data, and returns the result tensor.
ConstantWithDataShapeDataType(data foundation.NSData, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
// Creates a 2D (forward) convolution operation and returns the result tensor.
Convolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D convolution gradient operation with respect to the weights tensor of the forward convolution.
Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D convolution gradient operation with respect to weights tensor of forward convolution.
Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D forward convolution operation and returns the result tensor.
Convolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, outputShape IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a get-coordindate operation and returns the result tensor.
CoordinateAlongAxisWithShapeName(axis int, shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a get-coordindate operation and returns the result tensor.
CoordinateAlongAxisWithShapeTensorName(axis int, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a get-coordindate operation and returns the result tensor.
CoordinateAlongAxisTensorWithShapeName(axisTensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a get-coordindate operation and returns the result tensor.
CoordinateAlongAxisTensorWithShapeTensorName(axisTensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the cosine operation to the input tensor elements.
CosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the hyperbolic cosine operation to the input tensor elements.
CoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the cumulative maximum of the input tensor along the specified axis.
CumulativeMaximumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative maximum of the input tensor along the specified axis.
CumulativeMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Computes the cumulative maximum of the input tensor along the specified axis.
CumulativeMaximumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative maximum of the input tensor along the specified axis.
CumulativeMaximumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the cumulative minimum of the input tensor along the specified axis.
CumulativeMinimumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative minimum of the input tensor along the specified axis.
CumulativeMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Computes the cumulative minimum of the input tensor along the specified axis.
CumulativeMinimumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative minimum of the input tensor along the specified axis.
CumulativeMinimumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the cumulative product of the input tensor along the specified axis.
CumulativeProductWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative product of the input tensor along the specified axis.
CumulativeProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Computes the cumulative product of the input tensor along the specified axis.
CumulativeProductWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative product of the input tensor along the specified axis.
CumulativeProductWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the cumulative sum of the input tensor along the specified axis.
CumulativeSumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative sum of the input tensor along the specified axis.
CumulativeSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Computes the cumulative sum of the input tensor along the specified axis.
CumulativeSumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
// Computes the cumulative sum of the input tensor along the specified axis.
CumulativeSumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a depth-to-space2D operation and returns the result tensor.
DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a depth-to-space2D operation and returns the result tensor.
DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, heightAxisTensor IMPSGraphTensor, depthAxisTensor IMPSGraphTensor, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a 2D-depthwise convolution operation and returns the result tensor.
DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D-depthwise convolution gradient for data operation and returns the result tensor.
DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D-depthwise convolution gradient for weights operation and returns the result tensor.
DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D depthwise convolution operation and returns the result tensor.
DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D depthwise convolution gradient for data operation and returns the result tensor.
DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a 3D depthwise convolution gradient for weights operation and returns the result tensor.
DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
// Creates a vector lookup-table based quantization operation and returns the result tensor.
DequantizeTensorLUTTensorAxisName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a lookup-table based quantization operation and returns the result tensor.
DequantizeTensorLUTTensorName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates Dequantize operation and returns the result tensor.
DequantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, name string) IMPSGraphTensor
// Creates a dequantize operation and returns the result tensor.
DequantizeTensorScaleTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, dataType uint32, name string) IMPSGraphTensor
// Creates Dequantize operation and returns the result tensor.
DequantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, dataType uint32, axis int, name string) IMPSGraphTensor
// Creates a dequantize operation and returns the result tensor.
DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, axis int, name string) IMPSGraphTensor
// Creates a dequantize operation and returns the result tensor.
DequantizeTensorScaleTensorZeroPointTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, name string) IMPSGraphTensor
// Divides the first input tensor by the second.
DivisionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Divides the first input tensor by the second, with the result being 0 if the denominator is 0.
DivisionNoNaNWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a dropout operation and returns the result
DropoutTensorRateTensorName(tensor IMPSGraphTensor, rate IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a dropout operation and returns the result
DropoutTensorRateName(tensor IMPSGraphTensor, rate float64, name string) IMPSGraphTensor
// Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary, executionDescriptor IMPSGraphExecutionDescriptor)
// Encodes the graph for the given feeds to returns the target tensor values, ensuring all target operations also executed.
EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
// Returns the elementwise equality check of the input tensors.
EqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the error function to the input tensor elements.
ErfWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates an expand-dimensions operation and returns the result tensor.
ExpandDimsOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates an expand-dimensions operation and returns the result tensor.
ExpandDimsOfTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates an expand-dimensions operation and returns the result tensor.
ExpandDimsOfTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Applies the natural exponent to the input tensor elements.
ExponentWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies an exponent with base 10 to the input tensor elements.
ExponentBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies an exponent with base 2 to the input tensor elements.
ExponentBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a fast Fourier transform operation and returns the result tensor.
FastFourierTransformWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Creates a fast Fourier transform operation and returns the result tensor.
FastFourierTransformWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Creates a flatten2D operation and returns the result tensor.
Flatten2DTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a flatten2D operation and returns the result tensor.
Flatten2DTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the floor operation to the input tensor elements.
FloorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the remainder of floor divison between the primary and secondary tensor.
FloorModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Gather operation and returns the result tensor.
GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, axis uint, batchDimensions uint, name string) IMPSGraphTensor
// Creates a GatherAlongAxis operation and returns the result tensor.
GatherAlongAxisWithUpdatesTensorIndicesTensorName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a GatherAlongAxis operation and returns the result tensor.
GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a GatherND operation and returns the result tensor.
GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, batchDimensions uint, name string) IMPSGraphTensor
// Calculates a partial derivative of primaryTensor with respect to the tensors.
GradientForPrimaryTensorWithTensorsName(primaryTensor IMPSGraphTensor, tensors []MPSGraphTensor, name string) foundation.INSDictionary
// Checks in an elementwise manner if the first input tensor is greater than the second.
GreaterThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks in an elementwise manner if the first input tensor is greater than or equal to the second.
GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Copies the input tensor values into the output, behaving as an identity operation.
IdentityWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates an imToCol operation and returns the result tensor.
ImToColWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphImToColOpDescriptor, name string) IMPSGraphTensor
// Returns the imaginary part of a tensor.
ImaginaryPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the inverse of an input tensor.
InverseOfTensorName(inputTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks if the input tensor elements are finite or not.
IsFiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks if the input tensor elements are infinite or not.
IsInfiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks if the input tensor elements are [NaN] or not.
IsNaNWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
LeakyReLUWithTensorAlphaName(tensor IMPSGraphTensor, alpha float64, name string) IMPSGraphTensor
// Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
LeakyReLUWithTensorAlphaTensorName(tensor IMPSGraphTensor, alphaTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the gradient of the leaky rectified linear unit (ReLU) activation.
LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, alphaTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks in an elementwise manner if the first input tensor is less than the second.
LessThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Checks in an elementwise manner if the first input tensor is less than or equal to the second.
LessThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the natural logarithm to the input tensor elements.
LogarithmWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the logarithm with base 10 to the input tensor elements.
LogarithmBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the logarithm with base 2 to the input tensor elements.
LogarithmBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical AND of the input tensors.
LogicalANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical NAND of the input tensors.
LogicalNANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical NOR of the input tensors.
LogicalNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical OR of the input tensors.
LogicalORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical XNOR of the input tensors.
LogicalXNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise logical XOR of the input tensors.
LogicalXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the matrix multiplication of 2 input tensors with support for broadcasting.
MatrixMultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a 2D max-pooling operation and returns the result tensor.
MaxPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
// Creates a 2D max-pooling operation and returns the result tensor and the corresponding indices tensor.
MaxPooling2DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) []MPSGraphTensor
// Creates a 4D max-pooling operation and returns the result tensor.
MaxPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates a max-pooling gradient operation and returns the result tensor.
MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
// Creates a 4D max-pooling operation and returns the result tensor and the corresponding indices tensor.
MaxPooling4DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) []MPSGraphTensor
// Returns the elementwise maximum of the input tensors.
MaximumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise maximum of the input tensors, while propagating [NaN] values.
MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the mean of the first input along the specified axes.
MeanOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Returns the elementwise minimum of the input tensors.
MinimumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise minimum of the input tensors, while propagating [NaN] values.
MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the remainder obtained by dividing the first input tensor by the second.
ModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Multiplies two input tensors.
MultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies negative to the input tensor elements.
NegativeWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a nonMaximumumSuppression operation and returns the result tensor.
NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, classIndicesTensor IMPSGraphTensor, IOUThreshold float32, scoreThreshold float32, perClassSuppression bool, coordinateMode MPSGraphNonMaximumSuppressionCoordinateMode, name string) IMPSGraphTensor
// Creates a nonMaximumumSuppression operation and returns the result tensor.
NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, IOUThreshold float32, scoreThreshold float32, perClassSuppression bool, coordinateMode MPSGraphNonMaximumSuppressionCoordinateMode, name string) IMPSGraphTensor
// Computes the indices of the non-zero elements of the input tensor.
NonZeroIndicesOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a normalization beta-gradient operation and returns the result tensor.
NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a normalization gamma-gradient operation and returns the result tensor.
NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, meanTensor IMPSGraphTensor, varianceTensor IMPSGraphTensor, axes []foundation.NSNumber, epsilon float32, name string) IMPSGraphTensor
// Creates a normalization input gradient operation and returns the result tensor.
NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, meanTensor IMPSGraphTensor, varianceTensor IMPSGraphTensor, gamma IMPSGraphTensor, gammaGradient IMPSGraphTensor, betaGradient IMPSGraphTensor, axes []foundation.NSNumber, epsilon float32, name string) IMPSGraphTensor
// Creates a batch normalization operation and returns the result tensor.
NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(tensor IMPSGraphTensor, mean IMPSGraphTensor, variance IMPSGraphTensor, gamma IMPSGraphTensor, beta IMPSGraphTensor, epsilon float32, name string) IMPSGraphTensor
// Applies the logical NOT operation to the input tensor elements.
NotWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the elementwise inequality check of the input tensors.
NotEqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthAxisDataTypeName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, onValue float64, offValue float64, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthAxisName(indicesTensor IMPSGraphTensor, depth uint, axis uint, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthDataTypeName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, onValue float64, offValue float64, name string) IMPSGraphTensor
// Creates a oneHot operation and returns the result tensor.
OneHotWithIndicesTensorDepthName(indicesTensor IMPSGraphTensor, depth uint, name string) IMPSGraphTensor
// Creates a padding gradient operation and returns the result tensor.
PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, paddingMode MPSGraphPaddingMode, leftPadding foundation.NSArray, rightPadding foundation.NSArray, name string) IMPSGraphTensor
// Creates a padding operation and returns the result tensor.
PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName(tensor IMPSGraphTensor, paddingMode MPSGraphPaddingMode, leftPadding foundation.NSArray, rightPadding foundation.NSArray, constantValue float64, name string) IMPSGraphTensor
// Creates a placeholder operation and returns the result tensor.
PlaceholderWithShapeDataTypeName(shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
// Creates a placeholder operation and returns the result tensor with the dataType of the placeholder tensor set to 32 bit float.
PlaceholderWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
// Returns the elementwise result of raising the first tensor to the power of the second tensor.
PowerWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Quantize operation and returns the result tensor.
QuantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, name string) IMPSGraphTensor
// Creates a Quantize operation and returns the result tensor.
QuantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, dataType uint32, axis int, name string) IMPSGraphTensor
// Creates a Quantize operation and returns the result tensor.
QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, axis int, name string) IMPSGraphTensor
// Creates a tensor representing state using the Philox algorithm with given counter and key values.
RandomPhiloxStateTensorWithCounterLowCounterHighKeyName(counterLow uint, counterHigh uint, key uint, name string) IMPSGraphTensor
// Creates a tensor representing state using the Philox algorithm with given counter and key values.
RandomPhiloxStateTensorWithSeedName(seed uint, name string) IMPSGraphTensor
// Creates a Random op of type matching distribution in descriptor and returns random values.
RandomTensorWithShapeDescriptorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, name string) IMPSGraphTensor
// Creates a Random op of type matching distribution in descriptor and returns random values.
RandomTensorWithShapeDescriptorSeedName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, seed uint, name string) IMPSGraphTensor
// Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
RandomTensorWithShapeDescriptorStateTensorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, state IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a Random op of type matching distribution in descriptor and returns random values.
RandomTensorWithShapeTensorDescriptorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, name string) IMPSGraphTensor
// Creates a Random op of type matching distribution in descriptor and returns random values.
RandomTensorWithShapeTensorDescriptorSeedName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, seed uint, name string) IMPSGraphTensor
// Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
RandomTensorWithShapeTensorDescriptorStateTensorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, state IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values
RandomUniformTensorWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values
RandomUniformTensorWithShapeSeedName(shape foundation.NSArray, seed uint, name string) IMPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values and updated state
RandomUniformTensorWithShapeStateTensorName(shape foundation.NSArray, state IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values
RandomUniformTensorWithShapeTensorName(shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values
RandomUniformTensorWithShapeTensorSeedName(shapeTensor IMPSGraphTensor, seed uint, name string) IMPSGraphTensor
// Creates a RandomUniform operation and returns random uniform values and updated state
RandomUniformTensorWithShapeTensorStateTensorName(shapeTensor IMPSGraphTensor, state IMPSGraphTensor, name string) []MPSGraphTensor
// Computes the ReLU (rectified linear activation unit) function with the input tensor.
ReLUWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the gradient of the ReLU (rectified linear activation unit) function using the incoming gradient.
ReLUGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a read op which reads at this point of execution of the graph and returns the result tensor.
ReadVariableName(variable IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the real part of a tensor.
RealPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
RealToHermiteanFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
RealToHermiteanFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
// Applies the reciprocal operation to the input tensor elements.
ReciprocalWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the reciprocal square root operation to the input tensor elements.
ReciprocalSquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a reduction and operation and returns the result tensor.
ReductionAndWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction and operation and returns the result tensor.
ReductionAndWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction argMax operation and returns the result tensor.
ReductionArgMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction argMin operation and returns the result tensor.
ReductionArgMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction max operation and returns the result tensor.
ReductionMaximumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction max operation and returns the result tensor.
ReductionMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction max propagate NaN operation and returns the result tensor.
ReductionMaximumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction max propagate NaN operation and returns the result tensor.
ReductionMaximumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction min operation and returns the result tensor.
ReductionMinimumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction minimum operation and returns the result tensor.
ReductionMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction min propagate NaN operation and returns the result tensor.
ReductionMinimumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction min propagate NaN operation and returns the result tensor.
ReductionMinimumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction or operation and returns the result tensor.
ReductionOrWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction or operation and returns the result tensor.
ReductionOrWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction product operation and returns the result tensor.
ReductionProductWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction product operation and returns the result tensor.
ReductionProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reduction sum operation and returns the result tensor.
ReductionSumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reduction sum operation and returns the result tensor.
ReductionSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a reinterpret cast operation and returns the result tensor.
ReinterpretCastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
// Creates a reshape operation and returns the result tensor.
ReshapeTensorWithShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a reshape operation and returns the result tensor.
ReshapeTensorWithShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeTensorSizeModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size foundation.NSArray, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeTensorSizeTensorModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
// Resamples input images to given size using the provided scale and offset. Destination indices are computed using
ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, mode MPSGraphResizeMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeTensorSizeTensorScaleTensorOffsetTensorModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, mode MPSGraphResizeMode, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, mode MPSGraphResizeMode, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, mode MPSGraphResizeMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Resamples input images to given size using bilinear sampling.
ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
// Resamples input images to given size using the provided scale and offset and bilinear sampling See above discussion for more details.
ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Resamples input images to given size using nearest neighbor sampling.
ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
// Resamples input images to given size using the provided scale and offset and nearest neighbor sampling See above discussion for more details.
ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize operation and returns the result tensor.
ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, name string) IMPSGraphTensor
// Creates a Resize gradient operation and returns the result tensor.
ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
// Creates a reverse operation and returns the result tensor.
ReverseTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a reverse operation and returns the result tensor.
ReverseTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a reverse operation and returns the result tensor.
ReverseTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Rounds the input tensor elements by rounding to nearest even.
RintWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Rounds the input tensor elements.
RoundWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
RunWithFeedsTargetTensorsTargetOperations(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation) MPSGraphTensorDataDictionary
// Runs the graph for the given feeds and returns the target tensor values in the results dictionary provided by the user.
RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary)
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation) MPSGraphTensorDataDictionary
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
// Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary, executionDescriptor IMPSGraphExecutionDescriptor)
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
// Samples a tensor using the coordinates provided, using nearest neighbor sampling with specified rounding mode.
SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, normalizeCoordinates bool, relativeCoordinates bool, alignCorners bool, paddingMode MPSGraphPaddingMode, nearestRoundingMode MPSGraphResizeNearestRoundingMode, constantValue float64, name string) IMPSGraphTensor
// Samples a tensor using the coordinates provided.
SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, normalizeCoordinates bool, relativeCoordinates bool, alignCorners bool, paddingMode MPSGraphPaddingMode, samplingMode MPSGraphResizeMode, constantValue float64, name string) IMPSGraphTensor
// Creates a scaled dot product attention (SDPA) operation and returns the result tensor.
ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, maskTensor IMPSGraphTensor, scale float32, name string) IMPSGraphTensor
// Creates a scaled dot product attention (SDPA) operation (without a mask) and returns the result tensor.
ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, scale float32, name string) IMPSGraphTensor
// Creates a Scatter operation and returns the result tensor.
ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, axis int, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterAlongAxis operation and returns the result tensor.
ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName(axis int, dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterAlongAxis operation and returns the result tensor.
ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterAlongAxis operation and returns the result tensor.
ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName(axisTensor IMPSGraphTensor, dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterAlongAxis operation and returns the result tensor.
ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterND operation and returns the result tensor.
ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, batchDimensions uint, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a ScatterND operation and returns the result tensor.
ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, batchDimensions uint, name string) IMPSGraphTensor
// Creates a ScatterND operation and returns the result tensor.
ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, batchDimensions uint, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Creates a Scatter operation and returns the result tensor.
ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, axis int, mode MPSGraphScatterMode, name string) IMPSGraphTensor
// Selects values from either the true or false predicate tensor, depending on the values in the first input.
SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(predicateTensor IMPSGraphTensor, truePredicateTensor IMPSGraphTensor, falseSelectTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a shape-of operation and returns the result tensor.
ShapeOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the sigmoid operation on an input tensor.
SigmoidWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Computes the gradient of the sigmoid function using the incoming gradient tensor.
SigmoidGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the sign of the input tensor elements.
SignWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the sign bit of the input tensor elements.
SignbitWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the sine operation to the input tensor elements.
SinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Creates a single-gate RNN gradient operation and returns the gradient tensor values.
SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, stateGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
// Applies the hyperbolic sine operation to the input tensor elements.
SinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a strided-slice gradient operation and returns the result tensor.
SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, startTensor IMPSGraphTensor, endTensor IMPSGraphTensor, strideTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a slice gradient operation and returns the result tensor.
SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, startTensor IMPSGraphTensor, sizeTensor IMPSGraphTensor, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a strided-slice gradient operation and returns the result tensor.
SliceGradientTensorFwdInShapeTensorStartsEndsStridesName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a strided-slice gradient operation and returns the result tensor.
SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a slice operation and returns the result tensor.
SliceTensorDimensionStartLengthName(tensor IMPSGraphTensor, dimensionIndex uint, start int, length int, name string) IMPSGraphTensor
// Creates a strided-slice operation and returns the result tensor.
SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, endTensor IMPSGraphTensor, strideTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a slice operation and returns the result tensor.
SliceTensorStartTensorSizeTensorSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, sizeTensor IMPSGraphTensor, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a strided-slice operation and returns the result tensor.
SliceTensorStartsEndsStridesName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a strided-slice operation and returns the result tensor.
SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a strided-slice update operation with zero masks and returns the result tensor.
SliceUpdateDataTensorUpdateTensorStartsEndsStridesName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a strided-slice update operation and returns the result tensor.
SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Creates a strided-slice update operation with zero masks and returns the result tensor.
SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, startsTensor IMPSGraphTensor, endsTensor IMPSGraphTensor, stridesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a strided-slice update operation and returns the result tensor.
SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, startsTensor IMPSGraphTensor, endsTensor IMPSGraphTensor, stridesTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
// Computes the softmax function on the input tensor along the specified axis.
SoftMaxWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a softmax cross-entropy loss operation and returns the result tensor.
SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(sourceTensor IMPSGraphTensor, labelsTensor IMPSGraphTensor, axis int, reductionType MPSGraphLossReductionType, name string) IMPSGraphTensor
// Creates the gradient of a softmax cross-entropy loss operation and returns the result tensor.
SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(gradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, labelsTensor IMPSGraphTensor, axis int, reductionType MPSGraphLossReductionType, name string) IMPSGraphTensor
// Computes the gradient of the softmax function along the specified axis using the incoming gradient tensor.
SoftMaxGradientWithIncomingGradientSourceTensorAxisName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Sorts the elements of the input tensor along the specified axis.
SortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
// Sorts the elements of the input tensor along the specified axis.
SortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Sorts the elements of the input tensor along the specified axis.
SortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, name string) IMPSGraphTensor
// Sorts the elements of the input tensor along the specified axis.
SortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a space-to-depth2D operation and returns the result tensor.
SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a space-to-depth2D operation and returns the result tensor.
SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, heightAxisTensor IMPSGraphTensor, depthAxisTensor IMPSGraphTensor, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a space-to-batch operation and returns the result tensor.
SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, blockDimensions []foundation.NSNumber, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a space-to-batch operation and returns the result tensor.
SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, batchAxisTensor IMPSGraphTensor, blockDimensionsTensor IMPSGraphTensor, usePixelShuffleOrder bool, name string) IMPSGraphTensor
// Creates a sparse tensor representation.
SparseTensorWithDescriptorTensorsShapeName(sparseDescriptor IMPSGraphCreateSparseOpDescriptor, inputTensorArray []MPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
// Creates a sparse tensor representation.
SparseTensorWithTypeTensorsShapeDataTypeName(sparseStorageType MPSGraphSparseStorageType, inputTensorArray []MPSGraphTensor, shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
// Creates a split operation and returns the result tensor.
SplitTensorNumSplitsAxisName(tensor IMPSGraphTensor, numSplits uint, axis int, name string) []MPSGraphTensor
// Creates a split operation and returns the result tensor.
SplitTensorSplitSizesAxisName(tensor IMPSGraphTensor, splitSizes []foundation.NSNumber, axis int, name string) []MPSGraphTensor
// Creates a split operation and returns the result tensor.
SplitTensorSplitSizesTensorAxisName(tensor IMPSGraphTensor, splitSizesTensor IMPSGraphTensor, axis int, name string) []MPSGraphTensor
// Applies the square operation to the input tensor elements.
SquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the square root operation to the input tensor elements.
SquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a squeeze operation and returns the result tensor.
SqueezeTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a squeeze operation and returns the result tensor.
SqueezeTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a squeeze operation and returns the result tensor.
SqueezeTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a squeeze operation and returns the result tensor.
SqueezeTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a stack operation and returns the result tensor.
StackTensorsAxisName(inputTensors []MPSGraphTensor, axis int, name string) IMPSGraphTensor
// Creates a stencil operation and returns the result tensor.
StencilWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphStencilOpDescriptor, name string) IMPSGraphTensor
// The Stochastic gradient descent performs a gradient descent.
StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(learningRateTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Subtracts the second input tensor from the first.
SubtractionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the tangent operation to the input tensor elements.
TanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Applies the hyperbolic tangent operation to the input tensor elements.
TanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a tile gradient operation and returns the result tensor.
TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, multiplier foundation.NSArray, name string) IMPSGraphTensor
// Creates a tile operation and returns the result tensor.
TileTensorWithMultiplierName(tensor IMPSGraphTensor, multiplier foundation.NSArray, name string) IMPSGraphTensor
// Creates a TopK operation and returns the value and indices tensors.
TopKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
// Creates a TopK operation and returns the result tensor.
TopKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a TopK operation and returns the value and indices tensors
TopKWithSourceTensorKName(source IMPSGraphTensor, k uint, name string) []MPSGraphTensor
// Creates a TopK operation and returns the result tensor.
TopKWithSourceTensorKTensorName(source IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
// Creates a TopKGradient operation and returns the result tensor.
TopKWithGradientTensorSourceKName(gradient IMPSGraphTensor, source IMPSGraphTensor, k uint, name string) IMPSGraphTensor
// Creates a TopKGradient operation and returns the result tensor.
TopKWithGradientTensorSourceKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a TopKGradient operation and returns the result tensor.
TopKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, name string) IMPSGraphTensor
// Creates a TopKGradient operation and returns the result tensor.
TopKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a permutation operation and returns the result tensor.
TransposeTensorPermutationName(tensor IMPSGraphTensor, permutation []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a transpose operation and returns the result tensor.
TransposeTensorDimensionWithDimensionName(tensor IMPSGraphTensor, dimensionIndex uint, dimensionIndex2 uint, name string) IMPSGraphTensor
// Applies the truncate operation to the input tensor elements.
TruncateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Creates a variable operation and returns the result tensor.
VariableWithDataShapeDataTypeName(data foundation.NSData, shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
// Creates a variable from an input tensor.
VariableFromTensorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
// Returns the variance of the first input along the specified axes.
VarianceOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Returns the variance of the first input along the specified axes when the mean has been precomputed.
VarianceOfTensorMeanTensorAxesName(tensor IMPSGraphTensor, meanTensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
// Creates a scaled dot product attention (SDPA) operation using a descriptor and returns the result tensor.
ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorDescriptorName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, descriptor IMPSGraphSDPADescriptor, name string) IMPSGraphTensor
}
An interface definition for the MPSGraph class.
Instance Properties ¶
- IMPSGraph.Options: Options for the graph.
- IMPSGraph.SetOptions
- IMPSGraph.PlaceholderTensors: Array of all the placeholder tensors.
Instance Methods ¶
- IMPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- IMPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- IMPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- IMPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- IMPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- IMPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- IMPSGraph.HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName: Computes the hamming distance of two input tensors with support for broadcasting.
- IMPSGraph.HermiteanToRealFFTWithTensorAxesDescriptorName: Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
- IMPSGraph.HermiteanToRealFFTWithTensorAxesTensorDescriptorName: Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
- IMPSGraph.L2NormPooling4DWithSourceTensorDescriptorName: Creates a 4D L2-norm pooling operation and returns the result tensor.
- IMPSGraph.L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates a L2-Norm pooling gradient operation and returns the result tensor.
- IMPSGraph.LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- IMPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- IMPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- IMPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- IMPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- IMPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- IMPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- IMPSGraph.AbsoluteWithTensorName: Returns the absolute values of the input tensor elements.
- IMPSGraph.AbsoluteSquareWithTensorName: Returns the absolute square of the input tensor elements.
- IMPSGraph.AcosWithTensorName: Applies the inverse cosine operation to the input tensor elements.
- IMPSGraph.AcoshWithTensorName: Applies the inverse hyperbolic cosine operation to the input tensor elements.
- IMPSGraph.AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName: Creates operations to apply Adam optimization.
- IMPSGraph.AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName: Creates operations to apply Adam optimization.
- IMPSGraph.AdditionWithPrimaryTensorSecondaryTensorName: Adds two input tensors.
- IMPSGraph.ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName: The Stochastic gradient descent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable this op directly writes to the variable
- IMPSGraph.ArgSortWithTensorAxisDescendingName: Computes the indices that sort the elements of the input tensor along the specified axis.
- IMPSGraph.ArgSortWithTensorAxisName: Computes the indices that sort the elements of the input tensor along the specified axis.
- IMPSGraph.ArgSortWithTensorAxisTensorDescendingName: Computes the indices that sort the elements of the input tensor along the specified axis.
- IMPSGraph.ArgSortWithTensorAxisTensorName: Computes the indices that sort the elements of the input tensor along the specified axis.
- IMPSGraph.AsinWithTensorName: Applies the inverse sine operation to the input tensor elements.
- IMPSGraph.AsinhWithTensorName: Applies the inverse hyperbolic sine operation to the input tensor elements.
- IMPSGraph.AssignVariableWithValueOfTensorName: Creates an assign operation which writes at this point of execution of the graph.
- IMPSGraph.AtanWithTensorName: Applies the inverse tangent operation to the input tensor elements.
- IMPSGraph.Atan2WithPrimaryTensorSecondaryTensorName: Returns the elementwise two-argument arctangent of the input tensors.
- IMPSGraph.AtanhWithTensorName: Applies the inverse hyperbolic tangent operation to the input tensor elements.
- IMPSGraph.AvgPooling2DWithSourceTensorDescriptorName: Creates a 2D average-pooling operation and returns the result tensor.
- IMPSGraph.AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName: Creates a 2D average pooling gradient operation and returns the result tensor.
- IMPSGraph.AvgPooling4DWithSourceTensorDescriptorName: Creates a 4D average pooling operation and returns the result tensor.
- IMPSGraph.AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates an average pooling gradient operation and returns the result tensor.
- IMPSGraph.BandPartWithTensorNumLowerNumUpperName: Computes the band part of an input tensor.
- IMPSGraph.BandPartWithTensorNumLowerTensorNumUpperTensorName: Creates the band part operation and returns the result.
- IMPSGraph.BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName: Creates a batch-to-space operation and returns the result tensor.
- IMPSGraph.BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName: Creates a batch-to-space operation and returns the result tensor.
- IMPSGraph.BitwiseANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise AND of binary representations of two integer tensors.
- IMPSGraph.BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName: Returns the elementwise left-shifted binary representations of the primary integer by the secondary tensor amount.
- IMPSGraph.BitwiseNOTWithTensorName: Applies the bitwise NOT operation to the input tensor element.
- IMPSGraph.BitwiseORWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise OR of binary representations of two integer tensors.
- IMPSGraph.BitwisePopulationCountWithTensorName: Returns the population count of the input tensor elements.
- IMPSGraph.BitwiseRightShiftWithPrimaryTensorSecondaryTensorName: Returns the elementwise right-shifted binary representations of the primary integer by the secondary tensor amount.
- IMPSGraph.BitwiseXORWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise XOR of binary representations of two integer tensors.
- IMPSGraph.BottomKWithSourceTensorAxisKName: Creates a BottomK operation and returns the value and indices tensors.
- IMPSGraph.BottomKWithSourceTensorAxisTensorKTensorName: Creates a BottomK operation and returns the result tensor.
- IMPSGraph.BottomKWithGradientTensorSourceAxisKName: Creates a BottomKGradient operation and returns the result tensor.
- IMPSGraph.BottomKWithGradientTensorSourceAxisTensorKTensorName: Creates a BottomKGradient operation and returns the result tensor.
- IMPSGraph.BroadcastTensorToShapeName: Creates a broadcast operation and returns the result tensor.
- IMPSGraph.BroadcastTensorToShapeTensorName: Creates a broadcast operation and returns the result tensor.
- IMPSGraph.CallSymbolNameInputTensorsOutputTypesName: Creates an operation which invokes another executable.
- IMPSGraph.CastTensorToTypeName: Creates a cast operation and returns the result tensor.
- IMPSGraph.CeilWithTensorName: Applies the ceiling operation to the input tensor elements.
- IMPSGraph.ClampWithTensorMinValueTensorMaxValueTensorName: Clamps the values in the first tensor between the corresponding values in the minimum and maximum value tensor.
- IMPSGraph.ColToImWithSourceTensorOutputShapeDescriptorName: Creates a column to image operation and returns the result tensor.
- IMPSGraph.CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor: Compiles the graph for the given feeds to returns the target tensor values, ensuring all target operations would be executed.
- IMPSGraph.ConstantWithRealPartImaginaryPart: Creates a complex constant op with the MPSDataTypeComplexFloat32 data type and returns the result tensor.
- IMPSGraph.ConstantWithRealPartImaginaryPartDataType: Creates a complex constant operation and returns the result tensor.
- IMPSGraph.ConstantWithRealPartImaginaryPartShapeDataType: Creates a complex constant op with a given shape and returns the result tensor.
- IMPSGraph.ComplexTensorWithRealTensorImaginaryTensorName: Returns a complex tensor from the two input tensors.
- IMPSGraph.ConcatTensorWithTensorDimensionName: Creates a concatenation operation and returns the result tensor.
- IMPSGraph.ConcatTensorsDimensionInterleaveName: Creates a concatenation operation and returns the result tensor.
- IMPSGraph.ConcatTensorsDimensionName: Creates a concatenation operation and returns the result tensor.
- IMPSGraph.ConjugateWithTensorName: Returns the complex conjugate of the input tensor elements.
- IMPSGraph.ConstantWithScalarDataType: Creates a constant operation and returns the result tensor.
- IMPSGraph.ConstantWithScalarShapeDataType: Creates a constant op with a given shape and returns the result tensor.
- IMPSGraph.ConstantWithDataShapeDataType: Creates a constant op with a given shape and data, and returns the result tensor.
- IMPSGraph.Convolution2DWithSourceTensorWeightsTensorDescriptorName: Creates a 2D (forward) convolution operation and returns the result tensor.
- IMPSGraph.Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
- IMPSGraph.Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
- IMPSGraph.Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the weights tensor of the forward convolution.
- IMPSGraph.Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to weights tensor of forward convolution.
- IMPSGraph.Convolution3DWithSourceTensorWeightsTensorDescriptorName: Creates a 3D forward convolution operation and returns the result tensor.
- IMPSGraph.Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
- IMPSGraph.Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
- IMPSGraph.Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
- IMPSGraph.Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
- IMPSGraph.ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName: Creates a convolution transpose operation and returns the result tensor.
- IMPSGraph.ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName: Creates a convolution transpose operation and returns the result tensor.
- IMPSGraph.ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
- IMPSGraph.ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
- IMPSGraph.ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
- IMPSGraph.ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
- IMPSGraph.CoordinateAlongAxisWithShapeName: Creates a get-coordindate operation and returns the result tensor.
- IMPSGraph.CoordinateAlongAxisWithShapeTensorName: Creates a get-coordindate operation and returns the result tensor.
- IMPSGraph.CoordinateAlongAxisTensorWithShapeName: Creates a get-coordindate operation and returns the result tensor.
- IMPSGraph.CoordinateAlongAxisTensorWithShapeTensorName: Creates a get-coordindate operation and returns the result tensor.
- IMPSGraph.CosWithTensorName: Applies the cosine operation to the input tensor elements.
- IMPSGraph.CoshWithTensorName: Applies the hyperbolic cosine operation to the input tensor elements.
- IMPSGraph.CumulativeMaximumWithTensorAxisExclusiveReverseName: Computes the cumulative maximum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMaximumWithTensorAxisName: Computes the cumulative maximum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMaximumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative maximum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMaximumWithTensorAxisTensorName: Computes the cumulative maximum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMinimumWithTensorAxisExclusiveReverseName: Computes the cumulative minimum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMinimumWithTensorAxisName: Computes the cumulative minimum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMinimumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative minimum of the input tensor along the specified axis.
- IMPSGraph.CumulativeMinimumWithTensorAxisTensorName: Computes the cumulative minimum of the input tensor along the specified axis.
- IMPSGraph.CumulativeProductWithTensorAxisExclusiveReverseName: Computes the cumulative product of the input tensor along the specified axis.
- IMPSGraph.CumulativeProductWithTensorAxisName: Computes the cumulative product of the input tensor along the specified axis.
- IMPSGraph.CumulativeProductWithTensorAxisTensorExclusiveReverseName: Computes the cumulative product of the input tensor along the specified axis.
- IMPSGraph.CumulativeProductWithTensorAxisTensorName: Computes the cumulative product of the input tensor along the specified axis.
- IMPSGraph.CumulativeSumWithTensorAxisExclusiveReverseName: Computes the cumulative sum of the input tensor along the specified axis.
- IMPSGraph.CumulativeSumWithTensorAxisName: Computes the cumulative sum of the input tensor along the specified axis.
- IMPSGraph.CumulativeSumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative sum of the input tensor along the specified axis.
- IMPSGraph.CumulativeSumWithTensorAxisTensorName: Computes the cumulative sum of the input tensor along the specified axis.
- IMPSGraph.DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName: Creates a depth-to-space2D operation and returns the result tensor.
- IMPSGraph.DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName: Creates a depth-to-space2D operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName: Creates a 2D-depthwise convolution operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName: Creates a 2D-depthwise convolution gradient for data operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName: Creates a 2D-depthwise convolution gradient for weights operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName: Creates a 3D depthwise convolution operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName: Creates a 3D depthwise convolution gradient for data operation and returns the result tensor.
- IMPSGraph.DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName: Creates a 3D depthwise convolution gradient for weights operation and returns the result tensor.
- IMPSGraph.DequantizeTensorLUTTensorAxisName: Creates a vector lookup-table based quantization operation and returns the result tensor.
- IMPSGraph.DequantizeTensorLUTTensorName: Creates a lookup-table based quantization operation and returns the result tensor.
- IMPSGraph.DequantizeTensorScaleZeroPointDataTypeName: Creates Dequantize operation and returns the result tensor.
- IMPSGraph.DequantizeTensorScaleTensorDataTypeName: Creates a dequantize operation and returns the result tensor.
- IMPSGraph.DequantizeTensorScaleTensorZeroPointDataTypeAxisName: Creates Dequantize operation and returns the result tensor.
- IMPSGraph.DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName: Creates a dequantize operation and returns the result tensor.
- IMPSGraph.DequantizeTensorScaleTensorZeroPointTensorDataTypeName: Creates a dequantize operation and returns the result tensor.
- IMPSGraph.DivisionWithPrimaryTensorSecondaryTensorName: Divides the first input tensor by the second.
- IMPSGraph.DivisionNoNaNWithPrimaryTensorSecondaryTensorName: Divides the first input tensor by the second, with the result being 0 if the denominator is 0.
- IMPSGraph.DropoutTensorRateTensorName: Creates a dropout operation and returns the result
- IMPSGraph.DropoutTensorRateName: Creates a dropout operation and returns the result
- IMPSGraph.EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
- IMPSGraph.EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values, ensuring all target operations also executed.
- IMPSGraph.EqualWithPrimaryTensorSecondaryTensorName: Returns the elementwise equality check of the input tensors.
- IMPSGraph.ErfWithTensorName: Applies the error function to the input tensor elements.
- IMPSGraph.ExpandDimsOfTensorAxesName: Creates an expand-dimensions operation and returns the result tensor.
- IMPSGraph.ExpandDimsOfTensorAxesTensorName: Creates an expand-dimensions operation and returns the result tensor.
- IMPSGraph.ExpandDimsOfTensorAxisName: Creates an expand-dimensions operation and returns the result tensor.
- IMPSGraph.ExponentWithTensorName: Applies the natural exponent to the input tensor elements.
- IMPSGraph.ExponentBase10WithTensorName: Applies an exponent with base 10 to the input tensor elements.
- IMPSGraph.ExponentBase2WithTensorName: Applies an exponent with base 2 to the input tensor elements.
- IMPSGraph.FastFourierTransformWithTensorAxesDescriptorName: Creates a fast Fourier transform operation and returns the result tensor.
- IMPSGraph.FastFourierTransformWithTensorAxesTensorDescriptorName: Creates a fast Fourier transform operation and returns the result tensor.
- IMPSGraph.Flatten2DTensorAxisName: Creates a flatten2D operation and returns the result tensor.
- IMPSGraph.Flatten2DTensorAxisTensorName: Creates a flatten2D operation and returns the result tensor.
- IMPSGraph.FloorWithTensorName: Applies the floor operation to the input tensor elements.
- IMPSGraph.FloorModuloWithPrimaryTensorSecondaryTensorName: Returns the remainder of floor divison between the primary and secondary tensor.
- IMPSGraph.GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName: Creates a Gather operation and returns the result tensor.
- IMPSGraph.GatherAlongAxisWithUpdatesTensorIndicesTensorName: Creates a GatherAlongAxis operation and returns the result tensor.
- IMPSGraph.GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName: Creates a GatherAlongAxis operation and returns the result tensor.
- IMPSGraph.GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName: Creates a GatherND operation and returns the result tensor.
- IMPSGraph.GradientForPrimaryTensorWithTensorsName: Calculates a partial derivative of primaryTensor with respect to the tensors.
- IMPSGraph.GreaterThanWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is greater than the second.
- IMPSGraph.GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is greater than or equal to the second.
- IMPSGraph.IdentityWithTensorName: Copies the input tensor values into the output, behaving as an identity operation.
- IMPSGraph.ImToColWithSourceTensorDescriptorName: Creates an imToCol operation and returns the result tensor.
- IMPSGraph.ImaginaryPartOfTensorName: Returns the imaginary part of a tensor.
- IMPSGraph.InverseOfTensorName: Computes the inverse of an input tensor.
- IMPSGraph.IsFiniteWithTensorName: Checks if the input tensor elements are finite or not.
- IMPSGraph.IsInfiniteWithTensorName: Checks if the input tensor elements are infinite or not.
- IMPSGraph.IsNaNWithTensorName: Checks if the input tensor elements are [NaN] or not.
- IMPSGraph.LeakyReLUWithTensorAlphaName: Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
- IMPSGraph.LeakyReLUWithTensorAlphaTensorName: Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
- IMPSGraph.LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName: Computes the gradient of the leaky rectified linear unit (ReLU) activation.
- IMPSGraph.LessThanWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is less than the second.
- IMPSGraph.LessThanOrEqualToWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is less than or equal to the second.
- IMPSGraph.LogarithmWithTensorName: Computes the natural logarithm to the input tensor elements.
- IMPSGraph.LogarithmBase10WithTensorName: Computes the logarithm with base 10 to the input tensor elements.
- IMPSGraph.LogarithmBase2WithTensorName: Computes the logarithm with base 2 to the input tensor elements.
- IMPSGraph.LogicalANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical AND of the input tensors.
- IMPSGraph.LogicalNANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical NAND of the input tensors.
- IMPSGraph.LogicalNORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical NOR of the input tensors.
- IMPSGraph.LogicalORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical OR of the input tensors.
- IMPSGraph.LogicalXNORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical XNOR of the input tensors.
- IMPSGraph.LogicalXORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical XOR of the input tensors.
- IMPSGraph.MatrixMultiplicationWithPrimaryTensorSecondaryTensorName: Computes the matrix multiplication of 2 input tensors with support for broadcasting.
- IMPSGraph.MaxPooling2DWithSourceTensorDescriptorName: Creates a 2D max-pooling operation and returns the result tensor.
- IMPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName: Creates a 2D max-pooling operation and returns the result tensor and the corresponding indices tensor.
- IMPSGraph.MaxPooling4DWithSourceTensorDescriptorName: Creates a 4D max-pooling operation and returns the result tensor.
- IMPSGraph.MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- IMPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName: Creates a 4D max-pooling operation and returns the result tensor and the corresponding indices tensor.
- IMPSGraph.MaximumWithPrimaryTensorSecondaryTensorName: Returns the elementwise maximum of the input tensors.
- IMPSGraph.MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName: Returns the elementwise maximum of the input tensors, while propagating [NaN] values.
- IMPSGraph.MeanOfTensorAxesName: Returns the mean of the first input along the specified axes.
- IMPSGraph.MinimumWithPrimaryTensorSecondaryTensorName: Returns the elementwise minimum of the input tensors.
- IMPSGraph.MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName: Returns the elementwise minimum of the input tensors, while propagating [NaN] values.
- IMPSGraph.ModuloWithPrimaryTensorSecondaryTensorName: Returns the remainder obtained by dividing the first input tensor by the second.
- IMPSGraph.MultiplicationWithPrimaryTensorSecondaryTensorName: Multiplies two input tensors.
- IMPSGraph.NegativeWithTensorName: Applies negative to the input tensor elements.
- IMPSGraph.NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName: Creates a nonMaximumumSuppression operation and returns the result tensor.
- IMPSGraph.NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName: Creates a nonMaximumumSuppression operation and returns the result tensor.
- IMPSGraph.NonZeroIndicesOfTensorName: Computes the indices of the non-zero elements of the input tensor.
- IMPSGraph.NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName: Creates a normalization beta-gradient operation and returns the result tensor.
- IMPSGraph.NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName: Creates a normalization gamma-gradient operation and returns the result tensor.
- IMPSGraph.NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName: Creates a normalization input gradient operation and returns the result tensor.
- IMPSGraph.NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName: Creates a batch normalization operation and returns the result tensor.
- IMPSGraph.NotWithTensorName: Applies the logical NOT operation to the input tensor elements.
- IMPSGraph.NotEqualWithPrimaryTensorSecondaryTensorName: Returns the elementwise inequality check of the input tensors.
- IMPSGraph.OneHotWithIndicesTensorDepthAxisDataTypeName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.OneHotWithIndicesTensorDepthAxisName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.OneHotWithIndicesTensorDepthDataTypeName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.OneHotWithIndicesTensorDepthName: Creates a oneHot operation and returns the result tensor.
- IMPSGraph.PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName: Creates a padding gradient operation and returns the result tensor.
- IMPSGraph.PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName: Creates a padding operation and returns the result tensor.
- IMPSGraph.PlaceholderWithShapeDataTypeName: Creates a placeholder operation and returns the result tensor.
- IMPSGraph.PlaceholderWithShapeName: Creates a placeholder operation and returns the result tensor with the dataType of the placeholder tensor set to 32 bit float.
- IMPSGraph.PowerWithPrimaryTensorSecondaryTensorName: Returns the elementwise result of raising the first tensor to the power of the second tensor.
- IMPSGraph.QuantizeTensorScaleZeroPointDataTypeName: Creates a Quantize operation and returns the result tensor.
- IMPSGraph.QuantizeTensorScaleTensorZeroPointDataTypeAxisName: Creates a Quantize operation and returns the result tensor.
- IMPSGraph.QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName: Creates a Quantize operation and returns the result tensor.
- IMPSGraph.RandomPhiloxStateTensorWithCounterLowCounterHighKeyName: Creates a tensor representing state using the Philox algorithm with given counter and key values.
- IMPSGraph.RandomPhiloxStateTensorWithSeedName: Creates a tensor representing state using the Philox algorithm with given counter and key values.
- IMPSGraph.RandomTensorWithShapeDescriptorName: Creates a Random op of type matching distribution in descriptor and returns random values.
- IMPSGraph.RandomTensorWithShapeDescriptorSeedName: Creates a Random op of type matching distribution in descriptor and returns random values.
- IMPSGraph.RandomTensorWithShapeDescriptorStateTensorName: Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
- IMPSGraph.RandomTensorWithShapeTensorDescriptorName: Creates a Random op of type matching distribution in descriptor and returns random values.
- IMPSGraph.RandomTensorWithShapeTensorDescriptorSeedName: Creates a Random op of type matching distribution in descriptor and returns random values.
- IMPSGraph.RandomTensorWithShapeTensorDescriptorStateTensorName: Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
- IMPSGraph.RandomUniformTensorWithShapeName: Creates a RandomUniform operation and returns random uniform values
- IMPSGraph.RandomUniformTensorWithShapeSeedName: Creates a RandomUniform operation and returns random uniform values
- IMPSGraph.RandomUniformTensorWithShapeStateTensorName: Creates a RandomUniform operation and returns random uniform values and updated state
- IMPSGraph.RandomUniformTensorWithShapeTensorName: Creates a RandomUniform operation and returns random uniform values
- IMPSGraph.RandomUniformTensorWithShapeTensorSeedName: Creates a RandomUniform operation and returns random uniform values
- IMPSGraph.RandomUniformTensorWithShapeTensorStateTensorName: Creates a RandomUniform operation and returns random uniform values and updated state
- IMPSGraph.ReLUWithTensorName: Computes the ReLU (rectified linear activation unit) function with the input tensor.
- IMPSGraph.ReLUGradientWithIncomingGradientSourceTensorName: Computes the gradient of the ReLU (rectified linear activation unit) function using the incoming gradient.
- IMPSGraph.ReadVariableName: Creates a read op which reads at this point of execution of the graph and returns the result tensor.
- IMPSGraph.RealPartOfTensorName: Returns the real part of a tensor.
- IMPSGraph.RealToHermiteanFFTWithTensorAxesDescriptorName: Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
- IMPSGraph.RealToHermiteanFFTWithTensorAxesTensorDescriptorName: Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
- IMPSGraph.ReciprocalWithTensorName: Applies the reciprocal operation to the input tensor elements.
- IMPSGraph.ReciprocalSquareRootWithTensorName: Applies the reciprocal square root operation to the input tensor elements.
- IMPSGraph.ReductionAndWithTensorAxesName: Creates a reduction and operation and returns the result tensor.
- IMPSGraph.ReductionAndWithTensorAxisName: Creates a reduction and operation and returns the result tensor.
- IMPSGraph.ReductionArgMaximumWithTensorAxisName: Creates a reduction argMax operation and returns the result tensor.
- IMPSGraph.ReductionArgMinimumWithTensorAxisName: Creates a reduction argMin operation and returns the result tensor.
- IMPSGraph.ReductionMaximumWithTensorAxesName: Creates a reduction max operation and returns the result tensor.
- IMPSGraph.ReductionMaximumWithTensorAxisName: Creates a reduction max operation and returns the result tensor.
- IMPSGraph.ReductionMaximumPropagateNaNWithTensorAxesName: Creates a reduction max propagate NaN operation and returns the result tensor.
- IMPSGraph.ReductionMaximumPropagateNaNWithTensorAxisName: Creates a reduction max propagate NaN operation and returns the result tensor.
- IMPSGraph.ReductionMinimumWithTensorAxesName: Creates a reduction min operation and returns the result tensor.
- IMPSGraph.ReductionMinimumWithTensorAxisName: Creates a reduction minimum operation and returns the result tensor.
- IMPSGraph.ReductionMinimumPropagateNaNWithTensorAxesName: Creates a reduction min propagate NaN operation and returns the result tensor.
- IMPSGraph.ReductionMinimumPropagateNaNWithTensorAxisName: Creates a reduction min propagate NaN operation and returns the result tensor.
- IMPSGraph.ReductionOrWithTensorAxesName: Creates a reduction or operation and returns the result tensor.
- IMPSGraph.ReductionOrWithTensorAxisName: Creates a reduction or operation and returns the result tensor.
- IMPSGraph.ReductionProductWithTensorAxesName: Creates a reduction product operation and returns the result tensor.
- IMPSGraph.ReductionProductWithTensorAxisName: Creates a reduction product operation and returns the result tensor.
- IMPSGraph.ReductionSumWithTensorAxesName: Creates a reduction sum operation and returns the result tensor.
- IMPSGraph.ReductionSumWithTensorAxisName: Creates a reduction sum operation and returns the result tensor.
- IMPSGraph.ReinterpretCastTensorToTypeName: Creates a reinterpret cast operation and returns the result tensor.
- IMPSGraph.ReshapeTensorWithShapeName: Creates a reshape operation and returns the result tensor.
- IMPSGraph.ReshapeTensorWithShapeTensorName: Creates a reshape operation and returns the result tensor.
- IMPSGraph.ResizeTensorSizeModeCenterResultAlignCornersLayoutName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeTensorSizeTensorModeCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName: Resamples input images to given size using the provided scale and offset. Destination indices are computed using
- IMPSGraph.ResizeTensorSizeTensorScaleTensorOffsetTensorModeName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName: Resamples input images to given size using bilinear sampling.
- IMPSGraph.ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName: Resamples input images to given size using the provided scale and offset and bilinear sampling See above discussion for more details.
- IMPSGraph.ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName: Resamples input images to given size using nearest neighbor sampling.
- IMPSGraph.ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName: Resamples input images to given size using the provided scale and offset and nearest neighbor sampling See above discussion for more details.
- IMPSGraph.ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName: Creates a Resize operation and returns the result tensor.
- IMPSGraph.ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName: Creates a Resize gradient operation and returns the result tensor.
- IMPSGraph.ReverseTensorAxesName: Creates a reverse operation and returns the result tensor.
- IMPSGraph.ReverseTensorAxesTensorName: Creates a reverse operation and returns the result tensor.
- IMPSGraph.ReverseTensorName: Creates a reverse operation and returns the result tensor.
- IMPSGraph.RintWithTensorName: Rounds the input tensor elements by rounding to nearest even.
- IMPSGraph.RoundWithTensorName: Rounds the input tensor elements.
- IMPSGraph.RunWithFeedsTargetTensorsTargetOperations: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- IMPSGraph.RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary: Runs the graph for the given feeds and returns the target tensor values in the results dictionary provided by the user.
- IMPSGraph.RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- IMPSGraph.RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- IMPSGraph.RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
- IMPSGraph.RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- IMPSGraph.SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName: Samples a tensor using the coordinates provided, using nearest neighbor sampling with specified rounding mode.
- IMPSGraph.SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName: Samples a tensor using the coordinates provided.
- IMPSGraph.ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName: Creates a scaled dot product attention (SDPA) operation and returns the result tensor.
- IMPSGraph.ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName: Creates a scaled dot product attention (SDPA) operation (without a mask) and returns the result tensor.
- IMPSGraph.ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName: Creates a Scatter operation and returns the result tensor.
- IMPSGraph.ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- IMPSGraph.ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- IMPSGraph.ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- IMPSGraph.ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- IMPSGraph.ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName: Creates a ScatterND operation and returns the result tensor.
- IMPSGraph.ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName: Creates a ScatterND operation and returns the result tensor.
- IMPSGraph.ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName: Creates a ScatterND operation and returns the result tensor.
- IMPSGraph.ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName: Creates a Scatter operation and returns the result tensor.
- IMPSGraph.SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName: Selects values from either the true or false predicate tensor, depending on the values in the first input.
- IMPSGraph.ShapeOfTensorName: Creates a shape-of operation and returns the result tensor.
- IMPSGraph.SigmoidWithTensorName: Computes the sigmoid operation on an input tensor.
- IMPSGraph.SigmoidGradientWithIncomingGradientSourceTensorName: Computes the gradient of the sigmoid function using the incoming gradient tensor.
- IMPSGraph.SignWithTensorName: Returns the sign of the input tensor elements.
- IMPSGraph.SignbitWithTensorName: Returns the sign bit of the input tensor elements.
- IMPSGraph.SinWithTensorName: Applies the sine operation to the input tensor elements.
- IMPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- IMPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- IMPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- IMPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- IMPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- IMPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- IMPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- IMPSGraph.SinhWithTensorName: Applies the hyperbolic sine operation to the input tensor elements.
- IMPSGraph.SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice gradient operation and returns the result tensor.
- IMPSGraph.SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName: Creates a slice gradient operation and returns the result tensor.
- IMPSGraph.SliceGradientTensorFwdInShapeTensorStartsEndsStridesName: Creates a strided-slice gradient operation and returns the result tensor.
- IMPSGraph.SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice gradient operation and returns the result tensor.
- IMPSGraph.SliceTensorDimensionStartLengthName: Creates a slice operation and returns the result tensor.
- IMPSGraph.SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice operation and returns the result tensor.
- IMPSGraph.SliceTensorStartTensorSizeTensorSqueezeMaskName: Creates a slice operation and returns the result tensor.
- IMPSGraph.SliceTensorStartsEndsStridesName: Creates a strided-slice operation and returns the result tensor.
- IMPSGraph.SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice operation and returns the result tensor.
- IMPSGraph.SliceUpdateDataTensorUpdateTensorStartsEndsStridesName: Creates a strided-slice update operation with zero masks and returns the result tensor.
- IMPSGraph.SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice update operation and returns the result tensor.
- IMPSGraph.SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName: Creates a strided-slice update operation with zero masks and returns the result tensor.
- IMPSGraph.SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice update operation and returns the result tensor.
- IMPSGraph.SoftMaxWithTensorAxisName: Computes the softmax function on the input tensor along the specified axis.
- IMPSGraph.SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName: Creates a softmax cross-entropy loss operation and returns the result tensor.
- IMPSGraph.SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName: Creates the gradient of a softmax cross-entropy loss operation and returns the result tensor.
- IMPSGraph.SoftMaxGradientWithIncomingGradientSourceTensorAxisName: Computes the gradient of the softmax function along the specified axis using the incoming gradient tensor.
- IMPSGraph.SortWithTensorAxisDescendingName: Sorts the elements of the input tensor along the specified axis.
- IMPSGraph.SortWithTensorAxisName: Sorts the elements of the input tensor along the specified axis.
- IMPSGraph.SortWithTensorAxisTensorDescendingName: Sorts the elements of the input tensor along the specified axis.
- IMPSGraph.SortWithTensorAxisTensorName: Sorts the elements of the input tensor along the specified axis.
- IMPSGraph.SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName: Creates a space-to-depth2D operation and returns the result tensor.
- IMPSGraph.SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName: Creates a space-to-depth2D operation and returns the result tensor.
- IMPSGraph.SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName: Creates a space-to-batch operation and returns the result tensor.
- IMPSGraph.SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName: Creates a space-to-batch operation and returns the result tensor.
- IMPSGraph.SparseTensorWithDescriptorTensorsShapeName: Creates a sparse tensor representation.
- IMPSGraph.SparseTensorWithTypeTensorsShapeDataTypeName: Creates a sparse tensor representation.
- IMPSGraph.SplitTensorNumSplitsAxisName: Creates a split operation and returns the result tensor.
- IMPSGraph.SplitTensorSplitSizesAxisName: Creates a split operation and returns the result tensor.
- IMPSGraph.SplitTensorSplitSizesTensorAxisName: Creates a split operation and returns the result tensor.
- IMPSGraph.SquareWithTensorName: Applies the square operation to the input tensor elements.
- IMPSGraph.SquareRootWithTensorName: Applies the square root operation to the input tensor elements.
- IMPSGraph.SqueezeTensorAxesName: Creates a squeeze operation and returns the result tensor.
- IMPSGraph.SqueezeTensorAxesTensorName: Creates a squeeze operation and returns the result tensor.
- IMPSGraph.SqueezeTensorAxisName: Creates a squeeze operation and returns the result tensor.
- IMPSGraph.SqueezeTensorName: Creates a squeeze operation and returns the result tensor.
- IMPSGraph.StackTensorsAxisName: Creates a stack operation and returns the result tensor.
- IMPSGraph.StencilWithSourceTensorWeightsTensorDescriptorName: Creates a stencil operation and returns the result tensor.
- IMPSGraph.StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName: The Stochastic gradient descent performs a gradient descent.
- IMPSGraph.SubtractionWithPrimaryTensorSecondaryTensorName: Subtracts the second input tensor from the first.
- IMPSGraph.TanWithTensorName: Applies the tangent operation to the input tensor elements.
- IMPSGraph.TanhWithTensorName: Applies the hyperbolic tangent operation to the input tensor elements.
- IMPSGraph.TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName: Creates a tile gradient operation and returns the result tensor.
- IMPSGraph.TileTensorWithMultiplierName: Creates a tile operation and returns the result tensor.
- IMPSGraph.TopKWithSourceTensorAxisKName: Creates a TopK operation and returns the value and indices tensors.
- IMPSGraph.TopKWithSourceTensorAxisTensorKTensorName: Creates a TopK operation and returns the result tensor.
- IMPSGraph.TopKWithSourceTensorKName: Creates a TopK operation and returns the value and indices tensors
- IMPSGraph.TopKWithSourceTensorKTensorName: Creates a TopK operation and returns the result tensor.
- IMPSGraph.TopKWithGradientTensorSourceKName: Creates a TopKGradient operation and returns the result tensor.
- IMPSGraph.TopKWithGradientTensorSourceKTensorName: Creates a TopKGradient operation and returns the result tensor.
- IMPSGraph.TopKWithGradientTensorSourceAxisKName: Creates a TopKGradient operation and returns the result tensor.
- IMPSGraph.TopKWithGradientTensorSourceAxisTensorKTensorName: Creates a TopKGradient operation and returns the result tensor.
- IMPSGraph.TransposeTensorPermutationName: Creates a permutation operation and returns the result tensor.
- IMPSGraph.TransposeTensorDimensionWithDimensionName: Creates a transpose operation and returns the result tensor.
- IMPSGraph.TruncateWithTensorName: Applies the truncate operation to the input tensor elements.
- IMPSGraph.VariableWithDataShapeDataTypeName: Creates a variable operation and returns the result tensor.
- IMPSGraph.VariableFromTensorWithTensorName: Creates a variable from an input tensor.
- IMPSGraph.VarianceOfTensorAxesName: Returns the variance of the first input along the specified axes.
- IMPSGraph.VarianceOfTensorMeanTensorAxesName: Returns the variance of the first input along the specified axes when the mean has been precomputed.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph
type IMPSGraphCompilationDescriptor ¶
type IMPSGraphCompilationDescriptor interface {
IMPSGraphObject
// The dictionary used during runtime to lookup the [MPSGraphExecutable](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable>) which correspond to the `symbolName`.
Callables() MPSGraphCallableMap
SetCallables(value MPSGraphCallableMap)
// The handler that the graph calls when the compilation completes.
CompilationCompletionHandler() MPSGraphExecutableErrorHandler
SetCompilationCompletionHandler(value MPSGraphExecutableErrorHandler)
// The dispatch queue used for the compilation.
DispatchQueue() dispatch.Queue
SetDispatchQueue(value dispatch.Queue)
// The optimization level for the graph execution, default is MPSGraphOptimizationLevel1.
OptimizationLevel() MPSGraphOptimization
SetOptimizationLevel(value MPSGraphOptimization)
// The optimization profile for the graph optimization.
OptimizationProfile() MPSGraphOptimizationProfile
SetOptimizationProfile(value MPSGraphOptimizationProfile)
// Across the executable allow reduced precision fast math optimizations.
ReducedPrecisionFastMath() MPSGraphReducedPrecisionFastMath
SetReducedPrecisionFastMath(value MPSGraphReducedPrecisionFastMath)
// Flag that makes the compile or specialize call blocking till the entire compilation is complete, defaults to NO.
WaitForCompilationCompletion() bool
SetWaitForCompilationCompletion(value bool)
// Turns off type inference and relies on type inference during runtime.
DisableTypeInference()
}
An interface definition for the MPSGraphCompilationDescriptor class.
Instance Properties ¶
- IMPSGraphCompilationDescriptor.Callables: The dictionary used during runtime to lookup the MPSGraphExecutable(<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable>) which correspond to the `symbolName`.
- IMPSGraphCompilationDescriptor.SetCallables
- IMPSGraphCompilationDescriptor.CompilationCompletionHandler: The handler that the graph calls when the compilation completes.
- IMPSGraphCompilationDescriptor.SetCompilationCompletionHandler
- IMPSGraphCompilationDescriptor.DispatchQueue: The dispatch queue used for the compilation.
- IMPSGraphCompilationDescriptor.SetDispatchQueue
- IMPSGraphCompilationDescriptor.OptimizationLevel: The optimization level for the graph execution, default is MPSGraphOptimizationLevel1.
- IMPSGraphCompilationDescriptor.SetOptimizationLevel
- IMPSGraphCompilationDescriptor.OptimizationProfile: The optimization profile for the graph optimization.
- IMPSGraphCompilationDescriptor.SetOptimizationProfile
- IMPSGraphCompilationDescriptor.ReducedPrecisionFastMath: Across the executable allow reduced precision fast math optimizations.
- IMPSGraphCompilationDescriptor.SetReducedPrecisionFastMath
- IMPSGraphCompilationDescriptor.WaitForCompilationCompletion: Flag that makes the compile or specialize call blocking till the entire compilation is complete, defaults to NO.
- IMPSGraphCompilationDescriptor.SetWaitForCompilationCompletion
Instance Methods ¶
- IMPSGraphCompilationDescriptor.DisableTypeInference: Turns off type inference and relies on type inference during runtime.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphCompilationDescriptor
type IMPSGraphConvolution2DOpDescriptor ¶
type IMPSGraphConvolution2DOpDescriptor interface {
IMPSGraphObject
// The named layout of data in the source tensor.
DataLayout() MPSGraphTensorNamedDataLayout
SetDataLayout(value MPSGraphTensorNamedDataLayout)
// The amount by which the weights tensor expands in the `x`-direction.
DilationRateInX() uint
SetDilationRateInX(value uint)
// The amount by which the weights tensor expands in the `y`-direction.
DilationRateInY() uint
SetDilationRateInY(value uint)
// The number of partitions of the input and output channels.
Groups() uint
SetGroups(value uint)
// The number of zeros added at the bottom of the source tensor.
PaddingBottom() uint
SetPaddingBottom(value uint)
// The number of zeros added on the left side of the source tensor.
PaddingLeft() uint
SetPaddingLeft(value uint)
// The number of zeros added on the right side of the source tensor.
PaddingRight() uint
SetPaddingRight(value uint)
// The type of padding applied to the source tensor.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// The number of zeros added at the top of the source tensor.
PaddingTop() uint
SetPaddingTop(value uint)
// The scale that maps `x`-coordinate of the destination to `x`-coordinate of the source.
StrideInX() uint
SetStrideInX(value uint)
// The scale that maps `y`-coordinate of the destination to `y`-coordinate of the source.
StrideInY() uint
SetStrideInY(value uint)
// The named layout of data in the weights tensor.
WeightsLayout() MPSGraphTensorNamedDataLayout
SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
// Sets the left, right, top, and bottom padding values.
SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
}
An interface definition for the MPSGraphConvolution2DOpDescriptor class.
Instance Properties ¶
- IMPSGraphConvolution2DOpDescriptor.DataLayout: The named layout of data in the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetDataLayout
- IMPSGraphConvolution2DOpDescriptor.DilationRateInX: The amount by which the weights tensor expands in the `x`-direction.
- IMPSGraphConvolution2DOpDescriptor.SetDilationRateInX
- IMPSGraphConvolution2DOpDescriptor.DilationRateInY: The amount by which the weights tensor expands in the `y`-direction.
- IMPSGraphConvolution2DOpDescriptor.SetDilationRateInY
- IMPSGraphConvolution2DOpDescriptor.Groups: The number of partitions of the input and output channels.
- IMPSGraphConvolution2DOpDescriptor.SetGroups
- IMPSGraphConvolution2DOpDescriptor.PaddingBottom: The number of zeros added at the bottom of the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetPaddingBottom
- IMPSGraphConvolution2DOpDescriptor.PaddingLeft: The number of zeros added on the left side of the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetPaddingLeft
- IMPSGraphConvolution2DOpDescriptor.PaddingRight: The number of zeros added on the right side of the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetPaddingRight
- IMPSGraphConvolution2DOpDescriptor.PaddingStyle: The type of padding applied to the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetPaddingStyle
- IMPSGraphConvolution2DOpDescriptor.PaddingTop: The number of zeros added at the top of the source tensor.
- IMPSGraphConvolution2DOpDescriptor.SetPaddingTop
- IMPSGraphConvolution2DOpDescriptor.StrideInX: The scale that maps `x`-coordinate of the destination to `x`-coordinate of the source.
- IMPSGraphConvolution2DOpDescriptor.SetStrideInX
- IMPSGraphConvolution2DOpDescriptor.StrideInY: The scale that maps `y`-coordinate of the destination to `y`-coordinate of the source.
- IMPSGraphConvolution2DOpDescriptor.SetStrideInY
- IMPSGraphConvolution2DOpDescriptor.WeightsLayout: The named layout of data in the weights tensor.
- IMPSGraphConvolution2DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- IMPSGraphConvolution2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the left, right, top, and bottom padding values.
type IMPSGraphConvolution3DOpDescriptor ¶
type IMPSGraphConvolution3DOpDescriptor interface {
IMPSGraphObject
// The named layout of data in the source tensor.
DataLayout() MPSGraphTensorNamedDataLayout
SetDataLayout(value MPSGraphTensorNamedDataLayout)
// The amount by which weights tensor expands in the `x`-direction.
DilationRateInX() uint
SetDilationRateInX(value uint)
// The amount by which weights tensor expands in the `y`-direction.
DilationRateInY() uint
SetDilationRateInY(value uint)
// The amount by which weights tensor expands in the `z`-direction.
DilationRateInZ() uint
SetDilationRateInZ(value uint)
// The number of partitions of the input and output channels.
Groups() uint
SetGroups(value uint)
// The number of zeros added at the back of the source tensor.
PaddingBack() uint
SetPaddingBack(value uint)
// The number of zeros added at the bottom of the source tensor.
PaddingBottom() uint
SetPaddingBottom(value uint)
// The number of zeros added at the front of the source tensor.
PaddingFront() uint
SetPaddingFront(value uint)
// The number of zeros added on the left side of the source tensor.
PaddingLeft() uint
SetPaddingLeft(value uint)
// The number of zeros added on the right side of the source tensor.
PaddingRight() uint
SetPaddingRight(value uint)
// The type of padding that is applied to the source tensor.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// The number of zeros added at the top of the source tensor.
PaddingTop() uint
SetPaddingTop(value uint)
// The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
StrideInX() uint
SetStrideInX(value uint)
// The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
StrideInY() uint
SetStrideInY(value uint)
// The scale that maps`z`-coordinate of destination to `z`-coordinate of source.
StrideInZ() uint
SetStrideInZ(value uint)
// The named layout of data in the weights tensor.
WeightsLayout() MPSGraphTensorNamedDataLayout
SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
// Sets the left, right, top, bottom, front, and back padding values.
SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingFront uint, paddingBack uint)
}
An interface definition for the MPSGraphConvolution3DOpDescriptor class.
Instance Properties ¶
- IMPSGraphConvolution3DOpDescriptor.DataLayout: The named layout of data in the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetDataLayout
- IMPSGraphConvolution3DOpDescriptor.DilationRateInX: The amount by which weights tensor expands in the `x`-direction.
- IMPSGraphConvolution3DOpDescriptor.SetDilationRateInX
- IMPSGraphConvolution3DOpDescriptor.DilationRateInY: The amount by which weights tensor expands in the `y`-direction.
- IMPSGraphConvolution3DOpDescriptor.SetDilationRateInY
- IMPSGraphConvolution3DOpDescriptor.DilationRateInZ: The amount by which weights tensor expands in the `z`-direction.
- IMPSGraphConvolution3DOpDescriptor.SetDilationRateInZ
- IMPSGraphConvolution3DOpDescriptor.Groups: The number of partitions of the input and output channels.
- IMPSGraphConvolution3DOpDescriptor.SetGroups
- IMPSGraphConvolution3DOpDescriptor.PaddingBack: The number of zeros added at the back of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingBack
- IMPSGraphConvolution3DOpDescriptor.PaddingBottom: The number of zeros added at the bottom of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingBottom
- IMPSGraphConvolution3DOpDescriptor.PaddingFront: The number of zeros added at the front of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingFront
- IMPSGraphConvolution3DOpDescriptor.PaddingLeft: The number of zeros added on the left side of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingLeft
- IMPSGraphConvolution3DOpDescriptor.PaddingRight: The number of zeros added on the right side of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingRight
- IMPSGraphConvolution3DOpDescriptor.PaddingStyle: The type of padding that is applied to the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingStyle
- IMPSGraphConvolution3DOpDescriptor.PaddingTop: The number of zeros added at the top of the source tensor.
- IMPSGraphConvolution3DOpDescriptor.SetPaddingTop
- IMPSGraphConvolution3DOpDescriptor.StrideInX: The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
- IMPSGraphConvolution3DOpDescriptor.SetStrideInX
- IMPSGraphConvolution3DOpDescriptor.StrideInY: The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
- IMPSGraphConvolution3DOpDescriptor.SetStrideInY
- IMPSGraphConvolution3DOpDescriptor.StrideInZ: The scale that maps`z`-coordinate of destination to `z`-coordinate of source.
- IMPSGraphConvolution3DOpDescriptor.SetStrideInZ
- IMPSGraphConvolution3DOpDescriptor.WeightsLayout: The named layout of data in the weights tensor.
- IMPSGraphConvolution3DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- IMPSGraphConvolution3DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack: Sets the left, right, top, bottom, front, and back padding values.
type IMPSGraphCreateSparseOpDescriptor ¶
type IMPSGraphCreateSparseOpDescriptor interface {
IMPSGraphObject
// Defines the datatype of the sparse tensor.
DataType() uint32
SetDataType(value uint32)
// Defines the storage format of the sparse tensor.
SparseStorageType() MPSGraphSparseStorageType
SetSparseStorageType(value MPSGraphSparseStorageType)
}
An interface definition for the MPSGraphCreateSparseOpDescriptor class.
Instance Properties ¶
- IMPSGraphCreateSparseOpDescriptor.DataType: Defines the datatype of the sparse tensor.
- IMPSGraphCreateSparseOpDescriptor.SetDataType
- IMPSGraphCreateSparseOpDescriptor.SparseStorageType: Defines the storage format of the sparse tensor.
- IMPSGraphCreateSparseOpDescriptor.SetSparseStorageType
type IMPSGraphDepthwiseConvolution2DOpDescriptor ¶
type IMPSGraphDepthwiseConvolution2DOpDescriptor interface {
IMPSGraphObject
// The data layout of the input data in the forward pass.
DataLayout() MPSGraphTensorNamedDataLayout
SetDataLayout(value MPSGraphTensorNamedDataLayout)
// The dilation rate for the x dimension.
DilationRateInX() uint
SetDilationRateInX(value uint)
// The dilation rate for the y dimension.
DilationRateInY() uint
SetDilationRateInY(value uint)
// The explicit padding value for the y dimension operation adds after the data.
PaddingBottom() uint
SetPaddingBottom(value uint)
// The explicit padding value for the x dimension the operation adds before the data.
PaddingLeft() uint
SetPaddingLeft(value uint)
// The explicit padding value for the x dimension operation adds after the data.
PaddingRight() uint
SetPaddingRight(value uint)
// The padding style for the operation.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// The explicit padding value for the y dimension operation adds before the data.
PaddingTop() uint
SetPaddingTop(value uint)
// The stride for the x dimension.
StrideInX() uint
SetStrideInX(value uint)
// The stride for the y dimension.
StrideInY() uint
SetStrideInY(value uint)
// The data layout of the weights.
WeightsLayout() MPSGraphTensorNamedDataLayout
SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
// Sets the explicit padding values.
SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
}
An interface definition for the MPSGraphDepthwiseConvolution2DOpDescriptor class.
Instance Properties ¶
- IMPSGraphDepthwiseConvolution2DOpDescriptor.DataLayout: The data layout of the input data in the forward pass.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetDataLayout
- IMPSGraphDepthwiseConvolution2DOpDescriptor.DilationRateInX: The dilation rate for the x dimension.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetDilationRateInX
- IMPSGraphDepthwiseConvolution2DOpDescriptor.DilationRateInY: The dilation rate for the y dimension.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetDilationRateInY
- IMPSGraphDepthwiseConvolution2DOpDescriptor.PaddingBottom: The explicit padding value for the y dimension operation adds after the data.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingBottom
- IMPSGraphDepthwiseConvolution2DOpDescriptor.PaddingLeft: The explicit padding value for the x dimension the operation adds before the data.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingLeft
- IMPSGraphDepthwiseConvolution2DOpDescriptor.PaddingRight: The explicit padding value for the x dimension operation adds after the data.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingRight
- IMPSGraphDepthwiseConvolution2DOpDescriptor.PaddingStyle: The padding style for the operation.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingStyle
- IMPSGraphDepthwiseConvolution2DOpDescriptor.PaddingTop: The explicit padding value for the y dimension operation adds before the data.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingTop
- IMPSGraphDepthwiseConvolution2DOpDescriptor.StrideInX: The stride for the x dimension.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetStrideInX
- IMPSGraphDepthwiseConvolution2DOpDescriptor.StrideInY: The stride for the y dimension.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetStrideInY
- IMPSGraphDepthwiseConvolution2DOpDescriptor.WeightsLayout: The data layout of the weights.
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- IMPSGraphDepthwiseConvolution2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the explicit padding values.
type IMPSGraphDepthwiseConvolution3DOpDescriptor ¶
type IMPSGraphDepthwiseConvolution3DOpDescriptor interface {
IMPSGraphObject
// The axis that contains the channels in the input and the weights, within the 4D tile of the last dimensions.
ChannelDimensionIndex() int
SetChannelDimensionIndex(value int)
// The dilation rates for spatial dimensions.
DilationRates() []foundation.NSNumber
SetDilationRates(value []foundation.NSNumber)
// The padding style for the operation.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// The padding values for spatial dimensions.
PaddingValues() []foundation.NSNumber
SetPaddingValues(value []foundation.NSNumber)
// The strides for spatial dimensions.
Strides() []foundation.NSNumber
SetStrides(value []foundation.NSNumber)
}
An interface definition for the MPSGraphDepthwiseConvolution3DOpDescriptor class.
Instance Properties ¶
- IMPSGraphDepthwiseConvolution3DOpDescriptor.ChannelDimensionIndex: The axis that contains the channels in the input and the weights, within the 4D tile of the last dimensions.
- IMPSGraphDepthwiseConvolution3DOpDescriptor.SetChannelDimensionIndex
- IMPSGraphDepthwiseConvolution3DOpDescriptor.DilationRates: The dilation rates for spatial dimensions.
- IMPSGraphDepthwiseConvolution3DOpDescriptor.SetDilationRates
- IMPSGraphDepthwiseConvolution3DOpDescriptor.PaddingStyle: The padding style for the operation.
- IMPSGraphDepthwiseConvolution3DOpDescriptor.SetPaddingStyle
- IMPSGraphDepthwiseConvolution3DOpDescriptor.PaddingValues: The padding values for spatial dimensions.
- IMPSGraphDepthwiseConvolution3DOpDescriptor.SetPaddingValues
- IMPSGraphDepthwiseConvolution3DOpDescriptor.Strides: The strides for spatial dimensions.
- IMPSGraphDepthwiseConvolution3DOpDescriptor.SetStrides
type IMPSGraphDevice ¶
type IMPSGraphDevice interface {
IMPSGraphObject
// If device type is Metal then returns the corresponding MTLDevice else nil.
MetalDevice() metal.MTLDevice
// Device of the MPSGraphDevice.
Type() MPSGraphDeviceType
}
An interface definition for the MPSGraphDevice class.
Instance Properties ¶
- IMPSGraphDevice.MetalDevice: If device type is Metal then returns the corresponding MTLDevice else nil.
- IMPSGraphDevice.Type: Device of the MPSGraphDevice.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDevice
type IMPSGraphExecutable ¶
type IMPSGraphExecutable interface {
IMPSGraphObject
// Initialize the executable with the Core ML model package at the provided URL.
InitWithCoreMLPackageAtURLCompilationDescriptor(coreMLPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
// Initialize the executable with the Metal Performance Shaders Graph package at the provided URL.
InitWithMPSGraphPackageAtURLCompilationDescriptor(mpsgraphPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
// Tensors fed to the graph, can be used to order the inputs when executable is created with a graph.
FeedTensors() []MPSGraphTensor
// Options for the graph executable.
Options() MPSGraphOptions
SetOptions(value MPSGraphOptions)
// Tensors targeted by the graph, can be used to order the outputs when executable was created with a graph.
TargetTensors() []MPSGraphTensor
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately after finishing encoding.
EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
// Get output shapes for a specialized executable.
GetOutputTypesWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, compilationDescriptor IMPSGraphCompilationDescriptor) []MPSGraphShapedType
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
// Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately.
RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
// Serialize the MPSGraph executable at the provided url.
SerializeToMPSGraphPackageAtURLDescriptor(url foundation.NSURL, descriptor IMPSGraphExecutableSerializationDescriptor)
// Specialize the executable and optimize it.
SpecializeWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, compilationDescriptor IMPSGraphCompilationDescriptor)
}
An interface definition for the MPSGraphExecutable class.
Initializers ¶
- IMPSGraphExecutable.InitWithCoreMLPackageAtURLCompilationDescriptor: Initialize the executable with the Core ML model package at the provided URL.
- IMPSGraphExecutable.InitWithMPSGraphPackageAtURLCompilationDescriptor: Initialize the executable with the Metal Performance Shaders Graph package at the provided URL.
Instance Properties ¶
- IMPSGraphExecutable.FeedTensors: Tensors fed to the graph, can be used to order the inputs when executable is created with a graph.
- IMPSGraphExecutable.Options: Options for the graph executable.
- IMPSGraphExecutable.SetOptions
- IMPSGraphExecutable.TargetTensors: Tensors targeted by the graph, can be used to order the outputs when executable was created with a graph.
Instance Methods ¶
- IMPSGraphExecutable.EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately after finishing encoding.
- IMPSGraphExecutable.GetOutputTypesWithDeviceInputTypesCompilationDescriptor: Get output shapes for a specialized executable.
- IMPSGraphExecutable.RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- IMPSGraphExecutable.RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately.
- IMPSGraphExecutable.SerializeToMPSGraphPackageAtURLDescriptor: Serialize the MPSGraph executable at the provided url.
- IMPSGraphExecutable.SpecializeWithDeviceInputTypesCompilationDescriptor: Specialize the executable and optimize it.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable
type IMPSGraphExecutableExecutionDescriptor ¶
type IMPSGraphExecutableExecutionDescriptor interface {
IMPSGraphObject
// A notification that appears when graph-executable execution is finished.
CompletionHandler() MPSGraphTensorDataArrayErrorHandler
SetCompletionHandler(value MPSGraphTensorDataArrayErrorHandler)
// A notification that appears when graph-executable execution is scheduled.
ScheduledHandler() MPSGraphTensorDataArrayErrorHandler
SetScheduledHandler(value MPSGraphTensorDataArrayErrorHandler)
// Flag for the graph executable to wait till the execution has completed.
WaitUntilCompleted() bool
SetWaitUntilCompleted(value bool)
// Signals these shared events at execution stage and immediately proceeds.
SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, value uint64)
// Waits on these shared events before scheduling execution on the HW.
WaitForEventValue(event metal.MTLSharedEvent, value uint64)
}
An interface definition for the MPSGraphExecutableExecutionDescriptor class.
Instance Properties ¶
- IMPSGraphExecutableExecutionDescriptor.CompletionHandler: A notification that appears when graph-executable execution is finished.
- IMPSGraphExecutableExecutionDescriptor.SetCompletionHandler
- IMPSGraphExecutableExecutionDescriptor.ScheduledHandler: A notification that appears when graph-executable execution is scheduled.
- IMPSGraphExecutableExecutionDescriptor.SetScheduledHandler
- IMPSGraphExecutableExecutionDescriptor.WaitUntilCompleted: Flag for the graph executable to wait till the execution has completed.
- IMPSGraphExecutableExecutionDescriptor.SetWaitUntilCompleted
Instance Methods ¶
- IMPSGraphExecutableExecutionDescriptor.SignalEventAtExecutionEventValue: Signals these shared events at execution stage and immediately proceeds.
- IMPSGraphExecutableExecutionDescriptor.WaitForEventValue: Waits on these shared events before scheduling execution on the HW.
type IMPSGraphExecutableSerializationDescriptor ¶
type IMPSGraphExecutableSerializationDescriptor interface {
IMPSGraphObject
// Flag to append to an existing .mpsgraphpackage if found at provided url.
Append() bool
SetAppend(value bool)
// The deployment platform used to serialize the executable.
DeploymentPlatform() MPSGraphDeploymentPlatform
SetDeploymentPlatform(value MPSGraphDeploymentPlatform)
// The minimum deployment target to serialize the executable.
MinimumDeploymentTarget() string
SetMinimumDeploymentTarget(value string)
}
An interface definition for the MPSGraphExecutableSerializationDescriptor class.
Instance Properties ¶
- IMPSGraphExecutableSerializationDescriptor.Append: Flag to append to an existing .mpsgraphpackage if found at provided url.
- IMPSGraphExecutableSerializationDescriptor.SetAppend
- IMPSGraphExecutableSerializationDescriptor.DeploymentPlatform: The deployment platform used to serialize the executable.
- IMPSGraphExecutableSerializationDescriptor.SetDeploymentPlatform
- IMPSGraphExecutableSerializationDescriptor.MinimumDeploymentTarget: The minimum deployment target to serialize the executable.
- IMPSGraphExecutableSerializationDescriptor.SetMinimumDeploymentTarget
type IMPSGraphExecutionDescriptor ¶
type IMPSGraphExecutionDescriptor interface {
IMPSGraphObject
// The compilation descriptor for the graph.
CompilationDescriptor() IMPSGraphCompilationDescriptor
SetCompilationDescriptor(value IMPSGraphCompilationDescriptor)
// The handler that graph calls at the completion of the execution.
CompletionHandler() MPSGraphCompletionHandler
SetCompletionHandler(value objc.ID)
// The handler that graph calls when it schedules the execution.
ScheduledHandler() MPSGraphScheduledHandler
SetScheduledHandler(value objc.ID)
// The flag that blocks the execution call until the entire execution is complete.
WaitUntilCompleted() bool
SetWaitUntilCompleted(value bool)
// Executable signals these shared events at execution stage and immediately proceeds.
SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, value uint64)
// Executable waits on these shared events before scheduling execution on the HW, this does not include encoding which can still continue.
WaitForEventValue(event metal.MTLSharedEvent, value uint64)
}
An interface definition for the MPSGraphExecutionDescriptor class.
Instance Properties ¶
- IMPSGraphExecutionDescriptor.CompilationDescriptor: The compilation descriptor for the graph.
- IMPSGraphExecutionDescriptor.SetCompilationDescriptor
- IMPSGraphExecutionDescriptor.CompletionHandler: The handler that graph calls at the completion of the execution.
- IMPSGraphExecutionDescriptor.SetCompletionHandler
- IMPSGraphExecutionDescriptor.ScheduledHandler: The handler that graph calls when it schedules the execution.
- IMPSGraphExecutionDescriptor.SetScheduledHandler
- IMPSGraphExecutionDescriptor.WaitUntilCompleted: The flag that blocks the execution call until the entire execution is complete.
- IMPSGraphExecutionDescriptor.SetWaitUntilCompleted
Instance Methods ¶
- IMPSGraphExecutionDescriptor.SignalEventAtExecutionEventValue: Executable signals these shared events at execution stage and immediately proceeds.
- IMPSGraphExecutionDescriptor.WaitForEventValue: Executable waits on these shared events before scheduling execution on the HW, this does not include encoding which can still continue.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutionDescriptor
type IMPSGraphFFTDescriptor ¶
type IMPSGraphFFTDescriptor interface {
IMPSGraphObject
// A Boolean-valued parameter that defines the phase factor sign for Fourier transforms.
Inverse() bool
SetInverse(value bool)
// A parameter which controls how graph rounds the output tensor size for a Hermitean-to-real Fourier transform.
RoundToOddHermitean() bool
SetRoundToOddHermitean(value bool)
// The scaling mode of the fast fourier transform (FFT) operation.
ScalingMode() MPSGraphFFTScalingMode
SetScalingMode(value MPSGraphFFTScalingMode)
}
An interface definition for the MPSGraphFFTDescriptor class.
Instance Properties ¶
- IMPSGraphFFTDescriptor.Inverse: A Boolean-valued parameter that defines the phase factor sign for Fourier transforms.
- IMPSGraphFFTDescriptor.SetInverse
- IMPSGraphFFTDescriptor.RoundToOddHermitean: A parameter which controls how graph rounds the output tensor size for a Hermitean-to-real Fourier transform.
- IMPSGraphFFTDescriptor.SetRoundToOddHermitean
- IMPSGraphFFTDescriptor.ScalingMode: The scaling mode of the fast fourier transform (FFT) operation.
- IMPSGraphFFTDescriptor.SetScalingMode
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphFFTDescriptor
type IMPSGraphGRUDescriptor ¶
type IMPSGraphGRUDescriptor interface {
IMPSGraphObject
// A parameter that defines a bidirectional GRU layer.
Bidirectional() bool
SetBidirectional(value bool)
// A parameter that chooses between two variants for the final output computation.
FlipZ() bool
SetFlipZ(value bool)
// A parameter that defines the activation function to use with the output-gate of the GRU operation.
OutputGateActivation() MPSGraphRNNActivation
SetOutputGateActivation(value MPSGraphRNNActivation)
// A parameter that chooses between two variants for the reset gate computation.
ResetAfter() bool
SetResetAfter(value bool)
// A parameter that defines the activation function to use with the reset-gate of the GRU operation.
ResetGateActivation() MPSGraphRNNActivation
SetResetGateActivation(value MPSGraphRNNActivation)
// A parameter that controls the internal order of the GRU gates.
ResetGateFirst() bool
SetResetGateFirst(value bool)
// A parameter that defines the time direction of the input sequence.
Reverse() bool
SetReverse(value bool)
// A parameter that enables the GRU layer to support training.
Training() bool
SetTraining(value bool)
// A parameter that defines the activation function to use with the update-gate of the GRU operation.
UpdateGateActivation() MPSGraphRNNActivation
SetUpdateGateActivation(value MPSGraphRNNActivation)
}
An interface definition for the MPSGraphGRUDescriptor class.
Instance Properties ¶
- IMPSGraphGRUDescriptor.Bidirectional: A parameter that defines a bidirectional GRU layer.
- IMPSGraphGRUDescriptor.SetBidirectional
- IMPSGraphGRUDescriptor.FlipZ: A parameter that chooses between two variants for the final output computation.
- IMPSGraphGRUDescriptor.SetFlipZ
- IMPSGraphGRUDescriptor.OutputGateActivation: A parameter that defines the activation function to use with the output-gate of the GRU operation.
- IMPSGraphGRUDescriptor.SetOutputGateActivation
- IMPSGraphGRUDescriptor.ResetAfter: A parameter that chooses between two variants for the reset gate computation.
- IMPSGraphGRUDescriptor.SetResetAfter
- IMPSGraphGRUDescriptor.ResetGateActivation: A parameter that defines the activation function to use with the reset-gate of the GRU operation.
- IMPSGraphGRUDescriptor.SetResetGateActivation
- IMPSGraphGRUDescriptor.ResetGateFirst: A parameter that controls the internal order of the GRU gates.
- IMPSGraphGRUDescriptor.SetResetGateFirst
- IMPSGraphGRUDescriptor.Reverse: A parameter that defines the time direction of the input sequence.
- IMPSGraphGRUDescriptor.SetReverse
- IMPSGraphGRUDescriptor.Training: A parameter that enables the GRU layer to support training.
- IMPSGraphGRUDescriptor.SetTraining
- IMPSGraphGRUDescriptor.UpdateGateActivation: A parameter that defines the activation function to use with the update-gate of the GRU operation.
- IMPSGraphGRUDescriptor.SetUpdateGateActivation
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphGRUDescriptor
type IMPSGraphImToColOpDescriptor ¶
type IMPSGraphImToColOpDescriptor interface {
IMPSGraphObject
// The property that defines the layout of source or output tensor. e.g. `batch x channels x width x height` for [NCHW] layout
DataLayout() MPSGraphTensorNamedDataLayout
SetDataLayout(value MPSGraphTensorNamedDataLayout)
// The property that defines the dilation in width dimension.
DilationRateInX() uint
SetDilationRateInX(value uint)
// The property that defines the dilation in height dimension.
DilationRateInY() uint
SetDilationRateInY(value uint)
// The property that defines the kernel size in height dimension.
KernelHeight() uint
SetKernelHeight(value uint)
// The property that defines the kernel size in width dimension.
KernelWidth() uint
SetKernelWidth(value uint)
// The property that defines the padding in height dimension at the bottom.
PaddingBottom() uint
SetPaddingBottom(value uint)
// The property that defines the padding in width dimension on the left side.
PaddingLeft() uint
SetPaddingLeft(value uint)
// The property that defines the padding in width dimension on the right side.
PaddingRight() uint
SetPaddingRight(value uint)
// The property that defines the padding in height dimension at the top.
PaddingTop() uint
SetPaddingTop(value uint)
// The property that defines the stride in width dimension.
StrideInX() uint
SetStrideInX(value uint)
// The property that defines the stride in height dimension.
StrideInY() uint
SetStrideInY(value uint)
// Sets the descriptor’s padding to the given values.
SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
}
An interface definition for the MPSGraphImToColOpDescriptor class.
Instance Properties ¶
- IMPSGraphImToColOpDescriptor.DataLayout: The property that defines the layout of source or output tensor. e.g. `batch x channels x width x height` for [NCHW] layout
- IMPSGraphImToColOpDescriptor.SetDataLayout
- IMPSGraphImToColOpDescriptor.DilationRateInX: The property that defines the dilation in width dimension.
- IMPSGraphImToColOpDescriptor.SetDilationRateInX
- IMPSGraphImToColOpDescriptor.DilationRateInY: The property that defines the dilation in height dimension.
- IMPSGraphImToColOpDescriptor.SetDilationRateInY
- IMPSGraphImToColOpDescriptor.KernelHeight: The property that defines the kernel size in height dimension.
- IMPSGraphImToColOpDescriptor.SetKernelHeight
- IMPSGraphImToColOpDescriptor.KernelWidth: The property that defines the kernel size in width dimension.
- IMPSGraphImToColOpDescriptor.SetKernelWidth
- IMPSGraphImToColOpDescriptor.PaddingBottom: The property that defines the padding in height dimension at the bottom.
- IMPSGraphImToColOpDescriptor.SetPaddingBottom
- IMPSGraphImToColOpDescriptor.PaddingLeft: The property that defines the padding in width dimension on the left side.
- IMPSGraphImToColOpDescriptor.SetPaddingLeft
- IMPSGraphImToColOpDescriptor.PaddingRight: The property that defines the padding in width dimension on the right side.
- IMPSGraphImToColOpDescriptor.SetPaddingRight
- IMPSGraphImToColOpDescriptor.PaddingTop: The property that defines the padding in height dimension at the top.
- IMPSGraphImToColOpDescriptor.SetPaddingTop
- IMPSGraphImToColOpDescriptor.StrideInX: The property that defines the stride in width dimension.
- IMPSGraphImToColOpDescriptor.SetStrideInX
- IMPSGraphImToColOpDescriptor.StrideInY: The property that defines the stride in height dimension.
- IMPSGraphImToColOpDescriptor.SetStrideInY
Instance Methods ¶
- IMPSGraphImToColOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the descriptor’s padding to the given values.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphImToColOpDescriptor
type IMPSGraphLSTMDescriptor ¶
type IMPSGraphLSTMDescriptor interface {
IMPSGraphObject
// A parameter that defines the activation function used with the current cell value of the LSTM operation.
Activation() MPSGraphRNNActivation
SetActivation(value MPSGraphRNNActivation)
// A parameter that defines a bidirectional LSTM layer.
Bidirectional() bool
SetBidirectional(value bool)
// A parameter that defines the activation function used with the cell gate of the LSTM operation.
CellGateActivation() MPSGraphRNNActivation
SetCellGateActivation(value MPSGraphRNNActivation)
// A parameter that defines the activation function used with the forget gate of the LSTM operation.
ForgetGateActivation() MPSGraphRNNActivation
SetForgetGateActivation(value MPSGraphRNNActivation)
// A parameter that controls the internal order of the LSTM gates.
ForgetGateLast() bool
SetForgetGateLast(value bool)
// A parameter that defines the activation function used with the input gate of the LSTM operation.
InputGateActivation() MPSGraphRNNActivation
SetInputGateActivation(value MPSGraphRNNActivation)
// A parameter that defines the activation function used with the output gate of the LSTM operation.
OutputGateActivation() MPSGraphRNNActivation
SetOutputGateActivation(value MPSGraphRNNActivation)
// A parameter that controls whether or not to return the output cell from the LSTM layer.
ProduceCell() bool
SetProduceCell(value bool)
// A parameter that defines time direction of the input sequence.
Reverse() bool
SetReverse(value bool)
// A parameter that enables the LSTM layer to support training.
Training() bool
SetTraining(value bool)
}
An interface definition for the MPSGraphLSTMDescriptor class.
Instance Properties ¶
- IMPSGraphLSTMDescriptor.Activation: A parameter that defines the activation function used with the current cell value of the LSTM operation.
- IMPSGraphLSTMDescriptor.SetActivation
- IMPSGraphLSTMDescriptor.Bidirectional: A parameter that defines a bidirectional LSTM layer.
- IMPSGraphLSTMDescriptor.SetBidirectional
- IMPSGraphLSTMDescriptor.CellGateActivation: A parameter that defines the activation function used with the cell gate of the LSTM operation.
- IMPSGraphLSTMDescriptor.SetCellGateActivation
- IMPSGraphLSTMDescriptor.ForgetGateActivation: A parameter that defines the activation function used with the forget gate of the LSTM operation.
- IMPSGraphLSTMDescriptor.SetForgetGateActivation
- IMPSGraphLSTMDescriptor.ForgetGateLast: A parameter that controls the internal order of the LSTM gates.
- IMPSGraphLSTMDescriptor.SetForgetGateLast
- IMPSGraphLSTMDescriptor.InputGateActivation: A parameter that defines the activation function used with the input gate of the LSTM operation.
- IMPSGraphLSTMDescriptor.SetInputGateActivation
- IMPSGraphLSTMDescriptor.OutputGateActivation: A parameter that defines the activation function used with the output gate of the LSTM operation.
- IMPSGraphLSTMDescriptor.SetOutputGateActivation
- IMPSGraphLSTMDescriptor.ProduceCell: A parameter that controls whether or not to return the output cell from the LSTM layer.
- IMPSGraphLSTMDescriptor.SetProduceCell
- IMPSGraphLSTMDescriptor.Reverse: A parameter that defines time direction of the input sequence.
- IMPSGraphLSTMDescriptor.SetReverse
- IMPSGraphLSTMDescriptor.Training: A parameter that enables the LSTM layer to support training.
- IMPSGraphLSTMDescriptor.SetTraining
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphLSTMDescriptor
type IMPSGraphObject ¶
type IMPSGraphObject interface {
objectivec.IObject
}
An interface definition for the MPSGraphObject class.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphObject
type IMPSGraphOperation ¶
type IMPSGraphOperation interface {
IMPSGraphObject
// The set of operations guaranteed to execute before this operation.
ControlDependencies() []MPSGraphOperation
// The graph on which the operation is defined.
Graph() IMPSGraph
// The input tensors of the operation.
InputTensors() []MPSGraphTensor
// Name of the operation.
Name() string
// The output tensors of the operation.
OutputTensors() []MPSGraphTensor
}
An interface definition for the MPSGraphOperation class.
Instance Properties ¶
- IMPSGraphOperation.ControlDependencies: The set of operations guaranteed to execute before this operation.
- IMPSGraphOperation.Graph: The graph on which the operation is defined.
- IMPSGraphOperation.InputTensors: The input tensors of the operation.
- IMPSGraphOperation.Name: Name of the operation.
- IMPSGraphOperation.OutputTensors: The output tensors of the operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOperation
type IMPSGraphPooling2DOpDescriptor ¶
type IMPSGraphPooling2DOpDescriptor interface {
IMPSGraphObject
// Affects how the graph computes the output size.
CeilMode() bool
SetCeilMode(value bool)
// Defines the data layout of the input data in the forward pass. See: [MPSGraphTensorNamedDataLayout](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorNamedDataLayout>).
DataLayout() MPSGraphTensorNamedDataLayout
SetDataLayout(value MPSGraphTensorNamedDataLayout)
// Defines the dilation rate for the width dimension.
DilationRateInX() uint
SetDilationRateInX(value uint)
// Defines the dilation rate for the height dimension.
DilationRateInY() uint
SetDilationRateInY(value uint)
// Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
IncludeZeroPadToAverage() bool
SetIncludeZeroPadToAverage(value bool)
// Defines the pooling window size for the height dimension.
KernelHeight() uint
SetKernelHeight(value uint)
// Defines the pooling window size for the width dimension.
KernelWidth() uint
SetKernelWidth(value uint)
// Defines the explicit padding value for the height dimension to add after the data.
PaddingBottom() uint
SetPaddingBottom(value uint)
// Defines the explicit padding value for the width dimension to add before the data.
PaddingLeft() uint
SetPaddingLeft(value uint)
// Defines the explicit padding value for the width dimension to add after the data.
PaddingRight() uint
SetPaddingRight(value uint)
// Defines what kind of padding graph applies to the operation.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// Defines the explicit padding value for the height dimension to add before the data.
PaddingTop() uint
SetPaddingTop(value uint)
// Defines the data type for returned indices. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. Currently MPSGraph supports the following datatypes: [MPSDataTypeInt32]. Default value: [MPSDataTypeInt32].
ReturnIndicesDataType() uint32
SetReturnIndicesDataType(value uint32)
// Defines the mode for returned indices of maximum values within each pooling window. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result MPSGraph returns from [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) will be valid and using the second result will assert. Default value: [MPSGraphPoolingReturnIndicesNone].
ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
// Defines the stride for the width dimension.
StrideInX() uint
SetStrideInX(value uint)
// Defines the stride for the height dimension.
StrideInY() uint
SetStrideInY(value uint)
// Sets the explicit padding values and sets padding style to explicit.
SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
}
An interface definition for the MPSGraphPooling2DOpDescriptor class.
Instance Properties ¶
- IMPSGraphPooling2DOpDescriptor.CeilMode: Affects how the graph computes the output size.
- IMPSGraphPooling2DOpDescriptor.SetCeilMode
- IMPSGraphPooling2DOpDescriptor.DataLayout: Defines the data layout of the input data in the forward pass. See: MPSGraphTensorNamedDataLayout(<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorNamedDataLayout>).
- IMPSGraphPooling2DOpDescriptor.SetDataLayout
- IMPSGraphPooling2DOpDescriptor.DilationRateInX: Defines the dilation rate for the width dimension.
- IMPSGraphPooling2DOpDescriptor.SetDilationRateInX
- IMPSGraphPooling2DOpDescriptor.DilationRateInY: Defines the dilation rate for the height dimension.
- IMPSGraphPooling2DOpDescriptor.SetDilationRateInY
- IMPSGraphPooling2DOpDescriptor.IncludeZeroPadToAverage: Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
- IMPSGraphPooling2DOpDescriptor.SetIncludeZeroPadToAverage
- IMPSGraphPooling2DOpDescriptor.KernelHeight: Defines the pooling window size for the height dimension.
- IMPSGraphPooling2DOpDescriptor.SetKernelHeight
- IMPSGraphPooling2DOpDescriptor.KernelWidth: Defines the pooling window size for the width dimension.
- IMPSGraphPooling2DOpDescriptor.SetKernelWidth
- IMPSGraphPooling2DOpDescriptor.PaddingBottom: Defines the explicit padding value for the height dimension to add after the data.
- IMPSGraphPooling2DOpDescriptor.SetPaddingBottom
- IMPSGraphPooling2DOpDescriptor.PaddingLeft: Defines the explicit padding value for the width dimension to add before the data.
- IMPSGraphPooling2DOpDescriptor.SetPaddingLeft
- IMPSGraphPooling2DOpDescriptor.PaddingRight: Defines the explicit padding value for the width dimension to add after the data.
- IMPSGraphPooling2DOpDescriptor.SetPaddingRight
- IMPSGraphPooling2DOpDescriptor.PaddingStyle: Defines what kind of padding graph applies to the operation.
- IMPSGraphPooling2DOpDescriptor.SetPaddingStyle
- IMPSGraphPooling2DOpDescriptor.PaddingTop: Defines the explicit padding value for the height dimension to add before the data.
- IMPSGraphPooling2DOpDescriptor.SetPaddingTop
- IMPSGraphPooling2DOpDescriptor.ReturnIndicesDataType: Defines the data type for returned indices. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. Currently MPSGraph supports the following datatypes: [MPSDataTypeInt32]. Default value: [MPSDataTypeInt32].
- IMPSGraphPooling2DOpDescriptor.SetReturnIndicesDataType
- IMPSGraphPooling2DOpDescriptor.ReturnIndicesMode: Defines the mode for returned indices of maximum values within each pooling window. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result MPSGraph returns from [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) will be valid and using the second result will assert. Default value: MPSGraphPoolingReturnIndicesNone.
- IMPSGraphPooling2DOpDescriptor.SetReturnIndicesMode
- IMPSGraphPooling2DOpDescriptor.StrideInX: Defines the stride for the width dimension.
- IMPSGraphPooling2DOpDescriptor.SetStrideInX
- IMPSGraphPooling2DOpDescriptor.StrideInY: Defines the stride for the height dimension.
- IMPSGraphPooling2DOpDescriptor.SetStrideInY
Instance Methods ¶
- IMPSGraphPooling2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the explicit padding values and sets padding style to explicit.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPooling2DOpDescriptor
type IMPSGraphPooling4DOpDescriptor ¶
type IMPSGraphPooling4DOpDescriptor interface {
IMPSGraphObject
// Affects how MPSGraph computes the output size: if set to [YES] then output size is computed by rounding up instead of down when dividing input size by stride.
CeilMode() bool
SetCeilMode(value bool)
// Defines dilation rates for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
DilationRates() []foundation.NSNumber
SetDilationRates(value []foundation.NSNumber)
// Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
IncludeZeroPadToAverage() bool
SetIncludeZeroPadToAverage(value bool)
// Defines the pooling window size.
KernelSizes() []foundation.NSNumber
SetKernelSizes(value []foundation.NSNumber)
// Defines what kind of padding graph applies to the operation.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// Defines padding values for spatial dimensions which must be eight numbers, two for each spatial dimension.
PaddingValues() []foundation.NSNumber
SetPaddingValues(value []foundation.NSNumber)
// Defines the data type for returned indices.
ReturnIndicesDataType() uint32
SetReturnIndicesDataType(value uint32)
// Defines the mode for returned indices of maximum values within each pooling window.
ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
// Defines strides for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
Strides() []foundation.NSNumber
SetStrides(value []foundation.NSNumber)
}
An interface definition for the MPSGraphPooling4DOpDescriptor class.
Instance Properties ¶
- IMPSGraphPooling4DOpDescriptor.CeilMode: Affects how MPSGraph computes the output size: if set to [YES] then output size is computed by rounding up instead of down when dividing input size by stride.
- IMPSGraphPooling4DOpDescriptor.SetCeilMode
- IMPSGraphPooling4DOpDescriptor.DilationRates: Defines dilation rates for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
- IMPSGraphPooling4DOpDescriptor.SetDilationRates
- IMPSGraphPooling4DOpDescriptor.IncludeZeroPadToAverage: Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
- IMPSGraphPooling4DOpDescriptor.SetIncludeZeroPadToAverage
- IMPSGraphPooling4DOpDescriptor.KernelSizes: Defines the pooling window size.
- IMPSGraphPooling4DOpDescriptor.SetKernelSizes
- IMPSGraphPooling4DOpDescriptor.PaddingStyle: Defines what kind of padding graph applies to the operation.
- IMPSGraphPooling4DOpDescriptor.SetPaddingStyle
- IMPSGraphPooling4DOpDescriptor.PaddingValues: Defines padding values for spatial dimensions which must be eight numbers, two for each spatial dimension.
- IMPSGraphPooling4DOpDescriptor.SetPaddingValues
- IMPSGraphPooling4DOpDescriptor.ReturnIndicesDataType: Defines the data type for returned indices.
- IMPSGraphPooling4DOpDescriptor.SetReturnIndicesDataType
- IMPSGraphPooling4DOpDescriptor.ReturnIndicesMode: Defines the mode for returned indices of maximum values within each pooling window.
- IMPSGraphPooling4DOpDescriptor.SetReturnIndicesMode
- IMPSGraphPooling4DOpDescriptor.Strides: Defines strides for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
- IMPSGraphPooling4DOpDescriptor.SetStrides
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPooling4DOpDescriptor
type IMPSGraphRandomOpDescriptor ¶
type IMPSGraphRandomOpDescriptor interface {
IMPSGraphObject
// The data type of the generated result values.
DataType() uint32
SetDataType(value uint32)
// The type of distribution to draw samples from. See MPSGraphRandomDistribution.
Distribution() MPSGraphRandomDistribution
SetDistribution(value MPSGraphRandomDistribution)
// The upper range of the distribution.
Max() float32
SetMax(value float32)
// The upper range of the distribution.
MaxInteger() int
SetMaxInteger(value int)
// The mean of the distribution.
Mean() float32
SetMean(value float32)
// The lower range of the distribution.
Min() float32
SetMin(value float32)
// The lower range of the distribution.
MinInteger() int
SetMinInteger(value int)
// The sampling method of the distribution.
SamplingMethod() MPSGraphRandomNormalSamplingMethod
SetSamplingMethod(value MPSGraphRandomNormalSamplingMethod)
// The standard deviation of the distribution.
StandardDeviation() float32
SetStandardDeviation(value float32)
}
An interface definition for the MPSGraphRandomOpDescriptor class.
Instance Properties ¶
- IMPSGraphRandomOpDescriptor.DataType: The data type of the generated result values.
- IMPSGraphRandomOpDescriptor.SetDataType
- IMPSGraphRandomOpDescriptor.Distribution: The type of distribution to draw samples from. See MPSGraphRandomDistribution.
- IMPSGraphRandomOpDescriptor.SetDistribution
- IMPSGraphRandomOpDescriptor.Max: The upper range of the distribution.
- IMPSGraphRandomOpDescriptor.SetMax
- IMPSGraphRandomOpDescriptor.MaxInteger: The upper range of the distribution.
- IMPSGraphRandomOpDescriptor.SetMaxInteger
- IMPSGraphRandomOpDescriptor.Mean: The mean of the distribution.
- IMPSGraphRandomOpDescriptor.SetMean
- IMPSGraphRandomOpDescriptor.Min: The lower range of the distribution.
- IMPSGraphRandomOpDescriptor.SetMin
- IMPSGraphRandomOpDescriptor.MinInteger: The lower range of the distribution.
- IMPSGraphRandomOpDescriptor.SetMinInteger
- IMPSGraphRandomOpDescriptor.SamplingMethod: The sampling method of the distribution.
- IMPSGraphRandomOpDescriptor.SetSamplingMethod
- IMPSGraphRandomOpDescriptor.StandardDeviation: The standard deviation of the distribution.
- IMPSGraphRandomOpDescriptor.SetStandardDeviation
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphRandomOpDescriptor
type IMPSGraphSDPADescriptor ¶
type IMPSGraphSDPADescriptor interface {
IMPSGraphObject
// When YES, a causal (lower-triangular) mask is applied so that each query position attends only to key positions at or before it. Mutually exclusive with [maskTensor](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/maskTensor>).
IsCausal() bool
SetIsCausal(value bool)
// An optional additive mask tensor applied to the scaled QK^T scores before softmax. Must be broadcast-compatible with shape `[batch, heads, T_q, T_kv]`. Mutually exclusive with [isCausal](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/isCausal>).
MaskTensor() IMPSGraphTensor
SetMaskTensor(value IMPSGraphTensor)
// The scale applied to the result of the query–key matrix multiply before softmax. Typically set to `1/sqrt(headDimension)`.
Scale() float32
SetScale(value float32)
// An optional attention-sinks tensor of shape `[nHeads]`. Each element seeds the online-softmax accumulator for the corresponding query head with a virtual token logit, causing real-token attention weights to sum to less than one.
SinksTensor() IMPSGraphTensor
SetSinksTensor(value IMPSGraphTensor)
}
An interface definition for the MPSGraphSDPADescriptor class.
Instance Properties ¶
- IMPSGraphSDPADescriptor.IsCausal: When YES, a causal (lower-triangular) mask is applied so that each query position attends only to key positions at or before it. Mutually exclusive with [maskTensor](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/maskTensor>).
- IMPSGraphSDPADescriptor.SetIsCausal
- IMPSGraphSDPADescriptor.MaskTensor: An optional additive mask tensor applied to the scaled QK^T scores before softmax. Must be broadcast-compatible with shape `[batch, heads, T_q, T_kv]`. Mutually exclusive with [isCausal](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/isCausal>).
- IMPSGraphSDPADescriptor.SetMaskTensor
- IMPSGraphSDPADescriptor.Scale: The scale applied to the result of the query–key matrix multiply before softmax. Typically set to `1/sqrt(headDimension)`.
- IMPSGraphSDPADescriptor.SetScale
- IMPSGraphSDPADescriptor.SinksTensor: An optional attention-sinks tensor of shape `[nHeads]`. Each element seeds the online-softmax accumulator for the corresponding query head with a virtual token logit, causing real-token attention weights to sum to less than one.
- IMPSGraphSDPADescriptor.SetSinksTensor
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor
type IMPSGraphShapedType ¶
type IMPSGraphShapedType interface {
IMPSGraphType
// Initializes a shaped type.
InitWithShapeDataType(shape foundation.NSArray, dataType uint32) MPSGraphShapedType
// The data type of the shaped type.
DataType() uint32
SetDataType(value uint32)
// The Shape of the shaped type.
Shape() foundation.NSArray
SetShape(value foundation.NSArray)
}
An interface definition for the MPSGraphShapedType class.
Initializers ¶
- IMPSGraphShapedType.InitWithShapeDataType: Initializes a shaped type.
Instance Properties ¶
- IMPSGraphShapedType.DataType: The data type of the shaped type.
- IMPSGraphShapedType.SetDataType
- IMPSGraphShapedType.Shape: The Shape of the shaped type.
- IMPSGraphShapedType.SetShape
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType
type IMPSGraphSingleGateRNNDescriptor ¶
type IMPSGraphSingleGateRNNDescriptor interface {
IMPSGraphObject
// A parameter that defines the activation function to use with the RNN operation.
Activation() MPSGraphRNNActivation
SetActivation(value MPSGraphRNNActivation)
// A parameter that defines a bidirectional RNN layer.
Bidirectional() bool
SetBidirectional(value bool)
// A parameter that defines time direction of the input sequence.
Reverse() bool
SetReverse(value bool)
// A parameter that makes the RNN layer support training.
Training() bool
SetTraining(value bool)
}
An interface definition for the MPSGraphSingleGateRNNDescriptor class.
Instance Properties ¶
- IMPSGraphSingleGateRNNDescriptor.Activation: A parameter that defines the activation function to use with the RNN operation.
- IMPSGraphSingleGateRNNDescriptor.SetActivation
- IMPSGraphSingleGateRNNDescriptor.Bidirectional: A parameter that defines a bidirectional RNN layer.
- IMPSGraphSingleGateRNNDescriptor.SetBidirectional
- IMPSGraphSingleGateRNNDescriptor.Reverse: A parameter that defines time direction of the input sequence.
- IMPSGraphSingleGateRNNDescriptor.SetReverse
- IMPSGraphSingleGateRNNDescriptor.Training: A parameter that makes the RNN layer support training.
- IMPSGraphSingleGateRNNDescriptor.SetTraining
type IMPSGraphStencilOpDescriptor ¶
type IMPSGraphStencilOpDescriptor interface {
IMPSGraphObject
// The property that determines which values to use for padding the input tensor.
BoundaryMode() MPSGraphPaddingMode
SetBoundaryMode(value MPSGraphPaddingMode)
// The property that defines dilation rates for spatial dimensions.
DilationRates() foundation.NSArray
SetDilationRates(value foundation.NSArray)
// The property that defines padding values for spatial dimensions.
ExplicitPadding() foundation.NSArray
SetExplicitPadding(value foundation.NSArray)
// An array of length four that determines from which offset to start reading the input tensor.
Offsets() foundation.NSArray
SetOffsets(value foundation.NSArray)
// The padding value for `boundaryMode = MPSGraphPaddingModeConstant`.
PaddingConstant() float32
SetPaddingConstant(value float32)
// The property that defines what kind of padding to apply to the stencil operation.
PaddingStyle() MPSGraphPaddingStyle
SetPaddingStyle(value MPSGraphPaddingStyle)
// The reduction mode to use within the stencil window.
ReductionMode() MPSGraphReductionMode
SetReductionMode(value MPSGraphReductionMode)
// The property that defines strides for spatial dimensions.
Strides() foundation.NSArray
SetStrides(value foundation.NSArray)
}
An interface definition for the MPSGraphStencilOpDescriptor class.
Instance Properties ¶
- IMPSGraphStencilOpDescriptor.BoundaryMode: The property that determines which values to use for padding the input tensor.
- IMPSGraphStencilOpDescriptor.SetBoundaryMode
- IMPSGraphStencilOpDescriptor.DilationRates: The property that defines dilation rates for spatial dimensions.
- IMPSGraphStencilOpDescriptor.SetDilationRates
- IMPSGraphStencilOpDescriptor.ExplicitPadding: The property that defines padding values for spatial dimensions.
- IMPSGraphStencilOpDescriptor.SetExplicitPadding
- IMPSGraphStencilOpDescriptor.Offsets: An array of length four that determines from which offset to start reading the input tensor.
- IMPSGraphStencilOpDescriptor.SetOffsets
- IMPSGraphStencilOpDescriptor.PaddingConstant: The padding value for `boundaryMode = MPSGraphPaddingModeConstant`.
- IMPSGraphStencilOpDescriptor.SetPaddingConstant
- IMPSGraphStencilOpDescriptor.PaddingStyle: The property that defines what kind of padding to apply to the stencil operation.
- IMPSGraphStencilOpDescriptor.SetPaddingStyle
- IMPSGraphStencilOpDescriptor.ReductionMode: The reduction mode to use within the stencil window.
- IMPSGraphStencilOpDescriptor.SetReductionMode
- IMPSGraphStencilOpDescriptor.Strides: The property that defines strides for spatial dimensions.
- IMPSGraphStencilOpDescriptor.SetStrides
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphStencilOpDescriptor
type IMPSGraphTensor ¶
type IMPSGraphTensor interface {
IMPSGraphObject
// The data type of the tensor.
DataType() uint32
// The operation responsible for creating this tensor.
Operation() IMPSGraphOperation
// The shape of the tensor.
Shape() foundation.NSArray
}
An interface definition for the MPSGraphTensor class.
Instance Properties ¶
- IMPSGraphTensor.DataType: The data type of the tensor.
- IMPSGraphTensor.Operation: The operation responsible for creating this tensor.
- IMPSGraphTensor.Shape: The shape of the tensor.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensor
type IMPSGraphTensorData ¶
type IMPSGraphTensorData interface {
IMPSGraphObject
// Initializes a tensor data with an MPS matrix.
InitWithMPSMatrix(matrix *metalperformanceshaders.MPSMatrix) MPSGraphTensorData
// Initializes an MPSGraphTensorData with an MPS ndarray.
InitWithMPSNDArray(ndarray *metalperformanceshaders.MPSNDArray) MPSGraphTensorData
// Initializes a tensor data with an MPS image batch.
InitWithMPSImageBatch(imageBatch foundation.NSArray) MPSGraphTensorData
// Initializes an MPSGraphTensorData with an MTLTensor.
InitWithMTLTensor(tensor metal.MTLTensor) MPSGraphTensorData
// Initializes a tensor data with an MPS vector.
InitWithMPSVector(vector *metalperformanceshaders.MPSVector) MPSGraphTensorData
// Initializes a tensor data with an MPS vector enforcing rank of the result.
InitWithMPSVectorRank(vector *metalperformanceshaders.MPSVector, rank uint) MPSGraphTensorData
// Initializes a tensor data with an MPS matrix enforcing rank of the result.
InitWithMPSMatrixRank(matrix *metalperformanceshaders.MPSMatrix, rank uint) MPSGraphTensorData
// Initializes an tensor data with a metal buffer.
InitWithMTLBufferShapeDataType(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
// Initializes an tensor data with a metal buffer.
InitWithMTLBufferShapeDataTypeRowBytes(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32, rowBytes uint) MPSGraphTensorData
// Initializes the tensor data with an [NSData] on a device.
InitWithDeviceDataShapeDataType(device IMPSGraphDevice, data foundation.NSData, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
// The data type of the tensor data.
DataType() uint32
// The device of the tensor data.
Device() IMPSGraphDevice
// The shape of the tensor data.
Shape() foundation.NSArray
// Return an mpsndarray object will copy contents if the contents are not stored in an MPS ndarray.
Mpsndarray() metalperformanceshaders.MPSNDArray
}
An interface definition for the MPSGraphTensorData class.
Initializers ¶
- IMPSGraphTensorData.InitWithMPSMatrix: Initializes a tensor data with an MPS matrix.
- IMPSGraphTensorData.InitWithMPSNDArray: Initializes an MPSGraphTensorData with an MPS ndarray.
- IMPSGraphTensorData.InitWithMPSImageBatch: Initializes a tensor data with an MPS image batch.
- IMPSGraphTensorData.InitWithMTLTensor: Initializes an MPSGraphTensorData with an MTLTensor.
- IMPSGraphTensorData.InitWithMPSVector: Initializes a tensor data with an MPS vector.
- IMPSGraphTensorData.InitWithMPSVectorRank: Initializes a tensor data with an MPS vector enforcing rank of the result.
- IMPSGraphTensorData.InitWithMPSMatrixRank: Initializes a tensor data with an MPS matrix enforcing rank of the result.
- IMPSGraphTensorData.InitWithMTLBufferShapeDataType: Initializes an tensor data with a metal buffer.
- IMPSGraphTensorData.InitWithMTLBufferShapeDataTypeRowBytes: Initializes an tensor data with a metal buffer.
- IMPSGraphTensorData.InitWithDeviceDataShapeDataType: Initializes the tensor data with an [NSData] on a device.
Instance Properties ¶
- IMPSGraphTensorData.DataType: The data type of the tensor data.
- IMPSGraphTensorData.Device: The device of the tensor data.
- IMPSGraphTensorData.Shape: The shape of the tensor data.
Instance Methods ¶
- IMPSGraphTensorData.Mpsndarray: Return an mpsndarray object will copy contents if the contents are not stored in an MPS ndarray.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData
type IMPSGraphType ¶
type IMPSGraphType interface {
IMPSGraphObject
}
An interface definition for the MPSGraphType class.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphType
type IMPSGraphVariableOp ¶
type IMPSGraphVariableOp interface {
IMPSGraphOperation
// The data type of the variable.
DataType() uint32
// The shape of the variable.
Shape() foundation.NSArray
}
An interface definition for the MPSGraphVariableOp class.
Instance Properties ¶
- IMPSGraphVariableOp.DataType: The data type of the variable.
- IMPSGraphVariableOp.Shape: The shape of the variable.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphVariableOp
type MPSGraph ¶
type MPSGraph struct {
MPSGraphObject
}
The optimized representation of a compute graph of operations and tensors.
Overview ¶
An MPSGraph is a symbolic representation of operations to be utilized to execute compute graphs on a device.
Instance Properties ¶
- MPSGraph.Options: Options for the graph.
- MPSGraph.SetOptions
- MPSGraph.PlaceholderTensors: Array of all the placeholder tensors.
Instance Methods ¶
- MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName: Creates a GRU operation and returns the value and optionally the training state tensor.
- MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName: Creates a GRU gradient operation and returns the gradient tensor values.
- MPSGraph.HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName: Computes the hamming distance of two input tensors with support for broadcasting.
- MPSGraph.HermiteanToRealFFTWithTensorAxesDescriptorName: Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
- MPSGraph.HermiteanToRealFFTWithTensorAxesTensorDescriptorName: Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
- MPSGraph.L2NormPooling4DWithSourceTensorDescriptorName: Creates a 4D L2-norm pooling operation and returns the result tensor.
- MPSGraph.L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates a L2-Norm pooling gradient operation and returns the result tensor.
- MPSGraph.LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName: Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
- MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName: Creates an LSTM gradient operation and returns the gradient tensor values.
- MPSGraph.AbsoluteWithTensorName: Returns the absolute values of the input tensor elements.
- MPSGraph.AbsoluteSquareWithTensorName: Returns the absolute square of the input tensor elements.
- MPSGraph.AcosWithTensorName: Applies the inverse cosine operation to the input tensor elements.
- MPSGraph.AcoshWithTensorName: Applies the inverse hyperbolic cosine operation to the input tensor elements.
- MPSGraph.AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName: Creates operations to apply Adam optimization.
- MPSGraph.AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName: Creates operations to apply Adam optimization.
- MPSGraph.AdditionWithPrimaryTensorSecondaryTensorName: Adds two input tensors.
- MPSGraph.ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName: The Stochastic gradient descent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable this op directly writes to the variable
- MPSGraph.ArgSortWithTensorAxisDescendingName: Computes the indices that sort the elements of the input tensor along the specified axis.
- MPSGraph.ArgSortWithTensorAxisName: Computes the indices that sort the elements of the input tensor along the specified axis.
- MPSGraph.ArgSortWithTensorAxisTensorDescendingName: Computes the indices that sort the elements of the input tensor along the specified axis.
- MPSGraph.ArgSortWithTensorAxisTensorName: Computes the indices that sort the elements of the input tensor along the specified axis.
- MPSGraph.AsinWithTensorName: Applies the inverse sine operation to the input tensor elements.
- MPSGraph.AsinhWithTensorName: Applies the inverse hyperbolic sine operation to the input tensor elements.
- MPSGraph.AssignVariableWithValueOfTensorName: Creates an assign operation which writes at this point of execution of the graph.
- MPSGraph.AtanWithTensorName: Applies the inverse tangent operation to the input tensor elements.
- MPSGraph.Atan2WithPrimaryTensorSecondaryTensorName: Returns the elementwise two-argument arctangent of the input tensors.
- MPSGraph.AtanhWithTensorName: Applies the inverse hyperbolic tangent operation to the input tensor elements.
- MPSGraph.AvgPooling2DWithSourceTensorDescriptorName: Creates a 2D average-pooling operation and returns the result tensor.
- MPSGraph.AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName: Creates a 2D average pooling gradient operation and returns the result tensor.
- MPSGraph.AvgPooling4DWithSourceTensorDescriptorName: Creates a 4D average pooling operation and returns the result tensor.
- MPSGraph.AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates an average pooling gradient operation and returns the result tensor.
- MPSGraph.BandPartWithTensorNumLowerNumUpperName: Computes the band part of an input tensor.
- MPSGraph.BandPartWithTensorNumLowerTensorNumUpperTensorName: Creates the band part operation and returns the result.
- MPSGraph.BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName: Creates a batch-to-space operation and returns the result tensor.
- MPSGraph.BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName: Creates a batch-to-space operation and returns the result tensor.
- MPSGraph.BitwiseANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise AND of binary representations of two integer tensors.
- MPSGraph.BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName: Returns the elementwise left-shifted binary representations of the primary integer by the secondary tensor amount.
- MPSGraph.BitwiseNOTWithTensorName: Applies the bitwise NOT operation to the input tensor element.
- MPSGraph.BitwiseORWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise OR of binary representations of two integer tensors.
- MPSGraph.BitwisePopulationCountWithTensorName: Returns the population count of the input tensor elements.
- MPSGraph.BitwiseRightShiftWithPrimaryTensorSecondaryTensorName: Returns the elementwise right-shifted binary representations of the primary integer by the secondary tensor amount.
- MPSGraph.BitwiseXORWithPrimaryTensorSecondaryTensorName: Returns the elementwise bitwise XOR of binary representations of two integer tensors.
- MPSGraph.BottomKWithSourceTensorAxisKName: Creates a BottomK operation and returns the value and indices tensors.
- MPSGraph.BottomKWithSourceTensorAxisTensorKTensorName: Creates a BottomK operation and returns the result tensor.
- MPSGraph.BottomKWithGradientTensorSourceAxisKName: Creates a BottomKGradient operation and returns the result tensor.
- MPSGraph.BottomKWithGradientTensorSourceAxisTensorKTensorName: Creates a BottomKGradient operation and returns the result tensor.
- MPSGraph.BroadcastTensorToShapeName: Creates a broadcast operation and returns the result tensor.
- MPSGraph.BroadcastTensorToShapeTensorName: Creates a broadcast operation and returns the result tensor.
- MPSGraph.CallSymbolNameInputTensorsOutputTypesName: Creates an operation which invokes another executable.
- MPSGraph.CastTensorToTypeName: Creates a cast operation and returns the result tensor.
- MPSGraph.CeilWithTensorName: Applies the ceiling operation to the input tensor elements.
- MPSGraph.ClampWithTensorMinValueTensorMaxValueTensorName: Clamps the values in the first tensor between the corresponding values in the minimum and maximum value tensor.
- MPSGraph.ColToImWithSourceTensorOutputShapeDescriptorName: Creates a column to image operation and returns the result tensor.
- MPSGraph.CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor: Compiles the graph for the given feeds to returns the target tensor values, ensuring all target operations would be executed.
- MPSGraph.ConstantWithRealPartImaginaryPart: Creates a complex constant op with the MPSDataTypeComplexFloat32 data type and returns the result tensor.
- MPSGraph.ConstantWithRealPartImaginaryPartDataType: Creates a complex constant operation and returns the result tensor.
- MPSGraph.ConstantWithRealPartImaginaryPartShapeDataType: Creates a complex constant op with a given shape and returns the result tensor.
- MPSGraph.ComplexTensorWithRealTensorImaginaryTensorName: Returns a complex tensor from the two input tensors.
- MPSGraph.ConcatTensorWithTensorDimensionName: Creates a concatenation operation and returns the result tensor.
- MPSGraph.ConcatTensorsDimensionInterleaveName: Creates a concatenation operation and returns the result tensor.
- MPSGraph.ConcatTensorsDimensionName: Creates a concatenation operation and returns the result tensor.
- MPSGraph.ConjugateWithTensorName: Returns the complex conjugate of the input tensor elements.
- MPSGraph.ConstantWithScalarDataType: Creates a constant operation and returns the result tensor.
- MPSGraph.ConstantWithScalarShapeDataType: Creates a constant op with a given shape and returns the result tensor.
- MPSGraph.ConstantWithDataShapeDataType: Creates a constant op with a given shape and data, and returns the result tensor.
- MPSGraph.Convolution2DWithSourceTensorWeightsTensorDescriptorName: Creates a 2D (forward) convolution operation and returns the result tensor.
- MPSGraph.Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
- MPSGraph.Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
- MPSGraph.Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to the weights tensor of the forward convolution.
- MPSGraph.Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 2D convolution gradient operation with respect to weights tensor of forward convolution.
- MPSGraph.Convolution3DWithSourceTensorWeightsTensorDescriptorName: Creates a 3D forward convolution operation and returns the result tensor.
- MPSGraph.Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
- MPSGraph.Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
- MPSGraph.Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
- MPSGraph.Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
- MPSGraph.ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName: Creates a convolution transpose operation and returns the result tensor.
- MPSGraph.ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName: Creates a convolution transpose operation and returns the result tensor.
- MPSGraph.ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
- MPSGraph.ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
- MPSGraph.ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
- MPSGraph.ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName: Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
- MPSGraph.CoordinateAlongAxisWithShapeName: Creates a get-coordindate operation and returns the result tensor.
- MPSGraph.CoordinateAlongAxisWithShapeTensorName: Creates a get-coordindate operation and returns the result tensor.
- MPSGraph.CoordinateAlongAxisTensorWithShapeName: Creates a get-coordindate operation and returns the result tensor.
- MPSGraph.CoordinateAlongAxisTensorWithShapeTensorName: Creates a get-coordindate operation and returns the result tensor.
- MPSGraph.CosWithTensorName: Applies the cosine operation to the input tensor elements.
- MPSGraph.CoshWithTensorName: Applies the hyperbolic cosine operation to the input tensor elements.
- MPSGraph.CumulativeMaximumWithTensorAxisExclusiveReverseName: Computes the cumulative maximum of the input tensor along the specified axis.
- MPSGraph.CumulativeMaximumWithTensorAxisName: Computes the cumulative maximum of the input tensor along the specified axis.
- MPSGraph.CumulativeMaximumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative maximum of the input tensor along the specified axis.
- MPSGraph.CumulativeMaximumWithTensorAxisTensorName: Computes the cumulative maximum of the input tensor along the specified axis.
- MPSGraph.CumulativeMinimumWithTensorAxisExclusiveReverseName: Computes the cumulative minimum of the input tensor along the specified axis.
- MPSGraph.CumulativeMinimumWithTensorAxisName: Computes the cumulative minimum of the input tensor along the specified axis.
- MPSGraph.CumulativeMinimumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative minimum of the input tensor along the specified axis.
- MPSGraph.CumulativeMinimumWithTensorAxisTensorName: Computes the cumulative minimum of the input tensor along the specified axis.
- MPSGraph.CumulativeProductWithTensorAxisExclusiveReverseName: Computes the cumulative product of the input tensor along the specified axis.
- MPSGraph.CumulativeProductWithTensorAxisName: Computes the cumulative product of the input tensor along the specified axis.
- MPSGraph.CumulativeProductWithTensorAxisTensorExclusiveReverseName: Computes the cumulative product of the input tensor along the specified axis.
- MPSGraph.CumulativeProductWithTensorAxisTensorName: Computes the cumulative product of the input tensor along the specified axis.
- MPSGraph.CumulativeSumWithTensorAxisExclusiveReverseName: Computes the cumulative sum of the input tensor along the specified axis.
- MPSGraph.CumulativeSumWithTensorAxisName: Computes the cumulative sum of the input tensor along the specified axis.
- MPSGraph.CumulativeSumWithTensorAxisTensorExclusiveReverseName: Computes the cumulative sum of the input tensor along the specified axis.
- MPSGraph.CumulativeSumWithTensorAxisTensorName: Computes the cumulative sum of the input tensor along the specified axis.
- MPSGraph.DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName: Creates a depth-to-space2D operation and returns the result tensor.
- MPSGraph.DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName: Creates a depth-to-space2D operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName: Creates a 2D-depthwise convolution operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName: Creates a 2D-depthwise convolution gradient for data operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName: Creates a 2D-depthwise convolution gradient for weights operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName: Creates a 3D depthwise convolution operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName: Creates a 3D depthwise convolution gradient for data operation and returns the result tensor.
- MPSGraph.DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName: Creates a 3D depthwise convolution gradient for weights operation and returns the result tensor.
- MPSGraph.DequantizeTensorLUTTensorAxisName: Creates a vector lookup-table based quantization operation and returns the result tensor.
- MPSGraph.DequantizeTensorLUTTensorName: Creates a lookup-table based quantization operation and returns the result tensor.
- MPSGraph.DequantizeTensorScaleZeroPointDataTypeName: Creates Dequantize operation and returns the result tensor.
- MPSGraph.DequantizeTensorScaleTensorDataTypeName: Creates a dequantize operation and returns the result tensor.
- MPSGraph.DequantizeTensorScaleTensorZeroPointDataTypeAxisName: Creates Dequantize operation and returns the result tensor.
- MPSGraph.DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName: Creates a dequantize operation and returns the result tensor.
- MPSGraph.DequantizeTensorScaleTensorZeroPointTensorDataTypeName: Creates a dequantize operation and returns the result tensor.
- MPSGraph.DivisionWithPrimaryTensorSecondaryTensorName: Divides the first input tensor by the second.
- MPSGraph.DivisionNoNaNWithPrimaryTensorSecondaryTensorName: Divides the first input tensor by the second, with the result being 0 if the denominator is 0.
- MPSGraph.DropoutTensorRateTensorName: Creates a dropout operation and returns the result
- MPSGraph.DropoutTensorRateName: Creates a dropout operation and returns the result
- MPSGraph.EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
- MPSGraph.EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values, ensuring all target operations also executed.
- MPSGraph.EqualWithPrimaryTensorSecondaryTensorName: Returns the elementwise equality check of the input tensors.
- MPSGraph.ErfWithTensorName: Applies the error function to the input tensor elements.
- MPSGraph.ExpandDimsOfTensorAxesName: Creates an expand-dimensions operation and returns the result tensor.
- MPSGraph.ExpandDimsOfTensorAxesTensorName: Creates an expand-dimensions operation and returns the result tensor.
- MPSGraph.ExpandDimsOfTensorAxisName: Creates an expand-dimensions operation and returns the result tensor.
- MPSGraph.ExponentWithTensorName: Applies the natural exponent to the input tensor elements.
- MPSGraph.ExponentBase10WithTensorName: Applies an exponent with base 10 to the input tensor elements.
- MPSGraph.ExponentBase2WithTensorName: Applies an exponent with base 2 to the input tensor elements.
- MPSGraph.FastFourierTransformWithTensorAxesDescriptorName: Creates a fast Fourier transform operation and returns the result tensor.
- MPSGraph.FastFourierTransformWithTensorAxesTensorDescriptorName: Creates a fast Fourier transform operation and returns the result tensor.
- MPSGraph.Flatten2DTensorAxisName: Creates a flatten2D operation and returns the result tensor.
- MPSGraph.Flatten2DTensorAxisTensorName: Creates a flatten2D operation and returns the result tensor.
- MPSGraph.FloorWithTensorName: Applies the floor operation to the input tensor elements.
- MPSGraph.FloorModuloWithPrimaryTensorSecondaryTensorName: Returns the remainder of floor divison between the primary and secondary tensor.
- MPSGraph.GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName: Creates a Gather operation and returns the result tensor.
- MPSGraph.GatherAlongAxisWithUpdatesTensorIndicesTensorName: Creates a GatherAlongAxis operation and returns the result tensor.
- MPSGraph.GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName: Creates a GatherAlongAxis operation and returns the result tensor.
- MPSGraph.GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName: Creates a GatherND operation and returns the result tensor.
- MPSGraph.GradientForPrimaryTensorWithTensorsName: Calculates a partial derivative of primaryTensor with respect to the tensors.
- MPSGraph.GreaterThanWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is greater than the second.
- MPSGraph.GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is greater than or equal to the second.
- MPSGraph.IdentityWithTensorName: Copies the input tensor values into the output, behaving as an identity operation.
- MPSGraph.ImToColWithSourceTensorDescriptorName: Creates an imToCol operation and returns the result tensor.
- MPSGraph.ImaginaryPartOfTensorName: Returns the imaginary part of a tensor.
- MPSGraph.InverseOfTensorName: Computes the inverse of an input tensor.
- MPSGraph.IsFiniteWithTensorName: Checks if the input tensor elements are finite or not.
- MPSGraph.IsInfiniteWithTensorName: Checks if the input tensor elements are infinite or not.
- MPSGraph.IsNaNWithTensorName: Checks if the input tensor elements are [NaN] or not.
- MPSGraph.LeakyReLUWithTensorAlphaName: Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
- MPSGraph.LeakyReLUWithTensorAlphaTensorName: Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
- MPSGraph.LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName: Computes the gradient of the leaky rectified linear unit (ReLU) activation.
- MPSGraph.LessThanWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is less than the second.
- MPSGraph.LessThanOrEqualToWithPrimaryTensorSecondaryTensorName: Checks in an elementwise manner if the first input tensor is less than or equal to the second.
- MPSGraph.LogarithmWithTensorName: Computes the natural logarithm to the input tensor elements.
- MPSGraph.LogarithmBase10WithTensorName: Computes the logarithm with base 10 to the input tensor elements.
- MPSGraph.LogarithmBase2WithTensorName: Computes the logarithm with base 2 to the input tensor elements.
- MPSGraph.LogicalANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical AND of the input tensors.
- MPSGraph.LogicalNANDWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical NAND of the input tensors.
- MPSGraph.LogicalNORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical NOR of the input tensors.
- MPSGraph.LogicalORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical OR of the input tensors.
- MPSGraph.LogicalXNORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical XNOR of the input tensors.
- MPSGraph.LogicalXORWithPrimaryTensorSecondaryTensorName: Returns the elementwise logical XOR of the input tensors.
- MPSGraph.MatrixMultiplicationWithPrimaryTensorSecondaryTensorName: Computes the matrix multiplication of 2 input tensors with support for broadcasting.
- MPSGraph.MaxPooling2DWithSourceTensorDescriptorName: Creates a 2D max-pooling operation and returns the result tensor.
- MPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName: Creates a 2D max-pooling operation and returns the result tensor and the corresponding indices tensor.
- MPSGraph.MaxPooling4DWithSourceTensorDescriptorName: Creates a 4D max-pooling operation and returns the result tensor.
- MPSGraph.MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName: Creates a max-pooling gradient operation and returns the result tensor.
- MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName: Creates a 4D max-pooling operation and returns the result tensor and the corresponding indices tensor.
- MPSGraph.MaximumWithPrimaryTensorSecondaryTensorName: Returns the elementwise maximum of the input tensors.
- MPSGraph.MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName: Returns the elementwise maximum of the input tensors, while propagating [NaN] values.
- MPSGraph.MeanOfTensorAxesName: Returns the mean of the first input along the specified axes.
- MPSGraph.MinimumWithPrimaryTensorSecondaryTensorName: Returns the elementwise minimum of the input tensors.
- MPSGraph.MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName: Returns the elementwise minimum of the input tensors, while propagating [NaN] values.
- MPSGraph.ModuloWithPrimaryTensorSecondaryTensorName: Returns the remainder obtained by dividing the first input tensor by the second.
- MPSGraph.MultiplicationWithPrimaryTensorSecondaryTensorName: Multiplies two input tensors.
- MPSGraph.NegativeWithTensorName: Applies negative to the input tensor elements.
- MPSGraph.NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName: Creates a nonMaximumumSuppression operation and returns the result tensor.
- MPSGraph.NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName: Creates a nonMaximumumSuppression operation and returns the result tensor.
- MPSGraph.NonZeroIndicesOfTensorName: Computes the indices of the non-zero elements of the input tensor.
- MPSGraph.NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName: Creates a normalization beta-gradient operation and returns the result tensor.
- MPSGraph.NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName: Creates a normalization gamma-gradient operation and returns the result tensor.
- MPSGraph.NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName: Creates a normalization input gradient operation and returns the result tensor.
- MPSGraph.NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName: Creates a batch normalization operation and returns the result tensor.
- MPSGraph.NotWithTensorName: Applies the logical NOT operation to the input tensor elements.
- MPSGraph.NotEqualWithPrimaryTensorSecondaryTensorName: Returns the elementwise inequality check of the input tensors.
- MPSGraph.OneHotWithIndicesTensorDepthAxisDataTypeName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.OneHotWithIndicesTensorDepthAxisName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.OneHotWithIndicesTensorDepthDataTypeName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.OneHotWithIndicesTensorDepthName: Creates a oneHot operation and returns the result tensor.
- MPSGraph.PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName: Creates a padding gradient operation and returns the result tensor.
- MPSGraph.PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName: Creates a padding operation and returns the result tensor.
- MPSGraph.PlaceholderWithShapeDataTypeName: Creates a placeholder operation and returns the result tensor.
- MPSGraph.PlaceholderWithShapeName: Creates a placeholder operation and returns the result tensor with the dataType of the placeholder tensor set to 32 bit float.
- MPSGraph.PowerWithPrimaryTensorSecondaryTensorName: Returns the elementwise result of raising the first tensor to the power of the second tensor.
- MPSGraph.QuantizeTensorScaleZeroPointDataTypeName: Creates a Quantize operation and returns the result tensor.
- MPSGraph.QuantizeTensorScaleTensorZeroPointDataTypeAxisName: Creates a Quantize operation and returns the result tensor.
- MPSGraph.QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName: Creates a Quantize operation and returns the result tensor.
- MPSGraph.RandomPhiloxStateTensorWithCounterLowCounterHighKeyName: Creates a tensor representing state using the Philox algorithm with given counter and key values.
- MPSGraph.RandomPhiloxStateTensorWithSeedName: Creates a tensor representing state using the Philox algorithm with given counter and key values.
- MPSGraph.RandomTensorWithShapeDescriptorName: Creates a Random op of type matching distribution in descriptor and returns random values.
- MPSGraph.RandomTensorWithShapeDescriptorSeedName: Creates a Random op of type matching distribution in descriptor and returns random values.
- MPSGraph.RandomTensorWithShapeDescriptorStateTensorName: Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
- MPSGraph.RandomTensorWithShapeTensorDescriptorName: Creates a Random op of type matching distribution in descriptor and returns random values.
- MPSGraph.RandomTensorWithShapeTensorDescriptorSeedName: Creates a Random op of type matching distribution in descriptor and returns random values.
- MPSGraph.RandomTensorWithShapeTensorDescriptorStateTensorName: Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
- MPSGraph.RandomUniformTensorWithShapeName: Creates a RandomUniform operation and returns random uniform values
- MPSGraph.RandomUniformTensorWithShapeSeedName: Creates a RandomUniform operation and returns random uniform values
- MPSGraph.RandomUniformTensorWithShapeStateTensorName: Creates a RandomUniform operation and returns random uniform values and updated state
- MPSGraph.RandomUniformTensorWithShapeTensorName: Creates a RandomUniform operation and returns random uniform values
- MPSGraph.RandomUniformTensorWithShapeTensorSeedName: Creates a RandomUniform operation and returns random uniform values
- MPSGraph.RandomUniformTensorWithShapeTensorStateTensorName: Creates a RandomUniform operation and returns random uniform values and updated state
- MPSGraph.ReLUWithTensorName: Computes the ReLU (rectified linear activation unit) function with the input tensor.
- MPSGraph.ReLUGradientWithIncomingGradientSourceTensorName: Computes the gradient of the ReLU (rectified linear activation unit) function using the incoming gradient.
- MPSGraph.ReadVariableName: Creates a read op which reads at this point of execution of the graph and returns the result tensor.
- MPSGraph.RealPartOfTensorName: Returns the real part of a tensor.
- MPSGraph.RealToHermiteanFFTWithTensorAxesDescriptorName: Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
- MPSGraph.RealToHermiteanFFTWithTensorAxesTensorDescriptorName: Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
- MPSGraph.ReciprocalWithTensorName: Applies the reciprocal operation to the input tensor elements.
- MPSGraph.ReciprocalSquareRootWithTensorName: Applies the reciprocal square root operation to the input tensor elements.
- MPSGraph.ReductionAndWithTensorAxesName: Creates a reduction and operation and returns the result tensor.
- MPSGraph.ReductionAndWithTensorAxisName: Creates a reduction and operation and returns the result tensor.
- MPSGraph.ReductionArgMaximumWithTensorAxisName: Creates a reduction argMax operation and returns the result tensor.
- MPSGraph.ReductionArgMinimumWithTensorAxisName: Creates a reduction argMin operation and returns the result tensor.
- MPSGraph.ReductionMaximumWithTensorAxesName: Creates a reduction max operation and returns the result tensor.
- MPSGraph.ReductionMaximumWithTensorAxisName: Creates a reduction max operation and returns the result tensor.
- MPSGraph.ReductionMaximumPropagateNaNWithTensorAxesName: Creates a reduction max propagate NaN operation and returns the result tensor.
- MPSGraph.ReductionMaximumPropagateNaNWithTensorAxisName: Creates a reduction max propagate NaN operation and returns the result tensor.
- MPSGraph.ReductionMinimumWithTensorAxesName: Creates a reduction min operation and returns the result tensor.
- MPSGraph.ReductionMinimumWithTensorAxisName: Creates a reduction minimum operation and returns the result tensor.
- MPSGraph.ReductionMinimumPropagateNaNWithTensorAxesName: Creates a reduction min propagate NaN operation and returns the result tensor.
- MPSGraph.ReductionMinimumPropagateNaNWithTensorAxisName: Creates a reduction min propagate NaN operation and returns the result tensor.
- MPSGraph.ReductionOrWithTensorAxesName: Creates a reduction or operation and returns the result tensor.
- MPSGraph.ReductionOrWithTensorAxisName: Creates a reduction or operation and returns the result tensor.
- MPSGraph.ReductionProductWithTensorAxesName: Creates a reduction product operation and returns the result tensor.
- MPSGraph.ReductionProductWithTensorAxisName: Creates a reduction product operation and returns the result tensor.
- MPSGraph.ReductionSumWithTensorAxesName: Creates a reduction sum operation and returns the result tensor.
- MPSGraph.ReductionSumWithTensorAxisName: Creates a reduction sum operation and returns the result tensor.
- MPSGraph.ReinterpretCastTensorToTypeName: Creates a reinterpret cast operation and returns the result tensor.
- MPSGraph.ReshapeTensorWithShapeName: Creates a reshape operation and returns the result tensor.
- MPSGraph.ReshapeTensorWithShapeTensorName: Creates a reshape operation and returns the result tensor.
- MPSGraph.ResizeTensorSizeModeCenterResultAlignCornersLayoutName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeTensorSizeTensorModeCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName: Resamples input images to given size using the provided scale and offset. Destination indices are computed using
- MPSGraph.ResizeTensorSizeTensorScaleTensorOffsetTensorModeName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName: Resamples input images to given size using bilinear sampling.
- MPSGraph.ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName: Resamples input images to given size using the provided scale and offset and bilinear sampling See above discussion for more details.
- MPSGraph.ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName: Resamples input images to given size using nearest neighbor sampling.
- MPSGraph.ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName: Resamples input images to given size using the provided scale and offset and nearest neighbor sampling See above discussion for more details.
- MPSGraph.ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName: Creates a Resize operation and returns the result tensor.
- MPSGraph.ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName: Creates a Resize gradient operation and returns the result tensor.
- MPSGraph.ReverseTensorAxesName: Creates a reverse operation and returns the result tensor.
- MPSGraph.ReverseTensorAxesTensorName: Creates a reverse operation and returns the result tensor.
- MPSGraph.ReverseTensorName: Creates a reverse operation and returns the result tensor.
- MPSGraph.RintWithTensorName: Rounds the input tensor elements by rounding to nearest even.
- MPSGraph.RoundWithTensorName: Rounds the input tensor elements.
- MPSGraph.RunWithFeedsTargetTensorsTargetOperations: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- MPSGraph.RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary: Runs the graph for the given feeds and returns the target tensor values in the results dictionary provided by the user.
- MPSGraph.RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- MPSGraph.RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- MPSGraph.RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor: Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
- MPSGraph.RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- MPSGraph.SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName: Samples a tensor using the coordinates provided, using nearest neighbor sampling with specified rounding mode.
- MPSGraph.SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName: Samples a tensor using the coordinates provided.
- MPSGraph.ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName: Creates a scaled dot product attention (SDPA) operation and returns the result tensor.
- MPSGraph.ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName: Creates a scaled dot product attention (SDPA) operation (without a mask) and returns the result tensor.
- MPSGraph.ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName: Creates a Scatter operation and returns the result tensor.
- MPSGraph.ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- MPSGraph.ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- MPSGraph.ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- MPSGraph.ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName: Creates a ScatterAlongAxis operation and returns the result tensor.
- MPSGraph.ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName: Creates a ScatterND operation and returns the result tensor.
- MPSGraph.ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName: Creates a ScatterND operation and returns the result tensor.
- MPSGraph.ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName: Creates a ScatterND operation and returns the result tensor.
- MPSGraph.ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName: Creates a Scatter operation and returns the result tensor.
- MPSGraph.SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName: Selects values from either the true or false predicate tensor, depending on the values in the first input.
- MPSGraph.ShapeOfTensorName: Creates a shape-of operation and returns the result tensor.
- MPSGraph.SigmoidWithTensorName: Computes the sigmoid operation on an input tensor.
- MPSGraph.SigmoidGradientWithIncomingGradientSourceTensorName: Computes the gradient of the sigmoid function using the incoming gradient tensor.
- MPSGraph.SignWithTensorName: Returns the sign of the input tensor elements.
- MPSGraph.SignbitWithTensorName: Returns the sign bit of the input tensor elements.
- MPSGraph.SinWithTensorName: Applies the sine operation to the input tensor elements.
- MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
- MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName: Creates a single-gate RNN gradient operation and returns the gradient tensor values.
- MPSGraph.SinhWithTensorName: Applies the hyperbolic sine operation to the input tensor elements.
- MPSGraph.SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice gradient operation and returns the result tensor.
- MPSGraph.SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName: Creates a slice gradient operation and returns the result tensor.
- MPSGraph.SliceGradientTensorFwdInShapeTensorStartsEndsStridesName: Creates a strided-slice gradient operation and returns the result tensor.
- MPSGraph.SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice gradient operation and returns the result tensor.
- MPSGraph.SliceTensorDimensionStartLengthName: Creates a slice operation and returns the result tensor.
- MPSGraph.SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice operation and returns the result tensor.
- MPSGraph.SliceTensorStartTensorSizeTensorSqueezeMaskName: Creates a slice operation and returns the result tensor.
- MPSGraph.SliceTensorStartsEndsStridesName: Creates a strided-slice operation and returns the result tensor.
- MPSGraph.SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice operation and returns the result tensor.
- MPSGraph.SliceUpdateDataTensorUpdateTensorStartsEndsStridesName: Creates a strided-slice update operation with zero masks and returns the result tensor.
- MPSGraph.SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName: Creates a strided-slice update operation and returns the result tensor.
- MPSGraph.SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName: Creates a strided-slice update operation with zero masks and returns the result tensor.
- MPSGraph.SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName: Creates a strided-slice update operation and returns the result tensor.
- MPSGraph.SoftMaxWithTensorAxisName: Computes the softmax function on the input tensor along the specified axis.
- MPSGraph.SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName: Creates a softmax cross-entropy loss operation and returns the result tensor.
- MPSGraph.SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName: Creates the gradient of a softmax cross-entropy loss operation and returns the result tensor.
- MPSGraph.SoftMaxGradientWithIncomingGradientSourceTensorAxisName: Computes the gradient of the softmax function along the specified axis using the incoming gradient tensor.
- MPSGraph.SortWithTensorAxisDescendingName: Sorts the elements of the input tensor along the specified axis.
- MPSGraph.SortWithTensorAxisName: Sorts the elements of the input tensor along the specified axis.
- MPSGraph.SortWithTensorAxisTensorDescendingName: Sorts the elements of the input tensor along the specified axis.
- MPSGraph.SortWithTensorAxisTensorName: Sorts the elements of the input tensor along the specified axis.
- MPSGraph.SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName: Creates a space-to-depth2D operation and returns the result tensor.
- MPSGraph.SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName: Creates a space-to-depth2D operation and returns the result tensor.
- MPSGraph.SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName: Creates a space-to-batch operation and returns the result tensor.
- MPSGraph.SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName: Creates a space-to-batch operation and returns the result tensor.
- MPSGraph.SparseTensorWithDescriptorTensorsShapeName: Creates a sparse tensor representation.
- MPSGraph.SparseTensorWithTypeTensorsShapeDataTypeName: Creates a sparse tensor representation.
- MPSGraph.SplitTensorNumSplitsAxisName: Creates a split operation and returns the result tensor.
- MPSGraph.SplitTensorSplitSizesAxisName: Creates a split operation and returns the result tensor.
- MPSGraph.SplitTensorSplitSizesTensorAxisName: Creates a split operation and returns the result tensor.
- MPSGraph.SquareWithTensorName: Applies the square operation to the input tensor elements.
- MPSGraph.SquareRootWithTensorName: Applies the square root operation to the input tensor elements.
- MPSGraph.SqueezeTensorAxesName: Creates a squeeze operation and returns the result tensor.
- MPSGraph.SqueezeTensorAxesTensorName: Creates a squeeze operation and returns the result tensor.
- MPSGraph.SqueezeTensorAxisName: Creates a squeeze operation and returns the result tensor.
- MPSGraph.SqueezeTensorName: Creates a squeeze operation and returns the result tensor.
- MPSGraph.StackTensorsAxisName: Creates a stack operation and returns the result tensor.
- MPSGraph.StencilWithSourceTensorWeightsTensorDescriptorName: Creates a stencil operation and returns the result tensor.
- MPSGraph.StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName: The Stochastic gradient descent performs a gradient descent.
- MPSGraph.SubtractionWithPrimaryTensorSecondaryTensorName: Subtracts the second input tensor from the first.
- MPSGraph.TanWithTensorName: Applies the tangent operation to the input tensor elements.
- MPSGraph.TanhWithTensorName: Applies the hyperbolic tangent operation to the input tensor elements.
- MPSGraph.TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName: Creates a tile gradient operation and returns the result tensor.
- MPSGraph.TileTensorWithMultiplierName: Creates a tile operation and returns the result tensor.
- MPSGraph.TopKWithSourceTensorAxisKName: Creates a TopK operation and returns the value and indices tensors.
- MPSGraph.TopKWithSourceTensorAxisTensorKTensorName: Creates a TopK operation and returns the result tensor.
- MPSGraph.TopKWithSourceTensorKName: Creates a TopK operation and returns the value and indices tensors
- MPSGraph.TopKWithSourceTensorKTensorName: Creates a TopK operation and returns the result tensor.
- MPSGraph.TopKWithGradientTensorSourceKName: Creates a TopKGradient operation and returns the result tensor.
- MPSGraph.TopKWithGradientTensorSourceKTensorName: Creates a TopKGradient operation and returns the result tensor.
- MPSGraph.TopKWithGradientTensorSourceAxisKName: Creates a TopKGradient operation and returns the result tensor.
- MPSGraph.TopKWithGradientTensorSourceAxisTensorKTensorName: Creates a TopKGradient operation and returns the result tensor.
- MPSGraph.TransposeTensorPermutationName: Creates a permutation operation and returns the result tensor.
- MPSGraph.TransposeTensorDimensionWithDimensionName: Creates a transpose operation and returns the result tensor.
- MPSGraph.TruncateWithTensorName: Applies the truncate operation to the input tensor elements.
- MPSGraph.VariableWithDataShapeDataTypeName: Creates a variable operation and returns the result tensor.
- MPSGraph.VariableFromTensorWithTensorName: Creates a variable from an input tensor.
- MPSGraph.VarianceOfTensorAxesName: Returns the variance of the first input along the specified axes.
- MPSGraph.VarianceOfTensorMeanTensorAxesName: Returns the variance of the first input along the specified axes when the mean has been precomputed.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph
func MPSGraphFromID ¶
MPSGraphFromID constructs a MPSGraph from an objc.ID.
The optimized representation of a compute graph of operations and tensors.
func (MPSGraph) AbsoluteSquareWithTensorName ¶
func (g MPSGraph) AbsoluteSquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the absolute square of the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation..
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) AbsoluteWithTensorName ¶
func (g MPSGraph) AbsoluteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the absolute values of the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/absolute(with:name:)
func (MPSGraph) AcosWithTensorName ¶
func (g MPSGraph) AcosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse cosine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/acos(with:name:)
func (MPSGraph) AcoshWithTensorName ¶
func (g MPSGraph) AcoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse hyperbolic cosine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/acosh(with:name:)
func (MPSGraph) AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName ¶
func (g MPSGraph) AdamWithCurrentLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(currentLearningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, beta2Tensor IMPSGraphTensor, epsilonTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, momentumTensor IMPSGraphTensor, velocityTensor IMPSGraphTensor, maximumVelocityTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) []MPSGraphTensor
Creates operations to apply Adam optimization.
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
Return Value ¶
If maximumVelocity is nil array of 3 tensors (update, newMomentum, newVelocity) else array of 4 tensors (update, newMomentum, newVelocity, newMaximumVelocity)
Discussion ¶
The adam update ops are added ¶
func (MPSGraph) AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName ¶
func (g MPSGraph) AdamWithLearningRateTensorBeta1TensorBeta2TensorEpsilonTensorBeta1PowerTensorBeta2PowerTensorValuesTensorMomentumTensorVelocityTensorMaximumVelocityTensorGradientTensorName(learningRateTensor IMPSGraphTensor, beta1Tensor IMPSGraphTensor, beta2Tensor IMPSGraphTensor, epsilonTensor IMPSGraphTensor, beta1PowerTensor IMPSGraphTensor, beta2PowerTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, momentumTensor IMPSGraphTensor, velocityTensor IMPSGraphTensor, maximumVelocityTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) []MPSGraphTensor
Creates operations to apply Adam optimization.
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
Return Value ¶
If maximumVelocity is nil array of 3 tensors (update, newMomentum, newVelocity) else array of 4 tensors (update, newMomentum, newVelocity, newMaximumVelocity)
Discussion ¶
The adam update ops are added current learning rate:
func (MPSGraph) AdditionWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) AdditionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Adds two input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates an add operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/addition(_:_:name:)
func (MPSGraph) ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName ¶
func (g MPSGraph) ApplyStochasticGradientDescentWithLearningRateTensorVariableGradientTensorName(learningRateTensor IMPSGraphTensor, variable IMPSGraphVariableOp, gradientTensor IMPSGraphTensor, name string) IMPSGraphOperation
The Stochastic gradient descent performs a gradient descent `variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable this op directly writes to the variable
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
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ArgSortWithTensorAxisDescendingName ¶
func (g MPSGraph) ArgSortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
Computes the indices that sort the elements of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object with 32-bit integer data type ¶
func (MPSGraph) ArgSortWithTensorAxisName ¶
func (g MPSGraph) ArgSortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the indices that sort the elements of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension over which you sort the tensor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object with 32-bit integer data type ¶
func (MPSGraph) ArgSortWithTensorAxisTensorDescendingName ¶
func (g MPSGraph) ArgSortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, name string) IMPSGraphTensor
Computes the indices that sort the elements of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object with 32-bit integer data type ¶
func (MPSGraph) ArgSortWithTensorAxisTensorName ¶
func (g MPSGraph) ArgSortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the indices that sort the elements of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension over which you sort the tensor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object with 32-bit integer data type ¶
func (MPSGraph) AsinWithTensorName ¶
func (g MPSGraph) AsinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse sine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/asin(with:name:)
func (MPSGraph) AsinhWithTensorName ¶
func (g MPSGraph) AsinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse hyperbolic sine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/asinh(with:name:)
func (MPSGraph) AssignVariableWithValueOfTensorName ¶
func (g MPSGraph) AssignVariableWithValueOfTensorName(variable IMPSGraphTensor, tensor IMPSGraphTensor, name string) IMPSGraphOperation
Creates an assign operation which writes at this point of execution of the graph.
variable: The variable resource tensor to assign to.
tensor: The tensor to assign to the variable.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) Atan2WithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) Atan2WithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise two-argument arctangent of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a `atan2` operation and returns the result tensor. It supports broadcasting as well. Graph computes arc tangent of primaryTensor over secondaryTensor.
func (MPSGraph) AtanWithTensorName ¶
func (g MPSGraph) AtanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse tangent operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/atan(with:name:)
func (MPSGraph) AtanhWithTensorName ¶
func (g MPSGraph) AtanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the inverse hyperbolic tangent operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/atanh(with:name:)
func (MPSGraph) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraph) AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName ¶
func (g MPSGraph) AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D average pooling gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) AvgPooling2DWithSourceTensorDescriptorName ¶
func (g MPSGraph) AvgPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D average-pooling operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName ¶
func (g MPSGraph) AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates an average pooling gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) AvgPooling4DWithSourceTensorDescriptorName ¶
func (g MPSGraph) AvgPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a 4D average pooling operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) BandPartWithTensorNumLowerNumUpperName ¶
func (g MPSGraph) BandPartWithTensorNumLowerNumUpperName(inputTensor IMPSGraphTensor, numLower int, numUpper int, name string) IMPSGraphTensor
Computes the band part of an input tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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
The values outside of the band are set to 0.
func (MPSGraph) BandPartWithTensorNumLowerTensorNumUpperTensorName ¶
func (g MPSGraph) BandPartWithTensorNumLowerTensorNumUpperTensorName(inputTensor IMPSGraphTensor, numLowerTensor IMPSGraphTensor, numUpperTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates the band part operation and returns the result.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
See above discussion of bandPartWithTensor: numLower: numUpper: name:
func (MPSGraph) BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName ¶
func (g MPSGraph) BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, blockDimensions []foundation.NSNumber, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a batch-to-space operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
This operation outputs a copy of the input tensor, where values from the `batchAxis` dimension are moved in spatial blocks of size `blockDimensions` to the `spatialAxes` dimensions (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported, otherwise limited only by [MPSNDArray] rank limitations). 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.SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName. Note: This operation is a generalization of MPSGraph.DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName ¶
func (g MPSGraph) BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, batchAxisTensor IMPSGraphTensor, blockDimensionsTensor IMPSGraphTensor, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a batch-to-space operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName. Note: This operation is a generalization of MPSGraph.DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) BitwiseANDWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) BitwiseANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise bitwise AND of binary representations of two integer tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) BitwiseLeftShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise left-shifted binary representations of the primary integer by the secondary tensor amount.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) BitwiseNOTWithTensorName ¶
func (g MPSGraph) BitwiseNOTWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the bitwise NOT operation to the input tensor element.
tensor: The input tensor, which must be of integer type.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation only accepts integer tensors.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/bitwiseNOT(_:name:)
func (MPSGraph) BitwiseORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) BitwiseORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise bitwise OR of binary representations of two integer tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/bitwiseOR(_:_:name:)
func (MPSGraph) BitwisePopulationCountWithTensorName ¶
func (g MPSGraph) BitwisePopulationCountWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the population count of the input tensor elements.
tensor: The input tensor, which must be of integer type.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation only accepts integer tensors, and returns the number of bits set in the input element.
func (MPSGraph) BitwiseRightShiftWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) BitwiseRightShiftWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise right-shifted binary representations of the primary integer by the secondary tensor amount.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) BitwiseXORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) BitwiseXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise bitwise XOR of binary representations of two integer tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) BottomKWithGradientTensorSourceAxisKName ¶
func (g MPSGraph) BottomKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, name string) IMPSGraphTensor
Creates a BottomKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K smallest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) BottomKWithGradientTensorSourceAxisTensorKTensorName ¶
func (g MPSGraph) BottomKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a BottomKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K smallest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) BottomKWithSourceTensorAxisKName ¶
func (g MPSGraph) BottomKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
Creates a BottomK operation and returns the value and indices tensors.
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.
Return Value ¶
A valid MPSGraphTensor array of size 2.
Discussion ¶
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.
func (MPSGraph) BottomKWithSourceTensorAxisTensorKTensorName ¶
func (g MPSGraph) BottomKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
Creates a BottomK operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of size 2.
Discussion ¶
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.
func (MPSGraph) BroadcastTensorToShapeName ¶
func (g MPSGraph) BroadcastTensorToShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
Creates a broadcast operation and returns the result tensor.
tensor: The tensor to be broadcasted
shape: The shape of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) BroadcastTensorToShapeTensorName ¶
func (g MPSGraph) BroadcastTensorToShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a broadcast operation and returns the result tensor.
tensor: The Tensor to be broadcasted.
shapeTensor: A rank-1 tensor of type [MPSDataTypeInt32] or [MPSDataTypeInt64] that defines the shape of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) CallSymbolNameInputTensorsOutputTypesName ¶
func (g MPSGraph) CallSymbolNameInputTensorsOutputTypesName(symbolName string, inputTensors []MPSGraphTensor, outputTypes []MPSGraphType, name string) []MPSGraphTensor
Creates an operation which invokes another executable.
symbolName: The unique identifier used to find the executable in the `MPSGraphCompilationDescriptor.Callables()` directory.
inputTensors: The tensors which are passed as inputs to the executable being invoked.
outputTypes: The expected return types of the executable being invoked.
name: Name of operation.
Return Value ¶
An array of valid MPSGraphTensor objects representing the return tensors of the invoked executable.
func (MPSGraph) CastTensorToTypeName ¶
func (g MPSGraph) CastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
Creates a cast operation and returns the result tensor.
tensor: The input tensor.
type: The datatype to which MPSGraph casts the input.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Returns the input tensor casted to the specied data type.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/cast(_:to:name:)
func (MPSGraph) CeilWithTensorName ¶
func (g MPSGraph) CeilWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the ceiling operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/ceil(with:name:)
func (MPSGraph) ClampWithTensorMinValueTensorMaxValueTensorName ¶
func (g MPSGraph) ClampWithTensorMinValueTensorMaxValueTensorName(tensor IMPSGraphTensor, minValueTensor IMPSGraphTensor, maxValueTensor IMPSGraphTensor, name string) IMPSGraphTensor
Clamps the values in the first tensor between the corresponding values in the minimum and maximum value tensor.
tensor: The tensor to be clamped.
minValueTensor: The tensor with min values to clamp to.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a clamp operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) ColToImWithSourceTensorOutputShapeDescriptorName ¶
func (g MPSGraph) ColToImWithSourceTensorOutputShapeDescriptorName(source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphImToColOpDescriptor, name string) IMPSGraphTensor
Creates a column to image operation and returns the result tensor.
source: The tensor containing the source data. Must be of rank 4. The layout is defined by `descriptor.DataLayout()`.
outputShape: The result tensor shape.
descriptor: The descriptor object that specifies the parameters of the operation.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor ¶
func (g MPSGraph) CompileWithDeviceFeedsTargetTensorsTargetOperationsCompilationDescriptor(device IMPSGraphDevice, feeds MPSGraphTensorShapedTypeDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, compilationDescriptor IMPSGraphCompilationDescriptor) IMPSGraphExecutable
Compiles the graph for the given feeds to returns the target tensor values, ensuring all target operations would be executed.
device: MPSGraph device to optimize for.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
compilationDescriptor: Compilation descriptor to set different compilation parameters.
Return Value ¶
A valid MPSGraphExecutable object ¶
Discussion ¶
This call blocks until execution has completed. The compilation descriptor helps specialize the executable returned.
func (MPSGraph) ComplexTensorWithRealTensorImaginaryTensorName ¶
func (g MPSGraph) ComplexTensorWithRealTensorImaginaryTensorName(realTensor IMPSGraphTensor, imaginaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns a complex tensor from the two input tensors.
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..
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ConcatTensorWithTensorDimensionName ¶
func (g MPSGraph) ConcatTensorWithTensorDimensionName(tensor IMPSGraphTensor, tensor2 IMPSGraphTensor, dimensionIndex int, name string) IMPSGraphTensor
Creates a concatenation operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Concatenates two input tensors along the specified dimension. Tensors must be broadcast compatible along all other dimensions, and have the same datatype.
func (MPSGraph) ConcatTensorsDimensionInterleaveName ¶
func (g MPSGraph) ConcatTensorsDimensionInterleaveName(tensors []MPSGraphTensor, dimensionIndex int, interleave bool, name string) IMPSGraphTensor
Creates a concatenation operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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:
func (MPSGraph) ConcatTensorsDimensionName ¶
func (g MPSGraph) ConcatTensorsDimensionName(tensors []MPSGraphTensor, dimensionIndex int, name string) IMPSGraphTensor
Creates a concatenation operation and returns the result tensor.
tensors: The tensors to concatenate.
dimensionIndex: The dimension to concatenate across, must be in range: `-rank <= dimension < rank`.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Concatenates all input tensors along the specified dimension. All inputs must be broadcast compatible along all other dimensions, and have the same datatype.
func (MPSGraph) ConjugateWithTensorName ¶
func (g MPSGraph) ConjugateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the complex conjugate of the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation..
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ConstantWithDataShapeDataType ¶
func (g MPSGraph) ConstantWithDataShapeDataType(data foundation.NSData, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
Creates a constant op with a given shape and data, and returns the result tensor.
data: The data for the tensor. The number of bytes should be sizeof(dataType)numberOfElements.
shape: The shape of the output tensor. This has to be statically shaped.
dataType: The dataType of theconstant tensor.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ConstantWithRealPartImaginaryPart ¶
func (g MPSGraph) ConstantWithRealPartImaginaryPart(realPart float64, imaginaryPart float64) IMPSGraphTensor
Creates a complex constant op with the MPSDataTypeComplexFloat32 data type and returns the result tensor.
realPart: The real part of the complex scalar to fill the entire tensor values with.
imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ConstantWithRealPartImaginaryPartDataType ¶
func (g MPSGraph) ConstantWithRealPartImaginaryPartDataType(realPart float64, imaginaryPart float64, dataType uint32) IMPSGraphTensor
Creates a complex constant operation and returns the result tensor.
realPart: The real part of the complex scalar to fill the entire tensor values with.
imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
dataType: The dataType of the constant tensor.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ConstantWithRealPartImaginaryPartShapeDataType ¶
func (g MPSGraph) ConstantWithRealPartImaginaryPartShapeDataType(realPart float64, imaginaryPart float64, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
Creates a complex constant op with a given shape and returns the result tensor.
realPart: The real part of the complex scalar to fill the entire tensor values with.
imaginaryPart: The imaginary part of the complex scalar to fill the entire tensor values with.
shape: The shape of the output tensor. This has to be statically shaped.
dataType: The dataType of the constant tensor.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ConstantWithScalarDataType ¶
func (g MPSGraph) ConstantWithScalarDataType(scalar float64, dataType uint32) IMPSGraphTensor
Creates a constant operation and returns the result tensor.
scalar: The scalar value to fill the entire tensor values with.
dataType: The dataType of the constant tensor.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ConstantWithScalarShapeDataType ¶
func (g MPSGraph) ConstantWithScalarShapeDataType(scalar float64, shape foundation.NSArray, dataType uint32) IMPSGraphTensor
Creates a constant op with a given shape and returns the result tensor.
scalar: The scalar value to fill the entire tensor values with.
shape: The shape of the output tensor.
dataType: The dataType of the constant tensor.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
incomingGradient: Incoming loss gradient tensor
weights: Forward pass weights tensor
outputShape: Shape of the forward pass source tensor
forwardConvolutionDescriptor: Forward convolution 2D op `descriptor`
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [S] is source tensor to forward convolution, [R] is the result/returned tensor from forward convolution, and [L] is the loss function, `convolution2DDataGradientWithIncomingGradientTensor` returns tensor `dL/dS = dL/dR * dR/dS`, where `dL/dR` is the incomingGradient parameter.
func (MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D convolution gradient operation with respect to the source tensor of the forward convolution.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [S] is source tensor to forward convolution, [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.
func (MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D convolution gradient operation with respect to the weights tensor of the forward convolution.
incomingGradient: Incoming loss gradient tensor
outputShape: Shape of the forward pass source tensor
forwardConvolutionDescriptor: Forward convolution 2D op `descriptor`
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [W] is weights tensor to forward convolution, [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.
func (MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D convolution gradient operation with respect to weights tensor of forward convolution.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [W] is weights tensor to forward convolution, [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.
func (MPSGraph) Convolution2DWithSourceTensorWeightsTensorDescriptorName ¶
func (g MPSGraph) Convolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D (forward) convolution operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
incomingGradient: Incoming loss gradient tensor
weights: Forward pass weights tensor
outputShape: Shape of the forward pass source tensor
forwardConvolutionDescriptor: Forward convolution 2D op `descriptor`
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [S] is source tensor to forward convolution, [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.
func (MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, weights IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D convolution gradient operation with respect to the source tensor of the forward convolution.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [S] is source tensor to forward convolution, [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.
func (MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
incomingGradient: Incoming loss gradient tensor
outputShape: Shape of the forward pass source tensor
forwardConvolutionDescriptor: Forward convolution 2D op `descriptor`
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [W] is weights tensor to forward convolution, [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.
func (MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) Convolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, outputShapeTensor IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D convolution gradient operation with respect to the weights tensor of the forward convolution.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
If [W] is weights tensor to forward convolution, [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.
func (MPSGraph) Convolution3DWithSourceTensorWeightsTensorDescriptorName ¶
func (g MPSGraph) Convolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D forward convolution operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
incomingGradient: Incoming gradient tensor
weights: Forward pass weights tensor
outputShape: Shape of the forward pass source tensor
forwardConvolutionDescriptor: Forward pass op descriptor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Inserts an operation in graph to compute gradient of convolution transpose with respect to source tensor of the corresponding convolution transpose operation.
func (MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose gradient operation with respect to the source tensor of convolution transpose operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Inserts an operation in graph to compute gradient of convolution transpose with respect to source tensor of the corresponding convolution transpose operation.
func (MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
incomingGradientTensor: Incoming gradient tensor
source: Forward pass source tensor
outputShape: Shape of the forward pass source weights tensor
forwardConvolutionDescriptor: Forward pass op descriptor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Inserts an operation in graph to compute gradient of convolution transpose with respect to the weights tensor of the corresponding convolution transpose operation.
func (MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeTensorForwardConvolutionDescriptorName(incomingGradientTensor IMPSGraphTensor, source IMPSGraphTensor, outputShape IMPSGraphTensor, forwardConvolutionDescriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose gradient operation with respect to the weights tensor of the convolution transpose operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Inserts an operation in graph to compute gradient of convolution transpose with respect to the weights tensor of the corresponding convolution transpose operation.
func (MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose operation and returns the result tensor.
source: Input tensor
weights: Weights tensor
outputShape: Shape of the result tensor.
descriptor: Descriptor for the corresponding forward 2D-convolution operation
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Convolution Tranpose operation is exactly the same as convolution gradint with respect to input image `convolution2DDataGradientWithIncomingGradient`. Weights tensor and source tensors are interpreted as they are in `convolution2DDataGradientWithIncomingGradient`. Convolution with stride `s` downsamples source tensor by factor `s` in spatial dimensions whereas convolution tranpose with stride `s` upsamples source tensor by factor `s`. Convolution transpose can map the same source size to multiple destination sizes. The relationship between the width of the source and the width of the destination is `(sourceWidth - 1)stride + 1 + (kernelWidth - 1)dilationRate <= destinationWidth + paddingLeft + paddingRight` so there are stride -1 values of the width of the destination that give same width of the source. In order to disambiguate, outputShape parameter is used.
func (MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName ¶
func (g MPSGraph) ConvolutionTranspose2DWithSourceTensorWeightsTensorOutputShapeTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a convolution transpose operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) CoordinateAlongAxisTensorWithShapeName ¶
func (g MPSGraph) CoordinateAlongAxisTensorWithShapeName(axisTensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
Creates a get-coordindate operation and returns the result tensor.
axisTensor: A Scalar tensor of type [MPSDataTypeInt32], that specifies the coordinate axis an element’s value is set to. Negative values wrap around.
shape: The shape of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
func (MPSGraph) CoordinateAlongAxisTensorWithShapeTensorName ¶
func (g MPSGraph) CoordinateAlongAxisTensorWithShapeTensorName(axisTensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a get-coordindate operation and returns the result tensor.
axisTensor: A Scalar tensor of type [MPSDataTypeInt32], that specifies the coordinate axis an element’s value is set to. Negative values wrap around.
shapeTensor: A rank-1 tensor of type [MPSDataTypeInt32] or [MPSDataTypeInt64] that defines the shape of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
func (MPSGraph) CoordinateAlongAxisWithShapeName ¶
func (g MPSGraph) CoordinateAlongAxisWithShapeName(axis int, shape foundation.NSArray, name string) IMPSGraphTensor
Creates a get-coordindate operation and returns the result tensor.
axis: The coordinate axis an element’s value is set to. Negative values wrap around.
shape: The shape of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Creates a tensor of specified shape with value at index `[i_0, i_1, ... , i_N] = i_axis` For example,
func (MPSGraph) CoordinateAlongAxisWithShapeTensorName ¶
func (g MPSGraph) CoordinateAlongAxisWithShapeTensorName(axis int, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a get-coordindate operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
func (MPSGraph) CosWithTensorName ¶
func (g MPSGraph) CosWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the cosine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/cos(with:name:)
func (MPSGraph) CoshWithTensorName ¶
func (g MPSGraph) CoshWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the hyperbolic cosine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/cosh(with:name:)
func (MPSGraph) CumulativeMaximumWithTensorAxisExclusiveReverseName ¶
func (g MPSGraph) CumulativeMaximumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative maximum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMaximumWithTensorAxisName ¶
func (g MPSGraph) CumulativeMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the cumulative maximum of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMaximumWithTensorAxisTensorExclusiveReverseName ¶
func (g MPSGraph) CumulativeMaximumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative maximum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMaximumWithTensorAxisTensorName ¶
func (g MPSGraph) CumulativeMaximumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the cumulative maximum of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMinimumWithTensorAxisExclusiveReverseName ¶
func (g MPSGraph) CumulativeMinimumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative minimum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMinimumWithTensorAxisName ¶
func (g MPSGraph) CumulativeMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the cumulative minimum of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMinimumWithTensorAxisTensorExclusiveReverseName ¶
func (g MPSGraph) CumulativeMinimumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative minimum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeMinimumWithTensorAxisTensorName ¶
func (g MPSGraph) CumulativeMinimumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the cumulative minimum of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeProductWithTensorAxisExclusiveReverseName ¶
func (g MPSGraph) CumulativeProductWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative product of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeProductWithTensorAxisName ¶
func (g MPSGraph) CumulativeProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the cumulative product of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeProductWithTensorAxisTensorExclusiveReverseName ¶
func (g MPSGraph) CumulativeProductWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative product of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeProductWithTensorAxisTensorName ¶
func (g MPSGraph) CumulativeProductWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the cumulative product of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeSumWithTensorAxisExclusiveReverseName ¶
func (g MPSGraph) CumulativeSumWithTensorAxisExclusiveReverseName(tensor IMPSGraphTensor, axis int, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative sum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeSumWithTensorAxisName ¶
func (g MPSGraph) CumulativeSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the cumulative sum of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeSumWithTensorAxisTensorExclusiveReverseName ¶
func (g MPSGraph) CumulativeSumWithTensorAxisTensorExclusiveReverseName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, exclusive bool, reverse bool, name string) IMPSGraphTensor
Computes the cumulative sum of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) CumulativeSumWithTensorAxisTensorName ¶
func (g MPSGraph) CumulativeSumWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the cumulative sum of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension where you compute the cumulative operation
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName ¶
func (g MPSGraph) DepthToSpace2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a depth-to-space2D operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
This operation outputs a copy of the input tensor, where values from the `depthAxis` dimension are moved in spatial blocks of size `blockSize` to the `heightAxis` and `widthAxis` dimensions. 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.SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName ¶
func (g MPSGraph) DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, heightAxisTensor IMPSGraphTensor, depthAxisTensor IMPSGraphTensor, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a depth-to-space2D operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D-depthwise convolution gradient for data operation and returns the result tensor.
incomingGradient: A 2D input gradient tensor - must be of rank=4. The layout is defined by `descriptor.DataLayout()`.
weights: The weights tensor, must be rank=4. The layout is defined by `descriptor.WeightsLayout()`.
outputShape: The shape of the οutput tensor (and therefore input tensor of forward pass).
descriptor: The descriptor object that specifies strides, dilation rates, paddings and layouts.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D-depthwise convolution gradient for weights operation and returns the result tensor.
incomingGradient: A 2D input gradient tensor - must be of rank=4. The layout is defined by `descriptor.DataLayout()`.
source: A 2D Image source as tensor - must be of rank=4. The layout is defined by `descriptor.DataLayout()`.
outputShape: The shape of the οutput tensor (and therefore weight tensor of forward pass).
descriptor: The descriptor object that specifies strides, dilation rates, paddings and layouts.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphDepthwiseConvolution2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D-depthwise convolution operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, weights IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D depthwise convolution gradient for data operation and returns the result tensor.
incomingGradient: A 3D input gradient tensor - must be at least rank=4 (CDHW).
weights: The weights tensor, must be rank=4 - axes are interpreted as CDHW.
outputShape: The shape of the οutput tensor (and therefore input tensor of forward pass).
descriptor: The descriptor object that specifies strides, dilation rates and paddings.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName(incomingGradient IMPSGraphTensor, source IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D depthwise convolution gradient for weights operation and returns the result tensor.
incomingGradient: A 3D input gradient tensor - must be at least rank=4 (NCDHW).
source: The forward pass 3D Image source as tensor - must be at least rank=4 (NCDHW).
outputShape: The shape of the οutput tensor (and therefore weight tensor of forward pass).
descriptor: The descriptor object that specifies strides, dilation rates and paddings.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName ¶
func (g MPSGraph) DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphDepthwiseConvolution3DOpDescriptor, name string) IMPSGraphTensor
Creates a 3D depthwise convolution operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) DequantizeTensorLUTTensorAxisName ¶
func (g MPSGraph) DequantizeTensorLUTTensorAxisName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a vector lookup-table based quantization operation and returns the result tensor.
tensor: Input tensor to be dequantized.
LUTTensor: The lookup table to use - for u4 the second to last dimension should have 16 elements, and for u8 256 elements.
axis: Axis on which the scale 1D value is being broadcasted.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Converts a u8 or u4 `tensor` to a float tensor by applying a lookup operation, where each input index defines a vector of values. The operation reads the vector values from the last dimension of the lookup table tensor and stores them into the dimension defined by `axis` on the result tensor.
Note: The operation supports LUT groups up to the last 2 dimensions for `tensor`.
func (MPSGraph) DequantizeTensorLUTTensorName ¶
func (g MPSGraph) DequantizeTensorLUTTensorName(tensor IMPSGraphTensor, LUTTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a lookup-table based quantization operation and returns the result tensor.
tensor: Input tensor to be dequantized.
LUTTensor: The lookup table to use - for u4 the last dimension should have 16 elements, and for u8 256 elements.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Converts a u8 or u4 `tensor` to a float tensor by applying a lookup operation:
Note: The operation supports LUT groups up to the last 3 dimensions for `tensor`.
func (MPSGraph) DequantizeTensorScaleTensorDataTypeName ¶
func (g MPSGraph) DequantizeTensorScaleTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, dataType uint32, name string) IMPSGraphTensor
Creates a dequantize operation and returns the result tensor.
tensor: Input tensor to be dequantized.
scaleTensor: Scale Tensor parameter with groups support.
dataType: Float data type of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor array of datatype `dataType`.
Discussion ¶
Converts the i8, u8, i4 or u4 `tensor` to a float tensor by applying a scale and bias transform:
func (MPSGraph) DequantizeTensorScaleTensorZeroPointDataTypeAxisName ¶
func (g MPSGraph) DequantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, dataType uint32, axis int, name string) IMPSGraphTensor
Creates Dequantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scaleTensor(tensor - zeroPoint)
func (MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName ¶
func (g MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, axis int, name string) IMPSGraphTensor
Creates a dequantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scaleTensor(tensor - zeroPointTensor)
func (MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeName ¶
func (g MPSGraph) DequantizeTensorScaleTensorZeroPointTensorDataTypeName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, name string) IMPSGraphTensor
Creates a dequantize operation and returns the result tensor.
tensor: Input tensor to be dequantized.
scaleTensor: The scale tensor with groups support.
zeroPointTensor: The bias tensor with groups support.
dataType: Float data type of the result tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor array of datatype `dataType`.
Discussion ¶
Convert the i8, u8, i4 or u4 `tensor` to a float tensor by applying a scale and bias transform:
func (MPSGraph) DequantizeTensorScaleZeroPointDataTypeName ¶
func (g MPSGraph) DequantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, name string) IMPSGraphTensor
Creates Dequantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the i8 or u8 `tensor` to a float tensor by applying a scale + bias transform: result = scale(tensor - zeroPoint)
func (MPSGraph) DivisionNoNaNWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) DivisionNoNaNWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Divides the first input tensor by the second, with the result being 0 if the denominator is 0.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
func (MPSGraph) DivisionWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) DivisionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Divides the first input tensor by the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a divide operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/division(_:_:name:)
func (MPSGraph) DropoutTensorRateName ¶
func (g MPSGraph) DropoutTensorRateName(tensor IMPSGraphTensor, rate float64, name string) IMPSGraphTensor
Creates a dropout operation and returns the result
tensor: Input tensor
rate: The rate of values to be set to 0
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Removes values in the `tensor` with a percentage chance equal to `rate`. Removed values are set to 0
func (MPSGraph) DropoutTensorRateTensorName ¶
func (g MPSGraph) DropoutTensorRateTensorName(tensor IMPSGraphTensor, rate IMPSGraphTensor, name string) IMPSGraphTensor
Creates a dropout operation and returns the result
tensor: Input tensor
rate: The rate of values to be set to 0
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Removes values in the `tensor` with a percentage chance equal to `rate`. Removed values are set to 0
func (MPSGraph) EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor ¶
func (g MPSGraph) EncodeToCommandBufferFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary, executionDescriptor IMPSGraphExecutionDescriptor)
Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
commandBuffer: commandBuffer passed to execute the graph on, commitAndContinue might be called, please don’t rely on underlying MTLCommandBuffer to remain uncommitted.
feeds: Feeds dictionary for the placeholder tensors.
targetOperations: Operations to be completed at the end of the run.
resultsDictionary: MPSGraphTensors dictionary passed by user, these will be filled with graph output data.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Discussion ¶
It ensures all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
func (MPSGraph) EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor ¶
func (g MPSGraph) EncodeToCommandBufferFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
Encodes the graph for the given feeds to returns the target tensor values, ensuring all target operations also executed.
commandBuffer: commandBuffer passed to exectute the graph on, it is an MPSCommandBuffer, commitAndContinue might be called, please don’t rely on underlying MTLCommandBuffer to remain uncommitted.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Return Value ¶
A valid MPSGraphTensor : MPSGraphTensorData dictionary with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
Discussion ¶
This call is asynchronous and will return immediately if a completionHandler is set.
func (MPSGraph) EqualWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) EqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise equality check of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a equal operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/equal(_:_:name:)
func (MPSGraph) ErfWithTensorName ¶
func (g MPSGraph) ErfWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the error function to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/erf(with:name:)
func (MPSGraph) ExpandDimsOfTensorAxesName ¶
func (g MPSGraph) ExpandDimsOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates an expand-dimensions operation and returns the result tensor.
tensor: The input tensor.
axes: The axes to expand.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Expands the tensor, inserting dimensions with size 1 at specified axes.
func (MPSGraph) ExpandDimsOfTensorAxesTensorName ¶
func (g MPSGraph) ExpandDimsOfTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates an expand-dimensions operation and returns the result tensor.
tensor: The input tensor.
axesTensor: The tensor containing the axes to expand.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Expands the tensor, inserting dimensions with size 1 at specified axes.
func (MPSGraph) ExpandDimsOfTensorAxisName ¶
func (g MPSGraph) ExpandDimsOfTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates an expand-dimensions operation and returns the result tensor.
tensor: The input tensor.
axis: The axis to expand.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Expands the tensor, inserting a dimension with size 1 at the specified axis.
func (MPSGraph) ExponentBase2WithTensorName ¶
func (g MPSGraph) ExponentBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies an exponent with base 2 to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ExponentBase10WithTensorName ¶
func (g MPSGraph) ExponentBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies an exponent with base 10 to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ExponentWithTensorName ¶
func (g MPSGraph) ExponentWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the natural exponent to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/exponent(with:name:)
func (MPSGraph) FastFourierTransformWithTensorAxesDescriptorName ¶
func (g MPSGraph) FastFourierTransformWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a fast Fourier transform operation and returns the result tensor.
tensor: A complex or real-valued input tensor.
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 the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid complex-valued MPSGraphTensor of the same shape as `tensor`.
Discussion ¶
This operation computes the fast Fourier transform of the input tensor according to the following formulae.
`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.
func (MPSGraph) FastFourierTransformWithTensorAxesTensorDescriptorName ¶
func (g MPSGraph) FastFourierTransformWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a fast Fourier transform operation and returns the result tensor.
tensor: A complex or real-valued input tensor.
axesTensor: A tensor of rank one containing the axes over which MPSGraph performs the transformation. See MPSGraph.FastFourierTransformWithTensorAxesDescriptorName.
descriptor: A descriptor that defines the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid complex-valued MPSGraphTensor of the same shape as `tensor`.
Discussion ¶
This operation computes the fast Fourier transform of the input tensor according to the following formulae.
`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.
func (MPSGraph) Flatten2DTensorAxisName ¶
func (g MPSGraph) Flatten2DTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a flatten2D operation and returns the result tensor.
tensor: The tensor to be flattened.
axis: The axis around which to flatten.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Flattens dimensions before `axis` to `result[0]` and dimensions starting from `axis` to `result[1]` and returns a rank-2 tensor as result.
func (MPSGraph) Flatten2DTensorAxisTensorName ¶
func (g MPSGraph) Flatten2DTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a flatten2D operation and returns the result tensor.
tensor: The tensor to be flattened.
axisTensor: A scalar tensor that contains the axis around which to flatten.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Flattens dimensions before `axis` to `result[0]` and dimensions starting from `axis` to `result[1]` and returns a rank-2 tensor as result.
func (MPSGraph) FloorModuloWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) FloorModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the remainder of floor divison between the primary and secondary tensor.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
Creates a floorModulo operation and returns the result tensor, it supports broadcasting as well, returns 0 if divisor is 0.
func (MPSGraph) FloorWithTensorName ¶
func (g MPSGraph) FloorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the floor operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/floor(with:name:)
func (MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName ¶
func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU gradient operation and returns the gradient tensor values.
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.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName with `descriptor.Training() = YES`.
outputFwd: The first output of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName.
func (MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName ¶
func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU gradient operation and returns the gradient tensor values.
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.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName with `descriptor.Training() = YES`.
outputFwd: The first output of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName.
func (MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName ¶
func (g MPSGraph) GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, outputFwd IMPSGraphTensor, stateGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, secondaryBias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU gradient operation and returns the gradient tensor values.
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.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName with `descriptor.Training() = YES`.
outputFwd: The first output of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName.
func (MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName ¶
func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
If `resetAfter = YES` then `c[t]` is replaced by
If `flipZ = YES` then `h[t]` is replaced by
[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()`.
func (MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName ¶
func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
If `resetAfter = YES` then `c[t]` is replaced by
If `flipZ = YES` then `h[t]` is replaced by
[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()`.
func (MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName ¶
func (g MPSGraph) GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, secondaryBias IMPSGraphTensor, descriptor IMPSGraphGRUDescriptor, name string) []MPSGraphTensor
Creates a GRU operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
If `resetAfter = YES` then `c[t]` is replaced by
If `flipZ = YES` then `h[t]` is replaced by
[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()`.
func (MPSGraph) GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName ¶
func (g MPSGraph) GatherAlongAxisTensorWithUpdatesTensorIndicesTensorName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a GatherAlongAxis operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) GatherAlongAxisWithUpdatesTensorIndicesTensorName ¶
func (g MPSGraph) GatherAlongAxisWithUpdatesTensorIndicesTensorName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a GatherAlongAxis operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName ¶
func (g MPSGraph) GatherNDWithUpdatesTensorIndicesTensorBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, batchDimensions uint, name string) IMPSGraphTensor
Creates a GatherND operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Gathers the slices in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as
The tensors have the following shape requirements ¶
func (MPSGraph) GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName ¶
func (g MPSGraph) GatherWithUpdatesTensorIndicesTensorAxisBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, axis uint, batchDimensions uint, name string) IMPSGraphTensor
Creates a Gather operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Gathers the values in updatesTensor to the result tensor along the indices in indicesTensor. The gather is defined as
The tensors have the following shape requirements ¶
func (MPSGraph) GradientForPrimaryTensorWithTensorsName ¶
func (g MPSGraph) GradientForPrimaryTensorWithTensorsName(primaryTensor IMPSGraphTensor, tensors []MPSGraphTensor, name string) foundation.INSDictionary
Calculates a partial derivative of primaryTensor with respect to the tensors.
primaryTensor: Tensor to be differentiated (numerator).
tensors: Tensors to do the differentiation with (denominator).
name: Name for the gradient operation.
Return Value ¶
A valid MPSGraphTensor dictionary object containing partial derivative d(primaryTensor)/d(secondaryTensor) for each tensor as key.
func (MPSGraph) GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) GreaterThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks in an elementwise manner if the first input tensor is greater than or equal to the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a `greaterThanOrEqual` operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) GreaterThanWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) GreaterThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks in an elementwise manner if the first input tensor is greater than the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a `greaterThan` operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName ¶
func (g MPSGraph) HammingDistanceWithPrimaryTensorSecondaryTensorResultDataTypeName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, resultDataType uint32, name string) IMPSGraphTensor
Computes the hamming distance of two input tensors with support for broadcasting.
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.
Return Value ¶
A valid tensor containing the hamming distance between the input tensors.
Discussion ¶
The hamming distance is computed between 2 sets of vectors and the last dimension(s) of each input tensor is considered a vector.
func (MPSGraph) HermiteanToRealFFTWithTensorAxesDescriptorName ¶
func (g MPSGraph) HermiteanToRealFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
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 the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor of type [MPSDataTypeFloat32] or [MPSDataTypeFloat16] (full size).
Discussion ¶
This operation computes the fast Fourier transform of a complex-valued input tensor according to the following formulae.
`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.
func (MPSGraph) HermiteanToRealFFTWithTensorAxesTensorDescriptorName ¶
func (g MPSGraph) HermiteanToRealFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a Hermitean-to-real fast Fourier transform operation and returns the result tensor.
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.FastFourierTransformWithTensorAxesDescriptorName.
descriptor: A descriptor that defines the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor of type [MPSDataTypeFloat32] or [MPSDataTypeFloat16] (full size).
Discussion ¶
This operation computes the fast Fourier transform of a complex-valued input tensor according to the following formulae.
`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.
func (MPSGraph) IdentityWithTensorName ¶
func (g MPSGraph) IdentityWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Copies the input tensor values into the output, behaving as an identity operation.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object which is a copy of the input.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/identity(with:name:)
func (MPSGraph) ImToColWithSourceTensorDescriptorName ¶
func (g MPSGraph) ImToColWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphImToColOpDescriptor, name string) IMPSGraphTensor
Creates an imToCol operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) ImaginaryPartOfTensorName ¶
func (g MPSGraph) ImaginaryPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the imaginary part of a tensor.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation..
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) InverseOfTensorName ¶
func (g MPSGraph) InverseOfTensorName(inputTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the inverse of an input tensor.
inputTensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the inverse of the input tensor.
Discussion ¶
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.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/inverse(input:name:)
func (MPSGraph) IsFiniteWithTensorName ¶
func (g MPSGraph) IsFiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks if the input tensor elements are finite or not.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
If the input tensor element is finite, the operation returns `true`, else it returns `false`.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/isFinite(with:name:)
func (MPSGraph) IsInfiniteWithTensorName ¶
func (g MPSGraph) IsInfiniteWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks if the input tensor elements are infinite or not.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
If the input tensor element is infinite, the operation returns `true`, else it returns `false`.
func (MPSGraph) IsNaNWithTensorName ¶
func (g MPSGraph) IsNaNWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks if the input tensor elements are [NaN] or not.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
If the input tensor element is [NaN], the operation returns `true`, else it returns `false`.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/isNaN(with:name:)
func (MPSGraph) L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName ¶
func (g MPSGraph) L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a L2-Norm pooling gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) L2NormPooling4DWithSourceTensorDescriptorName ¶
func (g MPSGraph) L2NormPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a 4D L2-norm pooling operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName ¶
func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM gradient operation and returns the gradient tensor values.
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.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName with `descriptor.Training() = YES`.
cellOutputFwd: The second output of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName.
func (MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName ¶
func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM gradient operation and returns the gradient tensor values.
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.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName with `descriptor.Training() = YES`.
cellOutputFwd: The second output of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName.
func (MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName ¶
func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM gradient operation and returns the gradient tensor values.
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.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName with `descriptor.Training() = YES`.
cellOutputFwd: The second output of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName.
func (MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName ¶
func (g MPSGraph) LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, cellOutputFwd IMPSGraphTensor, stateGradient IMPSGraphTensor, cellGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, peephole IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM gradient operation and returns the gradient tensor values.
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.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName with `descriptor.Training() = YES`.
cellOutputFwd: The second output of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName.
func (MPSGraph) LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName ¶
func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows:
[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()`.
func (MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName ¶
func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows:
[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()`.
func (MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName ¶
func (g MPSGraph) LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, initCell IMPSGraphTensor, mask IMPSGraphTensor, peephole IMPSGraphTensor, descriptor IMPSGraphLSTMDescriptor, name string) []MPSGraphTensor
Creates an LSTM operation and returns the value tensor and optionally the cell state tensor and the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `c` and optionally `z` that are defined recursively as follows:
[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()`.
func (MPSGraph) LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName ¶
func (g MPSGraph) LeakyReLUGradientWithIncomingGradientSourceTensorAlphaTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, alphaTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the gradient of the leaky rectified linear unit (ReLU) activation.
gradient: The incoming gradient tensor.
source: The input tensor in forward pass.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
Discussion ¶
This operation supports broadcasting with the alpha tensor.
func (MPSGraph) LeakyReLUWithTensorAlphaName ¶
func (g MPSGraph) LeakyReLUWithTensorAlphaName(tensor IMPSGraphTensor, alpha float64, name string) IMPSGraphTensor
Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
tensor: An input tensor.
alpha: The scalar value alpha used by all elements in the input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
Discussion ¶
The operation is: f(x) = max(x, alpha).
func (MPSGraph) LeakyReLUWithTensorAlphaTensorName ¶
func (g MPSGraph) LeakyReLUWithTensorAlphaTensorName(tensor IMPSGraphTensor, alphaTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the leaky rectified linear unit (ReLU) activation function on the input tensor.
tensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
Discussion ¶
The operation is: f(x) = max(x, alpha). This operation supports broadcasting with the alpha tensor.
func (MPSGraph) LessThanOrEqualToWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LessThanOrEqualToWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks in an elementwise manner if the first input tensor is less than or equal to the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a `lessThanOrEqualTo` operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) LessThanWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LessThanWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Checks in an elementwise manner if the first input tensor is less than the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a `lessThan` operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/lessThan(_:_:name:)
func (MPSGraph) LogarithmBase2WithTensorName ¶
func (g MPSGraph) LogarithmBase2WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the logarithm with base 2 to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) LogarithmBase10WithTensorName ¶
func (g MPSGraph) LogarithmBase10WithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the logarithm with base 10 to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) LogarithmWithTensorName ¶
func (g MPSGraph) LogarithmWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the natural logarithm to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) LogicalANDWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical AND of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical AND operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) LogicalNANDWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalNANDWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical NAND of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical NAND operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) LogicalNORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical NOR of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical NOR operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) LogicalORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical OR of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical OR operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/logicalOR(_:_:name:)
func (MPSGraph) LogicalXNORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalXNORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical XNOR of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical XNOR operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) LogicalXORWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) LogicalXORWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise logical XOR of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a logical XOR operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) MatrixMultiplicationWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MatrixMultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the matrix multiplication of 2 input tensors with support for broadcasting.
primaryTensor: The left-hand side tensor.
secondaryTensor: The right-hand side tensor.
name: The name for the operation.
Return Value ¶
A valid tensor containing the product of the input matrices.
func (MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName ¶
func (g MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
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.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName.
outputShape: The shape of the destination gradient.
descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
name: The name for the operation.
Return Value ¶
Destination gradient tensor.
Discussion ¶
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.
func (MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName ¶
func (g MPSGraph) MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
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.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName.
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.
Return Value ¶
Destination gradient tensor.
Discussion ¶
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.
func (MPSGraph) MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) MaxPooling2DReturnIndicesWithSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling2DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) []MPSGraphTensor
Creates a 2D max-pooling operation and returns the result tensor and the corresponding indices tensor.
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.
Return Value ¶
An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices
Discussion ¶
In order to Computes 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.
func (MPSGraph) MaxPooling2DWithSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling2DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling2DOpDescriptor, name string) IMPSGraphTensor
Creates a 2D max-pooling operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName ¶
func (g MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape foundation.NSArray, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
gradient: An input gradient tensor.
indices: Indices tensor returned from MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName.
outputShape: The shape of the destination gradient.
descriptor: A pooling operation descriptor that specifies pooling window sizes, strides, dilation rates, paddings and layouts.
name: The name for the operation.
Return Value ¶
Destination gradient tensor.
Discussion ¶
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.
func (MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName ¶
func (g MPSGraph) MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName(gradient IMPSGraphTensor, indices IMPSGraphTensor, outputShape IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
gradient: An input gradient tensor.
indices: The indices tensor returned from MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName.
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.
Return Value ¶
Destination gradient tensor.
Discussion ¶
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.
func (MPSGraph) MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName(gradient IMPSGraphTensor, source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a max-pooling gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) MaxPooling4DReturnIndicesWithSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling4DReturnIndicesWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) []MPSGraphTensor
Creates a 4D max-pooling operation and returns the result tensor and the corresponding indices tensor.
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.
Return Value ¶
An array of two MPSGraphTensors. The first tensor holds the result of max pool and the second tensor holds the corresponding indices.
Discussion ¶
In order to Computes 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.
func (MPSGraph) MaxPooling4DWithSourceTensorDescriptorName ¶
func (g MPSGraph) MaxPooling4DWithSourceTensorDescriptorName(source IMPSGraphTensor, descriptor IMPSGraphPooling4DOpDescriptor, name string) IMPSGraphTensor
Creates a 4D max-pooling operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MaximumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise maximum of the input tensors, while propagating [NaN] values.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a maximum with [NaN] propagation operation 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.
func (MPSGraph) MaximumWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MaximumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise maximum of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a maximum operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maximum(_:_:name:)
func (MPSGraph) MeanOfTensorAxesName ¶
func (g MPSGraph) MeanOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Returns the mean of the first input along the specified axes.
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.
Return Value ¶
A valid MPSGraphTensor object.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/mean(of:axes:name:)
func (MPSGraph) MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MinimumWithNaNPropagationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise minimum of the input tensors, while propagating [NaN] values.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a minimum with [NaN] propagation operation 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.
func (MPSGraph) MinimumWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MinimumWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise minimum of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a minimum operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/minimum(_:_:name:)
func (MPSGraph) ModuloWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) ModuloWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the remainder obtained by dividing the first input tensor by the second.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a modulo operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/modulo(_:_:name:)
func (MPSGraph) MultiplicationWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) MultiplicationWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Multiplies two input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a multiply operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) NegativeWithTensorName ¶
func (g MPSGraph) NegativeWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies negative to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/negative(with:name:)
func (MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName ¶
func (g MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorClassIndicesTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, classIndicesTensor IMPSGraphTensor, IOUThreshold float32, scoreThreshold float32, perClassSuppression bool, coordinateMode MPSGraphNonMaximumSuppressionCoordinateMode, name string) IMPSGraphTensor
Creates a nonMaximumumSuppression operation and returns the result tensor.
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.
func (MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName ¶
func (g MPSGraph) NonMaximumSuppressionWithBoxesTensorScoresTensorIOUThresholdScoreThresholdPerClassSuppressionCoordinateModeName(boxesTensor IMPSGraphTensor, scoresTensor IMPSGraphTensor, IOUThreshold float32, scoreThreshold float32, perClassSuppression bool, coordinateMode MPSGraphNonMaximumSuppressionCoordinateMode, name string) IMPSGraphTensor
Creates a nonMaximumumSuppression operation and returns the result tensor.
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.
func (MPSGraph) NonZeroIndicesOfTensorName ¶
func (g MPSGraph) NonZeroIndicesOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the indices of the non-zero elements of the input tensor.
tensor: An MPSGraphTensor of which to compute the non-zero indices.
Return Value ¶
A valid MPSGraphTensor containing indices in signed int32 data type.
Discussion ¶
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:
func (MPSGraph) NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName ¶
func (g MPSGraph) NormalizationBetaGradientWithIncomingGradientTensorSourceTensorReductionAxesName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a normalization beta-gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The mean and variance tensors should be outputs of `name` and `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]
func (MPSGraph) NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName ¶
func (g MPSGraph) NormalizationGammaGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, meanTensor IMPSGraphTensor, varianceTensor IMPSGraphTensor, axes []foundation.NSNumber, epsilon float32, name string) IMPSGraphTensor
Creates a normalization gamma-gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The mean and variance tensors should be outputs of `name` and `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]
func (MPSGraph) NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName ¶
func (g MPSGraph) NormalizationGradientWithIncomingGradientTensorSourceTensorMeanTensorVarianceTensorGammaTensorGammaGradientTensorBetaGradientTensorReductionAxesEpsilonName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, meanTensor IMPSGraphTensor, varianceTensor IMPSGraphTensor, gamma IMPSGraphTensor, gammaGradient IMPSGraphTensor, betaGradient IMPSGraphTensor, axes []foundation.NSNumber, epsilon float32, name string) IMPSGraphTensor
Creates a normalization input gradient operation and returns the result tensor.
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.
Discussion ¶
The mean and variance tensors should be outputs of `name` and `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]
func (MPSGraph) NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName ¶
func (g MPSGraph) NormalizationWithTensorMeanTensorVarianceTensorGammaTensorBetaTensorEpsilonName(tensor IMPSGraphTensor, mean IMPSGraphTensor, variance IMPSGraphTensor, gamma IMPSGraphTensor, beta IMPSGraphTensor, epsilon float32, name string) IMPSGraphTensor
Creates a batch normalization operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The mean and variance tensors should be outputs of `name` and `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.
func (MPSGraph) NotEqualWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) NotEqualWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise inequality check of the input tensors.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a not equal operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/notEqual(_:_:name:)
func (MPSGraph) NotWithTensorName ¶
func (g MPSGraph) NotWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the logical NOT operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/not(with:name:)
func (MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthAxisDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, axis uint, dataType uint32, onValue float64, offValue float64, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) OneHotWithIndicesTensorDepthAxisName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthAxisName(indicesTensor IMPSGraphTensor, depth uint, axis uint, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) OneHotWithIndicesTensorDepthDataTypeName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthDataTypeName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthDataTypeOnValueOffValueName(indicesTensor IMPSGraphTensor, depth uint, dataType uint32, onValue float64, offValue float64, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) OneHotWithIndicesTensorDepthName ¶
func (g MPSGraph) OneHotWithIndicesTensorDepthName(indicesTensor IMPSGraphTensor, depth uint, name string) IMPSGraphTensor
Creates a oneHot operation and returns the result tensor.
indicesTensor: Tensor of indices for on values
depth: Depth of the oneHot vector along the axis
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) Options ¶
func (g MPSGraph) Options() MPSGraphOptions
Options for the graph.
Discussion ¶
The default value is MPSGraphOptionsDefault.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/options
func (MPSGraph) PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName ¶
func (g MPSGraph) PadGradientWithIncomingGradientTensorSourceTensorPaddingModeLeftPaddingRightPaddingName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, paddingMode MPSGraphPaddingMode, leftPadding foundation.NSArray, rightPadding foundation.NSArray, name string) IMPSGraphTensor
Creates a padding gradient operation and returns the result tensor.
incomingGradientTensor: The input gradient tensor.
sourceTensor: The input tensor of the forward pass.
paddingMode: The parameter that defines the padding mode.
leftPadding: The parameter that defines how much padding the operation applies to the input tensor before each dimension - must be of size `rank(tensor)`.
rightPadding: The parameter that defines how much padding the operation applies to the input tensor after each dimension - must be of size `rank(tensor)`.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName ¶
func (g MPSGraph) PadTensorWithPaddingModeLeftPaddingRightPaddingConstantValueName(tensor IMPSGraphTensor, paddingMode MPSGraphPaddingMode, leftPadding foundation.NSArray, rightPadding foundation.NSArray, constantValue float64, name string) IMPSGraphTensor
Creates a padding operation and returns the result tensor.
tensor: The input tensor.
paddingMode: The parameter that defines the padding mode.
leftPadding: The parameter that defines how much padding the operation applies to the input tensor before each dimension - must be of size `rank(tensor)`.
rightPadding: The parameter that defines how much padding the operation applies to the input tensor after each dimension - must be of size `rank(tensor)`.
constantValue: The constant value the operation uses when `paddingMode = MPSGraphPaddingModeConstant`.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) PlaceholderTensors ¶
func (g MPSGraph) PlaceholderTensors() []MPSGraphTensor
Array of all the placeholder tensors.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/placeholderTensors
func (MPSGraph) PlaceholderWithShapeDataTypeName ¶
func (g MPSGraph) PlaceholderWithShapeDataTypeName(shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
Creates a placeholder operation and returns the result tensor.
shape: The shape of the output tensor. A nil shape will result in an unranked tensor.
dataType: The dataType of the placeholder tensor.
name: The name for the placeholder operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) PlaceholderWithShapeName ¶
func (g MPSGraph) PlaceholderWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
Creates a placeholder operation and returns the result tensor with the dataType of the placeholder tensor set to 32 bit float.
shape: The shape of the output tensor. A nil shape will result in an unranked tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) PowerWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) PowerWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the elementwise result of raising the first tensor to the power of the second tensor.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a power operation and returns the result tensor. It supports broadcasting as well.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/power(_:_:name:)
func (MPSGraph) QuantizeTensorScaleTensorZeroPointDataTypeAxisName ¶
func (g MPSGraph) QuantizeTensorScaleTensorZeroPointDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPoint float64, dataType uint32, axis int, name string) IMPSGraphTensor
Creates a Quantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scaleTensor) + zeroPoint
func (MPSGraph) QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName ¶
func (g MPSGraph) QuantizeTensorScaleTensorZeroPointTensorDataTypeAxisName(tensor IMPSGraphTensor, scaleTensor IMPSGraphTensor, zeroPointTensor IMPSGraphTensor, dataType uint32, axis int, name string) IMPSGraphTensor
Creates a Quantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scaleTensor) + zeroPointTensor
func (MPSGraph) QuantizeTensorScaleZeroPointDataTypeName ¶
func (g MPSGraph) QuantizeTensorScaleZeroPointDataTypeName(tensor IMPSGraphTensor, scale float64, zeroPoint float64, dataType uint32, name string) IMPSGraphTensor
Creates a Quantize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of datatype dataType ¶
Discussion ¶
Convert the float `tensor` to an i8 or u8 tensor by applying a scale + bias transform: result = (tensor / scale) + zeroPoint
func (MPSGraph) RandomPhiloxStateTensorWithCounterLowCounterHighKeyName ¶
func (g MPSGraph) RandomPhiloxStateTensorWithCounterLowCounterHighKeyName(counterLow uint, counterHigh uint, key uint, name string) IMPSGraphTensor
Creates a tensor representing state using the Philox algorithm with given counter and key values.
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
Return Value ¶
An MPSGraphTensor representing a random state, to be passed as an input to a random op.
Discussion ¶
See randomPhiloxStateTensorWithSeed.
func (MPSGraph) RandomPhiloxStateTensorWithSeedName ¶
func (g MPSGraph) RandomPhiloxStateTensorWithSeedName(seed uint, name string) IMPSGraphTensor
Creates a tensor representing state using the Philox algorithm with given counter and key values.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeDescriptorName ¶
func (g MPSGraph) RandomTensorWithShapeDescriptorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, name string) IMPSGraphTensor
Creates a Random op of type matching distribution in descriptor and returns random values.
shape: The shape of the tensor generated
descriptor: The descriptor of the distribution. See MPSGraphRandomOpDescriptor.
name: The name for the operation.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeDescriptorSeedName ¶
func (g MPSGraph) RandomTensorWithShapeDescriptorSeedName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, seed uint, name string) IMPSGraphTensor
Creates a Random op of type matching distribution in descriptor and returns random values.
shape: 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.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeDescriptorStateTensorName ¶
func (g MPSGraph) RandomTensorWithShapeDescriptorStateTensorName(shape foundation.NSArray, descriptor IMPSGraphRandomOpDescriptor, state IMPSGraphTensor, name string) []MPSGraphTensor
Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
shape: 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.
Return Value ¶
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.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeTensorDescriptorName ¶
func (g MPSGraph) RandomTensorWithShapeTensorDescriptorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, name string) IMPSGraphTensor
Creates a Random op of type matching distribution in descriptor and returns random values.
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.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeTensorDescriptorSeedName ¶
func (g MPSGraph) RandomTensorWithShapeTensorDescriptorSeedName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, seed uint, name string) IMPSGraphTensor
Creates a Random op of type matching distribution in descriptor and returns random values.
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.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomTensorWithShapeTensorDescriptorStateTensorName ¶
func (g MPSGraph) RandomTensorWithShapeTensorDescriptorStateTensorName(shapeTensor IMPSGraphTensor, descriptor IMPSGraphRandomOpDescriptor, state IMPSGraphTensor, name string) []MPSGraphTensor
Creates a Random op of type matching distribution in descriptor, and returns random values and updated state.
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.
Return Value ¶
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.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeName ¶
func (g MPSGraph) RandomUniformTensorWithShapeName(shape foundation.NSArray, name string) IMPSGraphTensor
Creates a RandomUniform operation and returns random uniform values
shape: The shape of the tensor generated
name: The name for the operation.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeSeedName ¶
func (g MPSGraph) RandomUniformTensorWithShapeSeedName(shape foundation.NSArray, seed uint, name string) IMPSGraphTensor
Creates a RandomUniform operation and returns random uniform values
shape: 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.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeStateTensorName ¶
func (g MPSGraph) RandomUniformTensorWithShapeStateTensorName(shape foundation.NSArray, state IMPSGraphTensor, name string) []MPSGraphTensor
Creates a RandomUniform operation and returns random uniform values and updated state
shape: 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.
Return Value ¶
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.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeTensorName ¶
func (g MPSGraph) RandomUniformTensorWithShapeTensorName(shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a RandomUniform operation and returns random uniform values
shapeTensor: 1D Int32 or Int64 tensor. The shape of the tensor generated
name: The name for the operation.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeTensorSeedName ¶
func (g MPSGraph) RandomUniformTensorWithShapeTensorSeedName(shapeTensor IMPSGraphTensor, seed uint, name string) IMPSGraphTensor
Creates a RandomUniform operation and returns random uniform values
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.
Return Value ¶
An MPSGraphTensor of shape containing random values in the defined range.
Discussion ¶
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.
func (MPSGraph) RandomUniformTensorWithShapeTensorStateTensorName ¶
func (g MPSGraph) RandomUniformTensorWithShapeTensorStateTensorName(shapeTensor IMPSGraphTensor, state IMPSGraphTensor, name string) []MPSGraphTensor
Creates a RandomUniform operation and returns random uniform values and updated state
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.
Return Value ¶
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.
Discussion ¶
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.
func (MPSGraph) ReLUGradientWithIncomingGradientSourceTensorName ¶
func (g MPSGraph) ReLUGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
Computes the gradient of the ReLU (rectified linear activation unit) function using the incoming gradient.
gradient: The incoming gradient tensor.
source: The input tensor from forward pass.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReLUWithTensorName ¶
func (g MPSGraph) ReLUWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the ReLU (rectified linear activation unit) function with the input tensor.
tensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The operation is: f(x) = max(x, 0).
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/reLU(with:name:)
func (MPSGraph) ReadVariableName ¶
func (g MPSGraph) ReadVariableName(variable IMPSGraphTensor, name string) IMPSGraphTensor
Creates a read op which reads at this point of execution of the graph and returns the result tensor.
variable: The variable resource tensor to read from.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/read(_:name:)
func (MPSGraph) RealPartOfTensorName ¶
func (g MPSGraph) RealPartOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the real part of a tensor.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation..
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) RealToHermiteanFFTWithTensorAxesDescriptorName ¶
func (g MPSGraph) RealToHermiteanFFTWithTensorAxesDescriptorName(tensor IMPSGraphTensor, axes []foundation.NSNumber, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
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 the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor of type [MPSDataTypeComplexFloat32] or [MPSDataTypeComplexFloat16] with reduced size (see Discussion).
Discussion ¶
This operation computes the fast Fourier transform of a real-valued input tensor according to the following formulae.
`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`.
func (MPSGraph) RealToHermiteanFFTWithTensorAxesTensorDescriptorName ¶
func (g MPSGraph) RealToHermiteanFFTWithTensorAxesTensorDescriptorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, descriptor IMPSGraphFFTDescriptor, name string) IMPSGraphTensor
Creates a Real-to-Hermitean fast Fourier transform operation and returns the result tensor.
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.FastFourierTransformWithTensorAxesDescriptorName.
descriptor: A descriptor that defines the parameters of the Fourier transform operation - see MPSGraphFFTDescriptor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor of type [MPSDataTypeComplexFloat32] or [MPSDataTypeComplexFloat16] with reduced size (see Discussion).
Discussion ¶
This operation computes the fast Fourier transform of a real-valued input tensor according to the following formulae.
`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`.
func (MPSGraph) ReciprocalSquareRootWithTensorName ¶
func (g MPSGraph) ReciprocalSquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the reciprocal square root operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ReciprocalWithTensorName ¶
func (g MPSGraph) ReciprocalWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the reciprocal operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) ReductionAndWithTensorAxesName ¶
func (g MPSGraph) ReductionAndWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction and operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionAndWithTensorAxisName ¶
func (g MPSGraph) ReductionAndWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction and operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionArgMaximumWithTensorAxisName ¶
func (g MPSGraph) ReductionArgMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction argMax operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionArgMinimumWithTensorAxisName ¶
func (g MPSGraph) ReductionArgMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction argMin operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMaximumPropagateNaNWithTensorAxesName ¶
func (g MPSGraph) ReductionMaximumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction max propagate NaN operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMaximumPropagateNaNWithTensorAxisName ¶
func (g MPSGraph) ReductionMaximumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction max propagate NaN operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMaximumWithTensorAxesName ¶
func (g MPSGraph) ReductionMaximumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction max operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMaximumWithTensorAxisName ¶
func (g MPSGraph) ReductionMaximumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction max operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMinimumPropagateNaNWithTensorAxesName ¶
func (g MPSGraph) ReductionMinimumPropagateNaNWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction min propagate NaN operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMinimumPropagateNaNWithTensorAxisName ¶
func (g MPSGraph) ReductionMinimumPropagateNaNWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction min propagate NaN operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMinimumWithTensorAxesName ¶
func (g MPSGraph) ReductionMinimumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction min operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionMinimumWithTensorAxisName ¶
func (g MPSGraph) ReductionMinimumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction minimum operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionOrWithTensorAxesName ¶
func (g MPSGraph) ReductionOrWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction or operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionOrWithTensorAxisName ¶
func (g MPSGraph) ReductionOrWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction or operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionProductWithTensorAxesName ¶
func (g MPSGraph) ReductionProductWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction product operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionProductWithTensorAxisName ¶
func (g MPSGraph) ReductionProductWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction product operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionSumWithTensorAxesName ¶
func (g MPSGraph) ReductionSumWithTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reduction sum operation and returns the result tensor.
tensor: Input tensor
axes: Axes of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReductionSumWithTensorAxisName ¶
func (g MPSGraph) ReductionSumWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a reduction sum operation and returns the result tensor.
tensor: Input tensor
axis: Axis of reduction
name: Name for the operation
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ReinterpretCastTensorToTypeName ¶
func (g MPSGraph) ReinterpretCastTensorToTypeName(tensor IMPSGraphTensor, type_ uint32, name string) IMPSGraphTensor
Creates a reinterpret cast operation and returns the result tensor.
tensor: The input tensor.
type: The element type of the returned tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) ReshapeTensorWithShapeName ¶
func (g MPSGraph) ReshapeTensorWithShapeName(tensor IMPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
Creates a reshape operation and returns the result tensor.
tensor: The tensor to be reshaped.
shape: The result tensor shape.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
This operation reshapes the input tensor to the target shape. The shape must be compatible with the input tensor shape, specifically the volume of the input tensor has to match the volume defined by the shape. The shape is allowed to contain dynamic dimensions (-1) when the result type can be inferred unambiguously.
func (MPSGraph) ReshapeTensorWithShapeTensorName ¶
func (g MPSGraph) ReshapeTensorWithShapeTensorName(tensor IMPSGraphTensor, shapeTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a reshape operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeBilinearWithGradientTensorInputCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName ¶
func (g MPSGraph) ResizeBilinearWithGradientTensorInputScaleOffsetTensorLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName ¶
func (g MPSGraph) ResizeBilinearWithGradientTensorInputScaleTensorOffsetTensorName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with bilinear sampling and identical parameters.
func (MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Resamples input images to given size using bilinear sampling.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName ¶
func (g MPSGraph) ResizeBilinearWithTensorSizeTensorCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName ¶
func (g MPSGraph) ResizeBilinearWithTensorSizeTensorScaleOffsetTensorLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Resamples input images to given size using the provided scale and offset and bilinear sampling See above discussion for more details.
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]
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName ¶
func (g MPSGraph) ResizeBilinearWithTensorSizeTensorScaleTensorOffsetTensorName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Resamples input images to given size using the provided scale and offset and bilinear sampling. Destination indices are computed using
For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners.
func (MPSGraph) ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeNearestWithGradientTensorInputNearestRoundingModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName ¶
func (g MPSGraph) ResizeNearestWithGradientTensorInputScaleOffsetTensorNearestRoundingModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName ¶
func (g MPSGraph) ResizeNearestWithGradientTensorInputScaleTensorOffsetTensorNearestRoundingModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Resamples input images to given size using nearest neighbor sampling.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
This API allows for the rounding mode to be specified. 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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName ¶
func (g MPSGraph) ResizeNearestWithTensorSizeTensorNearestRoundingModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName ¶
func (g MPSGraph) ResizeNearestWithTensorSizeTensorScaleOffsetTensorNearestRoundingModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Resamples input images to given size using the provided scale and offset and nearest neighbor sampling See above discussion for more details.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName ¶
func (g MPSGraph) ResizeNearestWithTensorSizeTensorScaleTensorOffsetTensorNearestRoundingModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, nearestRoundingMode MPSGraphResizeNearestRoundingMode, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Resamples input images to given size using the provided scale and offset and nearest neighbor sampling. Destination indices are computed using
For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners.
func (MPSGraph) ResizeTensorSizeModeCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeTensorSizeModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size foundation.NSArray, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
imagesTensor: Tensor containing input images.
size: 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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersName ¶
func (g MPSGraph) ResizeTensorSizeTensorModeCenterResultAlignCornersName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
To achieve the same behavior as TensorFlowV1 resize ¶
func (MPSGraph) ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName ¶
func (g MPSGraph) ResizeTensorSizeTensorScaleOffsetTensorModeLayoutName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scaleOffset IMPSGraphTensor, mode MPSGraphResizeMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Resamples input images to given size using the provided scale and offset. Destination indices are computed using
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners.
func (MPSGraph) ResizeTensorSizeTensorScaleTensorOffsetTensorModeName ¶
func (g MPSGraph) ResizeTensorSizeTensorScaleTensorOffsetTensorModeName(imagesTensor IMPSGraphTensor, size IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, mode MPSGraphResizeMode, name string) IMPSGraphTensor
Creates a Resize operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Resamples input images to given size using the provided scale and offset. Destination indices are computed using
For most use cases passing the scale and offset directly is unnecessary, and it is preferable to use the API specifying centerResult and alignCorners.
func (MPSGraph) ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName ¶
func (g MPSGraph) ResizeWithGradientTensorInputModeCenterResultAlignCornersLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, mode MPSGraphResizeMode, centerResult bool, alignCorners bool, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName ¶
func (g MPSGraph) ResizeWithGradientTensorInputScaleOffsetTensorModeLayoutName(gradient IMPSGraphTensor, input IMPSGraphTensor, scaleOffset IMPSGraphTensor, mode MPSGraphResizeMode, layout MPSGraphTensorNamedDataLayout, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName ¶
func (g MPSGraph) ResizeWithGradientTensorInputScaleTensorOffsetTensorModeName(gradient IMPSGraphTensor, input IMPSGraphTensor, scale IMPSGraphTensor, offset IMPSGraphTensor, mode MPSGraphResizeMode, name string) IMPSGraphTensor
Creates a Resize gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Computes the gradient for the forward pass Resize op with identical parameters. See discussion of resizeTensor for more in depth description of resize paramters.
func (MPSGraph) ReverseTensorAxesName ¶
func (g MPSGraph) ReverseTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a reverse operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Reverses a tensor on given axes. Semantics based on TensorFlow reverse op.
func (MPSGraph) ReverseTensorAxesTensorName ¶
func (g MPSGraph) ReverseTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a reverse operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Reverses a tensor on given axes. Semantics based on TensorFlow reverse op.
func (MPSGraph) ReverseTensorName ¶
func (g MPSGraph) ReverseTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a reverse operation and returns the result tensor.
tensor: The tensor to be reversed.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Reverses a tensor on all axes. Semantics based on TensorFlow reverse op.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/reverse(_:name:)
func (MPSGraph) RintWithTensorName ¶
func (g MPSGraph) RintWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Rounds the input tensor elements by rounding to nearest even.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/rint(with:name:)
func (MPSGraph) RoundWithTensorName ¶
func (g MPSGraph) RoundWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Rounds the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/round(with:name:)
func (MPSGraph) RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor ¶
func (g MPSGraph) RunAsyncWithFeedsTargetTensorsTargetOperationsExecutionDescriptor(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Return Value ¶
A valid MPSGraphTensor : MPSGraphTensorData dictionary with results synchronized to the CPU memory.
Discussion ¶
This call is asynchronous and will return immediately if a completionHandler is set.
func (MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor ¶
func (g MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetOperationsResultsDictionaryExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary, executionDescriptor IMPSGraphExecutionDescriptor)
Encodes the graph for the given feeds to returns the target tensor values in the results dictionary provided by the user.
commandQueue: CommandQueue passed to exectute the graph on.
feeds: Feeds dictionary for the placeholder tensors.
targetOperations: Operations to be completed at the end of the run.
resultsDictionary: MPSGraphTensors dictionary passed by user, these will be filled with graph output data.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Discussion ¶
It ensures all target operations also executed. This call is asynchronous and will return immediately if a completionHandler is set.
func (MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor ¶
func (g MPSGraph) RunAsyncWithMTLCommandQueueFeedsTargetTensorsTargetOperationsExecutionDescriptor(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation, executionDescriptor IMPSGraphExecutionDescriptor) MPSGraphTensorDataDictionary
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
commandQueue: CommandQueue passed to exectute the graph on.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Return Value ¶
A valid MPSGraphTensor : MPSGraphTensorData dictionary with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
Discussion ¶
This call is asynchronous and will return immediately if a completionHandler is set.
func (MPSGraph) RunWithFeedsTargetTensorsTargetOperations ¶
func (g MPSGraph) RunWithFeedsTargetTensorsTargetOperations(feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation) MPSGraphTensorDataDictionary
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
Return Value ¶
A valid MPSGraphTensor : MPSGraphTensorData dictionary with results synchronized to the CPU memory.
Discussion ¶
This call blocks until execution has completed.
func (MPSGraph) RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary ¶
func (g MPSGraph) RunWithMTLCommandQueueFeedsTargetOperationsResultsDictionary(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetOperations []MPSGraphOperation, resultsDictionary MPSGraphTensorDataDictionary)
Runs the graph for the given feeds and returns the target tensor values in the results dictionary provided by the user.
commandQueue: CommandQueue passed to exectute the graph on.
feeds: Feeds dictionary for the placeholder tensors.
targetOperations: Operations to be completed at the end of the run.
resultsDictionary: MPSGraphTensors dictionary passed by user, these will be filled with graph output data.
Discussion ¶
It also ensures all target operations also executed. This call blocks until execution has completed.
func (MPSGraph) RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations ¶
func (g MPSGraph) RunWithMTLCommandQueueFeedsTargetTensorsTargetOperations(commandQueue metal.MTLCommandQueue, feeds MPSGraphTensorDataDictionary, targetTensors []MPSGraphTensor, targetOperations []MPSGraphOperation) MPSGraphTensorDataDictionary
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
commandQueue: CommandQueue passed to exectute the graph on.
feeds: Feeds dictionary for the placeholder tensors.
targetTensors: Tensors for which the caller wishes MPSGraphTensorData to be returned.
targetOperations: Operations to be completed at the end of the run.
Return Value ¶
A valid MPSGraphTensor : MPSGraphTensorData dictionary with results synchronized to the CPU memory.
Discussion ¶
This call blocks until execution has completed.
func (MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName ¶
func (g MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeNearestRoundingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, normalizeCoordinates bool, relativeCoordinates bool, alignCorners bool, paddingMode MPSGraphPaddingMode, nearestRoundingMode MPSGraphResizeNearestRoundingMode, constantValue float64, name string) IMPSGraphTensor
Samples a tensor using the coordinates provided, using nearest neighbor sampling with specified rounding mode.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName ¶
func (g MPSGraph) SampleGridWithSourceTensorCoordinateTensorLayoutNormalizeCoordinatesRelativeCoordinatesAlignCornersPaddingModeSamplingModeConstantValueName(source IMPSGraphTensor, coordinates IMPSGraphTensor, layout MPSGraphTensorNamedDataLayout, normalizeCoordinates bool, relativeCoordinates bool, alignCorners bool, paddingMode MPSGraphPaddingMode, samplingMode MPSGraphResizeMode, constantValue float64, name string) IMPSGraphTensor
Samples a tensor using the coordinates provided.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.
func (MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorDescriptorName ¶
func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorDescriptorName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, descriptor IMPSGraphSDPADescriptor, name string) IMPSGraphTensor
Creates a scaled dot product attention (SDPA) operation using a descriptor and returns the result tensor.
queryTensor: A tensor that represents the query projection.
keyTensor: A tensor that represents the key projection.
valueTensor: A tensor that represents the value projection.
descriptor: A descriptor specifying scale and optional features (mask, isCausal, sinks).
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The descriptor allows configuring an optional attention mask, causal masking, and attention sinks without requiring a separate API method for each combination of features.
func (MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName ¶
func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorMaskTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, maskTensor IMPSGraphTensor, scale float32, name string) IMPSGraphTensor
Creates a scaled dot product attention (SDPA) operation and returns the result tensor.
queryTensor: A tensor that represents the query projection.
keyTensor: A tensor that represents the key projection.
valueTensor: A tensor that represents the value projection.
maskTensor: An optional tensor that contains a mask that is applied to the scaled, matrix multiplied query and value matrices. If mask tensor is nil, the QK^T is not element-wise masked.
scale: A scale that is applied to the result of query and value matrix multiply.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
SDPA Op computes attention by computing softmax(scale * QK^T + M)V. queryTensor Q with shape [B, Hq, Nq, F] and keyTensor K with shape [B, Hq, Nkv, F], with Q’s H dimension expandable to satisfy matmul QK^T. maskTensor M’s shape should be broadcast compatible to satisfy (QK^T + M). valueTensor V with shape [B, Hv, Nkv, F] should satisfy the matmul (QK^T + M)V.
func (MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName ¶
func (g MPSGraph) ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorScaleName(queryTensor IMPSGraphTensor, keyTensor IMPSGraphTensor, valueTensor IMPSGraphTensor, scale float32, name string) IMPSGraphTensor
Creates a scaled dot product attention (SDPA) operation (without a mask) and returns the result tensor.
queryTensor: A tensor that represents the query projection.
keyTensor: A tensor that represents the key projection.
valueTensor: A tensor that represents the value projection.
scale: A scale that is applied on the result of query and value matrix multiply.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName ¶
func (g MPSGraph) ScatterAlongAxisTensorWithDataTensorUpdatesTensorIndicesTensorModeName(axisTensor IMPSGraphTensor, dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterAlongAxis operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
func (MPSGraph) ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName ¶
func (g MPSGraph) ScatterAlongAxisTensorWithUpdatesTensorIndicesTensorShapeModeName(axisTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterAlongAxis operation and returns the result tensor.
axisTensor: Scalar Int32 tensor. The axis to scatter to. Negative values wrap around
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` into a result tensor. Values are updated following `mode`. See MPSGraphScatterMode. The shape of `updatesTensor` and `indicesTensor` must match. `shape` must match except at `axis`. The shape of the result tensor is equal to `shape` and initialized with an initial value corresponding to `mode`. If an index is out of bounds of `shape` along `axis` the update value is skipped.
func (MPSGraph) ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName ¶
func (g MPSGraph) ScatterAlongAxisWithDataTensorUpdatesTensorIndicesTensorModeName(axis int, dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterAlongAxis operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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,
func (MPSGraph) ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName ¶
func (g MPSGraph) ScatterAlongAxisWithUpdatesTensorIndicesTensorShapeModeName(axis int, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterAlongAxis operation and returns the result tensor.
axis: The axis to scatter to. Negative values wrap around
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` into a result tensor. Values are updated following `mode`. See MPSGraphScatterMode. The shape of `updatesTensor` and `indicesTensor` must match. `shape` must match except at `axis`. The shape of the result tensor is equal to `shape` and initialized with an initial value corresponding to `mode`. If an index is out of bounds of `shape` along `axis` the update value is skipped.
func (MPSGraph) ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName ¶
func (g MPSGraph) ScatterNDWithDataTensorUpdatesTensorIndicesTensorBatchDimensionsModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, batchDimensions uint, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterND operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as
Collisions will be updated according to mode, and slices not set by indices are set to 0. The tensors have the following shape requirements
func (MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName ¶
func (g MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, batchDimensions uint, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a ScatterND operation and returns the result tensor.
updatesTensor: Tensor containing slices to be inserted into the result tensor.
indicesTensor: Tensor containg the result indices to insert slices at
shape: The shape of the result tensor.
batchDimensions: The number of batch dimensions
mode: The type of update to use on the destination
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor. The scatter is defined as
Collisions will be summed, and slices not set by indices are set to 0. The tensors have the following shape requirements
func (MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName ¶
func (g MPSGraph) ScatterNDWithUpdatesTensorIndicesTensorShapeBatchDimensionsName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, batchDimensions uint, name string) IMPSGraphTensor
Creates a ScatterND operation and returns the result tensor.
updatesTensor: Tensor containing slices to be inserted into the result tensor.
indicesTensor: Tensor containg the result indices to insert slices at
shape: The shape of the result tensor.
batchDimensions: The number of batch dimensions
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor. The scatter is defined as
Collisions will be summed, and slices not set by indices are set to 0. The tensors have the following shape requirements
func (MPSGraph) ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName ¶
func (g MPSGraph) ScatterWithDataTensorUpdatesTensorIndicesTensorAxisModeName(dataTensor IMPSGraphTensor, updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, axis int, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a Scatter operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor, on top of dataTensor. The scatter is defined as
Collisions will be updated according to mode. The tensors have the following shape requirements
func (MPSGraph) ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName ¶
func (g MPSGraph) ScatterWithUpdatesTensorIndicesTensorShapeAxisModeName(updatesTensor IMPSGraphTensor, indicesTensor IMPSGraphTensor, shape foundation.NSArray, axis int, mode MPSGraphScatterMode, name string) IMPSGraphTensor
Creates a Scatter operation and returns the result tensor.
updatesTensor: Tensor containing values to be inserted into the result tensor.
indicesTensor: Tensor containg the result indices to insert values at.
shape: The shape of the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Scatters the slices in updatesTensor to the result tensor along the indices in indicesTensor. The scatter is defined as
Collisions will be updated according to mode. The tensors have the following shape requirements
func (MPSGraph) SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName ¶
func (g MPSGraph) SelectWithPredicateTensorTruePredicateTensorFalsePredicateTensorName(predicateTensor IMPSGraphTensor, truePredicateTensor IMPSGraphTensor, falseSelectTensor IMPSGraphTensor, name string) IMPSGraphTensor
Selects values from either the true or false predicate tensor, depending on the values in the first input.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a select operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) SetOptions ¶
func (g MPSGraph) SetOptions(value MPSGraphOptions)
func (MPSGraph) ShapeOfTensorName ¶
func (g MPSGraph) ShapeOfTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a shape-of operation and returns the result tensor.
tensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Returns a rank-1 tensor of type [MPSDataTypeInt32] with the values of the static shape of the input tensor.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/shapeOf(_:name:)
func (MPSGraph) SigmoidGradientWithIncomingGradientSourceTensorName ¶
func (g MPSGraph) SigmoidGradientWithIncomingGradientSourceTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, name string) IMPSGraphTensor
Computes the gradient of the sigmoid function using the incoming gradient tensor.
gradient: The incoming gradient tensor.
source: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
func (MPSGraph) SigmoidWithTensorName ¶
func (g MPSGraph) SigmoidWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Computes the sigmoid operation on an input tensor.
tensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/sigmoid(with:name:)
func (MPSGraph) SignWithTensorName ¶
func (g MPSGraph) SignWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the sign of the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
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.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/sign(with:name:)
func (MPSGraph) SignbitWithTensorName ¶
func (g MPSGraph) SignbitWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Returns the sign bit of the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation returns `true` if the sign bit is set for the correspnding floating-point input element, otherwise it returns `false`.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/signbit(with:name:)
func (MPSGraph) SinWithTensorName ¶
func (g MPSGraph) SinWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the sine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/sin(with:name:)
func (MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName ¶
func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN gradient operation and returns the gradient tensor values.
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.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName.
func (MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName ¶
func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN gradient operation and returns the gradient tensor values.
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.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName.
func (MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName ¶
func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN gradient operation and returns the gradient tensor values.
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.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName.
func (MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName ¶
func (g MPSGraph) SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, sourceGradient IMPSGraphTensor, zState IMPSGraphTensor, stateGradient IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN gradient operation and returns the gradient tensor values.
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.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName 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.
Return Value ¶
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`.
Discussion ¶
For details of this operation and parameters, refer to documentation of MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName.
func (MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName ¶
func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
[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.
func (MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName ¶
func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
[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.
func (MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName ¶
func (g MPSGraph) SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName(source IMPSGraphTensor, recurrentWeight IMPSGraphTensor, inputWeight IMPSGraphTensor, bias IMPSGraphTensor, initState IMPSGraphTensor, mask IMPSGraphTensor, descriptor IMPSGraphSingleGateRNNDescriptor, name string) []MPSGraphTensor
Creates a single-gate RNN operation and returns the value and optionally the training state tensor.
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.
Return Value ¶
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.
Discussion ¶
This operation returns tensors `h` and optionally `z` that are defined recursively as follows:
[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.
func (MPSGraph) SinhWithTensorName ¶
func (g MPSGraph) SinhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the hyperbolic sine operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/sinh(with:name:)
func (MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, startTensor IMPSGraphTensor, endTensor IMPSGraphTensor, strideTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice gradient operation and returns the result tensor.
inputGradientTensor: The input gradient.
fwdInShapeTensor: The shape of the forward pass input, that is the shape of the gradient output.
startTensor: The tensor that specifies the starting points for each dimension.
endTensor: The tensor that specifies the ending points for each dimension.
strideTensor: The tensor that specifies 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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName ¶
func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartTensorSizeTensorSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, startTensor IMPSGraphTensor, sizeTensor IMPSGraphTensor, squeezeMask uint32, name string) IMPSGraphTensor
Creates a slice gradient operation and returns the result tensor.
inputGradientTensor: The input gradient.
fwdInShapeTensor: The shape of the forward pass input, that is the shape of the gradient output.
startTensor: The tensor that specifies the starting points for each dimension.
sizeTensor: The tensor that specifies the size of the forward result for each dimension.
squeezeMask: A bitmask that indicates dimensions the operation will squeeze out from the result.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesName ¶
func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
Creates a strided-slice gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceGradientTensorFwdInShapeTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(inputGradientTensor IMPSGraphTensor, fwdInShapeTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice gradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceTensorDimensionStartLengthName ¶
func (g MPSGraph) SliceTensorDimensionStartLengthName(tensor IMPSGraphTensor, dimensionIndex uint, start int, length int, name string) IMPSGraphTensor
Creates a slice operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceTensorStartTensorEndTensorStrideTensorStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, endTensor IMPSGraphTensor, strideTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice operation and returns the result tensor.
tensor: The Tensor to be sliced.
startTensor: The tensor that specifies the starting points for each dimension.
endTensor: The tensor that specifies the ending points for each dimension.
strideTensor: The tensor that specifies 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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Slices a tensor starting from `startTensor`, stopping short before `endTensor` stepping `strideTensor` paces between each value. Semantics based on TensorFlow Strided Slice Op.
func (MPSGraph) SliceTensorStartTensorSizeTensorSqueezeMaskName ¶
func (g MPSGraph) SliceTensorStartTensorSizeTensorSqueezeMaskName(tensor IMPSGraphTensor, startTensor IMPSGraphTensor, sizeTensor IMPSGraphTensor, squeezeMask uint32, name string) IMPSGraphTensor
Creates a slice operation and returns the result tensor.
tensor: The Tensor to be sliced.
startTensor: The tensor that specifies the starting points for each dimension.
sizeTensor: The tensor that specifies the size of the result for each dimension.
squeezeMask: A bitmask that indicates dimensions the operation will squeeze out from the result.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Slices a tensor starting from `startTensor`, stopping short before `startTensor + endTensor` stepping a single pace between each value. Semantics based on TensorFlow Strided Slice Op.
func (MPSGraph) SliceTensorStartsEndsStridesName ¶
func (g MPSGraph) SliceTensorStartsEndsStridesName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
Creates a strided-slice operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Slices a tensor starting from `starts`, stopping short before `ends` stepping `strides` paces between each value. Semantics based on TensorFlow Strided Slice Op.
func (MPSGraph) SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(tensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Slices a tensor starting from `starts`, stopping short before `ends` stepping `strides` paces between each value. Semantics based on TensorFlow Strided Slice Op.
func (MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesName ¶
func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, name string) IMPSGraphTensor
Creates a strided-slice update operation with zero masks and returns the result tensor.
dataTensor: The large tensor that will receive the update.
updateTensor: The tensor with the new values that will replace values in the dataTensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsEndsStridesStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, starts []foundation.NSNumber, ends []foundation.NSNumber, strides []foundation.NSNumber, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice update operation and returns the result tensor.
dataTensor: The large tensor that will receive the update.
updateTensor: The tensor with the new values that will replace values in the dataTensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName ¶
func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, startsTensor IMPSGraphTensor, endsTensor IMPSGraphTensor, stridesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a strided-slice update operation with zero masks and returns the result tensor.
dataTensor: The large tensor that will receive the update.
updateTensor: The tensor with the new values that will replace values in the dataTensor.
startsTensor: A Tensor that contains an array of numbers that specify the starting points for each dimension.
endsTensor: A Tensor that contains an array of numbers that specify the ending points for each dimension.
stridesTensor: A Tensor that contains an array of numbers that specify the strides for each dimension.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName ¶
func (g MPSGraph) SliceUpdateDataTensorUpdateTensorStartsTensorEndsTensorStridesTensorStartMaskEndMaskSqueezeMaskName(dataTensor IMPSGraphTensor, updateTensor IMPSGraphTensor, startsTensor IMPSGraphTensor, endsTensor IMPSGraphTensor, stridesTensor IMPSGraphTensor, startMask uint32, endMask uint32, squeezeMask uint32, name string) IMPSGraphTensor
Creates a strided-slice update operation and returns the result tensor.
dataTensor: The large tensor that will receive the update.
updateTensor: The tensor with the new values that will replace values in the dataTensor.
startsTensor: A Tensor that contains an array of numbers that specify the starting points for each dimension.
endsTensor: A Tensor that contains an array of numbers that specify the ending points for each dimension.
stridesTensor: A Tensor that contains 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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName ¶
func (g MPSGraph) SoftMaxCrossEntropyGradientWithIncomingGradientTensorSourceTensorLabelsTensorAxisReductionTypeName(gradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, labelsTensor IMPSGraphTensor, axis int, reductionType MPSGraphLossReductionType, name string) IMPSGraphTensor
Creates the gradient of a softmax cross-entropy loss operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName ¶
func (g MPSGraph) SoftMaxCrossEntropyWithSourceTensorLabelsTensorAxisReductionTypeName(sourceTensor IMPSGraphTensor, labelsTensor IMPSGraphTensor, axis int, reductionType MPSGraphLossReductionType, name string) IMPSGraphTensor
Creates a softmax cross-entropy loss operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
The softmax cross-entropy operation computes:
the operation performs the reduction over the `axis` dimension.
func (MPSGraph) SoftMaxGradientWithIncomingGradientSourceTensorAxisName ¶
func (g MPSGraph) SoftMaxGradientWithIncomingGradientSourceTensorAxisName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the gradient of the softmax function along the specified axis using the incoming gradient tensor.
gradient: The incoming gradient tensor.
source: The input tensor.
axis: The axis along which softmax is computed.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
func (MPSGraph) SoftMaxWithTensorAxisName ¶
func (g MPSGraph) SoftMaxWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Computes the softmax function on the input tensor along the specified axis.
tensor: The input tensor.
axis: The axis along which softmax is computed.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object
func (MPSGraph) SortWithTensorAxisDescendingName ¶
func (g MPSGraph) SortWithTensorAxisDescendingName(tensor IMPSGraphTensor, axis int, descending bool, name string) IMPSGraphTensor
Sorts the elements of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SortWithTensorAxisName ¶
func (g MPSGraph) SortWithTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Sorts the elements of the input tensor along the specified axis.
tensor: The input tensor
axis: The tensor dimension over which you sort the tensor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/sort(_:axis:name:)
func (MPSGraph) SortWithTensorAxisTensorDescendingName ¶
func (g MPSGraph) SortWithTensorAxisTensorDescendingName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, descending bool, name string) IMPSGraphTensor
Sorts the elements of the input tensor along the specified axis.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SortWithTensorAxisTensorName ¶
func (g MPSGraph) SortWithTensorAxisTensorName(tensor IMPSGraphTensor, axisTensor IMPSGraphTensor, name string) IMPSGraphTensor
Sorts the elements of the input tensor along the specified axis.
tensor: The input tensor
axisTensor: The tensor dimension over which you sort the tensor
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
func (MPSGraph) SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName ¶
func (g MPSGraph) SpaceToBatchTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxes []foundation.NSNumber, batchAxis int, blockDimensions []foundation.NSNumber, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a space-to-batch operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
This operation outputs a copy of the `input` tensor, where values from the `spatialAxes` (for `usePixelShuffleOrder=YES` 1,2 or 3 axes supported, otherwise limited only by [MPSNDArray] rank limitations) dimensions are moved in spatial blocks with rectangular size defined by `blockDimensions` to the `batchAxis` dimension. 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.BatchToSpaceTensorSpatialAxesBatchAxisBlockDimensionsUsePixelShuffleOrderName. Note: This operation is a generalization of MPSGraph.SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName ¶
func (g MPSGraph) SpaceToBatchTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName(tensor IMPSGraphTensor, spatialAxesTensor IMPSGraphTensor, batchAxisTensor IMPSGraphTensor, blockDimensionsTensor IMPSGraphTensor, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a space-to-batch operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.BatchToSpaceTensorSpatialAxesTensorBatchAxisTensorBlockDimensionsTensorUsePixelShuffleOrderName. Note: This operation is a generalization of MPSGraph.SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName ¶
func (g MPSGraph) SpaceToDepth2DTensorWidthAxisHeightAxisDepthAxisBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxis uint, heightAxis uint, depthAxis uint, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a space-to-depth2D operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
This operation outputs a copy of the `input` tensor, where values from the `widthAxis` and `heightAxis` dimensions are moved in spatial blocks of size `blockSize` to the `depthAxis` dimension. 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:`.
func (MPSGraph) SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName ¶
func (g MPSGraph) SpaceToDepth2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName(tensor IMPSGraphTensor, widthAxisTensor IMPSGraphTensor, heightAxisTensor IMPSGraphTensor, depthAxisTensor IMPSGraphTensor, blockSize uint, usePixelShuffleOrder bool, name string) IMPSGraphTensor
Creates a space-to-depth2D operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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.DepthToSpace2DTensorWidthAxisTensorHeightAxisTensorDepthAxisTensorBlockSizeUsePixelShuffleOrderName.
func (MPSGraph) SparseTensorWithDescriptorTensorsShapeName ¶
func (g MPSGraph) SparseTensorWithDescriptorTensorsShapeName(sparseDescriptor IMPSGraphCreateSparseOpDescriptor, inputTensorArray []MPSGraphTensor, shape foundation.NSArray, name string) IMPSGraphTensor
Creates a sparse tensor representation.
sparseDescriptor: A sparseDescriptor.
inputTensorArray: An array of input tensors as [sparseVals, indexTensor0, indexTensor1].
shape: The shape of the sparse tensor.
name: A name for the operation.
Return Value ¶
A valid MPSGraphTensor object
Discussion ¶
sparseVals corresponds to non zero values in matrix. indexTensor0 and indexTensor1 are indices used for indexing into sparse data structure. For COO, indexTensor0 is x index and indexTensor1 is y index . For CSC, indexTensor0 and indexTensor1 correspond to rowIndex and colStarts respectively. For CSR, indexTensor0 and indexTensor1 correspond to colIndex and rowStarts respectively. You must set input tensors appropriately for each sparse storage type.
func (MPSGraph) SparseTensorWithTypeTensorsShapeDataTypeName ¶
func (g MPSGraph) SparseTensorWithTypeTensorsShapeDataTypeName(sparseStorageType MPSGraphSparseStorageType, inputTensorArray []MPSGraphTensor, shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
Creates a sparse tensor representation.
sparseStorageType: A sparseStorageType.
inputTensorArray: An array of input tensors as [sparseVals, indexTensor0, indexTensor1].
shape: The shape of the sparse tensor.
dataType: The dataType of the sparse tensor.
name: A name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
sparseVals corresponds to non zero values in matrix. indexTensor0 and indexTensor1 are indices used for indexing into sparse data structure. For COO, indexTensor0 is x index and indexTensor1 is y index. For CSC, indexTensor0 and indexTensor1 correspond to rowIndex and colStarts respectively. For CSR, indexTensor0 and indexTensor1 correspond to colIndex and rowStarts respectively. You must set input tensors appropriately for each sparse storage type.
func (MPSGraph) SplitTensorNumSplitsAxisName ¶
func (g MPSGraph) SplitTensorNumSplitsAxisName(tensor IMPSGraphTensor, numSplits uint, axis int, name string) []MPSGraphTensor
Creates a split operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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`.
func (MPSGraph) SplitTensorSplitSizesAxisName ¶
func (g MPSGraph) SplitTensorSplitSizesAxisName(tensor IMPSGraphTensor, splitSizes []foundation.NSNumber, axis int, name string) []MPSGraphTensor
Creates a split operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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`.
func (MPSGraph) SplitTensorSplitSizesTensorAxisName ¶
func (g MPSGraph) SplitTensorSplitSizesTensorAxisName(tensor IMPSGraphTensor, splitSizesTensor IMPSGraphTensor, axis int, name string) []MPSGraphTensor
Creates a split operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
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`.
func (MPSGraph) SquareRootWithTensorName ¶
func (g MPSGraph) SquareRootWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the square root operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
func (MPSGraph) SquareWithTensorName ¶
func (g MPSGraph) SquareWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the square operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/square(with:name:)
func (MPSGraph) SqueezeTensorAxesName ¶
func (g MPSGraph) SqueezeTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Creates a squeeze operation and returns the result tensor.
tensor: The input tensor.
axes: The axes to squeeze.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes.
func (MPSGraph) SqueezeTensorAxesTensorName ¶
func (g MPSGraph) SqueezeTensorAxesTensorName(tensor IMPSGraphTensor, axesTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a squeeze operation and returns the result tensor.
tensor: The input tensor.
axesTensor: The tensor containing the axes to squeeze.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object ¶
Discussion ¶
Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes.
func (MPSGraph) SqueezeTensorAxisName ¶
func (g MPSGraph) SqueezeTensorAxisName(tensor IMPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a squeeze operation and returns the result tensor.
tensor: The input tensor.
axis: The axis to squeeze.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
func (MPSGraph) SqueezeTensorName ¶
func (g MPSGraph) SqueezeTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a squeeze operation and returns the result tensor.
tensor: The input tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Squeezes the tensor, removing all dimensions with size 1.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/squeeze(_:name:)
func (MPSGraph) StackTensorsAxisName ¶
func (g MPSGraph) StackTensorsAxisName(inputTensors []MPSGraphTensor, axis int, name string) IMPSGraphTensor
Creates a stack operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/stack(_:axis:name:)
func (MPSGraph) StencilWithSourceTensorWeightsTensorDescriptorName ¶
func (g MPSGraph) StencilWithSourceTensorWeightsTensorDescriptorName(source IMPSGraphTensor, weights IMPSGraphTensor, descriptor IMPSGraphStencilOpDescriptor, name string) IMPSGraphTensor
Creates a stencil operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
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`.
func (MPSGraph) StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName ¶
func (g MPSGraph) StochasticGradientDescentWithLearningRateTensorValuesTensorGradientTensorName(learningRateTensor IMPSGraphTensor, valuesTensor IMPSGraphTensor, gradientTensor IMPSGraphTensor, name string) IMPSGraphTensor
The Stochastic gradient descent performs a gradient descent.
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
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
`variable = variable - (learningRate * g)` where, `g` is gradient of error wrt variable
func (MPSGraph) SubtractionWithPrimaryTensorSecondaryTensorName ¶
func (g MPSGraph) SubtractionWithPrimaryTensorSecondaryTensorName(primaryTensor IMPSGraphTensor, secondaryTensor IMPSGraphTensor, name string) IMPSGraphTensor
Subtracts the second input tensor from the first.
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.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation creates a subtract operation and returns the result tensor. It supports broadcasting as well.
func (MPSGraph) TanWithTensorName ¶
func (g MPSGraph) TanWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the tangent operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/tan(with:name:)
func (MPSGraph) TanhWithTensorName ¶
func (g MPSGraph) TanhWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the hyperbolic tangent operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/tanh(with:name:)
func (MPSGraph) TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName ¶
func (g MPSGraph) TileGradientWithIncomingGradientTensorSourceTensorWithMultiplierName(incomingGradientTensor IMPSGraphTensor, sourceTensor IMPSGraphTensor, multiplier foundation.NSArray, name string) IMPSGraphTensor
Creates a tile gradient operation and returns the result tensor.
incomingGradientTensor: The input gradient tensor.
sourceTensor: The input tensor of the forward pass.
multiplier: An array of numbers that specifies how many copies per dimension MPSGraph produced in the forward pass.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) TileTensorWithMultiplierName ¶
func (g MPSGraph) TileTensorWithMultiplierName(tensor IMPSGraphTensor, multiplier foundation.NSArray, name string) IMPSGraphTensor
Creates a tile operation and returns the result tensor.
tensor: The input tensor
multiplier: An array of numbers that specifies how many copies per dimension MPSGraph produces.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Creates a tensor which contains multiple copies of the input tensor along each dimension of the tensor.
func (MPSGraph) TopKWithGradientTensorSourceAxisKName ¶
func (g MPSGraph) TopKWithGradientTensorSourceAxisKName(gradient IMPSGraphTensor, source IMPSGraphTensor, axis int, k uint, name string) IMPSGraphTensor
Creates a TopKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) TopKWithGradientTensorSourceAxisTensorKTensorName ¶
func (g MPSGraph) TopKWithGradientTensorSourceAxisTensorKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a TopKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) TopKWithGradientTensorSourceKName ¶
func (g MPSGraph) TopKWithGradientTensorSourceKName(gradient IMPSGraphTensor, source IMPSGraphTensor, k uint, name string) IMPSGraphTensor
Creates a TopKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) TopKWithGradientTensorSourceKTensorName ¶
func (g MPSGraph) TopKWithGradientTensorSourceKTensorName(gradient IMPSGraphTensor, source IMPSGraphTensor, kTensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a TopKGradient operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Finds the K largest values along the minor dimension of the input. The input must have at least K elements along its minor dimension.
func (MPSGraph) TopKWithSourceTensorAxisKName ¶
func (g MPSGraph) TopKWithSourceTensorAxisKName(source IMPSGraphTensor, axis int, k uint, name string) []MPSGraphTensor
Creates a TopK operation and returns the value and indices tensors.
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.
Return Value ¶
A valid MPSGraphTensor array of size 2.
Discussion ¶
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.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/topK(_:axis:k:name:)
func (MPSGraph) TopKWithSourceTensorAxisTensorKTensorName ¶
func (g MPSGraph) TopKWithSourceTensorAxisTensorKTensorName(source IMPSGraphTensor, axisTensor IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
Creates a TopK operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor array of size 2.
Discussion ¶
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.
func (MPSGraph) TopKWithSourceTensorKName ¶
func (g MPSGraph) TopKWithSourceTensorKName(source IMPSGraphTensor, k uint, name string) []MPSGraphTensor
Creates a TopK operation and returns the value and indices tensors
source: Tensor containing source data
k: The number of largest values to return
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor array of size 2 ¶
Discussion ¶
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.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/topK(_:k:name:)
func (MPSGraph) TopKWithSourceTensorKTensorName ¶
func (g MPSGraph) TopKWithSourceTensorKTensorName(source IMPSGraphTensor, kTensor IMPSGraphTensor, name string) []MPSGraphTensor
Creates a TopK operation and returns the result tensor.
source: Tensor containing source data.
kTensor: Tensor of the number of largest values to return.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor array of size 2.
Discussion ¶
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.
func (MPSGraph) TransposeTensorDimensionWithDimensionName ¶
func (g MPSGraph) TransposeTensorDimensionWithDimensionName(tensor IMPSGraphTensor, dimensionIndex uint, dimensionIndex2 uint, name string) IMPSGraphTensor
Creates a transpose operation and returns the result tensor.
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.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Transposes the dimensions `dimensionIndex` and `dimensionIndex2` of the input tensor.
func (MPSGraph) TransposeTensorPermutationName ¶
func (g MPSGraph) TransposeTensorPermutationName(tensor IMPSGraphTensor, permutation []foundation.NSNumber, name string) IMPSGraphTensor
Creates a permutation operation and returns the result tensor.
tensor: The tensor to be permuted.
permutation: An array of numbers defining the permutation, must be of length `rank(tensor)` and define a valid permutation.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
Discussion ¶
Permutes the dimensions of the input tensor according to values in `permutation`.
func (MPSGraph) TruncateWithTensorName ¶
func (g MPSGraph) TruncateWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Applies the truncate operation to the input tensor elements.
tensor: The input tensor.
name: An optional string which serves as an identifier for the operation.
Return Value ¶
A valid MPSGraphTensor object containing the elementwise result of the applied operation.
Discussion ¶
This operation applies the floor operation to positive inputs and ceiling operation to negative inputs.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/truncate(_:name:)
func (MPSGraph) VariableFromTensorWithTensorName ¶
func (g MPSGraph) VariableFromTensorWithTensorName(tensor IMPSGraphTensor, name string) IMPSGraphTensor
Creates a variable from an input tensor.
tensor: The tensor from which to form the variable.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) VariableWithDataShapeDataTypeName ¶
func (g MPSGraph) VariableWithDataShapeDataTypeName(data foundation.NSData, shape foundation.NSArray, dataType uint32, name string) IMPSGraphTensor
Creates a variable operation and returns the result tensor.
data: The data for the tensor. The number of bytes should be sizeof(dataType)numberOfElements.
shape: The shape of the output tensor. This has to be statically shaped.
dataType: The dataType of the constant tensor.
name: The name for the operation.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) VarianceOfTensorAxesName ¶
func (g MPSGraph) VarianceOfTensorAxesName(tensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Returns the variance of the first input along the specified axes.
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.
Return Value ¶
A valid MPSGraphTensor object.
func (MPSGraph) VarianceOfTensorMeanTensorAxesName ¶
func (g MPSGraph) VarianceOfTensorMeanTensorAxesName(tensor IMPSGraphTensor, meanTensor IMPSGraphTensor, axes []foundation.NSNumber, name string) IMPSGraphTensor
Returns the variance of the first input along the specified axes when the mean has been precomputed.
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.
Return Value ¶
A valid MPSGraphTensor object.
type MPSGraphCallableMap ¶
type MPSGraphCallableMap = foundation.INSDictionary
MPSGraphCallableMap is a dictionary of symbol names and the corresponding executables for them.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphCallableMap
type MPSGraphClass ¶
type MPSGraphClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphClass ¶
func GetMPSGraphClass() MPSGraphClass
GetMPSGraphClass returns the class object for MPSGraph.
func (MPSGraphClass) Alloc ¶
func (mc MPSGraphClass) Alloc() MPSGraph
Alloc allocates memory for a new instance of the class.
func (MPSGraphClass) Class ¶
func (mc MPSGraphClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphCompilationCompletionHandler ¶
type MPSGraphCompilationCompletionHandler = func(executable MPSGraphExecutable, error_ foundation.NSError)
MPSGraphCompilationCompletionHandler is a notification that appears when compilation finishes.
type MPSGraphCompilationDescriptor ¶
type MPSGraphCompilationDescriptor struct {
MPSGraphObject
}
A class that consists of all the levers for compiling graphs.
Instance Properties ¶
- MPSGraphCompilationDescriptor.Callables: The dictionary used during runtime to lookup the MPSGraphExecutable(<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable>) which correspond to the `symbolName`.
- MPSGraphCompilationDescriptor.SetCallables
- MPSGraphCompilationDescriptor.CompilationCompletionHandler: The handler that the graph calls when the compilation completes.
- MPSGraphCompilationDescriptor.SetCompilationCompletionHandler
- MPSGraphCompilationDescriptor.DispatchQueue: The dispatch queue used for the compilation.
- MPSGraphCompilationDescriptor.SetDispatchQueue
- MPSGraphCompilationDescriptor.OptimizationLevel: The optimization level for the graph execution, default is MPSGraphOptimizationLevel1.
- MPSGraphCompilationDescriptor.SetOptimizationLevel
- MPSGraphCompilationDescriptor.OptimizationProfile: The optimization profile for the graph optimization.
- MPSGraphCompilationDescriptor.SetOptimizationProfile
- MPSGraphCompilationDescriptor.ReducedPrecisionFastMath: Across the executable allow reduced precision fast math optimizations.
- MPSGraphCompilationDescriptor.SetReducedPrecisionFastMath
- MPSGraphCompilationDescriptor.WaitForCompilationCompletion: Flag that makes the compile or specialize call blocking till the entire compilation is complete, defaults to NO.
- MPSGraphCompilationDescriptor.SetWaitForCompilationCompletion
Instance Methods ¶
- MPSGraphCompilationDescriptor.DisableTypeInference: Turns off type inference and relies on type inference during runtime.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphCompilationDescriptor
func MPSGraphCompilationDescriptorFromID ¶
func MPSGraphCompilationDescriptorFromID(id objc.ID) MPSGraphCompilationDescriptor
MPSGraphCompilationDescriptorFromID constructs a MPSGraphCompilationDescriptor from an objc.ID.
A class that consists of all the levers for compiling graphs.
func NewMPSGraphCompilationDescriptor ¶
func NewMPSGraphCompilationDescriptor() MPSGraphCompilationDescriptor
NewMPSGraphCompilationDescriptor creates a new MPSGraphCompilationDescriptor instance.
func (MPSGraphCompilationDescriptor) Autorelease ¶
func (g MPSGraphCompilationDescriptor) Autorelease() MPSGraphCompilationDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphCompilationDescriptor) Callables ¶
func (g MPSGraphCompilationDescriptor) Callables() MPSGraphCallableMap
The dictionary used during runtime to lookup the MPSGraphExecutable which correspond to the `symbolName`.
func (MPSGraphCompilationDescriptor) CompilationCompletionHandler ¶
func (g MPSGraphCompilationDescriptor) CompilationCompletionHandler() MPSGraphExecutableErrorHandler
The handler that the graph calls when the compilation completes.
Discussion ¶
Default value is nil.
func (MPSGraphCompilationDescriptor) DisableTypeInference ¶
func (g MPSGraphCompilationDescriptor) DisableTypeInference()
Turns off type inference and relies on type inference during runtime.
func (MPSGraphCompilationDescriptor) DispatchQueue ¶
func (g MPSGraphCompilationDescriptor) DispatchQueue() dispatch.Queue
The dispatch queue used for the compilation.
Discussion ¶
Default value is nil.
func (MPSGraphCompilationDescriptor) Init ¶
func (g MPSGraphCompilationDescriptor) Init() MPSGraphCompilationDescriptor
Init initializes the instance.
func (MPSGraphCompilationDescriptor) OptimizationLevel ¶
func (g MPSGraphCompilationDescriptor) OptimizationLevel() MPSGraphOptimization
The optimization level for the graph execution, default is MPSGraphOptimizationLevel1.
func (MPSGraphCompilationDescriptor) OptimizationProfile ¶
func (g MPSGraphCompilationDescriptor) OptimizationProfile() MPSGraphOptimizationProfile
The optimization profile for the graph optimization.
Discussion ¶
Default is MPSGraphOptimizationProfilePerformance.
func (MPSGraphCompilationDescriptor) ReducedPrecisionFastMath ¶
func (g MPSGraphCompilationDescriptor) ReducedPrecisionFastMath() MPSGraphReducedPrecisionFastMath
Across the executable allow reduced precision fast math optimizations.
func (MPSGraphCompilationDescriptor) SetCallables ¶
func (g MPSGraphCompilationDescriptor) SetCallables(value MPSGraphCallableMap)
func (MPSGraphCompilationDescriptor) SetCompilationCompletionHandler ¶
func (g MPSGraphCompilationDescriptor) SetCompilationCompletionHandler(value MPSGraphExecutableErrorHandler)
func (MPSGraphCompilationDescriptor) SetDispatchQueue ¶
func (g MPSGraphCompilationDescriptor) SetDispatchQueue(value dispatch.Queue)
func (MPSGraphCompilationDescriptor) SetOptimizationLevel ¶
func (g MPSGraphCompilationDescriptor) SetOptimizationLevel(value MPSGraphOptimization)
func (MPSGraphCompilationDescriptor) SetOptimizationProfile ¶
func (g MPSGraphCompilationDescriptor) SetOptimizationProfile(value MPSGraphOptimizationProfile)
func (MPSGraphCompilationDescriptor) SetReducedPrecisionFastMath ¶
func (g MPSGraphCompilationDescriptor) SetReducedPrecisionFastMath(value MPSGraphReducedPrecisionFastMath)
func (MPSGraphCompilationDescriptor) SetWaitForCompilationCompletion ¶
func (g MPSGraphCompilationDescriptor) SetWaitForCompilationCompletion(value bool)
func (MPSGraphCompilationDescriptor) WaitForCompilationCompletion ¶
func (g MPSGraphCompilationDescriptor) WaitForCompilationCompletion() bool
Flag that makes the compile or specialize call blocking till the entire compilation is complete, defaults to NO.
type MPSGraphCompilationDescriptorClass ¶
type MPSGraphCompilationDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphCompilationDescriptorClass ¶
func GetMPSGraphCompilationDescriptorClass() MPSGraphCompilationDescriptorClass
GetMPSGraphCompilationDescriptorClass returns the class object for MPSGraphCompilationDescriptor.
func (MPSGraphCompilationDescriptorClass) Alloc ¶
func (mc MPSGraphCompilationDescriptorClass) Alloc() MPSGraphCompilationDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphCompilationDescriptorClass) Class ¶
func (mc MPSGraphCompilationDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphCompletionHandler ¶
type MPSGraphCompletionHandler = func(resultsDictionary foundation.INSDictionary, error_ foundation.NSError)
MPSGraphCompletionHandler is a notification that appears when graph execution finishes.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphCompletionHandler
type MPSGraphControlFlowDependencyBlock ¶
type MPSGraphControlFlowDependencyBlock = func() []MPSGraphTensor
MPSGraphControlFlowDependencyBlock is the scope where all the operations defined in this block get control-dependency operations.
type MPSGraphConvolution2DOpDescriptor ¶
type MPSGraphConvolution2DOpDescriptor struct {
MPSGraphObject
}
A class that describes the properties of a 2D-convolution operator.
Overview ¶
Use an instance of this class is to add a 2D-convolution operator with the desired properties to the graph.
Instance Properties ¶
- MPSGraphConvolution2DOpDescriptor.DataLayout: The named layout of data in the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetDataLayout
- MPSGraphConvolution2DOpDescriptor.DilationRateInX: The amount by which the weights tensor expands in the `x`-direction.
- MPSGraphConvolution2DOpDescriptor.SetDilationRateInX
- MPSGraphConvolution2DOpDescriptor.DilationRateInY: The amount by which the weights tensor expands in the `y`-direction.
- MPSGraphConvolution2DOpDescriptor.SetDilationRateInY
- MPSGraphConvolution2DOpDescriptor.Groups: The number of partitions of the input and output channels.
- MPSGraphConvolution2DOpDescriptor.SetGroups
- MPSGraphConvolution2DOpDescriptor.PaddingBottom: The number of zeros added at the bottom of the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetPaddingBottom
- MPSGraphConvolution2DOpDescriptor.PaddingLeft: The number of zeros added on the left side of the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetPaddingLeft
- MPSGraphConvolution2DOpDescriptor.PaddingRight: The number of zeros added on the right side of the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetPaddingRight
- MPSGraphConvolution2DOpDescriptor.PaddingStyle: The type of padding applied to the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetPaddingStyle
- MPSGraphConvolution2DOpDescriptor.PaddingTop: The number of zeros added at the top of the source tensor.
- MPSGraphConvolution2DOpDescriptor.SetPaddingTop
- MPSGraphConvolution2DOpDescriptor.StrideInX: The scale that maps `x`-coordinate of the destination to `x`-coordinate of the source.
- MPSGraphConvolution2DOpDescriptor.SetStrideInX
- MPSGraphConvolution2DOpDescriptor.StrideInY: The scale that maps `y`-coordinate of the destination to `y`-coordinate of the source.
- MPSGraphConvolution2DOpDescriptor.SetStrideInY
- MPSGraphConvolution2DOpDescriptor.WeightsLayout: The named layout of data in the weights tensor.
- MPSGraphConvolution2DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- MPSGraphConvolution2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the left, right, top, and bottom padding values.
func MPSGraphConvolution2DOpDescriptorFromID ¶
func MPSGraphConvolution2DOpDescriptorFromID(id objc.ID) MPSGraphConvolution2DOpDescriptor
MPSGraphConvolution2DOpDescriptorFromID constructs a MPSGraphConvolution2DOpDescriptor from an objc.ID.
A class that describes the properties of a 2D-convolution operator.
func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout ¶
func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, groups uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphConvolution2DOpDescriptor
Creates a convolution descriptor with given values for parameters.
strideInX: See MPSGraphConvolution2DOpDescriptor.StrideInX property.
strideInY: See MPSGraphConvolution2DOpDescriptor.StrideInY property.
dilationRateInX: See MPSGraphConvolution2DOpDescriptor.DilationRateInX property.
dilationRateInY: See MPSGraphConvolution2DOpDescriptor.DilationRateInY property.
groups: See MPSGraphConvolution2DOpDescriptor.Groups property.
paddingLeft: See MPSGraphConvolution2DOpDescriptor.PaddingLeft property.
paddingRight: See MPSGraphConvolution2DOpDescriptor.PaddingRight property.
paddingTop: See MPSGraphConvolution2DOpDescriptor.PaddingTop property.
paddingBottom: See MPSGraphConvolution2DOpDescriptor.PaddingBottom property.
paddingStyle: See MPSGraphConvolution2DOpDescriptor.PaddingStyle property.
dataLayout: See MPSGraphConvolution2DOpDescriptor.DataLayout property.
weightsLayout: See MPSGraphConvolution2DOpDescriptor.WeightsLayout property.
Return Value ¶
The MPSGraphConvolution2DOpDescriptor on autoreleasepool.
func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout ¶
func NewGraphConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, groups uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphConvolution2DOpDescriptor
Creates a convolution descriptor with given values for parameters.
strideInX: See MPSGraphConvolution2DOpDescriptor.StrideInX property.
strideInY: See MPSGraphConvolution2DOpDescriptor.StrideInY property.
dilationRateInX: See MPSGraphConvolution2DOpDescriptor.DilationRateInX property.
dilationRateInY: See MPSGraphConvolution2DOpDescriptor.DilationRateInY property.
groups: See MPSGraphConvolution2DOpDescriptor.Groups property.
paddingStyle: See MPSGraphConvolution2DOpDescriptor.PaddingStyle property.
dataLayout: See MPSGraphConvolution2DOpDescriptor.DataLayout property.
weightsLayout: See MPSGraphConvolution2DOpDescriptor.WeightsLayout property.
Return Value ¶
The MPSGraphConvolution2DOpDescriptor on autoreleasepool.
func NewMPSGraphConvolution2DOpDescriptor ¶
func NewMPSGraphConvolution2DOpDescriptor() MPSGraphConvolution2DOpDescriptor
NewMPSGraphConvolution2DOpDescriptor creates a new MPSGraphConvolution2DOpDescriptor instance.
func (MPSGraphConvolution2DOpDescriptor) Autorelease ¶
func (g MPSGraphConvolution2DOpDescriptor) Autorelease() MPSGraphConvolution2DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphConvolution2DOpDescriptor) DataLayout ¶
func (g MPSGraphConvolution2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
The named layout of data in the source tensor.
Discussion ¶
It defines the order of named dimensions (Batch, Channel, Height, Width). The convolution operation uses this to interpret data in the source tensor. For example, if `dataLayout` is MPSGraphTensorNamedDataLayoutNCHW, frameork interprets data in source tensor as `batch x channels x height x width` with `width` as fastest moving dimension.
func (MPSGraphConvolution2DOpDescriptor) DilationRateInX ¶
func (g MPSGraphConvolution2DOpDescriptor) DilationRateInX() uint
The amount by which the weights tensor expands in the `x`-direction.
Discussion ¶
The weights tensor is dilated by inserting `dilationRateInX-1` zeros between consecutive values in `x`-dimension. Dilated weights tensor width is `(dilationRateInX-1)*kernelWidth+1`. Default value is 1.
func (MPSGraphConvolution2DOpDescriptor) DilationRateInY ¶
func (g MPSGraphConvolution2DOpDescriptor) DilationRateInY() uint
The amount by which the weights tensor expands in the `y`-direction.
Discussion ¶
The weights tensor is dilated by inserting `dilationRateInY-1` zeros between consecutive values in `y`-dimension. Dilated weights tensor width is `(dilationRateInY-1)*kernelHeight+1`. Default value is 1.
func (MPSGraphConvolution2DOpDescriptor) Groups ¶
func (g MPSGraphConvolution2DOpDescriptor) Groups() uint
The number of partitions of the input and output channels.
Discussion ¶
The convolution operation divides input and output channels in `groups` partitions. input channels in a group or partition are only connected to output channels in corresponding group. Number of weights the convolution needs is `outputFeatureChannels x inputFeatureChannels/groups x kernelWidth x kernelHeight`
func (MPSGraphConvolution2DOpDescriptor) Init ¶
func (g MPSGraphConvolution2DOpDescriptor) Init() MPSGraphConvolution2DOpDescriptor
Init initializes the instance.
func (MPSGraphConvolution2DOpDescriptor) PaddingBottom ¶
func (g MPSGraphConvolution2DOpDescriptor) PaddingBottom() uint
The number of zeros added at the bottom of the source tensor.
func (MPSGraphConvolution2DOpDescriptor) PaddingLeft ¶
func (g MPSGraphConvolution2DOpDescriptor) PaddingLeft() uint
The number of zeros added on the left side of the source tensor.
func (MPSGraphConvolution2DOpDescriptor) PaddingRight ¶
func (g MPSGraphConvolution2DOpDescriptor) PaddingRight() uint
The number of zeros added on the right side of the source tensor.
func (MPSGraphConvolution2DOpDescriptor) PaddingStyle ¶
func (g MPSGraphConvolution2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
The type of padding applied to the source tensor.
Discussion ¶
If paddingStyle is MPSGraphPaddingStyleExplicit, `paddingLeft`, `laddingRight`, `paddingTop`, and `paddingBottom` must to be specified. For all other padding styles, framework compute these values so you dont need to provide these values.
func (MPSGraphConvolution2DOpDescriptor) PaddingTop ¶
func (g MPSGraphConvolution2DOpDescriptor) PaddingTop() uint
The number of zeros added at the top of the source tensor.
func (MPSGraphConvolution2DOpDescriptor) SetDataLayout ¶
func (g MPSGraphConvolution2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphConvolution2DOpDescriptor) SetDilationRateInX ¶
func (g MPSGraphConvolution2DOpDescriptor) SetDilationRateInX(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetDilationRateInY ¶
func (g MPSGraphConvolution2DOpDescriptor) SetDilationRateInY(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom ¶
func (g MPSGraphConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
Sets the left, right, top, and bottom padding values.
paddingLeft: See MPSGraphConvolution2DOpDescriptor.PaddingLeft property.
paddingRight: See MPSGraphConvolution2DOpDescriptor.PaddingRight property.
paddingTop: See MPSGraphConvolution2DOpDescriptor.PaddingTop property.
paddingBottom: See MPSGraphConvolution2DOpDescriptor.PaddingBottom property.
func (MPSGraphConvolution2DOpDescriptor) SetGroups ¶
func (g MPSGraphConvolution2DOpDescriptor) SetGroups(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetPaddingBottom ¶
func (g MPSGraphConvolution2DOpDescriptor) SetPaddingBottom(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetPaddingLeft ¶
func (g MPSGraphConvolution2DOpDescriptor) SetPaddingLeft(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetPaddingRight ¶
func (g MPSGraphConvolution2DOpDescriptor) SetPaddingRight(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphConvolution2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphConvolution2DOpDescriptor) SetPaddingTop ¶
func (g MPSGraphConvolution2DOpDescriptor) SetPaddingTop(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetStrideInX ¶
func (g MPSGraphConvolution2DOpDescriptor) SetStrideInX(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetStrideInY ¶
func (g MPSGraphConvolution2DOpDescriptor) SetStrideInY(value uint)
func (MPSGraphConvolution2DOpDescriptor) SetWeightsLayout ¶
func (g MPSGraphConvolution2DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphConvolution2DOpDescriptor) StrideInX ¶
func (g MPSGraphConvolution2DOpDescriptor) StrideInX() uint
The scale that maps `x`-coordinate of the destination to `x`-coordinate of the source.
Discussion ¶
Source `x`-coordinate, `sx` is computed from destination `x`-coordinate, `dx` as `sx = strideInX*dx`. Default value is 1.
func (MPSGraphConvolution2DOpDescriptor) StrideInY ¶
func (g MPSGraphConvolution2DOpDescriptor) StrideInY() uint
The scale that maps `y`-coordinate of the destination to `y`-coordinate of the source.
Discussion ¶
Source `y`-coordinate, `sy` is computed from destination `y`-coordinate, `dy` as `sy = strideInY*dy`. Default value is 1.
func (MPSGraphConvolution2DOpDescriptor) WeightsLayout ¶
func (g MPSGraphConvolution2DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
The named layout of data in the weights tensor.
Discussion ¶
It defines the order of named dimensions (Output channels, Input channels, Kernel height, Kernel width). The convolution operation uses this to interpret data in the weights tensor. For example, if `weightsLayout` is MPSGraphTensorNamedDataLayoutOIHW, frameork interprets data in weights tensor as `outputChannels x inputChannels x kernelHeight x kernelWidth` with `kernelWidth` as fastest moving dimension.
type MPSGraphConvolution2DOpDescriptorClass ¶
type MPSGraphConvolution2DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphConvolution2DOpDescriptorClass ¶
func GetMPSGraphConvolution2DOpDescriptorClass() MPSGraphConvolution2DOpDescriptorClass
GetMPSGraphConvolution2DOpDescriptorClass returns the class object for MPSGraphConvolution2DOpDescriptor.
func (MPSGraphConvolution2DOpDescriptorClass) Alloc ¶
func (mc MPSGraphConvolution2DOpDescriptorClass) Alloc() MPSGraphConvolution2DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphConvolution2DOpDescriptorClass) Class ¶
func (mc MPSGraphConvolution2DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphConvolution3DOpDescriptor ¶
type MPSGraphConvolution3DOpDescriptor struct {
MPSGraphObject
}
A class that describes the properties of a 3D-convolution operator.
Overview ¶
Use an instance of this class is to add a 3D-convolution operator with desired properties to the graph.
Instance Properties ¶
- MPSGraphConvolution3DOpDescriptor.DataLayout: The named layout of data in the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetDataLayout
- MPSGraphConvolution3DOpDescriptor.DilationRateInX: The amount by which weights tensor expands in the `x`-direction.
- MPSGraphConvolution3DOpDescriptor.SetDilationRateInX
- MPSGraphConvolution3DOpDescriptor.DilationRateInY: The amount by which weights tensor expands in the `y`-direction.
- MPSGraphConvolution3DOpDescriptor.SetDilationRateInY
- MPSGraphConvolution3DOpDescriptor.DilationRateInZ: The amount by which weights tensor expands in the `z`-direction.
- MPSGraphConvolution3DOpDescriptor.SetDilationRateInZ
- MPSGraphConvolution3DOpDescriptor.Groups: The number of partitions of the input and output channels.
- MPSGraphConvolution3DOpDescriptor.SetGroups
- MPSGraphConvolution3DOpDescriptor.PaddingBack: The number of zeros added at the back of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingBack
- MPSGraphConvolution3DOpDescriptor.PaddingBottom: The number of zeros added at the bottom of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingBottom
- MPSGraphConvolution3DOpDescriptor.PaddingFront: The number of zeros added at the front of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingFront
- MPSGraphConvolution3DOpDescriptor.PaddingLeft: The number of zeros added on the left side of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingLeft
- MPSGraphConvolution3DOpDescriptor.PaddingRight: The number of zeros added on the right side of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingRight
- MPSGraphConvolution3DOpDescriptor.PaddingStyle: The type of padding that is applied to the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingStyle
- MPSGraphConvolution3DOpDescriptor.PaddingTop: The number of zeros added at the top of the source tensor.
- MPSGraphConvolution3DOpDescriptor.SetPaddingTop
- MPSGraphConvolution3DOpDescriptor.StrideInX: The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
- MPSGraphConvolution3DOpDescriptor.SetStrideInX
- MPSGraphConvolution3DOpDescriptor.StrideInY: The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
- MPSGraphConvolution3DOpDescriptor.SetStrideInY
- MPSGraphConvolution3DOpDescriptor.StrideInZ: The scale that maps`z`-coordinate of destination to `z`-coordinate of source.
- MPSGraphConvolution3DOpDescriptor.SetStrideInZ
- MPSGraphConvolution3DOpDescriptor.WeightsLayout: The named layout of data in the weights tensor.
- MPSGraphConvolution3DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- MPSGraphConvolution3DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack: Sets the left, right, top, bottom, front, and back padding values.
func MPSGraphConvolution3DOpDescriptorFromID ¶
func MPSGraphConvolution3DOpDescriptorFromID(id objc.ID) MPSGraphConvolution3DOpDescriptor
MPSGraphConvolution3DOpDescriptorFromID constructs a MPSGraphConvolution3DOpDescriptor from an objc.ID.
A class that describes the properties of a 3D-convolution operator.
func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBackPaddingStyleDataLayoutWeightsLayout ¶
func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBackPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, strideInZ uint, dilationRateInX uint, dilationRateInY uint, dilationRateInZ uint, groups uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingFront uint, paddingBack uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphConvolution3DOpDescriptor
Creates a convolution descriptor with given values for parameters.
strideInX: See MPSGraphConvolution3DOpDescriptor.StrideInX property.
strideInY: See MPSGraphConvolution3DOpDescriptor.StrideInY property.
strideInZ: See MPSGraphConvolution3DOpDescriptor.StrideInZ property.
dilationRateInX: See MPSGraphConvolution3DOpDescriptor.DilationRateInX property.
dilationRateInY: See MPSGraphConvolution3DOpDescriptor.DilationRateInY property.
dilationRateInZ: See MPSGraphConvolution3DOpDescriptor.DilationRateInZ property.
groups: See MPSGraphConvolution3DOpDescriptor.Groups property.
paddingLeft: See MPSGraphConvolution3DOpDescriptor.PaddingLeft property.
paddingRight: See MPSGraphConvolution3DOpDescriptor.PaddingRight property.
paddingTop: See MPSGraphConvolution3DOpDescriptor.PaddingTop property.
paddingBottom: See MPSGraphConvolution3DOpDescriptor.PaddingBottom property.
paddingFront: See MPSGraphConvolution3DOpDescriptor.PaddingFront property.
paddingBack: See MPSGraphConvolution3DOpDescriptor.PaddingBack property.
paddingStyle: See MPSGraphConvolution3DOpDescriptor.PaddingStyle property.
dataLayout: See MPSGraphConvolution3DOpDescriptor.DataLayout property.
weightsLayout: See MPSGraphConvolution3DOpDescriptor.WeightsLayout property.
Return Value ¶
The MPSGraphConvolution3DOpDescriptor on autoreleasepool.
func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingStyleDataLayoutWeightsLayout ¶
func NewGraphConvolution3DOpDescriptorWithStrideInXStrideInYStrideInZDilationRateInXDilationRateInYDilationRateInZGroupsPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, strideInZ uint, dilationRateInX uint, dilationRateInY uint, dilationRateInZ uint, groups uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphConvolution3DOpDescriptor
Creates a convolution descriptor with given values for parameters.
strideInX: See MPSGraphConvolution3DOpDescriptor.StrideInX property.
strideInY: See MPSGraphConvolution3DOpDescriptor.StrideInY property.
strideInZ: See MPSGraphConvolution3DOpDescriptor.StrideInZ property.
dilationRateInX: See MPSGraphConvolution3DOpDescriptor.DilationRateInX property.
dilationRateInY: See MPSGraphConvolution3DOpDescriptor.DilationRateInY property.
dilationRateInZ: See MPSGraphConvolution3DOpDescriptor.DilationRateInZ property.
groups: See MPSGraphConvolution3DOpDescriptor.Groups property.
paddingStyle: See MPSGraphConvolution3DOpDescriptor.PaddingStyle property.
dataLayout: See MPSGraphConvolution3DOpDescriptor.DataLayout property.
weightsLayout: See MPSGraphConvolution3DOpDescriptor.WeightsLayout property.
Return Value ¶
The MPSGraphConvolution3DOpDescriptor on autoreleasepool.
func NewMPSGraphConvolution3DOpDescriptor ¶
func NewMPSGraphConvolution3DOpDescriptor() MPSGraphConvolution3DOpDescriptor
NewMPSGraphConvolution3DOpDescriptor creates a new MPSGraphConvolution3DOpDescriptor instance.
func (MPSGraphConvolution3DOpDescriptor) Autorelease ¶
func (g MPSGraphConvolution3DOpDescriptor) Autorelease() MPSGraphConvolution3DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphConvolution3DOpDescriptor) DataLayout ¶
func (g MPSGraphConvolution3DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
The named layout of data in the source tensor.
Discussion ¶
It defines the order of named dimensions (Batch, Channel, Depth, Height, Width). The convolution operation uses this to interpret data in the source tensor. For example, if `dataLayout` is MPSGraphTensorNamedDataLayoutNCDHW, frameork interprets data in source tensor as `batch x channels x depth x height x width` with `width` as fastest moving dimension.
func (MPSGraphConvolution3DOpDescriptor) DilationRateInX ¶
func (g MPSGraphConvolution3DOpDescriptor) DilationRateInX() uint
The amount by which weights tensor expands in the `x`-direction.
Discussion ¶
The weights tensor is dilated by inserting `dilationRateInX-1` zeros between consecutive values in `x`-dimension. Dilated weights tensor width is `(dilationRateInX-1)*kernelWidth+1`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) DilationRateInY ¶
func (g MPSGraphConvolution3DOpDescriptor) DilationRateInY() uint
The amount by which weights tensor expands in the `y`-direction.
Discussion ¶
The weights tensor is dilated by inserting `dilationRateInY-1` zeros between consecutive values in `y`-dimension. Dilated weights tensor width is `(dilationRateInY-1)*kernelHeight+1`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) DilationRateInZ ¶
func (g MPSGraphConvolution3DOpDescriptor) DilationRateInZ() uint
The amount by which weights tensor expands in the `z`-direction.
Discussion ¶
The weights tensor is dilated by inserting `dilationRateInZ-1` zeros between consecutive values in `z`-dimension. Dilated weights tensor depth is `(dilationRateInZ-1)*kernelDepth+1`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) Groups ¶
func (g MPSGraphConvolution3DOpDescriptor) Groups() uint
The number of partitions of the input and output channels.
Discussion ¶
The convolution operation divides input and output channels in `groups` partitions. input channels in a group or partition are only connected to output channels in corresponding group. Number of weights the convolution needs is `outputFeatureChannels x inputFeatureChannels/groups x kernelDepth x kernelWidth x kernelHeight`
func (MPSGraphConvolution3DOpDescriptor) Init ¶
func (g MPSGraphConvolution3DOpDescriptor) Init() MPSGraphConvolution3DOpDescriptor
Init initializes the instance.
func (MPSGraphConvolution3DOpDescriptor) PaddingBack ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingBack() uint
The number of zeros added at the back of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) PaddingBottom ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingBottom() uint
The number of zeros added at the bottom of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) PaddingFront ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingFront() uint
The number of zeros added at the front of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) PaddingLeft ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingLeft() uint
The number of zeros added on the left side of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) PaddingRight ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingRight() uint
The number of zeros added on the right side of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) PaddingStyle ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
The type of padding that is applied to the source tensor.
Discussion ¶
If paddingStyle is MPSGraphPaddingStyleExplicit, `paddingLeft`, `laddingRight`, `paddingTop`, `paddingBottom`, `paddingFront` and `paddingBack` must to be specified. For all other padding styles, framework compute these values so you dont need to provide these values.
func (MPSGraphConvolution3DOpDescriptor) PaddingTop ¶
func (g MPSGraphConvolution3DOpDescriptor) PaddingTop() uint
The number of zeros added at the top of the source tensor.
func (MPSGraphConvolution3DOpDescriptor) SetDataLayout ¶
func (g MPSGraphConvolution3DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphConvolution3DOpDescriptor) SetDilationRateInX ¶
func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInX(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetDilationRateInY ¶
func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInY(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetDilationRateInZ ¶
func (g MPSGraphConvolution3DOpDescriptor) SetDilationRateInZ(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack ¶
func (g MPSGraphConvolution3DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingFrontPaddingBack(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingFront uint, paddingBack uint)
Sets the left, right, top, bottom, front, and back padding values.
paddingLeft: See MPSGraphConvolution3DOpDescriptor.PaddingLeft property.
paddingRight: See MPSGraphConvolution3DOpDescriptor.PaddingRight property.
paddingTop: See MPSGraphConvolution3DOpDescriptor.PaddingTop property.
paddingBottom: See MPSGraphConvolution3DOpDescriptor.PaddingBottom property.
paddingFront: See MPSGraphConvolution3DOpDescriptor.PaddingFront property.
func (MPSGraphConvolution3DOpDescriptor) SetGroups ¶
func (g MPSGraphConvolution3DOpDescriptor) SetGroups(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingBack ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingBack(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingBottom ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingBottom(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingFront ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingFront(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingLeft ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingLeft(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingRight ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingRight(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphConvolution3DOpDescriptor) SetPaddingTop ¶
func (g MPSGraphConvolution3DOpDescriptor) SetPaddingTop(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetStrideInX ¶
func (g MPSGraphConvolution3DOpDescriptor) SetStrideInX(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetStrideInY ¶
func (g MPSGraphConvolution3DOpDescriptor) SetStrideInY(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetStrideInZ ¶
func (g MPSGraphConvolution3DOpDescriptor) SetStrideInZ(value uint)
func (MPSGraphConvolution3DOpDescriptor) SetWeightsLayout ¶
func (g MPSGraphConvolution3DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphConvolution3DOpDescriptor) StrideInX ¶
func (g MPSGraphConvolution3DOpDescriptor) StrideInX() uint
The scale that maps`x`-coordinate of destination to `x`-coordinate of source.
Discussion ¶
Source `x`-coordinate, `sx` is computed from destination `x`-coordinate, `dx` as `sx = strideInX*dx`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) StrideInY ¶
func (g MPSGraphConvolution3DOpDescriptor) StrideInY() uint
The scale that maps`y`-coordinate of destination to `y`-coordinate of source.
Discussion ¶
Source `y`-coordinate, `sy` is computed from destination `y`-coordinate, `dy` as `sy = strideInY*dy`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) StrideInZ ¶
func (g MPSGraphConvolution3DOpDescriptor) StrideInZ() uint
The scale that maps`z`-coordinate of destination to `z`-coordinate of source.
Discussion ¶
Source `z`-coordinate, `sz` is computed from destination `z`-coordinate, `dz` as `sz = strideInZ*dz`. Default value is 1.
func (MPSGraphConvolution3DOpDescriptor) WeightsLayout ¶
func (g MPSGraphConvolution3DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
The named layout of data in the weights tensor.
Discussion ¶
It defines the order of named dimensions (Output channels, Input channels, Kernel depth, Kernel height, Kernel width). The convolution operation uses this to interpret data in the weights tensor. For example, if `weightsLayout` is MPSGraphTensorNamedDataLayoutOIDHW, frameork interprets data in weights tensor as `outputChannels x inputChannels x kernelDepth x kernelHeight x kernelWidth` with `kernelWidth` as fastest moving dimension.
type MPSGraphConvolution3DOpDescriptorClass ¶
type MPSGraphConvolution3DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphConvolution3DOpDescriptorClass ¶
func GetMPSGraphConvolution3DOpDescriptorClass() MPSGraphConvolution3DOpDescriptorClass
GetMPSGraphConvolution3DOpDescriptorClass returns the class object for MPSGraphConvolution3DOpDescriptor.
func (MPSGraphConvolution3DOpDescriptorClass) Alloc ¶
func (mc MPSGraphConvolution3DOpDescriptorClass) Alloc() MPSGraphConvolution3DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphConvolution3DOpDescriptorClass) Class ¶
func (mc MPSGraphConvolution3DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphCreateSparseOpDescriptor ¶
type MPSGraphCreateSparseOpDescriptor struct {
MPSGraphObject
}
A class that describes the properties of a create sparse operation.
Instance Properties ¶
- MPSGraphCreateSparseOpDescriptor.DataType: Defines the datatype of the sparse tensor.
- MPSGraphCreateSparseOpDescriptor.SetDataType
- MPSGraphCreateSparseOpDescriptor.SparseStorageType: Defines the storage format of the sparse tensor.
- MPSGraphCreateSparseOpDescriptor.SetSparseStorageType
func MPSGraphCreateSparseOpDescriptorFromID ¶
func MPSGraphCreateSparseOpDescriptorFromID(id objc.ID) MPSGraphCreateSparseOpDescriptor
MPSGraphCreateSparseOpDescriptorFromID constructs a MPSGraphCreateSparseOpDescriptor from an objc.ID.
A class that describes the properties of a create sparse operation.
func NewMPSGraphCreateSparseOpDescriptor ¶
func NewMPSGraphCreateSparseOpDescriptor() MPSGraphCreateSparseOpDescriptor
NewMPSGraphCreateSparseOpDescriptor creates a new MPSGraphCreateSparseOpDescriptor instance.
func (MPSGraphCreateSparseOpDescriptor) Autorelease ¶
func (g MPSGraphCreateSparseOpDescriptor) Autorelease() MPSGraphCreateSparseOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphCreateSparseOpDescriptor) DataType ¶
func (g MPSGraphCreateSparseOpDescriptor) DataType() uint32
Defines the datatype of the sparse tensor.
func (MPSGraphCreateSparseOpDescriptor) Init ¶
func (g MPSGraphCreateSparseOpDescriptor) Init() MPSGraphCreateSparseOpDescriptor
Init initializes the instance.
func (MPSGraphCreateSparseOpDescriptor) SetDataType ¶
func (g MPSGraphCreateSparseOpDescriptor) SetDataType(value uint32)
func (MPSGraphCreateSparseOpDescriptor) SetSparseStorageType ¶
func (g MPSGraphCreateSparseOpDescriptor) SetSparseStorageType(value MPSGraphSparseStorageType)
func (MPSGraphCreateSparseOpDescriptor) SparseStorageType ¶
func (g MPSGraphCreateSparseOpDescriptor) SparseStorageType() MPSGraphSparseStorageType
Defines the storage format of the sparse tensor.
type MPSGraphCreateSparseOpDescriptorClass ¶
type MPSGraphCreateSparseOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphCreateSparseOpDescriptorClass ¶
func GetMPSGraphCreateSparseOpDescriptorClass() MPSGraphCreateSparseOpDescriptorClass
GetMPSGraphCreateSparseOpDescriptorClass returns the class object for MPSGraphCreateSparseOpDescriptor.
func (MPSGraphCreateSparseOpDescriptorClass) Alloc ¶
func (mc MPSGraphCreateSparseOpDescriptorClass) Alloc() MPSGraphCreateSparseOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphCreateSparseOpDescriptorClass) Class ¶
func (mc MPSGraphCreateSparseOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (MPSGraphCreateSparseOpDescriptorClass) DescriptorWithStorageTypeDataType ¶
func (_MPSGraphCreateSparseOpDescriptorClass MPSGraphCreateSparseOpDescriptorClass) DescriptorWithStorageTypeDataType(sparseStorageType MPSGraphSparseStorageType, dataType uint32) MPSGraphCreateSparseOpDescriptor
Creates a descriptor for a sparse tensor.
sparseStorageType: A sparseStorageType.
dataType: A dataType of the sparse tensor.
Return Value ¶
The descriptor.
type MPSGraphDeploymentPlatform ¶
type MPSGraphDeploymentPlatform uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDeploymentPlatform
const ( // MPSGraphDeploymentPlatformIOS: Deployment target for iOS. MPSGraphDeploymentPlatformIOS MPSGraphDeploymentPlatform = 1 // MPSGraphDeploymentPlatformMacOS: Deployment platofmr for macOS. MPSGraphDeploymentPlatformMacOS MPSGraphDeploymentPlatform = 0 // MPSGraphDeploymentPlatformTvOS: Deployment target for tvOS. MPSGraphDeploymentPlatformTvOS MPSGraphDeploymentPlatform = 2 // MPSGraphDeploymentPlatformVisionOS: Deployment target for visionOS. MPSGraphDeploymentPlatformVisionOS MPSGraphDeploymentPlatform = 3 )
func (MPSGraphDeploymentPlatform) String ¶
func (e MPSGraphDeploymentPlatform) String() string
type MPSGraphDepthwiseConvolution2DOpDescriptor ¶
type MPSGraphDepthwiseConvolution2DOpDescriptor struct {
MPSGraphObject
}
A class that defines the parameters for a 2D-depthwise convolution operation.
Overview ¶
An MPSGraphDepthwiseConvolution2DOpDescriptor defines constant parameters for 2D-depthwise convolutions. Use this class with MPSGraph.DepthwiseConvolution2DWithSourceTensorWeightsTensorDescriptorName, MPSGraph.DepthwiseConvolution2DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName, and MPSGraph.DepthwiseConvolution2DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName methods.
Instance Properties ¶
- MPSGraphDepthwiseConvolution2DOpDescriptor.DataLayout: The data layout of the input data in the forward pass.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetDataLayout
- MPSGraphDepthwiseConvolution2DOpDescriptor.DilationRateInX: The dilation rate for the x dimension.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetDilationRateInX
- MPSGraphDepthwiseConvolution2DOpDescriptor.DilationRateInY: The dilation rate for the y dimension.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetDilationRateInY
- MPSGraphDepthwiseConvolution2DOpDescriptor.PaddingBottom: The explicit padding value for the y dimension operation adds after the data.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingBottom
- MPSGraphDepthwiseConvolution2DOpDescriptor.PaddingLeft: The explicit padding value for the x dimension the operation adds before the data.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingLeft
- MPSGraphDepthwiseConvolution2DOpDescriptor.PaddingRight: The explicit padding value for the x dimension operation adds after the data.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingRight
- MPSGraphDepthwiseConvolution2DOpDescriptor.PaddingStyle: The padding style for the operation.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingStyle
- MPSGraphDepthwiseConvolution2DOpDescriptor.PaddingTop: The explicit padding value for the y dimension operation adds before the data.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetPaddingTop
- MPSGraphDepthwiseConvolution2DOpDescriptor.StrideInX: The stride for the x dimension.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetStrideInX
- MPSGraphDepthwiseConvolution2DOpDescriptor.StrideInY: The stride for the y dimension.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetStrideInY
- MPSGraphDepthwiseConvolution2DOpDescriptor.WeightsLayout: The data layout of the weights.
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetWeightsLayout
Instance Methods ¶
- MPSGraphDepthwiseConvolution2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the explicit padding values.
func MPSGraphDepthwiseConvolution2DOpDescriptorFromID ¶
func MPSGraphDepthwiseConvolution2DOpDescriptorFromID(id objc.ID) MPSGraphDepthwiseConvolution2DOpDescriptor
MPSGraphDepthwiseConvolution2DOpDescriptorFromID constructs a MPSGraphDepthwiseConvolution2DOpDescriptor from an objc.ID.
A class that defines the parameters for a 2D-depthwise convolution operation.
func NewGraphDepthwiseConvolution2DOpDescriptorWithDataLayoutWeightsLayout ¶
func NewGraphDepthwiseConvolution2DOpDescriptorWithDataLayoutWeightsLayout(dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphDepthwiseConvolution2DOpDescriptor
Creates a 2D-depthwise convolution descriptor with given properties and default values.
dataLayout: See `dataLayout` property.
weightsLayout: See `weightsLayout` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewGraphDepthwiseConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout ¶
func NewGraphDepthwiseConvolution2DOpDescriptorWithStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayoutWeightsLayout(strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout, weightsLayout MPSGraphTensorNamedDataLayout) MPSGraphDepthwiseConvolution2DOpDescriptor
Creates a 2D-depthwise convolution descriptor with given values.
strideInX: See `strideInX` property.
strideInY: See `strideInY` property.
dilationRateInX: See `dilationRateInX` property.
dilationRateInY: See `dilationRateInY` property.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
paddingStyle: See `paddingStyle` property.
dataLayout: See `dataLayout` property.
weightsLayout: See `weightsLayout` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewMPSGraphDepthwiseConvolution2DOpDescriptor ¶
func NewMPSGraphDepthwiseConvolution2DOpDescriptor() MPSGraphDepthwiseConvolution2DOpDescriptor
NewMPSGraphDepthwiseConvolution2DOpDescriptor creates a new MPSGraphDepthwiseConvolution2DOpDescriptor instance.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) Autorelease ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) Autorelease() MPSGraphDepthwiseConvolution2DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) DataLayout ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
The data layout of the input data in the forward pass.
Discussion ¶
func (MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInX ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInX() uint
The dilation rate for the x dimension.
Discussion ¶
Default value: 1.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInY ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) DilationRateInY() uint
The dilation rate for the y dimension.
Discussion ¶
Default value: 1.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) Init ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) Init() MPSGraphDepthwiseConvolution2DOpDescriptor
Init initializes the instance.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingBottom ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingBottom() uint
The explicit padding value for the y dimension operation adds after the data.
Discussion ¶
Default value: 0.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingLeft ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingLeft() uint
The explicit padding value for the x dimension the operation adds before the data.
Discussion ¶
Default value: 0.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingRight ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingRight() uint
The explicit padding value for the x dimension operation adds after the data.
Discussion ¶
Default value: 0.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingStyle ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
The padding style for the operation.
Discussion ¶
Default value is MPSGraphPaddingStyleExplicit.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingTop ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) PaddingTop() uint
The explicit padding value for the y dimension operation adds before the data.
Discussion ¶
Default value: 0.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetDataLayout ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInX ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInX(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInY ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetDilationRateInY(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
Sets the explicit padding values.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
Discussion ¶
Note: this method also sets `paddingStyle` to MPSGraphPaddingStyleExplicit (see MPSGraphPaddingStyle).
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingBottom ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingBottom(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingLeft ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingLeft(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingRight ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingRight(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingTop ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetPaddingTop(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInX ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInX(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInY ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetStrideInY(value uint)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) SetWeightsLayout ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) SetWeightsLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInX ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInX() uint
The stride for the x dimension.
Discussion ¶
Default value: 1.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInY ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) StrideInY() uint
The stride for the y dimension.
Discussion ¶
Default value: 1.
func (MPSGraphDepthwiseConvolution2DOpDescriptor) WeightsLayout ¶
func (g MPSGraphDepthwiseConvolution2DOpDescriptor) WeightsLayout() MPSGraphTensorNamedDataLayout
The data layout of the weights.
Discussion ¶
NOTE: ‘O’ index is channel multiplier index. See: MPSGraphTensorNamedDataLayout.
type MPSGraphDepthwiseConvolution2DOpDescriptorClass ¶
type MPSGraphDepthwiseConvolution2DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphDepthwiseConvolution2DOpDescriptorClass ¶
func GetMPSGraphDepthwiseConvolution2DOpDescriptorClass() MPSGraphDepthwiseConvolution2DOpDescriptorClass
GetMPSGraphDepthwiseConvolution2DOpDescriptorClass returns the class object for MPSGraphDepthwiseConvolution2DOpDescriptor.
func (MPSGraphDepthwiseConvolution2DOpDescriptorClass) Alloc ¶
func (mc MPSGraphDepthwiseConvolution2DOpDescriptorClass) Alloc() MPSGraphDepthwiseConvolution2DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphDepthwiseConvolution2DOpDescriptorClass) Class ¶
func (mc MPSGraphDepthwiseConvolution2DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphDepthwiseConvolution3DOpDescriptor ¶
type MPSGraphDepthwiseConvolution3DOpDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a 3D-depthwise convolution operation.
Overview ¶
A MPSGraphDepthwiseConvolution3DOpDescriptor defines constant parameters for 3D depthwise convolutions. Use this class with MPSGraph.DepthwiseConvolution3DWithSourceTensorWeightsTensorDescriptorName, MPSGraph.DepthwiseConvolution3DDataGradientWithIncomingGradientTensorWeightsTensorOutputShapeDescriptorName and MPSGraph.DepthwiseConvolution3DWeightsGradientWithIncomingGradientTensorSourceTensorOutputShapeDescriptorName methods.
Instance Properties ¶
- MPSGraphDepthwiseConvolution3DOpDescriptor.ChannelDimensionIndex: The axis that contains the channels in the input and the weights, within the 4D tile of the last dimensions.
- MPSGraphDepthwiseConvolution3DOpDescriptor.SetChannelDimensionIndex
- MPSGraphDepthwiseConvolution3DOpDescriptor.DilationRates: The dilation rates for spatial dimensions.
- MPSGraphDepthwiseConvolution3DOpDescriptor.SetDilationRates
- MPSGraphDepthwiseConvolution3DOpDescriptor.PaddingStyle: The padding style for the operation.
- MPSGraphDepthwiseConvolution3DOpDescriptor.SetPaddingStyle
- MPSGraphDepthwiseConvolution3DOpDescriptor.PaddingValues: The padding values for spatial dimensions.
- MPSGraphDepthwiseConvolution3DOpDescriptor.SetPaddingValues
- MPSGraphDepthwiseConvolution3DOpDescriptor.Strides: The strides for spatial dimensions.
- MPSGraphDepthwiseConvolution3DOpDescriptor.SetStrides
func MPSGraphDepthwiseConvolution3DOpDescriptorFromID ¶
func MPSGraphDepthwiseConvolution3DOpDescriptorFromID(id objc.ID) MPSGraphDepthwiseConvolution3DOpDescriptor
MPSGraphDepthwiseConvolution3DOpDescriptorFromID constructs a MPSGraphDepthwiseConvolution3DOpDescriptor from an objc.ID.
The class that defines the parameters for a 3D-depthwise convolution operation.
func NewGraphDepthwiseConvolution3DOpDescriptorWithPaddingStyle ¶
func NewGraphDepthwiseConvolution3DOpDescriptorWithPaddingStyle(paddingStyle MPSGraphPaddingStyle) MPSGraphDepthwiseConvolution3DOpDescriptor
Creates a 3D depthwise convolution descriptor with default values.
paddingStyle: See `paddingStyle` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewGraphDepthwiseConvolution3DOpDescriptorWithStridesDilationRatesPaddingValuesPaddingStyle ¶
func NewGraphDepthwiseConvolution3DOpDescriptorWithStridesDilationRatesPaddingValuesPaddingStyle(strides []foundation.NSNumber, dilationRates []foundation.NSNumber, paddingValues []foundation.NSNumber, paddingStyle MPSGraphPaddingStyle) MPSGraphDepthwiseConvolution3DOpDescriptor
Creates a 3D depthwise convolution descriptor with given values.
strides: See `strides` property.
dilationRates: See `dilationRates` property.
paddingValues: See `paddingValues` property.
paddingStyle: See `paddingStyle` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewMPSGraphDepthwiseConvolution3DOpDescriptor ¶
func NewMPSGraphDepthwiseConvolution3DOpDescriptor() MPSGraphDepthwiseConvolution3DOpDescriptor
NewMPSGraphDepthwiseConvolution3DOpDescriptor creates a new MPSGraphDepthwiseConvolution3DOpDescriptor instance.
func (MPSGraphDepthwiseConvolution3DOpDescriptor) Autorelease ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Autorelease() MPSGraphDepthwiseConvolution3DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphDepthwiseConvolution3DOpDescriptor) ChannelDimensionIndex ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) ChannelDimensionIndex() int
The axis that contains the channels in the input and the weights, within the 4D tile of the last dimensions.
Discussion ¶
For example the value of `-1` corresponds to [NDHWC], [NHWC] layouts. This allows the placement of the channel index anywhere within the last 4 dimensions of the tensor. In case your weights are in a different layout you can bring them to the same layout as inputs using transposes or permutations. Default value: `-4`, corresponds to [NCDHW] and [CDHW] layouts.
func (MPSGraphDepthwiseConvolution3DOpDescriptor) DilationRates ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) DilationRates() []foundation.NSNumber
The dilation rates for spatial dimensions.
Discussion ¶
Must be three numbers, one for each spatial dimension, fastest running index last. Default value: `@[ @1, @1, @1 ]`
func (MPSGraphDepthwiseConvolution3DOpDescriptor) Init ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Init() MPSGraphDepthwiseConvolution3DOpDescriptor
Init initializes the instance.
func (MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingStyle ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
The padding style for the operation.
Discussion ¶
Default value: MPSGraphPaddingStyleExplicit.
func (MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingValues ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) PaddingValues() []foundation.NSNumber
The padding values for spatial dimensions.
Discussion ¶
Must be six numbers, two for each spatial dimension. For example `paddingValues[0]` defines the explicit padding amount before the first spatial dimension (slowest running index of spatial dimensions), `paddingValues[1]` defines the padding amount after the first spatial dimension etc. Use only with `paddingStyle = MPSGraphPaddingStyleExplicit`. Default value: `@[ @0, @0, @0, @0, @0, @0 ]`
func (MPSGraphDepthwiseConvolution3DOpDescriptor) SetChannelDimensionIndex ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetChannelDimensionIndex(value int)
func (MPSGraphDepthwiseConvolution3DOpDescriptor) SetDilationRates ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetDilationRates(value []foundation.NSNumber)
func (MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingValues ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetPaddingValues(value []foundation.NSNumber)
func (MPSGraphDepthwiseConvolution3DOpDescriptor) SetStrides ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) SetStrides(value []foundation.NSNumber)
func (MPSGraphDepthwiseConvolution3DOpDescriptor) Strides ¶
func (g MPSGraphDepthwiseConvolution3DOpDescriptor) Strides() []foundation.NSNumber
The strides for spatial dimensions.
Discussion ¶
Must be three numbers, one for each spatial dimension, fastest running index last. Default value: `@[ @1, @1, @1 ]`
type MPSGraphDepthwiseConvolution3DOpDescriptorClass ¶
type MPSGraphDepthwiseConvolution3DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphDepthwiseConvolution3DOpDescriptorClass ¶
func GetMPSGraphDepthwiseConvolution3DOpDescriptorClass() MPSGraphDepthwiseConvolution3DOpDescriptorClass
GetMPSGraphDepthwiseConvolution3DOpDescriptorClass returns the class object for MPSGraphDepthwiseConvolution3DOpDescriptor.
func (MPSGraphDepthwiseConvolution3DOpDescriptorClass) Alloc ¶
func (mc MPSGraphDepthwiseConvolution3DOpDescriptorClass) Alloc() MPSGraphDepthwiseConvolution3DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphDepthwiseConvolution3DOpDescriptorClass) Class ¶
func (mc MPSGraphDepthwiseConvolution3DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphDevice ¶
type MPSGraphDevice struct {
MPSGraphObject
}
A class that describes the compute device.
Instance Properties ¶
- MPSGraphDevice.MetalDevice: If device type is Metal then returns the corresponding MTLDevice else nil.
- MPSGraphDevice.Type: Device of the MPSGraphDevice.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDevice
func MPSGraphDeviceFromID ¶
func MPSGraphDeviceFromID(id objc.ID) MPSGraphDevice
MPSGraphDeviceFromID constructs a MPSGraphDevice from an objc.ID.
A class that describes the compute device.
func NewGraphDeviceWithMTLDevice ¶
func NewGraphDeviceWithMTLDevice(metalDevice metal.MTLDevice) MPSGraphDevice
Creates a device from a given Metal device.
metalDevice: [MTLDevice] to create an MPSGraphDevice from.
Return Value ¶
A valid device.
func NewMPSGraphDevice ¶
func NewMPSGraphDevice() MPSGraphDevice
NewMPSGraphDevice creates a new MPSGraphDevice instance.
func (MPSGraphDevice) Autorelease ¶
func (g MPSGraphDevice) Autorelease() MPSGraphDevice
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphDevice) Init ¶
func (g MPSGraphDevice) Init() MPSGraphDevice
Init initializes the instance.
func (MPSGraphDevice) MetalDevice ¶
func (g MPSGraphDevice) MetalDevice() metal.MTLDevice
If device type is Metal then returns the corresponding MTLDevice else nil.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDevice/metalDevice
func (MPSGraphDevice) Type ¶
func (g MPSGraphDevice) Type() MPSGraphDeviceType
Device of the MPSGraphDevice.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDevice/type
type MPSGraphDeviceClass ¶
type MPSGraphDeviceClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphDeviceClass ¶
func GetMPSGraphDeviceClass() MPSGraphDeviceClass
GetMPSGraphDeviceClass returns the class object for MPSGraphDevice.
func (MPSGraphDeviceClass) Alloc ¶
func (mc MPSGraphDeviceClass) Alloc() MPSGraphDevice
Alloc allocates memory for a new instance of the class.
func (MPSGraphDeviceClass) Class ¶
func (mc MPSGraphDeviceClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphDeviceType ¶
type MPSGraphDeviceType uint32
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphDeviceType
const ( // MPSGraphDeviceTypeMetal: Device of type Metal MPSGraphDeviceTypeMetal MPSGraphDeviceType = 0 )
func (MPSGraphDeviceType) String ¶
func (e MPSGraphDeviceType) String() string
type MPSGraphExecutable ¶
type MPSGraphExecutable struct {
MPSGraphObject
}
The compiled representation of a compute graph executable.
Overview ¶
An MPSGraphExecutable is a compiled graph for specific feeds for specific target tensors and target operations.
Initializers ¶
- MPSGraphExecutable.InitWithCoreMLPackageAtURLCompilationDescriptor: Initialize the executable with the Core ML model package at the provided URL.
- MPSGraphExecutable.InitWithMPSGraphPackageAtURLCompilationDescriptor: Initialize the executable with the Metal Performance Shaders Graph package at the provided URL.
Instance Properties ¶
- MPSGraphExecutable.FeedTensors: Tensors fed to the graph, can be used to order the inputs when executable is created with a graph.
- MPSGraphExecutable.Options: Options for the graph executable.
- MPSGraphExecutable.SetOptions
- MPSGraphExecutable.TargetTensors: Tensors targeted by the graph, can be used to order the outputs when executable was created with a graph.
Instance Methods ¶
- MPSGraphExecutable.EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately after finishing encoding.
- MPSGraphExecutable.GetOutputTypesWithDeviceInputTypesCompilationDescriptor: Get output shapes for a specialized executable.
- MPSGraphExecutable.RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
- MPSGraphExecutable.RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor: Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately.
- MPSGraphExecutable.SerializeToMPSGraphPackageAtURLDescriptor: Serialize the MPSGraph executable at the provided url.
- MPSGraphExecutable.SpecializeWithDeviceInputTypesCompilationDescriptor: Specialize the executable and optimize it.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable
func MPSGraphExecutableFromID ¶
func MPSGraphExecutableFromID(id objc.ID) MPSGraphExecutable
MPSGraphExecutableFromID constructs a MPSGraphExecutable from an objc.ID.
The compiled representation of a compute graph executable.
func NewGraphExecutableWithCoreMLPackageAtURLCompilationDescriptor ¶
func NewGraphExecutableWithCoreMLPackageAtURLCompilationDescriptor(coreMLPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
Initialize the executable with the Core ML model package at the provided URL.
coreMLPackageURL: The URL where to read the Core ML model package.
compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
func NewGraphExecutableWithMPSGraphPackageAtURLCompilationDescriptor ¶
func NewGraphExecutableWithMPSGraphPackageAtURLCompilationDescriptor(mpsgraphPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
Initialize the executable with the Metal Performance Shaders Graph package at the provided URL.
mpsgraphPackageURL: The URL where to read the serialized MPSGraphExecutable.
compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
func NewMPSGraphExecutable ¶
func NewMPSGraphExecutable() MPSGraphExecutable
NewMPSGraphExecutable creates a new MPSGraphExecutable instance.
func (MPSGraphExecutable) Autorelease ¶
func (g MPSGraphExecutable) Autorelease() MPSGraphExecutable
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphExecutable) EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor ¶
func (g MPSGraphExecutable) EncodeToCommandBufferInputsArrayResultsArrayExecutionDescriptor(commandBuffer *metalperformanceshaders.MPSCommandBuffer, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately after finishing encoding.
commandBuffer: CommandBuffer passed to exectute the graph on, commitAndContinue might be called, please don’t rely on underlying MTLCommandBuffer to remain uncommitted
inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function
resultsArray: Tensors for which the caller wishes MPSGraphTensorData to be returned
executionDescriptor: ExecutionDescriptor to be passed in and used,
Return Value ¶
A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
func (MPSGraphExecutable) FeedTensors ¶
func (g MPSGraphExecutable) FeedTensors() []MPSGraphTensor
Tensors fed to the graph, can be used to order the inputs when executable is created with a graph.
func (MPSGraphExecutable) GetOutputTypesWithDeviceInputTypesCompilationDescriptor ¶
func (g MPSGraphExecutable) GetOutputTypesWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, compilationDescriptor IMPSGraphCompilationDescriptor) []MPSGraphShapedType
Get output shapes for a specialized executable.
device: Optional MPSGraph device to compile with
inputTypes: Input types expected to be passed to the executable.
compilationDescriptor: CompilationDescriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
Discussion ¶
In case specialization has not been done yet then calling this function will specialize for the given input shapes.
func (MPSGraphExecutable) Init ¶
func (g MPSGraphExecutable) Init() MPSGraphExecutable
Init initializes the instance.
func (MPSGraphExecutable) InitWithCoreMLPackageAtURLCompilationDescriptor ¶
func (g MPSGraphExecutable) InitWithCoreMLPackageAtURLCompilationDescriptor(coreMLPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
Initialize the executable with the Core ML model package at the provided URL.
coreMLPackageURL: The URL where to read the Core ML model package.
compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
func (MPSGraphExecutable) InitWithMPSGraphPackageAtURLCompilationDescriptor ¶
func (g MPSGraphExecutable) InitWithMPSGraphPackageAtURLCompilationDescriptor(mpsgraphPackageURL foundation.NSURL, compilationDescriptor IMPSGraphCompilationDescriptor) MPSGraphExecutable
Initialize the executable with the Metal Performance Shaders Graph package at the provided URL.
mpsgraphPackageURL: The URL where to read the serialized MPSGraphExecutable.
compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
func (MPSGraphExecutable) Options ¶
func (g MPSGraphExecutable) Options() MPSGraphOptions
Options for the graph executable.
Discussion ¶
Default value is MPSGraphOptionsDefault.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutable/options
func (MPSGraphExecutable) RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor ¶
func (g MPSGraphExecutable) RunAsyncWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed. This call is asynchronous and will return immediately.
commandQueue: CommandQueue passed to exectute the graph on.
inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function.
resultsArray: Tensors for which the caller wishes MPSGraphTensorData to be returned.
executionDescriptor: ExecutionDescriptor to be passed in and used.
Return Value ¶
A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
func (MPSGraphExecutable) RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor ¶
func (g MPSGraphExecutable) RunWithMTLCommandQueueInputsArrayResultsArrayExecutionDescriptor(commandQueue metal.MTLCommandQueue, inputsArray []MPSGraphTensorData, resultsArray []MPSGraphTensorData, executionDescriptor IMPSGraphExecutableExecutionDescriptor) []MPSGraphTensorData
Runs the graph for the given feeds and returns the target tensor values, ensuring all target operations also executed.
commandQueue: CommandQueue passed to exectute the graph on.
inputsArray: Feeds tensorData for the placeholder tensors, same order as arguments of main function.
resultsArray: Results tensorData for which the caller wishes MPSGraphTensorData to be returned.
Return Value ¶
A valid MPSGraphTensorData array with results synchronized to the CPU memory if MPSGraphOptionsSynchronizeResults set.
Discussion ¶
This call is synchronous and will return on completion of execution.
func (MPSGraphExecutable) SerializeToMPSGraphPackageAtURLDescriptor ¶
func (g MPSGraphExecutable) SerializeToMPSGraphPackageAtURLDescriptor(url foundation.NSURL, descriptor IMPSGraphExecutableSerializationDescriptor)
Serialize the MPSGraph executable at the provided url.
url: The URL where to serialize the MPSGraph executable.
descriptor: The descriptor to be used to serialize the graph.
func (MPSGraphExecutable) SetOptions ¶
func (g MPSGraphExecutable) SetOptions(value MPSGraphOptions)
func (MPSGraphExecutable) SpecializeWithDeviceInputTypesCompilationDescriptor ¶
func (g MPSGraphExecutable) SpecializeWithDeviceInputTypesCompilationDescriptor(device IMPSGraphDevice, inputTypes []MPSGraphType, compilationDescriptor IMPSGraphCompilationDescriptor)
Specialize the executable and optimize it.
device: Ooptional MPSGraph device to compile with.
inputTypes: Input types expected to be passed to the executable.
compilationDescriptor: Compilation descriptor to be used to specialize, since the executable was created with a compilationDescriptor already this one overrides those settings to the extent it can.
Discussion ¶
Use this method to choose when specialization happens, else it occurs at encode time automatically.
func (MPSGraphExecutable) TargetTensors ¶
func (g MPSGraphExecutable) TargetTensors() []MPSGraphTensor
Tensors targeted by the graph, can be used to order the outputs when executable was created with a graph.
type MPSGraphExecutableClass ¶
type MPSGraphExecutableClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphExecutableClass ¶
func GetMPSGraphExecutableClass() MPSGraphExecutableClass
GetMPSGraphExecutableClass returns the class object for MPSGraphExecutable.
func (MPSGraphExecutableClass) Alloc ¶
func (mc MPSGraphExecutableClass) Alloc() MPSGraphExecutable
Alloc allocates memory for a new instance of the class.
func (MPSGraphExecutableClass) Class ¶
func (mc MPSGraphExecutableClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphExecutableCompletionHandler ¶
type MPSGraphExecutableCompletionHandler = func(results []MPSGraphTensorData, error_ foundation.NSError)
MPSGraphExecutableCompletionHandler is a notification when graph executable execution finishes.
type MPSGraphExecutableErrorHandler ¶
type MPSGraphExecutableErrorHandler = func(*MPSGraphExecutable, error)
MPSGraphExecutableErrorHandler is the signature for a completion handler block.
type MPSGraphExecutableExecutionDescriptor ¶
type MPSGraphExecutableExecutionDescriptor struct {
MPSGraphObject
}
A class that consists of all the levers to synchronize and schedule executable execution.
Instance Properties ¶
- MPSGraphExecutableExecutionDescriptor.CompletionHandler: A notification that appears when graph-executable execution is finished.
- MPSGraphExecutableExecutionDescriptor.SetCompletionHandler
- MPSGraphExecutableExecutionDescriptor.ScheduledHandler: A notification that appears when graph-executable execution is scheduled.
- MPSGraphExecutableExecutionDescriptor.SetScheduledHandler
- MPSGraphExecutableExecutionDescriptor.WaitUntilCompleted: Flag for the graph executable to wait till the execution has completed.
- MPSGraphExecutableExecutionDescriptor.SetWaitUntilCompleted
Instance Methods ¶
- MPSGraphExecutableExecutionDescriptor.SignalEventAtExecutionEventValue: Signals these shared events at execution stage and immediately proceeds.
- MPSGraphExecutableExecutionDescriptor.WaitForEventValue: Waits on these shared events before scheduling execution on the HW.
func MPSGraphExecutableExecutionDescriptorFromID ¶
func MPSGraphExecutableExecutionDescriptorFromID(id objc.ID) MPSGraphExecutableExecutionDescriptor
MPSGraphExecutableExecutionDescriptorFromID constructs a MPSGraphExecutableExecutionDescriptor from an objc.ID.
A class that consists of all the levers to synchronize and schedule executable execution.
func NewMPSGraphExecutableExecutionDescriptor ¶
func NewMPSGraphExecutableExecutionDescriptor() MPSGraphExecutableExecutionDescriptor
NewMPSGraphExecutableExecutionDescriptor creates a new MPSGraphExecutableExecutionDescriptor instance.
func (MPSGraphExecutableExecutionDescriptor) Autorelease ¶
func (g MPSGraphExecutableExecutionDescriptor) Autorelease() MPSGraphExecutableExecutionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphExecutableExecutionDescriptor) CompletionHandler ¶
func (g MPSGraphExecutableExecutionDescriptor) CompletionHandler() MPSGraphTensorDataArrayErrorHandler
A notification that appears when graph-executable execution is finished.
Discussion ¶
Default value is nil.
func (MPSGraphExecutableExecutionDescriptor) ScheduledHandler ¶
func (g MPSGraphExecutableExecutionDescriptor) ScheduledHandler() MPSGraphTensorDataArrayErrorHandler
A notification that appears when graph-executable execution is scheduled.
Discussion ¶
Default value is nil.
func (MPSGraphExecutableExecutionDescriptor) SetCompletionHandler ¶
func (g MPSGraphExecutableExecutionDescriptor) SetCompletionHandler(value MPSGraphTensorDataArrayErrorHandler)
func (MPSGraphExecutableExecutionDescriptor) SetScheduledHandler ¶
func (g MPSGraphExecutableExecutionDescriptor) SetScheduledHandler(value MPSGraphTensorDataArrayErrorHandler)
func (MPSGraphExecutableExecutionDescriptor) SetWaitUntilCompleted ¶
func (g MPSGraphExecutableExecutionDescriptor) SetWaitUntilCompleted(value bool)
func (MPSGraphExecutableExecutionDescriptor) SignalEventAtExecutionEventValue ¶
func (g MPSGraphExecutableExecutionDescriptor) SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, value uint64)
Signals these shared events at execution stage and immediately proceeds.
event: Shared event to signal.
executionStage: Execution stage to signal event at.
value: Value for shared event to wait on.
func (MPSGraphExecutableExecutionDescriptor) WaitForEventValue ¶
func (g MPSGraphExecutableExecutionDescriptor) WaitForEventValue(event metal.MTLSharedEvent, value uint64)
Waits on these shared events before scheduling execution on the HW.
event: Shared event to wait on.
value: Value for shared event to wait on.
Discussion ¶
This does not include encoding which can still continue.
func (MPSGraphExecutableExecutionDescriptor) WaitUntilCompleted ¶
func (g MPSGraphExecutableExecutionDescriptor) WaitUntilCompleted() bool
Flag for the graph executable to wait till the execution has completed.
Discussion ¶
Default value is false.
type MPSGraphExecutableExecutionDescriptorClass ¶
type MPSGraphExecutableExecutionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphExecutableExecutionDescriptorClass ¶
func GetMPSGraphExecutableExecutionDescriptorClass() MPSGraphExecutableExecutionDescriptorClass
GetMPSGraphExecutableExecutionDescriptorClass returns the class object for MPSGraphExecutableExecutionDescriptor.
func (MPSGraphExecutableExecutionDescriptorClass) Alloc ¶
Alloc allocates memory for a new instance of the class.
func (MPSGraphExecutableExecutionDescriptorClass) Class ¶
func (mc MPSGraphExecutableExecutionDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphExecutableScheduledHandler ¶
type MPSGraphExecutableScheduledHandler = func(results []MPSGraphTensorData, error_ foundation.NSError)
MPSGraphExecutableScheduledHandler is a notification when graph executable execution schedules.
type MPSGraphExecutableSerializationDescriptor ¶
type MPSGraphExecutableSerializationDescriptor struct {
MPSGraphObject
}
A class that consists of all the levers to serialize an executable.
Instance Properties ¶
- MPSGraphExecutableSerializationDescriptor.Append: Flag to append to an existing .mpsgraphpackage if found at provided url.
- MPSGraphExecutableSerializationDescriptor.SetAppend
- MPSGraphExecutableSerializationDescriptor.DeploymentPlatform: The deployment platform used to serialize the executable.
- MPSGraphExecutableSerializationDescriptor.SetDeploymentPlatform
- MPSGraphExecutableSerializationDescriptor.MinimumDeploymentTarget: The minimum deployment target to serialize the executable.
- MPSGraphExecutableSerializationDescriptor.SetMinimumDeploymentTarget
func MPSGraphExecutableSerializationDescriptorFromID ¶
func MPSGraphExecutableSerializationDescriptorFromID(id objc.ID) MPSGraphExecutableSerializationDescriptor
MPSGraphExecutableSerializationDescriptorFromID constructs a MPSGraphExecutableSerializationDescriptor from an objc.ID.
A class that consists of all the levers to serialize an executable.
func NewMPSGraphExecutableSerializationDescriptor ¶
func NewMPSGraphExecutableSerializationDescriptor() MPSGraphExecutableSerializationDescriptor
NewMPSGraphExecutableSerializationDescriptor creates a new MPSGraphExecutableSerializationDescriptor instance.
func (MPSGraphExecutableSerializationDescriptor) Append ¶
func (g MPSGraphExecutableSerializationDescriptor) Append() bool
Flag to append to an existing .mpsgraphpackage if found at provided url.
Discussion ¶
If false, the exisiting .mpsgraphpackage will be overwritten.
func (MPSGraphExecutableSerializationDescriptor) Autorelease ¶
func (g MPSGraphExecutableSerializationDescriptor) Autorelease() MPSGraphExecutableSerializationDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphExecutableSerializationDescriptor) DeploymentPlatform ¶
func (g MPSGraphExecutableSerializationDescriptor) DeploymentPlatform() MPSGraphDeploymentPlatform
The deployment platform used to serialize the executable.
Discussion ¶
Defaults to the current platform.
func (MPSGraphExecutableSerializationDescriptor) MinimumDeploymentTarget ¶
func (g MPSGraphExecutableSerializationDescriptor) MinimumDeploymentTarget() string
The minimum deployment target to serialize the executable.
Discussion ¶
If not set, the package created will target the latest version of the `deploymentPlatform` set.
func (MPSGraphExecutableSerializationDescriptor) SetAppend ¶
func (g MPSGraphExecutableSerializationDescriptor) SetAppend(value bool)
func (MPSGraphExecutableSerializationDescriptor) SetDeploymentPlatform ¶
func (g MPSGraphExecutableSerializationDescriptor) SetDeploymentPlatform(value MPSGraphDeploymentPlatform)
func (MPSGraphExecutableSerializationDescriptor) SetMinimumDeploymentTarget ¶
func (g MPSGraphExecutableSerializationDescriptor) SetMinimumDeploymentTarget(value string)
type MPSGraphExecutableSerializationDescriptorClass ¶
type MPSGraphExecutableSerializationDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphExecutableSerializationDescriptorClass ¶
func GetMPSGraphExecutableSerializationDescriptorClass() MPSGraphExecutableSerializationDescriptorClass
GetMPSGraphExecutableSerializationDescriptorClass returns the class object for MPSGraphExecutableSerializationDescriptor.
func (MPSGraphExecutableSerializationDescriptorClass) Alloc ¶
func (mc MPSGraphExecutableSerializationDescriptorClass) Alloc() MPSGraphExecutableSerializationDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphExecutableSerializationDescriptorClass) Class ¶
func (mc MPSGraphExecutableSerializationDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphExecutionDescriptor ¶
type MPSGraphExecutionDescriptor struct {
MPSGraphObject
}
A class that consists of all the levers to synchronize and schedule graph execution.
Instance Properties ¶
- MPSGraphExecutionDescriptor.CompilationDescriptor: The compilation descriptor for the graph.
- MPSGraphExecutionDescriptor.SetCompilationDescriptor
- MPSGraphExecutionDescriptor.CompletionHandler: The handler that graph calls at the completion of the execution.
- MPSGraphExecutionDescriptor.SetCompletionHandler
- MPSGraphExecutionDescriptor.ScheduledHandler: The handler that graph calls when it schedules the execution.
- MPSGraphExecutionDescriptor.SetScheduledHandler
- MPSGraphExecutionDescriptor.WaitUntilCompleted: The flag that blocks the execution call until the entire execution is complete.
- MPSGraphExecutionDescriptor.SetWaitUntilCompleted
Instance Methods ¶
- MPSGraphExecutionDescriptor.SignalEventAtExecutionEventValue: Executable signals these shared events at execution stage and immediately proceeds.
- MPSGraphExecutionDescriptor.WaitForEventValue: Executable waits on these shared events before scheduling execution on the HW, this does not include encoding which can still continue.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutionDescriptor
func MPSGraphExecutionDescriptorFromID ¶
func MPSGraphExecutionDescriptorFromID(id objc.ID) MPSGraphExecutionDescriptor
MPSGraphExecutionDescriptorFromID constructs a MPSGraphExecutionDescriptor from an objc.ID.
A class that consists of all the levers to synchronize and schedule graph execution.
func NewMPSGraphExecutionDescriptor ¶
func NewMPSGraphExecutionDescriptor() MPSGraphExecutionDescriptor
NewMPSGraphExecutionDescriptor creates a new MPSGraphExecutionDescriptor instance.
func (MPSGraphExecutionDescriptor) Autorelease ¶
func (g MPSGraphExecutionDescriptor) Autorelease() MPSGraphExecutionDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphExecutionDescriptor) CompilationDescriptor ¶
func (g MPSGraphExecutionDescriptor) CompilationDescriptor() IMPSGraphCompilationDescriptor
The compilation descriptor for the graph.
Discussion ¶
Default value is nil.
func (MPSGraphExecutionDescriptor) CompletionHandler ¶
func (g MPSGraphExecutionDescriptor) CompletionHandler() MPSGraphCompletionHandler
The handler that graph calls at the completion of the execution.
Discussion ¶
Default value is nil.
func (MPSGraphExecutionDescriptor) Init ¶
func (g MPSGraphExecutionDescriptor) Init() MPSGraphExecutionDescriptor
Init initializes the instance.
func (MPSGraphExecutionDescriptor) ScheduledHandler ¶
func (g MPSGraphExecutionDescriptor) ScheduledHandler() MPSGraphScheduledHandler
The handler that graph calls when it schedules the execution.
Discussion ¶
Default value is nil.
func (MPSGraphExecutionDescriptor) SetCompilationDescriptor ¶
func (g MPSGraphExecutionDescriptor) SetCompilationDescriptor(value IMPSGraphCompilationDescriptor)
func (MPSGraphExecutionDescriptor) SetCompletionHandler ¶
func (g MPSGraphExecutionDescriptor) SetCompletionHandler(value objc.ID)
func (MPSGraphExecutionDescriptor) SetScheduledHandler ¶
func (g MPSGraphExecutionDescriptor) SetScheduledHandler(value objc.ID)
func (MPSGraphExecutionDescriptor) SetWaitUntilCompleted ¶
func (g MPSGraphExecutionDescriptor) SetWaitUntilCompleted(value bool)
func (MPSGraphExecutionDescriptor) SignalEventAtExecutionEventValue ¶
func (g MPSGraphExecutionDescriptor) SignalEventAtExecutionEventValue(event metal.MTLSharedEvent, executionStage MPSGraphExecutionStage, value uint64)
Executable signals these shared events at execution stage and immediately proceeds.
event: Shared event to signal.
executionStage: Execution stage to signal event at.
value: Value for shared event to wait on.
func (MPSGraphExecutionDescriptor) WaitForEventValue ¶
func (g MPSGraphExecutionDescriptor) WaitForEventValue(event metal.MTLSharedEvent, value uint64)
Executable waits on these shared events before scheduling execution on the HW, this does not include encoding which can still continue.
event: Shared event graph waits on.
value: Value of shared event graph waits on.
func (MPSGraphExecutionDescriptor) WaitUntilCompleted ¶
func (g MPSGraphExecutionDescriptor) WaitUntilCompleted() bool
The flag that blocks the execution call until the entire execution is complete.
Discussion ¶
Defaults to NO.
type MPSGraphExecutionDescriptorClass ¶
type MPSGraphExecutionDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphExecutionDescriptorClass ¶
func GetMPSGraphExecutionDescriptorClass() MPSGraphExecutionDescriptorClass
GetMPSGraphExecutionDescriptorClass returns the class object for MPSGraphExecutionDescriptor.
func (MPSGraphExecutionDescriptorClass) Alloc ¶
func (mc MPSGraphExecutionDescriptorClass) Alloc() MPSGraphExecutionDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphExecutionDescriptorClass) Class ¶
func (mc MPSGraphExecutionDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphExecutionStage ¶
type MPSGraphExecutionStage uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphExecutionStage
const ( // MPSGraphExecutionStageCompleted: stage when execution of the graph completes. MPSGraphExecutionStageCompleted MPSGraphExecutionStage = 0 )
func (MPSGraphExecutionStage) String ¶
func (e MPSGraphExecutionStage) String() string
type MPSGraphFFTDescriptor ¶
type MPSGraphFFTDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a fast Fourier transform (FFT) operation.
Overview ¶
Use this descriptor with MPSGraph.FastFourierTransformWithTensorAxesDescriptorName, MPSGraph.RealToHermiteanFFTWithTensorAxesTensorDescriptorName, and MPSGraph.HermiteanToRealFFTWithTensorAxesTensorDescriptorName methods.
Instance Properties ¶
- MPSGraphFFTDescriptor.Inverse: A Boolean-valued parameter that defines the phase factor sign for Fourier transforms.
- MPSGraphFFTDescriptor.SetInverse
- MPSGraphFFTDescriptor.RoundToOddHermitean: A parameter which controls how graph rounds the output tensor size for a Hermitean-to-real Fourier transform.
- MPSGraphFFTDescriptor.SetRoundToOddHermitean
- MPSGraphFFTDescriptor.ScalingMode: The scaling mode of the fast fourier transform (FFT) operation.
- MPSGraphFFTDescriptor.SetScalingMode
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphFFTDescriptor
func MPSGraphFFTDescriptorFromID ¶
func MPSGraphFFTDescriptorFromID(id objc.ID) MPSGraphFFTDescriptor
MPSGraphFFTDescriptorFromID constructs a MPSGraphFFTDescriptor from an objc.ID.
The class that defines the parameters for a fast Fourier transform (FFT) operation.
func NewMPSGraphFFTDescriptor ¶
func NewMPSGraphFFTDescriptor() MPSGraphFFTDescriptor
NewMPSGraphFFTDescriptor creates a new MPSGraphFFTDescriptor instance.
func (MPSGraphFFTDescriptor) Autorelease ¶
func (g MPSGraphFFTDescriptor) Autorelease() MPSGraphFFTDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphFFTDescriptor) Init ¶
func (g MPSGraphFFTDescriptor) Init() MPSGraphFFTDescriptor
Init initializes the instance.
func (MPSGraphFFTDescriptor) Inverse ¶
func (g MPSGraphFFTDescriptor) Inverse() bool
A Boolean-valued parameter that defines the phase factor sign for Fourier transforms.
Discussion ¶
When set to [YES] graph uses the positive phase factor: `exp(+i 2Pi mu nu / n)`, when computing the (inverse) Fourier transform. Otherwise MPSGraph uses the negative phase factor: `exp(-i 2Pi mu nu / n)`, when computing the Fourier transform. Default value: [NO].
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphFFTDescriptor/inverse
func (MPSGraphFFTDescriptor) RoundToOddHermitean ¶
func (g MPSGraphFFTDescriptor) RoundToOddHermitean() bool
A parameter which controls how graph rounds the output tensor size for a Hermitean-to-real Fourier transform.
Discussion ¶
If set to [YES] then MPSGraph rounds the last output dimension of the result tensor in MPSGraph.HermiteanToRealFFTWithTensorAxesTensorDescriptorName to an odd value. Has no effect in the other Fourier transform operations. Default value: [NO].
func (MPSGraphFFTDescriptor) ScalingMode ¶
func (g MPSGraphFFTDescriptor) ScalingMode() MPSGraphFFTScalingMode
The scaling mode of the fast fourier transform (FFT) operation.
Discussion ¶
Note that the scaling mode is independent from the phase factor. Default value: MPSGraphFFTScalingModeNone.
func (MPSGraphFFTDescriptor) SetInverse ¶
func (g MPSGraphFFTDescriptor) SetInverse(value bool)
func (MPSGraphFFTDescriptor) SetRoundToOddHermitean ¶
func (g MPSGraphFFTDescriptor) SetRoundToOddHermitean(value bool)
func (MPSGraphFFTDescriptor) SetScalingMode ¶
func (g MPSGraphFFTDescriptor) SetScalingMode(value MPSGraphFFTScalingMode)
type MPSGraphFFTDescriptorClass ¶
type MPSGraphFFTDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphFFTDescriptorClass ¶
func GetMPSGraphFFTDescriptorClass() MPSGraphFFTDescriptorClass
GetMPSGraphFFTDescriptorClass returns the class object for MPSGraphFFTDescriptor.
func (MPSGraphFFTDescriptorClass) Alloc ¶
func (mc MPSGraphFFTDescriptorClass) Alloc() MPSGraphFFTDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphFFTDescriptorClass) Class ¶
func (mc MPSGraphFFTDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (MPSGraphFFTDescriptorClass) Descriptor ¶
func (_MPSGraphFFTDescriptorClass MPSGraphFFTDescriptorClass) Descriptor() MPSGraphFFTDescriptor
Creates a fast Fourier transform descriptor with default parameter values.
type MPSGraphFFTScalingMode ¶
type MPSGraphFFTScalingMode uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphFFTScalingMode
const ( // MPSGraphFFTScalingModeNone: Computes the FFT result with no scaling. MPSGraphFFTScalingModeNone MPSGraphFFTScalingMode = 0 // MPSGraphFFTScalingModeSize: Scales the FFT result with reciprocal of the total FFT size over all transformed dimensions. MPSGraphFFTScalingModeSize MPSGraphFFTScalingMode = 1 // MPSGraphFFTScalingModeUnitary: Scales the FFT result with reciprocal square root of the total FFT size over all transformed dimensions, resulting in signal strength conserving transformation. MPSGraphFFTScalingModeUnitary MPSGraphFFTScalingMode = 2 )
func (MPSGraphFFTScalingMode) String ¶
func (e MPSGraphFFTScalingMode) String() string
type MPSGraphForLoopBodyBlock ¶
type MPSGraphForLoopBodyBlock = func(index MPSGraphTensor, iterationArguments []MPSGraphTensor) []MPSGraphTensor
MPSGraphForLoopBodyBlock is a block for the body in the for loop.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphForLoopBodyBlock
type MPSGraphGRUDescriptor ¶
type MPSGraphGRUDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a gated recurrent unit (GRU) operation.
Overview ¶
Use this descriptor with the following MPSGraph methods:
- MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasDescriptorName - MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName - MPSGraph.GRUWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskSecondaryBiasDescriptorName - MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasDescriptorName - MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdInputWeightBiasInitStateDescriptorName - MPSGraph.GRUGradientsWithSourceTensorRecurrentWeightSourceGradientZStateOutputFwdStateGradientInputWeightBiasInitStateMaskSecondaryBiasDescriptorName
Instance Properties ¶
- MPSGraphGRUDescriptor.Bidirectional: A parameter that defines a bidirectional GRU layer.
- MPSGraphGRUDescriptor.SetBidirectional
- MPSGraphGRUDescriptor.FlipZ: A parameter that chooses between two variants for the final output computation.
- MPSGraphGRUDescriptor.SetFlipZ
- MPSGraphGRUDescriptor.OutputGateActivation: A parameter that defines the activation function to use with the output-gate of the GRU operation.
- MPSGraphGRUDescriptor.SetOutputGateActivation
- MPSGraphGRUDescriptor.ResetAfter: A parameter that chooses between two variants for the reset gate computation.
- MPSGraphGRUDescriptor.SetResetAfter
- MPSGraphGRUDescriptor.ResetGateActivation: A parameter that defines the activation function to use with the reset-gate of the GRU operation.
- MPSGraphGRUDescriptor.SetResetGateActivation
- MPSGraphGRUDescriptor.ResetGateFirst: A parameter that controls the internal order of the GRU gates.
- MPSGraphGRUDescriptor.SetResetGateFirst
- MPSGraphGRUDescriptor.Reverse: A parameter that defines the time direction of the input sequence.
- MPSGraphGRUDescriptor.SetReverse
- MPSGraphGRUDescriptor.Training: A parameter that enables the GRU layer to support training.
- MPSGraphGRUDescriptor.SetTraining
- MPSGraphGRUDescriptor.UpdateGateActivation: A parameter that defines the activation function to use with the update-gate of the GRU operation.
- MPSGraphGRUDescriptor.SetUpdateGateActivation
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphGRUDescriptor
func MPSGraphGRUDescriptorFromID ¶
func MPSGraphGRUDescriptorFromID(id objc.ID) MPSGraphGRUDescriptor
MPSGraphGRUDescriptorFromID constructs a MPSGraphGRUDescriptor from an objc.ID.
The class that defines the parameters for a gated recurrent unit (GRU) operation.
func NewMPSGraphGRUDescriptor ¶
func NewMPSGraphGRUDescriptor() MPSGraphGRUDescriptor
NewMPSGraphGRUDescriptor creates a new MPSGraphGRUDescriptor instance.
func (MPSGraphGRUDescriptor) Autorelease ¶
func (g MPSGraphGRUDescriptor) Autorelease() MPSGraphGRUDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphGRUDescriptor) Bidirectional ¶
func (g MPSGraphGRUDescriptor) Bidirectional() bool
A parameter that defines a bidirectional GRU layer.
Discussion ¶
If set to [YES] then the input sequence is traversed in both directions and the two results are concatenated together on the channel-axis. Default value: [NO].
func (MPSGraphGRUDescriptor) FlipZ ¶
func (g MPSGraphGRUDescriptor) FlipZ() bool
A parameter that chooses between two variants for the final output computation.
Discussion ¶
If set to [YES] then the layer will compute the final value as `h[t] = z[t] h[t-1] + (1-z[t]) o[t]`. Otherwise it’s computed as `h[t] = (1-z[t]) h[t-1] + z[t] o[t]`. Default value: [NO].
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphGRUDescriptor/flipZ
func (MPSGraphGRUDescriptor) Init ¶
func (g MPSGraphGRUDescriptor) Init() MPSGraphGRUDescriptor
Init initializes the instance.
func (MPSGraphGRUDescriptor) OutputGateActivation ¶
func (g MPSGraphGRUDescriptor) OutputGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function to use with the output-gate of the GRU operation.
Discussion ¶
Default value: MPSGraphRNNActivationTanh.
func (MPSGraphGRUDescriptor) ResetAfter ¶
func (g MPSGraphGRUDescriptor) ResetAfter() bool
A parameter that chooses between two variants for the reset gate computation.
Discussion ¶
If set to [YES] then the layer will compute the intermediate value as `c[t] = ( b + (h[t-1] m ) R^T) r[t]`. Otherwise it’s computed as `c[t] = (h[t-1] r[t] m) R^T`. Default value: [NO].
func (MPSGraphGRUDescriptor) ResetGateActivation ¶
func (g MPSGraphGRUDescriptor) ResetGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function to use with the reset-gate of the GRU operation.
Discussion ¶
Default value: MPSGraphRNNActivationSigmoid.
func (MPSGraphGRUDescriptor) ResetGateFirst ¶
func (g MPSGraphGRUDescriptor) ResetGateFirst() bool
A parameter that controls the internal order of the GRU gates.
Discussion ¶
If set to [YES] then the layer will use the gate-ordering `[ r, z, o ]` instead of default `[ z, r, o ]`. Default value: [NO].
func (MPSGraphGRUDescriptor) Reverse ¶
func (g MPSGraphGRUDescriptor) Reverse() bool
A parameter that defines the time direction of the input sequence.
Discussion ¶
If set to [YES] then the input sequence is passed in reverse time order to the layer. Note: Ignored when `bidirectional = YES`. Default value: [NO].
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphGRUDescriptor/reverse
func (MPSGraphGRUDescriptor) SetBidirectional ¶
func (g MPSGraphGRUDescriptor) SetBidirectional(value bool)
func (MPSGraphGRUDescriptor) SetFlipZ ¶
func (g MPSGraphGRUDescriptor) SetFlipZ(value bool)
func (MPSGraphGRUDescriptor) SetOutputGateActivation ¶
func (g MPSGraphGRUDescriptor) SetOutputGateActivation(value MPSGraphRNNActivation)
func (MPSGraphGRUDescriptor) SetResetAfter ¶
func (g MPSGraphGRUDescriptor) SetResetAfter(value bool)
func (MPSGraphGRUDescriptor) SetResetGateActivation ¶
func (g MPSGraphGRUDescriptor) SetResetGateActivation(value MPSGraphRNNActivation)
func (MPSGraphGRUDescriptor) SetResetGateFirst ¶
func (g MPSGraphGRUDescriptor) SetResetGateFirst(value bool)
func (MPSGraphGRUDescriptor) SetReverse ¶
func (g MPSGraphGRUDescriptor) SetReverse(value bool)
func (MPSGraphGRUDescriptor) SetTraining ¶
func (g MPSGraphGRUDescriptor) SetTraining(value bool)
func (MPSGraphGRUDescriptor) SetUpdateGateActivation ¶
func (g MPSGraphGRUDescriptor) SetUpdateGateActivation(value MPSGraphRNNActivation)
func (MPSGraphGRUDescriptor) Training ¶
func (g MPSGraphGRUDescriptor) Training() bool
A parameter that enables the GRU layer to support training.
Discussion ¶
If set to [YES] then the layer will produce training state tensor as a secondary output. Default value: [NO].
func (MPSGraphGRUDescriptor) UpdateGateActivation ¶
func (g MPSGraphGRUDescriptor) UpdateGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function to use with the update-gate of the GRU operation.
Discussion ¶
Default value: MPSGraphRNNActivationSigmoid.
type MPSGraphGRUDescriptorClass ¶
type MPSGraphGRUDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphGRUDescriptorClass ¶
func GetMPSGraphGRUDescriptorClass() MPSGraphGRUDescriptorClass
GetMPSGraphGRUDescriptorClass returns the class object for MPSGraphGRUDescriptor.
func (MPSGraphGRUDescriptorClass) Alloc ¶
func (mc MPSGraphGRUDescriptorClass) Alloc() MPSGraphGRUDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphGRUDescriptorClass) Class ¶
func (mc MPSGraphGRUDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (MPSGraphGRUDescriptorClass) Descriptor ¶
func (_MPSGraphGRUDescriptorClass MPSGraphGRUDescriptorClass) Descriptor() MPSGraphGRUDescriptor
Creates an GRU descriptor with default values.
type MPSGraphIfThenElseBlock ¶
type MPSGraphIfThenElseBlock = func() []MPSGraphTensor
MPSGraphIfThenElseBlock is a block of operations executed under either the if or else condition.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphIfThenElseBlock
type MPSGraphImToColOpDescriptor ¶
type MPSGraphImToColOpDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for an image to column or column to image operation.
Overview ¶
Use this descriptor with the following MPSGraph methods:
- MPSGraph.ImToColWithSourceTensorDescriptorName - MPSGraph.ColToImWithSourceTensorOutputShapeDescriptorName
Instance Properties ¶
- MPSGraphImToColOpDescriptor.DataLayout: The property that defines the layout of source or output tensor. e.g. `batch x channels x width x height` for [NCHW] layout
- MPSGraphImToColOpDescriptor.SetDataLayout
- MPSGraphImToColOpDescriptor.DilationRateInX: The property that defines the dilation in width dimension.
- MPSGraphImToColOpDescriptor.SetDilationRateInX
- MPSGraphImToColOpDescriptor.DilationRateInY: The property that defines the dilation in height dimension.
- MPSGraphImToColOpDescriptor.SetDilationRateInY
- MPSGraphImToColOpDescriptor.KernelHeight: The property that defines the kernel size in height dimension.
- MPSGraphImToColOpDescriptor.SetKernelHeight
- MPSGraphImToColOpDescriptor.KernelWidth: The property that defines the kernel size in width dimension.
- MPSGraphImToColOpDescriptor.SetKernelWidth
- MPSGraphImToColOpDescriptor.PaddingBottom: The property that defines the padding in height dimension at the bottom.
- MPSGraphImToColOpDescriptor.SetPaddingBottom
- MPSGraphImToColOpDescriptor.PaddingLeft: The property that defines the padding in width dimension on the left side.
- MPSGraphImToColOpDescriptor.SetPaddingLeft
- MPSGraphImToColOpDescriptor.PaddingRight: The property that defines the padding in width dimension on the right side.
- MPSGraphImToColOpDescriptor.SetPaddingRight
- MPSGraphImToColOpDescriptor.PaddingTop: The property that defines the padding in height dimension at the top.
- MPSGraphImToColOpDescriptor.SetPaddingTop
- MPSGraphImToColOpDescriptor.StrideInX: The property that defines the stride in width dimension.
- MPSGraphImToColOpDescriptor.SetStrideInX
- MPSGraphImToColOpDescriptor.StrideInY: The property that defines the stride in height dimension.
- MPSGraphImToColOpDescriptor.SetStrideInY
Instance Methods ¶
- MPSGraphImToColOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the descriptor’s padding to the given values.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphImToColOpDescriptor
func MPSGraphImToColOpDescriptorFromID ¶
func MPSGraphImToColOpDescriptorFromID(id objc.ID) MPSGraphImToColOpDescriptor
MPSGraphImToColOpDescriptorFromID constructs a MPSGraphImToColOpDescriptor from an objc.ID.
The class that defines the parameters for an image to column or column to image operation.
func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYDataLayout ¶
func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, dataLayout MPSGraphTensorNamedDataLayout) MPSGraphImToColOpDescriptor
Creates column to image descriptor with given values for parameters.
kernelWidth: See `kernelWidth` property.
kernelHeight: See `kernelHeight` property.
strideInX: See `strideInX` property.
strideInY: See `strideInY` property.
dilationRateInX: See `dilationRateInX` property.
dilationRateInY: See `dilationRateInY` property.
dataLayout: See `dataLayout` property.
Return Value ¶
A valid MPSGraphImToColOpDescriptor on autoreleasepool.
func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomDataLayout ¶
func NewGraphImToColOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, dataLayout MPSGraphTensorNamedDataLayout) MPSGraphImToColOpDescriptor
Creates an image to column descriptor with given values for parameters.
kernelWidth: See `kernelWidth` property.
kernelHeight: See `kernelHeight` property.
strideInX: See `strideInX` property.
strideInY: See `strideInY` property.
dilationRateInX: See `dilationRateInX` property.
dilationRateInY: See `dilationRateInY` property.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
dataLayout: See `dataLayout` property.
Return Value ¶
A valid MPSGraphImToColOpDescriptor on autoreleasepool.
func NewMPSGraphImToColOpDescriptor ¶
func NewMPSGraphImToColOpDescriptor() MPSGraphImToColOpDescriptor
NewMPSGraphImToColOpDescriptor creates a new MPSGraphImToColOpDescriptor instance.
func (MPSGraphImToColOpDescriptor) Autorelease ¶
func (g MPSGraphImToColOpDescriptor) Autorelease() MPSGraphImToColOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphImToColOpDescriptor) DataLayout ¶
func (g MPSGraphImToColOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
The property that defines the layout of source or output tensor. e.g. `batch x channels x width x height` for [NCHW] layout
func (MPSGraphImToColOpDescriptor) DilationRateInX ¶
func (g MPSGraphImToColOpDescriptor) DilationRateInX() uint
The property that defines the dilation in width dimension.
func (MPSGraphImToColOpDescriptor) DilationRateInY ¶
func (g MPSGraphImToColOpDescriptor) DilationRateInY() uint
The property that defines the dilation in height dimension.
func (MPSGraphImToColOpDescriptor) Init ¶
func (g MPSGraphImToColOpDescriptor) Init() MPSGraphImToColOpDescriptor
Init initializes the instance.
func (MPSGraphImToColOpDescriptor) KernelHeight ¶
func (g MPSGraphImToColOpDescriptor) KernelHeight() uint
The property that defines the kernel size in height dimension.
func (MPSGraphImToColOpDescriptor) KernelWidth ¶
func (g MPSGraphImToColOpDescriptor) KernelWidth() uint
The property that defines the kernel size in width dimension.
func (MPSGraphImToColOpDescriptor) PaddingBottom ¶
func (g MPSGraphImToColOpDescriptor) PaddingBottom() uint
The property that defines the padding in height dimension at the bottom.
func (MPSGraphImToColOpDescriptor) PaddingLeft ¶
func (g MPSGraphImToColOpDescriptor) PaddingLeft() uint
The property that defines the padding in width dimension on the left side.
func (MPSGraphImToColOpDescriptor) PaddingRight ¶
func (g MPSGraphImToColOpDescriptor) PaddingRight() uint
The property that defines the padding in width dimension on the right side.
func (MPSGraphImToColOpDescriptor) PaddingTop ¶
func (g MPSGraphImToColOpDescriptor) PaddingTop() uint
The property that defines the padding in height dimension at the top.
func (MPSGraphImToColOpDescriptor) SetDataLayout ¶
func (g MPSGraphImToColOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphImToColOpDescriptor) SetDilationRateInX ¶
func (g MPSGraphImToColOpDescriptor) SetDilationRateInX(value uint)
func (MPSGraphImToColOpDescriptor) SetDilationRateInY ¶
func (g MPSGraphImToColOpDescriptor) SetDilationRateInY(value uint)
func (MPSGraphImToColOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom ¶
func (g MPSGraphImToColOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
Sets the descriptor’s padding to the given values.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
func (MPSGraphImToColOpDescriptor) SetKernelHeight ¶
func (g MPSGraphImToColOpDescriptor) SetKernelHeight(value uint)
func (MPSGraphImToColOpDescriptor) SetKernelWidth ¶
func (g MPSGraphImToColOpDescriptor) SetKernelWidth(value uint)
func (MPSGraphImToColOpDescriptor) SetPaddingBottom ¶
func (g MPSGraphImToColOpDescriptor) SetPaddingBottom(value uint)
func (MPSGraphImToColOpDescriptor) SetPaddingLeft ¶
func (g MPSGraphImToColOpDescriptor) SetPaddingLeft(value uint)
func (MPSGraphImToColOpDescriptor) SetPaddingRight ¶
func (g MPSGraphImToColOpDescriptor) SetPaddingRight(value uint)
func (MPSGraphImToColOpDescriptor) SetPaddingTop ¶
func (g MPSGraphImToColOpDescriptor) SetPaddingTop(value uint)
func (MPSGraphImToColOpDescriptor) SetStrideInX ¶
func (g MPSGraphImToColOpDescriptor) SetStrideInX(value uint)
func (MPSGraphImToColOpDescriptor) SetStrideInY ¶
func (g MPSGraphImToColOpDescriptor) SetStrideInY(value uint)
func (MPSGraphImToColOpDescriptor) StrideInX ¶
func (g MPSGraphImToColOpDescriptor) StrideInX() uint
The property that defines the stride in width dimension.
func (MPSGraphImToColOpDescriptor) StrideInY ¶
func (g MPSGraphImToColOpDescriptor) StrideInY() uint
The property that defines the stride in height dimension.
type MPSGraphImToColOpDescriptorClass ¶
type MPSGraphImToColOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphImToColOpDescriptorClass ¶
func GetMPSGraphImToColOpDescriptorClass() MPSGraphImToColOpDescriptorClass
GetMPSGraphImToColOpDescriptorClass returns the class object for MPSGraphImToColOpDescriptor.
func (MPSGraphImToColOpDescriptorClass) Alloc ¶
func (mc MPSGraphImToColOpDescriptorClass) Alloc() MPSGraphImToColOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphImToColOpDescriptorClass) Class ¶
func (mc MPSGraphImToColOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphLSTMDescriptor ¶
type MPSGraphLSTMDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a long short-term memory (LSTM) operation.
Overview ¶
Use this descriptor with the following MPSGraph methods:
- MPSGraph.LSTMWithSourceTensorRecurrentWeightInitStateInitCellDescriptorName - MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellDescriptorName - MPSGraph.LSTMWithSourceTensorRecurrentWeightInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName - MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdDescriptorName - MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellDescriptorName - MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdInputWeightBiasInitStateInitCellMaskDescriptorName - MPSGraph.LSTMGradientsWithSourceTensorRecurrentWeightSourceGradientZStateCellOutputFwdStateGradientCellGradientInputWeightBiasInitStateInitCellMaskPeepholeDescriptorName
Instance Properties ¶
- MPSGraphLSTMDescriptor.Activation: A parameter that defines the activation function used with the current cell value of the LSTM operation.
- MPSGraphLSTMDescriptor.SetActivation
- MPSGraphLSTMDescriptor.Bidirectional: A parameter that defines a bidirectional LSTM layer.
- MPSGraphLSTMDescriptor.SetBidirectional
- MPSGraphLSTMDescriptor.CellGateActivation: A parameter that defines the activation function used with the cell gate of the LSTM operation.
- MPSGraphLSTMDescriptor.SetCellGateActivation
- MPSGraphLSTMDescriptor.ForgetGateActivation: A parameter that defines the activation function used with the forget gate of the LSTM operation.
- MPSGraphLSTMDescriptor.SetForgetGateActivation
- MPSGraphLSTMDescriptor.ForgetGateLast: A parameter that controls the internal order of the LSTM gates.
- MPSGraphLSTMDescriptor.SetForgetGateLast
- MPSGraphLSTMDescriptor.InputGateActivation: A parameter that defines the activation function used with the input gate of the LSTM operation.
- MPSGraphLSTMDescriptor.SetInputGateActivation
- MPSGraphLSTMDescriptor.OutputGateActivation: A parameter that defines the activation function used with the output gate of the LSTM operation.
- MPSGraphLSTMDescriptor.SetOutputGateActivation
- MPSGraphLSTMDescriptor.ProduceCell: A parameter that controls whether or not to return the output cell from the LSTM layer.
- MPSGraphLSTMDescriptor.SetProduceCell
- MPSGraphLSTMDescriptor.Reverse: A parameter that defines time direction of the input sequence.
- MPSGraphLSTMDescriptor.SetReverse
- MPSGraphLSTMDescriptor.Training: A parameter that enables the LSTM layer to support training.
- MPSGraphLSTMDescriptor.SetTraining
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphLSTMDescriptor
func MPSGraphLSTMDescriptorFromID ¶
func MPSGraphLSTMDescriptorFromID(id objc.ID) MPSGraphLSTMDescriptor
MPSGraphLSTMDescriptorFromID constructs a MPSGraphLSTMDescriptor from an objc.ID.
The class that defines the parameters for a long short-term memory (LSTM) operation.
func NewMPSGraphLSTMDescriptor ¶
func NewMPSGraphLSTMDescriptor() MPSGraphLSTMDescriptor
NewMPSGraphLSTMDescriptor creates a new MPSGraphLSTMDescriptor instance.
func (MPSGraphLSTMDescriptor) Activation ¶
func (g MPSGraphLSTMDescriptor) Activation() MPSGraphRNNActivation
A parameter that defines the activation function used with the current cell value of the LSTM operation.
Discussion ¶
Default value: MPSGraphRNNActivationTanh.
func (MPSGraphLSTMDescriptor) Autorelease ¶
func (g MPSGraphLSTMDescriptor) Autorelease() MPSGraphLSTMDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphLSTMDescriptor) Bidirectional ¶
func (g MPSGraphLSTMDescriptor) Bidirectional() bool
A parameter that defines a bidirectional LSTM layer.
Discussion ¶
If set to [YES] then the input sequence is traversed in both directions and the two results are concatenated together on the channel-axis. Default value: [NO].
func (MPSGraphLSTMDescriptor) CellGateActivation ¶
func (g MPSGraphLSTMDescriptor) CellGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function used with the cell gate of the LSTM operation.
Discussion ¶
Default value: MPSGraphRNNActivationTanh.
func (MPSGraphLSTMDescriptor) ForgetGateActivation ¶
func (g MPSGraphLSTMDescriptor) ForgetGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function used with the forget gate of the LSTM operation.
Discussion ¶
Default value: MPSGraphRNNActivationSigmoid.
func (MPSGraphLSTMDescriptor) ForgetGateLast ¶
func (g MPSGraphLSTMDescriptor) ForgetGateLast() bool
A parameter that controls the internal order of the LSTM gates.
Discussion ¶
If set to [YES] then the layer will use the gate-ordering `[ i, z, f, o ]` instead of default `[ i, f, z, o ]`. Default value: [NO]
func (MPSGraphLSTMDescriptor) Init ¶
func (g MPSGraphLSTMDescriptor) Init() MPSGraphLSTMDescriptor
Init initializes the instance.
func (MPSGraphLSTMDescriptor) InputGateActivation ¶
func (g MPSGraphLSTMDescriptor) InputGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function used with the input gate of the LSTM operation.
Discussion ¶
Default value: MPSGraphRNNActivationSigmoid.
func (MPSGraphLSTMDescriptor) OutputGateActivation ¶
func (g MPSGraphLSTMDescriptor) OutputGateActivation() MPSGraphRNNActivation
A parameter that defines the activation function used with the output gate of the LSTM operation.
Discussion ¶
Default value: MPSGraphRNNActivationSigmoid.
func (MPSGraphLSTMDescriptor) ProduceCell ¶
func (g MPSGraphLSTMDescriptor) ProduceCell() bool
A parameter that controls whether or not to return the output cell from the LSTM layer.
Discussion ¶
If set to [YES] then this layer will produce the internal cell of the LSTM unit as secondary output. Default value: [NO].
func (MPSGraphLSTMDescriptor) Reverse ¶
func (g MPSGraphLSTMDescriptor) Reverse() bool
A parameter that defines time direction of the input sequence.
Discussion ¶
If set to [YES] then the input sequence is passed in reverse time order to the layer. Note: Ignored when `bidirectional = YES`. Default value: [NO].
func (MPSGraphLSTMDescriptor) SetActivation ¶
func (g MPSGraphLSTMDescriptor) SetActivation(value MPSGraphRNNActivation)
func (MPSGraphLSTMDescriptor) SetBidirectional ¶
func (g MPSGraphLSTMDescriptor) SetBidirectional(value bool)
func (MPSGraphLSTMDescriptor) SetCellGateActivation ¶
func (g MPSGraphLSTMDescriptor) SetCellGateActivation(value MPSGraphRNNActivation)
func (MPSGraphLSTMDescriptor) SetForgetGateActivation ¶
func (g MPSGraphLSTMDescriptor) SetForgetGateActivation(value MPSGraphRNNActivation)
func (MPSGraphLSTMDescriptor) SetForgetGateLast ¶
func (g MPSGraphLSTMDescriptor) SetForgetGateLast(value bool)
func (MPSGraphLSTMDescriptor) SetInputGateActivation ¶
func (g MPSGraphLSTMDescriptor) SetInputGateActivation(value MPSGraphRNNActivation)
func (MPSGraphLSTMDescriptor) SetOutputGateActivation ¶
func (g MPSGraphLSTMDescriptor) SetOutputGateActivation(value MPSGraphRNNActivation)
func (MPSGraphLSTMDescriptor) SetProduceCell ¶
func (g MPSGraphLSTMDescriptor) SetProduceCell(value bool)
func (MPSGraphLSTMDescriptor) SetReverse ¶
func (g MPSGraphLSTMDescriptor) SetReverse(value bool)
func (MPSGraphLSTMDescriptor) SetTraining ¶
func (g MPSGraphLSTMDescriptor) SetTraining(value bool)
func (MPSGraphLSTMDescriptor) Training ¶
func (g MPSGraphLSTMDescriptor) Training() bool
A parameter that enables the LSTM layer to support training.
Discussion ¶
If set to [YES] then the layer will produce training state tensor as a secondary output. Default value: [NO].
type MPSGraphLSTMDescriptorClass ¶
type MPSGraphLSTMDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphLSTMDescriptorClass ¶
func GetMPSGraphLSTMDescriptorClass() MPSGraphLSTMDescriptorClass
GetMPSGraphLSTMDescriptorClass returns the class object for MPSGraphLSTMDescriptor.
func (MPSGraphLSTMDescriptorClass) Alloc ¶
func (mc MPSGraphLSTMDescriptorClass) Alloc() MPSGraphLSTMDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphLSTMDescriptorClass) Class ¶
func (mc MPSGraphLSTMDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (MPSGraphLSTMDescriptorClass) Descriptor ¶
func (_MPSGraphLSTMDescriptorClass MPSGraphLSTMDescriptorClass) Descriptor() MPSGraphLSTMDescriptor
Creates an LSTM descriptor with default values.
type MPSGraphLossReductionType ¶
type MPSGraphLossReductionType uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphLossReductionType
const ( // MPSGraphLossReductionTypeAxis: Computes the loss without reduction. MPSGraphLossReductionTypeAxis MPSGraphLossReductionType = 0 // MPSGraphLossReductionTypeMean: Reduces the loss down to a scalar with a mean operation. MPSGraphLossReductionTypeMean MPSGraphLossReductionType = 2 // MPSGraphLossReductionTypeNone: Computes the loss without reduction. MPSGraphLossReductionTypeNone MPSGraphLossReductionType = 0 // MPSGraphLossReductionTypeSum: Reduces the loss down to a scalar with a sum operation. MPSGraphLossReductionTypeSum MPSGraphLossReductionType = 1 )
func (MPSGraphLossReductionType) String ¶
func (e MPSGraphLossReductionType) String() string
type MPSGraphNonMaximumSuppressionCoordinateMode ¶
type MPSGraphNonMaximumSuppressionCoordinateMode uint
const ( MPSGraphNonMaximumSuppressionCoordinateModeCentersHeightFirst MPSGraphNonMaximumSuppressionCoordinateMode = 2 MPSGraphNonMaximumSuppressionCoordinateModeCentersWidthFirst MPSGraphNonMaximumSuppressionCoordinateMode = 3 MPSGraphNonMaximumSuppressionCoordinateModeCornersHeightFirst MPSGraphNonMaximumSuppressionCoordinateMode = 0 MPSGraphNonMaximumSuppressionCoordinateModeCornersWidthFirst MPSGraphNonMaximumSuppressionCoordinateMode = 1 )
func (MPSGraphNonMaximumSuppressionCoordinateMode) String ¶
func (e MPSGraphNonMaximumSuppressionCoordinateMode) String() string
type MPSGraphObject ¶
type MPSGraphObject struct {
objectivec.Object
}
The common base class for all Metal Performance Shaders Graph objects.
Overview ¶
Only the child classes should be used.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphObject
func MPSGraphObjectFromID ¶
func MPSGraphObjectFromID(id objc.ID) MPSGraphObject
MPSGraphObjectFromID constructs a MPSGraphObject from an objc.ID.
The common base class for all Metal Performance Shaders Graph objects.
func NewMPSGraphObject ¶
func NewMPSGraphObject() MPSGraphObject
NewMPSGraphObject creates a new MPSGraphObject instance.
func (MPSGraphObject) Autorelease ¶
func (g MPSGraphObject) Autorelease() MPSGraphObject
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphObject) Init ¶
func (g MPSGraphObject) Init() MPSGraphObject
Init initializes the instance.
type MPSGraphObjectClass ¶
type MPSGraphObjectClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphObjectClass ¶
func GetMPSGraphObjectClass() MPSGraphObjectClass
GetMPSGraphObjectClass returns the class object for MPSGraphObject.
func (MPSGraphObjectClass) Alloc ¶
func (mc MPSGraphObjectClass) Alloc() MPSGraphObject
Alloc allocates memory for a new instance of the class.
func (MPSGraphObjectClass) Class ¶
func (mc MPSGraphObjectClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphOperation ¶
type MPSGraphOperation struct {
MPSGraphObject
}
A symbolic representation of a compute operation.
Overview ¶
[NSCopy] will take a refrence, this is so [NSDictionary] can work with the tensor. All operations are created, owned and destroyed by the graph.
Instance Properties ¶
- MPSGraphOperation.ControlDependencies: The set of operations guaranteed to execute before this operation.
- MPSGraphOperation.Graph: The graph on which the operation is defined.
- MPSGraphOperation.InputTensors: The input tensors of the operation.
- MPSGraphOperation.Name: Name of the operation.
- MPSGraphOperation.OutputTensors: The output tensors of the operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOperation
func MPSGraphOperationFromID ¶
func MPSGraphOperationFromID(id objc.ID) MPSGraphOperation
MPSGraphOperationFromID constructs a MPSGraphOperation from an objc.ID.
A symbolic representation of a compute operation.
func NewMPSGraphOperation ¶
func NewMPSGraphOperation() MPSGraphOperation
NewMPSGraphOperation creates a new MPSGraphOperation instance.
func (MPSGraphOperation) Autorelease ¶
func (g MPSGraphOperation) Autorelease() MPSGraphOperation
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphOperation) ControlDependencies ¶
func (g MPSGraphOperation) ControlDependencies() []MPSGraphOperation
The set of operations guaranteed to execute before this operation.
func (MPSGraphOperation) Graph ¶
func (g MPSGraphOperation) Graph() IMPSGraph
The graph on which the operation is defined.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOperation/graph
func (MPSGraphOperation) Init ¶
func (g MPSGraphOperation) Init() MPSGraphOperation
Init initializes the instance.
func (MPSGraphOperation) InputTensors ¶
func (g MPSGraphOperation) InputTensors() []MPSGraphTensor
The input tensors of the operation.
func (MPSGraphOperation) Name ¶
func (g MPSGraphOperation) Name() string
Name of the operation.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOperation/name
func (MPSGraphOperation) OutputTensors ¶
func (g MPSGraphOperation) OutputTensors() []MPSGraphTensor
The output tensors of the operation.
type MPSGraphOperationClass ¶
type MPSGraphOperationClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphOperationClass ¶
func GetMPSGraphOperationClass() MPSGraphOperationClass
GetMPSGraphOperationClass returns the class object for MPSGraphOperation.
func (MPSGraphOperationClass) Alloc ¶
func (mc MPSGraphOperationClass) Alloc() MPSGraphOperation
Alloc allocates memory for a new instance of the class.
func (MPSGraphOperationClass) Class ¶
func (mc MPSGraphOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphOptimization ¶
type MPSGraphOptimization uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOptimization
const ( // MPSGraphOptimizationLevel0: Graph performs core optimizations only. MPSGraphOptimizationLevel0 MPSGraphOptimization = 0 // MPSGraphOptimizationLevel1: Graph performs additional Optimizations, like using the placement pass to dispatch across different HW blocks like the NeuralEngine and CPU along with the GPU. MPSGraphOptimizationLevel1 MPSGraphOptimization = 1 )
func (MPSGraphOptimization) String ¶
func (e MPSGraphOptimization) String() string
type MPSGraphOptimizationProfile ¶
type MPSGraphOptimizationProfile uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOptimizationProfile
const ( // MPSGraphOptimizationProfilePerformance: Default, graph optimized for performance. MPSGraphOptimizationProfilePerformance MPSGraphOptimizationProfile = 0 // MPSGraphOptimizationProfilePowerEfficiency: Graph optimized for power efficiency. MPSGraphOptimizationProfilePowerEfficiency MPSGraphOptimizationProfile = 1 )
func (MPSGraphOptimizationProfile) String ¶
func (e MPSGraphOptimizationProfile) String() string
type MPSGraphOptions ¶
type MPSGraphOptions uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphOptions
const ( // MPSGraphOptionsDefault: The framework uses these options as default if not overriden. MPSGraphOptionsDefault MPSGraphOptions = 1 // MPSGraphOptionsNone: No Options. MPSGraphOptionsNone MPSGraphOptions = 0 // MPSGraphOptionsSynchronizeResults: The graph synchronizes results to the CPU using a blit encoder if on a discrete GPU at the end of execution. MPSGraphOptionsSynchronizeResults MPSGraphOptions = 1 // MPSGraphOptionsVerbose: The framework prints more logging info. MPSGraphOptionsVerbose MPSGraphOptions = 2 )
func (MPSGraphOptions) String ¶
func (e MPSGraphOptions) String() string
type MPSGraphPaddingMode ¶
type MPSGraphPaddingMode int
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPaddingMode
const ( // MPSGraphPaddingModeAntiPeriodic: Anti Periodic `x[-2] -> -x[L-3]` MPSGraphPaddingModeAntiPeriodic MPSGraphPaddingMode = 6 // MPSGraphPaddingModeClampToEdge: ClampToEdge (PyTorch ReplicationPad) MPSGraphPaddingModeClampToEdge MPSGraphPaddingMode = 3 // MPSGraphPaddingModeConstant: Constant MPSGraphPaddingModeConstant MPSGraphPaddingMode = 0 // MPSGraphPaddingModePeriodic: Periodic `x[-2] -> x[L-3], where L is size of x.` MPSGraphPaddingModePeriodic MPSGraphPaddingMode = 5 // MPSGraphPaddingModeReflect: Reflect MPSGraphPaddingModeReflect MPSGraphPaddingMode = 1 // MPSGraphPaddingModeSymmetric: Symmetric MPSGraphPaddingModeSymmetric MPSGraphPaddingMode = 2 // MPSGraphPaddingModeZero: Zero MPSGraphPaddingModeZero MPSGraphPaddingMode = 4 )
func (MPSGraphPaddingMode) String ¶
func (e MPSGraphPaddingMode) String() string
type MPSGraphPaddingStyle ¶
type MPSGraphPaddingStyle uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPaddingStyle
const ( // MPSGraphPaddingStyleExplicit: Explicit MPSGraphPaddingStyleExplicit MPSGraphPaddingStyle = 0 // MPSGraphPaddingStyleExplicitOffset: TF_VALID MPSGraphPaddingStyleExplicitOffset MPSGraphPaddingStyle = 3 // MPSGraphPaddingStyleONNX_SAME_LOWER: Explicit offsets MPSGraphPaddingStyleONNX_SAME_LOWER MPSGraphPaddingStyle = 4 // MPSGraphPaddingStyleTF_SAME: TF_SAME MPSGraphPaddingStyleTF_SAME MPSGraphPaddingStyle = 2 // MPSGraphPaddingStyleTF_VALID: ONNX_SAME_LOWER MPSGraphPaddingStyleTF_VALID MPSGraphPaddingStyle = 1 )
func (MPSGraphPaddingStyle) String ¶
func (e MPSGraphPaddingStyle) String() string
type MPSGraphPooling2DOpDescriptor ¶
type MPSGraphPooling2DOpDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a 2D pooling operation.
Overview ¶
Use this descriptor with the following methods:
- MPSGraph.MaxPooling2DWithSourceTensorDescriptorName - MPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName - MPSGraph.MaxPooling2DGradientWithGradientTensorSourceTensorDescriptorName - MPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName - MPSGraph.MaxPooling2DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName - MPSGraph.AvgPooling2DWithSourceTensorDescriptorName - MPSGraph.AvgPooling2DGradientWithGradientTensorSourceTensorDescriptorName
Instance Properties ¶
- MPSGraphPooling2DOpDescriptor.CeilMode: Affects how the graph computes the output size.
- MPSGraphPooling2DOpDescriptor.SetCeilMode
- MPSGraphPooling2DOpDescriptor.DataLayout: Defines the data layout of the input data in the forward pass. See: MPSGraphTensorNamedDataLayout(<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorNamedDataLayout>).
- MPSGraphPooling2DOpDescriptor.SetDataLayout
- MPSGraphPooling2DOpDescriptor.DilationRateInX: Defines the dilation rate for the width dimension.
- MPSGraphPooling2DOpDescriptor.SetDilationRateInX
- MPSGraphPooling2DOpDescriptor.DilationRateInY: Defines the dilation rate for the height dimension.
- MPSGraphPooling2DOpDescriptor.SetDilationRateInY
- MPSGraphPooling2DOpDescriptor.IncludeZeroPadToAverage: Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
- MPSGraphPooling2DOpDescriptor.SetIncludeZeroPadToAverage
- MPSGraphPooling2DOpDescriptor.KernelHeight: Defines the pooling window size for the height dimension.
- MPSGraphPooling2DOpDescriptor.SetKernelHeight
- MPSGraphPooling2DOpDescriptor.KernelWidth: Defines the pooling window size for the width dimension.
- MPSGraphPooling2DOpDescriptor.SetKernelWidth
- MPSGraphPooling2DOpDescriptor.PaddingBottom: Defines the explicit padding value for the height dimension to add after the data.
- MPSGraphPooling2DOpDescriptor.SetPaddingBottom
- MPSGraphPooling2DOpDescriptor.PaddingLeft: Defines the explicit padding value for the width dimension to add before the data.
- MPSGraphPooling2DOpDescriptor.SetPaddingLeft
- MPSGraphPooling2DOpDescriptor.PaddingRight: Defines the explicit padding value for the width dimension to add after the data.
- MPSGraphPooling2DOpDescriptor.SetPaddingRight
- MPSGraphPooling2DOpDescriptor.PaddingStyle: Defines what kind of padding graph applies to the operation.
- MPSGraphPooling2DOpDescriptor.SetPaddingStyle
- MPSGraphPooling2DOpDescriptor.PaddingTop: Defines the explicit padding value for the height dimension to add before the data.
- MPSGraphPooling2DOpDescriptor.SetPaddingTop
- MPSGraphPooling2DOpDescriptor.ReturnIndicesDataType: Defines the data type for returned indices. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. Currently MPSGraph supports the following datatypes: [MPSDataTypeInt32]. Default value: [MPSDataTypeInt32].
- MPSGraphPooling2DOpDescriptor.SetReturnIndicesDataType
- MPSGraphPooling2DOpDescriptor.ReturnIndicesMode: Defines the mode for returned indices of maximum values within each pooling window. Use this in conjunction with [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) API. If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result MPSGraph returns from [maxPooling2DReturnIndices(_:descriptor:name:)](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraph/maxPooling2DReturnIndices(_:descriptor:name:)>) will be valid and using the second result will assert. Default value: MPSGraphPoolingReturnIndicesNone.
- MPSGraphPooling2DOpDescriptor.SetReturnIndicesMode
- MPSGraphPooling2DOpDescriptor.StrideInX: Defines the stride for the width dimension.
- MPSGraphPooling2DOpDescriptor.SetStrideInX
- MPSGraphPooling2DOpDescriptor.StrideInY: Defines the stride for the height dimension.
- MPSGraphPooling2DOpDescriptor.SetStrideInY
Instance Methods ¶
- MPSGraphPooling2DOpDescriptor.SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom: Sets the explicit padding values and sets padding style to explicit.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPooling2DOpDescriptor
func MPSGraphPooling2DOpDescriptorFromID ¶
func MPSGraphPooling2DOpDescriptorFromID(id objc.ID) MPSGraphPooling2DOpDescriptor
MPSGraphPooling2DOpDescriptorFromID constructs a MPSGraphPooling2DOpDescriptor from an objc.ID.
The class that defines the parameters for a 2D pooling operation.
func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayout ¶
func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYDilationRateInXDilationRateInYPaddingLeftPaddingRightPaddingTopPaddingBottomPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, dilationRateInX uint, dilationRateInY uint, paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout) MPSGraphPooling2DOpDescriptor
Creates a 2D pooling descriptor with given values.
kernelWidth: See `kernelWidth` property.
kernelHeight: See `kernelHeight` property.
strideInX: See `strideInX` property.
strideInY: See `strideInY` property.
dilationRateInX: See `dilationRateInX` property.
dilationRateInY: See `dilationRateInY` property.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
paddingStyle: See `paddingStyle` property.
dataLayout: See `dataLayout` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout ¶
func NewGraphPooling2DOpDescriptorWithKernelWidthKernelHeightStrideInXStrideInYPaddingStyleDataLayout(kernelWidth uint, kernelHeight uint, strideInX uint, strideInY uint, paddingStyle MPSGraphPaddingStyle, dataLayout MPSGraphTensorNamedDataLayout) MPSGraphPooling2DOpDescriptor
Creates a 2D pooling descriptor with given values.
kernelWidth: See `kernelWidth` property.
kernelHeight: See `kernelHeight“ property.
strideInX: See `strideInX` property.
strideInY: See `strideInY` property.
paddingStyle: See `paddingStyle` property.
dataLayout: See `dataLayout` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewMPSGraphPooling2DOpDescriptor ¶
func NewMPSGraphPooling2DOpDescriptor() MPSGraphPooling2DOpDescriptor
NewMPSGraphPooling2DOpDescriptor creates a new MPSGraphPooling2DOpDescriptor instance.
func (MPSGraphPooling2DOpDescriptor) Autorelease ¶
func (g MPSGraphPooling2DOpDescriptor) Autorelease() MPSGraphPooling2DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphPooling2DOpDescriptor) CeilMode ¶
func (g MPSGraphPooling2DOpDescriptor) CeilMode() bool
Affects how the graph computes the output size.
Discussion ¶
If set to [YES] then output size is computed by rounding up instead of down when dividing input size by stride. Default value: [NO].
func (MPSGraphPooling2DOpDescriptor) DataLayout ¶
func (g MPSGraphPooling2DOpDescriptor) DataLayout() MPSGraphTensorNamedDataLayout
Defines the data layout of the input data in the forward pass. See: MPSGraphTensorNamedDataLayout.
func (MPSGraphPooling2DOpDescriptor) DilationRateInX ¶
func (g MPSGraphPooling2DOpDescriptor) DilationRateInX() uint
Defines the dilation rate for the width dimension.
Discussion ¶
Default value: 1.
func (MPSGraphPooling2DOpDescriptor) DilationRateInY ¶
func (g MPSGraphPooling2DOpDescriptor) DilationRateInY() uint
Defines the dilation rate for the height dimension.
Discussion ¶
Default value: 1.
func (MPSGraphPooling2DOpDescriptor) IncludeZeroPadToAverage ¶
func (g MPSGraphPooling2DOpDescriptor) IncludeZeroPadToAverage() bool
Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
Discussion ¶
Otherwise the result is sum over samples divided by number of samples that didn’t come from padding. Default value: [NO].
func (MPSGraphPooling2DOpDescriptor) Init ¶
func (g MPSGraphPooling2DOpDescriptor) Init() MPSGraphPooling2DOpDescriptor
Init initializes the instance.
func (MPSGraphPooling2DOpDescriptor) KernelHeight ¶
func (g MPSGraphPooling2DOpDescriptor) KernelHeight() uint
Defines the pooling window size for the height dimension.
func (MPSGraphPooling2DOpDescriptor) KernelWidth ¶
func (g MPSGraphPooling2DOpDescriptor) KernelWidth() uint
Defines the pooling window size for the width dimension.
func (MPSGraphPooling2DOpDescriptor) PaddingBottom ¶
func (g MPSGraphPooling2DOpDescriptor) PaddingBottom() uint
Defines the explicit padding value for the height dimension to add after the data.
Discussion ¶
Default value: 0.
func (MPSGraphPooling2DOpDescriptor) PaddingLeft ¶
func (g MPSGraphPooling2DOpDescriptor) PaddingLeft() uint
Defines the explicit padding value for the width dimension to add before the data.
Discussion ¶
Default value: 0.
func (MPSGraphPooling2DOpDescriptor) PaddingRight ¶
func (g MPSGraphPooling2DOpDescriptor) PaddingRight() uint
Defines the explicit padding value for the width dimension to add after the data.
Discussion ¶
Default value: 0.
func (MPSGraphPooling2DOpDescriptor) PaddingStyle ¶
func (g MPSGraphPooling2DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
Defines what kind of padding graph applies to the operation.
Discussion ¶
Default value: MPSGraphPaddingStyleExplicit.
func (MPSGraphPooling2DOpDescriptor) PaddingTop ¶
func (g MPSGraphPooling2DOpDescriptor) PaddingTop() uint
Defines the explicit padding value for the height dimension to add before the data.
Discussion ¶
Default value: 0.
func (MPSGraphPooling2DOpDescriptor) ReturnIndicesDataType ¶
func (g MPSGraphPooling2DOpDescriptor) ReturnIndicesDataType() uint32
Defines the data type for returned indices. Use this in conjunction with MPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName API. Currently MPSGraph supports the following datatypes: [MPSDataTypeInt32]. Default value: [MPSDataTypeInt32].
func (MPSGraphPooling2DOpDescriptor) ReturnIndicesMode ¶
func (g MPSGraphPooling2DOpDescriptor) ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
Defines the mode for returned indices of maximum values within each pooling window. Use this in conjunction with MPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName API. If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result MPSGraph returns from MPSGraph.MaxPooling2DReturnIndicesWithSourceTensorDescriptorName will be valid and using the second result will assert. Default value: MPSGraphPoolingReturnIndicesNone.
func (MPSGraphPooling2DOpDescriptor) SetCeilMode ¶
func (g MPSGraphPooling2DOpDescriptor) SetCeilMode(value bool)
func (MPSGraphPooling2DOpDescriptor) SetDataLayout ¶
func (g MPSGraphPooling2DOpDescriptor) SetDataLayout(value MPSGraphTensorNamedDataLayout)
func (MPSGraphPooling2DOpDescriptor) SetDilationRateInX ¶
func (g MPSGraphPooling2DOpDescriptor) SetDilationRateInX(value uint)
func (MPSGraphPooling2DOpDescriptor) SetDilationRateInY ¶
func (g MPSGraphPooling2DOpDescriptor) SetDilationRateInY(value uint)
func (MPSGraphPooling2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom ¶
func (g MPSGraphPooling2DOpDescriptor) SetExplicitPaddingWithPaddingLeftPaddingRightPaddingTopPaddingBottom(paddingLeft uint, paddingRight uint, paddingTop uint, paddingBottom uint)
Sets the explicit padding values and sets padding style to explicit.
paddingLeft: See `paddingLeft` property.
paddingRight: See `paddingRight` property.
paddingTop: See `paddingTop` property.
paddingBottom: See `paddingBottom` property.
func (MPSGraphPooling2DOpDescriptor) SetIncludeZeroPadToAverage ¶
func (g MPSGraphPooling2DOpDescriptor) SetIncludeZeroPadToAverage(value bool)
func (MPSGraphPooling2DOpDescriptor) SetKernelHeight ¶
func (g MPSGraphPooling2DOpDescriptor) SetKernelHeight(value uint)
func (MPSGraphPooling2DOpDescriptor) SetKernelWidth ¶
func (g MPSGraphPooling2DOpDescriptor) SetKernelWidth(value uint)
func (MPSGraphPooling2DOpDescriptor) SetPaddingBottom ¶
func (g MPSGraphPooling2DOpDescriptor) SetPaddingBottom(value uint)
func (MPSGraphPooling2DOpDescriptor) SetPaddingLeft ¶
func (g MPSGraphPooling2DOpDescriptor) SetPaddingLeft(value uint)
func (MPSGraphPooling2DOpDescriptor) SetPaddingRight ¶
func (g MPSGraphPooling2DOpDescriptor) SetPaddingRight(value uint)
func (MPSGraphPooling2DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphPooling2DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphPooling2DOpDescriptor) SetPaddingTop ¶
func (g MPSGraphPooling2DOpDescriptor) SetPaddingTop(value uint)
func (MPSGraphPooling2DOpDescriptor) SetReturnIndicesDataType ¶
func (g MPSGraphPooling2DOpDescriptor) SetReturnIndicesDataType(value uint32)
func (MPSGraphPooling2DOpDescriptor) SetReturnIndicesMode ¶
func (g MPSGraphPooling2DOpDescriptor) SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
func (MPSGraphPooling2DOpDescriptor) SetStrideInX ¶
func (g MPSGraphPooling2DOpDescriptor) SetStrideInX(value uint)
func (MPSGraphPooling2DOpDescriptor) SetStrideInY ¶
func (g MPSGraphPooling2DOpDescriptor) SetStrideInY(value uint)
func (MPSGraphPooling2DOpDescriptor) StrideInX ¶
func (g MPSGraphPooling2DOpDescriptor) StrideInX() uint
Defines the stride for the width dimension.
Discussion ¶
Default value: 1.
func (MPSGraphPooling2DOpDescriptor) StrideInY ¶
func (g MPSGraphPooling2DOpDescriptor) StrideInY() uint
Defines the stride for the height dimension.
Discussion ¶
Default value: 1.
type MPSGraphPooling2DOpDescriptorClass ¶
type MPSGraphPooling2DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphPooling2DOpDescriptorClass ¶
func GetMPSGraphPooling2DOpDescriptorClass() MPSGraphPooling2DOpDescriptorClass
GetMPSGraphPooling2DOpDescriptorClass returns the class object for MPSGraphPooling2DOpDescriptor.
func (MPSGraphPooling2DOpDescriptorClass) Alloc ¶
func (mc MPSGraphPooling2DOpDescriptorClass) Alloc() MPSGraphPooling2DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphPooling2DOpDescriptorClass) Class ¶
func (mc MPSGraphPooling2DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphPooling4DOpDescriptor ¶
type MPSGraphPooling4DOpDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a 4D pooling operation.
Overview ¶
Use this descriptor with the following methods:
- MPSGraph.MaxPooling4DWithSourceTensorDescriptorName - MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName - MPSGraph.MaxPooling4DGradientWithGradientTensorSourceTensorDescriptorName - MPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeDescriptorName - MPSGraph.MaxPooling4DGradientWithGradientTensorIndicesTensorOutputShapeTensorDescriptorName - MPSGraph.AvgPooling4DWithSourceTensorDescriptorName - MPSGraph.AvgPooling4DGradientWithGradientTensorSourceTensorDescriptorName - MPSGraph.L2NormPooling4DWithSourceTensorDescriptorName - MPSGraph.L2NormPooling4DGradientWithGradientTensorSourceTensorDescriptorName
Instance Properties ¶
- MPSGraphPooling4DOpDescriptor.CeilMode: Affects how MPSGraph computes the output size: if set to [YES] then output size is computed by rounding up instead of down when dividing input size by stride.
- MPSGraphPooling4DOpDescriptor.SetCeilMode
- MPSGraphPooling4DOpDescriptor.DilationRates: Defines dilation rates for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
- MPSGraphPooling4DOpDescriptor.SetDilationRates
- MPSGraphPooling4DOpDescriptor.IncludeZeroPadToAverage: Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
- MPSGraphPooling4DOpDescriptor.SetIncludeZeroPadToAverage
- MPSGraphPooling4DOpDescriptor.KernelSizes: Defines the pooling window size.
- MPSGraphPooling4DOpDescriptor.SetKernelSizes
- MPSGraphPooling4DOpDescriptor.PaddingStyle: Defines what kind of padding graph applies to the operation.
- MPSGraphPooling4DOpDescriptor.SetPaddingStyle
- MPSGraphPooling4DOpDescriptor.PaddingValues: Defines padding values for spatial dimensions which must be eight numbers, two for each spatial dimension.
- MPSGraphPooling4DOpDescriptor.SetPaddingValues
- MPSGraphPooling4DOpDescriptor.ReturnIndicesDataType: Defines the data type for returned indices.
- MPSGraphPooling4DOpDescriptor.SetReturnIndicesDataType
- MPSGraphPooling4DOpDescriptor.ReturnIndicesMode: Defines the mode for returned indices of maximum values within each pooling window.
- MPSGraphPooling4DOpDescriptor.SetReturnIndicesMode
- MPSGraphPooling4DOpDescriptor.Strides: Defines strides for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
- MPSGraphPooling4DOpDescriptor.SetStrides
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphPooling4DOpDescriptor
func MPSGraphPooling4DOpDescriptorFromID ¶
func MPSGraphPooling4DOpDescriptorFromID(id objc.ID) MPSGraphPooling4DOpDescriptor
MPSGraphPooling4DOpDescriptorFromID constructs a MPSGraphPooling4DOpDescriptor from an objc.ID.
The class that defines the parameters for a 4D pooling operation.
func NewGraphPooling4DOpDescriptorWithKernelSizesPaddingStyle ¶
func NewGraphPooling4DOpDescriptorWithKernelSizesPaddingStyle(kernelSizes []foundation.NSNumber, paddingStyle MPSGraphPaddingStyle) MPSGraphPooling4DOpDescriptor
Creates a 4D pooling descriptor with default values.
kernelSizes: See `kernelSizes` property.
paddingStyle: See `paddingStyle` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewGraphPooling4DOpDescriptorWithKernelSizesStridesDilationRatesPaddingValuesPaddingStyle ¶
func NewGraphPooling4DOpDescriptorWithKernelSizesStridesDilationRatesPaddingValuesPaddingStyle(kernelSizes []foundation.NSNumber, strides []foundation.NSNumber, dilationRates []foundation.NSNumber, paddingValues []foundation.NSNumber, paddingStyle MPSGraphPaddingStyle) MPSGraphPooling4DOpDescriptor
Creates a 4D pooling descriptor with given values.
kernelSizes: See `kernelSizes` property.
strides: See `strides` property.
dilationRates: See `dilationRates` property.
paddingValues: See `paddingValues` property.
paddingStyle: See `paddingStyle` property.
Return Value ¶
The descriptor on autoreleasepool.
func NewMPSGraphPooling4DOpDescriptor ¶
func NewMPSGraphPooling4DOpDescriptor() MPSGraphPooling4DOpDescriptor
NewMPSGraphPooling4DOpDescriptor creates a new MPSGraphPooling4DOpDescriptor instance.
func (MPSGraphPooling4DOpDescriptor) Autorelease ¶
func (g MPSGraphPooling4DOpDescriptor) Autorelease() MPSGraphPooling4DOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphPooling4DOpDescriptor) CeilMode ¶
func (g MPSGraphPooling4DOpDescriptor) CeilMode() bool
Affects how MPSGraph computes the output size: if set to [YES] then output size is computed by rounding up instead of down when dividing input size by stride.
Discussion ¶
Default value: [NO].
func (MPSGraphPooling4DOpDescriptor) DilationRates ¶
func (g MPSGraphPooling4DOpDescriptor) DilationRates() []foundation.NSNumber
Defines dilation rates for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
Discussion ¶
Default value: `@[ @1, @1, @1, @1 ]`
func (MPSGraphPooling4DOpDescriptor) IncludeZeroPadToAverage ¶
func (g MPSGraphPooling4DOpDescriptor) IncludeZeroPadToAverage() bool
Defines a mode for average pooling, where samples outside the input tensor count as zeroes in the average computation.
Discussion ¶
Otherwise the result is sum over samples divided by number of samples that didn’t come from padding. Default value: [NO].
func (MPSGraphPooling4DOpDescriptor) Init ¶
func (g MPSGraphPooling4DOpDescriptor) Init() MPSGraphPooling4DOpDescriptor
Init initializes the instance.
func (MPSGraphPooling4DOpDescriptor) KernelSizes ¶
func (g MPSGraphPooling4DOpDescriptor) KernelSizes() []foundation.NSNumber
Defines the pooling window size.
Discussion ¶
Must be four numbers, one for each spatial dimension, fastest running index last.
func (MPSGraphPooling4DOpDescriptor) PaddingStyle ¶
func (g MPSGraphPooling4DOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
Defines what kind of padding graph applies to the operation.
Discussion ¶
Default value: MPSGraphPaddingStyleExplicit.
func (MPSGraphPooling4DOpDescriptor) PaddingValues ¶
func (g MPSGraphPooling4DOpDescriptor) PaddingValues() []foundation.NSNumber
Defines padding values for spatial dimensions which must be eight numbers, two for each spatial dimension.
Discussion ¶
For example `paddingValues[0]` defines the explicit padding amount before the first spatial dimension (slowest running index of spatial dimensions), `paddingValues[1]` defines the padding amount after the first spatial dimension etc. Used only when `paddingStyle = MPSGraphPaddingStyleExplicit`. Default value: `@[ @0, @0, @0, @0, @0, @0, @0, @0 ]`
func (MPSGraphPooling4DOpDescriptor) ReturnIndicesDataType ¶
func (g MPSGraphPooling4DOpDescriptor) ReturnIndicesDataType() uint32
Defines the data type for returned indices.
Discussion ¶
Use this in conjunction with MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName API. Currently MPSGraph supports the following datatypes: [MPSDataTypeInt32]. Default value: [MPSDataTypeInt32].
func (MPSGraphPooling4DOpDescriptor) ReturnIndicesMode ¶
func (g MPSGraphPooling4DOpDescriptor) ReturnIndicesMode() MPSGraphPoolingReturnIndicesMode
Defines the mode for returned indices of maximum values within each pooling window.
Discussion ¶
Use this in conjunction with MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName API. If `returnIndicesMode = MPSGraphPoolingReturnIndicesNone` then only the first result MPSGraph returns from MPSGraph.MaxPooling4DReturnIndicesWithSourceTensorDescriptorName will be valid and using the second result will assert. Default value: MPSGraphPoolingReturnIndicesNone.
func (MPSGraphPooling4DOpDescriptor) SetCeilMode ¶
func (g MPSGraphPooling4DOpDescriptor) SetCeilMode(value bool)
func (MPSGraphPooling4DOpDescriptor) SetDilationRates ¶
func (g MPSGraphPooling4DOpDescriptor) SetDilationRates(value []foundation.NSNumber)
func (MPSGraphPooling4DOpDescriptor) SetIncludeZeroPadToAverage ¶
func (g MPSGraphPooling4DOpDescriptor) SetIncludeZeroPadToAverage(value bool)
func (MPSGraphPooling4DOpDescriptor) SetKernelSizes ¶
func (g MPSGraphPooling4DOpDescriptor) SetKernelSizes(value []foundation.NSNumber)
func (MPSGraphPooling4DOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphPooling4DOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphPooling4DOpDescriptor) SetPaddingValues ¶
func (g MPSGraphPooling4DOpDescriptor) SetPaddingValues(value []foundation.NSNumber)
func (MPSGraphPooling4DOpDescriptor) SetReturnIndicesDataType ¶
func (g MPSGraphPooling4DOpDescriptor) SetReturnIndicesDataType(value uint32)
func (MPSGraphPooling4DOpDescriptor) SetReturnIndicesMode ¶
func (g MPSGraphPooling4DOpDescriptor) SetReturnIndicesMode(value MPSGraphPoolingReturnIndicesMode)
func (MPSGraphPooling4DOpDescriptor) SetStrides ¶
func (g MPSGraphPooling4DOpDescriptor) SetStrides(value []foundation.NSNumber)
func (MPSGraphPooling4DOpDescriptor) Strides ¶
func (g MPSGraphPooling4DOpDescriptor) Strides() []foundation.NSNumber
Defines strides for spatial dimensions. Must be four numbers, one for each spatial dimension, fastest running index last.
Discussion ¶
Default value: `@[ @1, @1, @1, @1 ]`
type MPSGraphPooling4DOpDescriptorClass ¶
type MPSGraphPooling4DOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphPooling4DOpDescriptorClass ¶
func GetMPSGraphPooling4DOpDescriptorClass() MPSGraphPooling4DOpDescriptorClass
GetMPSGraphPooling4DOpDescriptorClass returns the class object for MPSGraphPooling4DOpDescriptor.
func (MPSGraphPooling4DOpDescriptorClass) Alloc ¶
func (mc MPSGraphPooling4DOpDescriptorClass) Alloc() MPSGraphPooling4DOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphPooling4DOpDescriptorClass) Class ¶
func (mc MPSGraphPooling4DOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphPoolingReturnIndicesMode ¶
type MPSGraphPoolingReturnIndicesMode uint
const ( // MPSGraphPoolingReturnIndicesGlobalFlatten1D: Returns indices flattened in inner most (last) dimension. MPSGraphPoolingReturnIndicesGlobalFlatten1D MPSGraphPoolingReturnIndicesMode = 1 // MPSGraphPoolingReturnIndicesGlobalFlatten2D: Returns indices flattened in 2 innermost dimensions. MPSGraphPoolingReturnIndicesGlobalFlatten2D MPSGraphPoolingReturnIndicesMode = 2 // MPSGraphPoolingReturnIndicesGlobalFlatten3D: Returns indices flattened in 3 innernost dimensions. MPSGraphPoolingReturnIndicesGlobalFlatten3D MPSGraphPoolingReturnIndicesMode = 3 // MPSGraphPoolingReturnIndicesGlobalFlatten4D: Returns indices flattened in 4 innermost dimensions. MPSGraphPoolingReturnIndicesGlobalFlatten4D MPSGraphPoolingReturnIndicesMode = 4 // MPSGraphPoolingReturnIndicesLocalFlatten1D: Returns indices within pooling window, flattened in inner most dimension. MPSGraphPoolingReturnIndicesLocalFlatten1D MPSGraphPoolingReturnIndicesMode = 5 // MPSGraphPoolingReturnIndicesLocalFlatten2D: Returns indices within pooling window, flattened in 2 innermost dimensions. MPSGraphPoolingReturnIndicesLocalFlatten2D MPSGraphPoolingReturnIndicesMode = 6 // MPSGraphPoolingReturnIndicesLocalFlatten3D: Returns indices within pooling window, flattened in 3 innernost dimensions. MPSGraphPoolingReturnIndicesLocalFlatten3D MPSGraphPoolingReturnIndicesMode = 7 // MPSGraphPoolingReturnIndicesLocalFlatten4D: Returns indices within pooling window, flattened in 4 innermost dimensions. MPSGraphPoolingReturnIndicesLocalFlatten4D MPSGraphPoolingReturnIndicesMode = 8 // MPSGraphPoolingReturnIndicesNone: No indices returned. MPSGraphPoolingReturnIndicesNone MPSGraphPoolingReturnIndicesMode = 0 )
func (MPSGraphPoolingReturnIndicesMode) String ¶
func (e MPSGraphPoolingReturnIndicesMode) String() string
type MPSGraphRNNActivation ¶
type MPSGraphRNNActivation uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphRNNActivation
const ( // MPSGraphRNNActivationHardSigmoid: Defines a Hard sigmoid activation. MPSGraphRNNActivationHardSigmoid MPSGraphRNNActivation = 4 // MPSGraphRNNActivationNone: Defines a pass through activation. MPSGraphRNNActivationNone MPSGraphRNNActivation = 0 // MPSGraphRNNActivationRelu: Defines a ReLU activation. MPSGraphRNNActivationRelu MPSGraphRNNActivation = 1 // MPSGraphRNNActivationSigmoid: Defines a Sigmoid activation. MPSGraphRNNActivationSigmoid MPSGraphRNNActivation = 3 // MPSGraphRNNActivationTanh: Defines a Tanh activation. MPSGraphRNNActivationTanh MPSGraphRNNActivation = 2 )
func (MPSGraphRNNActivation) String ¶
func (e MPSGraphRNNActivation) String() string
type MPSGraphRandomDistribution ¶
type MPSGraphRandomDistribution uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphRandomDistribution
const ( // MPSGraphRandomDistributionNormal: The normal distribution defined by mean and standard deviation. MPSGraphRandomDistributionNormal MPSGraphRandomDistribution = 1 // MPSGraphRandomDistributionTruncatedNormal: The normal distribution defined by mean and standard deviation, truncated to the range [min, max) MPSGraphRandomDistributionTruncatedNormal MPSGraphRandomDistribution = 2 // MPSGraphRandomDistributionUniform: The uniform distribution, with samples drawn uniformly from [min, max) for float types, and [min, max] for integer types. MPSGraphRandomDistributionUniform MPSGraphRandomDistribution = 0 )
func (MPSGraphRandomDistribution) String ¶
func (e MPSGraphRandomDistribution) String() string
type MPSGraphRandomNormalSamplingMethod ¶
type MPSGraphRandomNormalSamplingMethod uint64
const ( // MPSGraphRandomNormalSamplingBoxMuller: Use Box Muller transform to convert uniform values to values in the normal distribution. MPSGraphRandomNormalSamplingBoxMuller MPSGraphRandomNormalSamplingMethod = 1 // MPSGraphRandomNormalSamplingInvCDF: Use inverse erf to convert uniform values to values in the normal distribution MPSGraphRandomNormalSamplingInvCDF MPSGraphRandomNormalSamplingMethod = 0 )
func (MPSGraphRandomNormalSamplingMethod) String ¶
func (e MPSGraphRandomNormalSamplingMethod) String() string
type MPSGraphRandomOpDescriptor ¶
type MPSGraphRandomOpDescriptor struct {
MPSGraphObject
}
A class that describes the random operation.
Instance Properties ¶
- MPSGraphRandomOpDescriptor.DataType: The data type of the generated result values.
- MPSGraphRandomOpDescriptor.SetDataType
- MPSGraphRandomOpDescriptor.Distribution: The type of distribution to draw samples from. See MPSGraphRandomDistribution.
- MPSGraphRandomOpDescriptor.SetDistribution
- MPSGraphRandomOpDescriptor.Max: The upper range of the distribution.
- MPSGraphRandomOpDescriptor.SetMax
- MPSGraphRandomOpDescriptor.MaxInteger: The upper range of the distribution.
- MPSGraphRandomOpDescriptor.SetMaxInteger
- MPSGraphRandomOpDescriptor.Mean: The mean of the distribution.
- MPSGraphRandomOpDescriptor.SetMean
- MPSGraphRandomOpDescriptor.Min: The lower range of the distribution.
- MPSGraphRandomOpDescriptor.SetMin
- MPSGraphRandomOpDescriptor.MinInteger: The lower range of the distribution.
- MPSGraphRandomOpDescriptor.SetMinInteger
- MPSGraphRandomOpDescriptor.SamplingMethod: The sampling method of the distribution.
- MPSGraphRandomOpDescriptor.SetSamplingMethod
- MPSGraphRandomOpDescriptor.StandardDeviation: The standard deviation of the distribution.
- MPSGraphRandomOpDescriptor.SetStandardDeviation
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphRandomOpDescriptor
func MPSGraphRandomOpDescriptorFromID ¶
func MPSGraphRandomOpDescriptorFromID(id objc.ID) MPSGraphRandomOpDescriptor
MPSGraphRandomOpDescriptorFromID constructs a MPSGraphRandomOpDescriptor from an objc.ID.
A class that describes the random operation.
func NewGraphRandomOpDescriptorWithDistributionDataType ¶
func NewGraphRandomOpDescriptorWithDistributionDataType(distribution MPSGraphRandomDistribution, dataType uint32) MPSGraphRandomOpDescriptor
Class method to initialize a distribution descriptor.
func NewMPSGraphRandomOpDescriptor ¶
func NewMPSGraphRandomOpDescriptor() MPSGraphRandomOpDescriptor
NewMPSGraphRandomOpDescriptor creates a new MPSGraphRandomOpDescriptor instance.
func (MPSGraphRandomOpDescriptor) Autorelease ¶
func (g MPSGraphRandomOpDescriptor) Autorelease() MPSGraphRandomOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphRandomOpDescriptor) DataType ¶
func (g MPSGraphRandomOpDescriptor) DataType() uint32
The data type of the generated result values.
Discussion ¶
When sampling from the uniform distribution, valid types are MPSDataTypeFloat16, MPSDataTypeFloat32, and MPSDataTypeInt32. When sampling from the normal or truncated normal distribution, valid types are MPSDataTypeFloat16 and MPSDataTypeFloat32.
func (MPSGraphRandomOpDescriptor) Distribution ¶
func (g MPSGraphRandomOpDescriptor) Distribution() MPSGraphRandomDistribution
The type of distribution to draw samples from. See MPSGraphRandomDistribution.
func (MPSGraphRandomOpDescriptor) Init ¶
func (g MPSGraphRandomOpDescriptor) Init() MPSGraphRandomOpDescriptor
Init initializes the instance.
func (MPSGraphRandomOpDescriptor) Max ¶
func (g MPSGraphRandomOpDescriptor) Max() float32
The upper range of the distribution.
Discussion ¶
This value is used for Uniform distributions with float data types and Truncated Normal disributions. Defaults to 1 for uniform distributions and 2 for normal distributions.
func (MPSGraphRandomOpDescriptor) MaxInteger ¶
func (g MPSGraphRandomOpDescriptor) MaxInteger() int
The upper range of the distribution.
Discussion ¶
This value is used for Uniform with integer data types Defaults to INT32_MAX for uniform distributions and 0 for normal distributions.
func (MPSGraphRandomOpDescriptor) Mean ¶
func (g MPSGraphRandomOpDescriptor) Mean() float32
The mean of the distribution.
Discussion ¶
This value is used for Normal and Truncated Normal disributions. Defaults to 0.
func (MPSGraphRandomOpDescriptor) Min ¶
func (g MPSGraphRandomOpDescriptor) Min() float32
The lower range of the distribution.
Discussion ¶
This value is used for Uniform distributions with float data types and Truncated Normal disributions. Defaults to 0 for uniform distributions and -2 for normal distributions.
func (MPSGraphRandomOpDescriptor) MinInteger ¶
func (g MPSGraphRandomOpDescriptor) MinInteger() int
The lower range of the distribution.
Discussion ¶
This value is used for Uniform with integer data types Defaults to 0.
func (MPSGraphRandomOpDescriptor) SamplingMethod ¶
func (g MPSGraphRandomOpDescriptor) SamplingMethod() MPSGraphRandomNormalSamplingMethod
The sampling method of the distribution.
Discussion ¶
This value is used for Normal and Truncated Normal disributions. See MPSGraphRandomNormalSamplingMethod. Defaults to MPSGraphRandomNormalSamplingInvCDF.
func (MPSGraphRandomOpDescriptor) SetDataType ¶
func (g MPSGraphRandomOpDescriptor) SetDataType(value uint32)
func (MPSGraphRandomOpDescriptor) SetDistribution ¶
func (g MPSGraphRandomOpDescriptor) SetDistribution(value MPSGraphRandomDistribution)
func (MPSGraphRandomOpDescriptor) SetMax ¶
func (g MPSGraphRandomOpDescriptor) SetMax(value float32)
func (MPSGraphRandomOpDescriptor) SetMaxInteger ¶
func (g MPSGraphRandomOpDescriptor) SetMaxInteger(value int)
func (MPSGraphRandomOpDescriptor) SetMean ¶
func (g MPSGraphRandomOpDescriptor) SetMean(value float32)
func (MPSGraphRandomOpDescriptor) SetMin ¶
func (g MPSGraphRandomOpDescriptor) SetMin(value float32)
func (MPSGraphRandomOpDescriptor) SetMinInteger ¶
func (g MPSGraphRandomOpDescriptor) SetMinInteger(value int)
func (MPSGraphRandomOpDescriptor) SetSamplingMethod ¶
func (g MPSGraphRandomOpDescriptor) SetSamplingMethod(value MPSGraphRandomNormalSamplingMethod)
func (MPSGraphRandomOpDescriptor) SetStandardDeviation ¶
func (g MPSGraphRandomOpDescriptor) SetStandardDeviation(value float32)
func (MPSGraphRandomOpDescriptor) StandardDeviation ¶
func (g MPSGraphRandomOpDescriptor) StandardDeviation() float32
The standard deviation of the distribution.
Discussion ¶
This value is used for Normal and Truncated Normal disributions. For Truncated Normal distribution this defines the standard deviation parameter of the underlying Normal distribution, that is the width of the Gaussian, not the true standard deviation of the truncated distribution which typically differs from the standard deviation of the original Normal distribution. Defaults to 0 for uniform distributions and 1 for normal distributions.
type MPSGraphRandomOpDescriptorClass ¶
type MPSGraphRandomOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphRandomOpDescriptorClass ¶
func GetMPSGraphRandomOpDescriptorClass() MPSGraphRandomOpDescriptorClass
GetMPSGraphRandomOpDescriptorClass returns the class object for MPSGraphRandomOpDescriptor.
func (MPSGraphRandomOpDescriptorClass) Alloc ¶
func (mc MPSGraphRandomOpDescriptorClass) Alloc() MPSGraphRandomOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphRandomOpDescriptorClass) Class ¶
func (mc MPSGraphRandomOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphReducedPrecisionFastMath ¶
type MPSGraphReducedPrecisionFastMath uint
const ( // MPSGraphReducedPrecisionFastMathAllowFP16Conv2DWinogradTransformIntermediate: Execute winograd transform intermediate as FP16. MPSGraphReducedPrecisionFastMathAllowFP16Conv2DWinogradTransformIntermediate MPSGraphReducedPrecisionFastMath = 2 // MPSGraphReducedPrecisionFastMathAllowFP16Intermediates: Curated list allowing intermediates for multi-pass GPU kernels to be FP16. MPSGraphReducedPrecisionFastMathAllowFP16Intermediates MPSGraphReducedPrecisionFastMath = 2 // MPSGraphReducedPrecisionFastMathDefault: Default selection. MPSGraphReducedPrecisionFastMathDefault MPSGraphReducedPrecisionFastMath = 0 // MPSGraphReducedPrecisionFastMathNone: Full precision math with maximum accuracy. MPSGraphReducedPrecisionFastMathNone MPSGraphReducedPrecisionFastMath = 0 )
func (MPSGraphReducedPrecisionFastMath) String ¶
func (e MPSGraphReducedPrecisionFastMath) String() string
type MPSGraphReductionMode ¶
type MPSGraphReductionMode uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphReductionMode
const ( // MPSGraphReductionModeArgumentMax: Argument Max MPSGraphReductionModeArgumentMax MPSGraphReductionMode = 5 // MPSGraphReductionModeArgumentMin: Argument Min MPSGraphReductionModeArgumentMin MPSGraphReductionMode = 4 // MPSGraphReductionModeMax: Max MPSGraphReductionModeMax MPSGraphReductionMode = 1 // MPSGraphReductionModeMin: Min MPSGraphReductionModeMin MPSGraphReductionMode = 0 // MPSGraphReductionModeProduct: Product MPSGraphReductionModeProduct MPSGraphReductionMode = 3 // MPSGraphReductionModeSum: Sum MPSGraphReductionModeSum MPSGraphReductionMode = 2 )
func (MPSGraphReductionMode) String ¶
func (e MPSGraphReductionMode) String() string
type MPSGraphResizeMode ¶
type MPSGraphResizeMode uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphResizeMode
const ( // MPSGraphResizeBilinear: Samples the 4 neighbors to the pixel coordinate and uses bilinear interpolation. MPSGraphResizeBilinear MPSGraphResizeMode = 1 // MPSGraphResizeNearest: Samples the nearest neighbor to the pixel coordinate. MPSGraphResizeNearest MPSGraphResizeMode = 0 )
func (MPSGraphResizeMode) String ¶
func (e MPSGraphResizeMode) String() string
type MPSGraphResizeNearestRoundingMode ¶
type MPSGraphResizeNearestRoundingMode uint
const ( // MPSGraphResizeNearestRoundingModeCeil: Rounds values toward +inf. MPSGraphResizeNearestRoundingModeCeil MPSGraphResizeNearestRoundingMode = 2 // MPSGraphResizeNearestRoundingModeFloor: Rounds values toward -inf. MPSGraphResizeNearestRoundingModeFloor MPSGraphResizeNearestRoundingMode = 3 // MPSGraphResizeNearestRoundingModeRoundPreferCeil: Rounds values to the nearest integer value, with 0.5f offset rounding toward +inf. MPSGraphResizeNearestRoundingModeRoundPreferCeil MPSGraphResizeNearestRoundingMode = 0 // MPSGraphResizeNearestRoundingModeRoundPreferFloor: Rounds values to the nearest integer value, with 0.5f rounding toward -inf. MPSGraphResizeNearestRoundingModeRoundPreferFloor MPSGraphResizeNearestRoundingMode = 1 // MPSGraphResizeNearestRoundingModeRoundToEven: Rounds values to the nearest integer value, with 0.5f rounding toward the closest even value. MPSGraphResizeNearestRoundingModeRoundToEven MPSGraphResizeNearestRoundingMode = 4 // MPSGraphResizeNearestRoundingModeRoundToOdd: Rounds values to the nearest integer value, with 0.5f rounding toward the closest odd value. MPSGraphResizeNearestRoundingModeRoundToOdd MPSGraphResizeNearestRoundingMode = 5 )
func (MPSGraphResizeNearestRoundingMode) String ¶
func (e MPSGraphResizeNearestRoundingMode) String() string
type MPSGraphSDPADescriptor ¶
type MPSGraphSDPADescriptor struct {
MPSGraphObject
}
A descriptor that configures a scaled dot product attention (SDPA) operation.
Overview ¶
Use this descriptor with MPSGraph.ScaledDotProductAttentionWithQueryTensorKeyTensorValueTensorDescriptorName to specify optional features such as an attention mask, causal masking, and attention sinks.
Instance Properties ¶
- MPSGraphSDPADescriptor.IsCausal: When YES, a causal (lower-triangular) mask is applied so that each query position attends only to key positions at or before it. Mutually exclusive with [maskTensor](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/maskTensor>).
- MPSGraphSDPADescriptor.SetIsCausal
- MPSGraphSDPADescriptor.MaskTensor: An optional additive mask tensor applied to the scaled QK^T scores before softmax. Must be broadcast-compatible with shape `[batch, heads, T_q, T_kv]`. Mutually exclusive with [isCausal](<https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/isCausal>).
- MPSGraphSDPADescriptor.SetMaskTensor
- MPSGraphSDPADescriptor.Scale: The scale applied to the result of the query–key matrix multiply before softmax. Typically set to `1/sqrt(headDimension)`.
- MPSGraphSDPADescriptor.SetScale
- MPSGraphSDPADescriptor.SinksTensor: An optional attention-sinks tensor of shape `[nHeads]`. Each element seeds the online-softmax accumulator for the corresponding query head with a virtual token logit, causing real-token attention weights to sum to less than one.
- MPSGraphSDPADescriptor.SetSinksTensor
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor
func MPSGraphSDPADescriptorFromID ¶
func MPSGraphSDPADescriptorFromID(id objc.ID) MPSGraphSDPADescriptor
MPSGraphSDPADescriptorFromID constructs a MPSGraphSDPADescriptor from an objc.ID.
A descriptor that configures a scaled dot product attention (SDPA) operation.
func NewGraphSDPADescriptorWithScale ¶
func NewGraphSDPADescriptorWithScale(scale float32) MPSGraphSDPADescriptor
Creates a descriptor with the given scale and all other properties set to their defaults (no mask, isCausal = NO, no sinks).
func NewMPSGraphSDPADescriptor ¶
func NewMPSGraphSDPADescriptor() MPSGraphSDPADescriptor
NewMPSGraphSDPADescriptor creates a new MPSGraphSDPADescriptor instance.
func (MPSGraphSDPADescriptor) Autorelease ¶
func (g MPSGraphSDPADescriptor) Autorelease() MPSGraphSDPADescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphSDPADescriptor) Init ¶
func (g MPSGraphSDPADescriptor) Init() MPSGraphSDPADescriptor
Init initializes the instance.
func (MPSGraphSDPADescriptor) IsCausal ¶
func (g MPSGraphSDPADescriptor) IsCausal() bool
When YES, a causal (lower-triangular) mask is applied so that each query position attends only to key positions at or before it. Mutually exclusive with MPSGraphSDPADescriptor.MaskTensor.
func (MPSGraphSDPADescriptor) MaskTensor ¶
func (g MPSGraphSDPADescriptor) MaskTensor() IMPSGraphTensor
An optional additive mask tensor applied to the scaled QK^T scores before softmax. Must be broadcast-compatible with shape `[batch, heads, T_q, T_kv]`. Mutually exclusive with MPSGraphSDPADescriptor.IsCausal.
func (MPSGraphSDPADescriptor) Scale ¶
func (g MPSGraphSDPADescriptor) Scale() float32
The scale applied to the result of the query–key matrix multiply before softmax. Typically set to `1/sqrt(headDimension)`.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/scale
func (MPSGraphSDPADescriptor) SetIsCausal ¶
func (g MPSGraphSDPADescriptor) SetIsCausal(value bool)
func (MPSGraphSDPADescriptor) SetMaskTensor ¶
func (g MPSGraphSDPADescriptor) SetMaskTensor(value IMPSGraphTensor)
func (MPSGraphSDPADescriptor) SetScale ¶
func (g MPSGraphSDPADescriptor) SetScale(value float32)
func (MPSGraphSDPADescriptor) SetSinksTensor ¶
func (g MPSGraphSDPADescriptor) SetSinksTensor(value IMPSGraphTensor)
func (MPSGraphSDPADescriptor) SinksTensor ¶
func (g MPSGraphSDPADescriptor) SinksTensor() IMPSGraphTensor
An optional attention-sinks tensor of shape `[nHeads]`. Each element seeds the online-softmax accumulator for the corresponding query head with a virtual token logit, causing real-token attention weights to sum to less than one.
type MPSGraphSDPADescriptorClass ¶
type MPSGraphSDPADescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphSDPADescriptorClass ¶
func GetMPSGraphSDPADescriptorClass() MPSGraphSDPADescriptorClass
GetMPSGraphSDPADescriptorClass returns the class object for MPSGraphSDPADescriptor.
func (MPSGraphSDPADescriptorClass) Alloc ¶
func (mc MPSGraphSDPADescriptorClass) Alloc() MPSGraphSDPADescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphSDPADescriptorClass) Class ¶
func (mc MPSGraphSDPADescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphScatterMode ¶
type MPSGraphScatterMode int
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphScatterMode
const ( // MPSGraphScatterModeAdd: Add MPSGraphScatterModeAdd MPSGraphScatterMode = 0 // MPSGraphScatterModeDiv: Divide MPSGraphScatterModeDiv MPSGraphScatterMode = 3 // MPSGraphScatterModeMax: Maximum MPSGraphScatterModeMax MPSGraphScatterMode = 5 // MPSGraphScatterModeMin: Minimum MPSGraphScatterModeMin MPSGraphScatterMode = 4 // MPSGraphScatterModeMul: Multiply MPSGraphScatterModeMul MPSGraphScatterMode = 2 // MPSGraphScatterModeSet: Set MPSGraphScatterModeSet MPSGraphScatterMode = 6 // MPSGraphScatterModeSub: Sub MPSGraphScatterModeSub MPSGraphScatterMode = 1 )
func (MPSGraphScatterMode) String ¶
func (e MPSGraphScatterMode) String() string
type MPSGraphScheduledHandler ¶
type MPSGraphScheduledHandler = func(resultsDictionary foundation.INSDictionary, error_ foundation.NSError)
MPSGraphScheduledHandler is a notification that appears when graph execution schedules.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphScheduledHandler
type MPSGraphShapedType ¶
type MPSGraphShapedType struct {
MPSGraphType
}
The shaped type class for types on tensors with a shape and data type.
Initializers ¶
- MPSGraphShapedType.InitWithShapeDataType: Initializes a shaped type.
Instance Properties ¶
- MPSGraphShapedType.DataType: The data type of the shaped type.
- MPSGraphShapedType.SetDataType
- MPSGraphShapedType.Shape: The Shape of the shaped type.
- MPSGraphShapedType.SetShape
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType
func MPSGraphShapedTypeFromID ¶
func MPSGraphShapedTypeFromID(id objc.ID) MPSGraphShapedType
MPSGraphShapedTypeFromID constructs a MPSGraphShapedType from an objc.ID.
The shaped type class for types on tensors with a shape and data type.
func NewGraphShapedTypeWithShapeDataType ¶
func NewGraphShapedTypeWithShapeDataType(shape foundation.NSArray, dataType uint32) MPSGraphShapedType
Initializes a shaped type.
shape: The shape of the shaped type.
dataType: The dataType of the shaped type.
Return Value ¶
A valid MPSGraphShapedType, or nil if allocation failure.
func NewMPSGraphShapedType ¶
func NewMPSGraphShapedType() MPSGraphShapedType
NewMPSGraphShapedType creates a new MPSGraphShapedType instance.
func (MPSGraphShapedType) Autorelease ¶
func (g MPSGraphShapedType) Autorelease() MPSGraphShapedType
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphShapedType) DataType ¶
func (g MPSGraphShapedType) DataType() uint32
The data type of the shaped type.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType/dataType
func (MPSGraphShapedType) Init ¶
func (g MPSGraphShapedType) Init() MPSGraphShapedType
Init initializes the instance.
func (MPSGraphShapedType) InitWithShapeDataType ¶
func (g MPSGraphShapedType) InitWithShapeDataType(shape foundation.NSArray, dataType uint32) MPSGraphShapedType
Initializes a shaped type.
shape: The shape of the shaped type.
dataType: The dataType of the shaped type.
Return Value ¶
A valid MPSGraphShapedType, or nil if allocation failure.
func (MPSGraphShapedType) SetDataType ¶
func (g MPSGraphShapedType) SetDataType(value uint32)
func (MPSGraphShapedType) SetShape ¶
func (g MPSGraphShapedType) SetShape(value foundation.NSArray)
func (MPSGraphShapedType) Shape ¶
func (g MPSGraphShapedType) Shape() foundation.NSArray
The Shape of the shaped type.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphShapedType/shape
type MPSGraphShapedTypeClass ¶
type MPSGraphShapedTypeClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphShapedTypeClass ¶
func GetMPSGraphShapedTypeClass() MPSGraphShapedTypeClass
GetMPSGraphShapedTypeClass returns the class object for MPSGraphShapedType.
func (MPSGraphShapedTypeClass) Alloc ¶
func (mc MPSGraphShapedTypeClass) Alloc() MPSGraphShapedType
Alloc allocates memory for a new instance of the class.
func (MPSGraphShapedTypeClass) Class ¶
func (mc MPSGraphShapedTypeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphSingleGateRNNDescriptor ¶
type MPSGraphSingleGateRNNDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a single gate RNN operation.
Overview ¶
Use this descriptor with the following MPSGraph methods:
- MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInitStateDescriptorName - MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateDescriptorName - MPSGraph.SingleGateRNNWithSourceTensorRecurrentWeightInputWeightBiasInitStateMaskDescriptorName - MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInitStateDescriptorName - MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateDescriptorName - MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateInputWeightBiasInitStateMaskDescriptorName - MPSGraph.SingleGateRNNGradientsWithSourceTensorRecurrentWeightSourceGradientZStateStateGradientInputWeightBiasInitStateMaskDescriptorName
Instance Properties ¶
- MPSGraphSingleGateRNNDescriptor.Activation: A parameter that defines the activation function to use with the RNN operation.
- MPSGraphSingleGateRNNDescriptor.SetActivation
- MPSGraphSingleGateRNNDescriptor.Bidirectional: A parameter that defines a bidirectional RNN layer.
- MPSGraphSingleGateRNNDescriptor.SetBidirectional
- MPSGraphSingleGateRNNDescriptor.Reverse: A parameter that defines time direction of the input sequence.
- MPSGraphSingleGateRNNDescriptor.SetReverse
- MPSGraphSingleGateRNNDescriptor.Training: A parameter that makes the RNN layer support training.
- MPSGraphSingleGateRNNDescriptor.SetTraining
func MPSGraphSingleGateRNNDescriptorFromID ¶
func MPSGraphSingleGateRNNDescriptorFromID(id objc.ID) MPSGraphSingleGateRNNDescriptor
MPSGraphSingleGateRNNDescriptorFromID constructs a MPSGraphSingleGateRNNDescriptor from an objc.ID.
The class that defines the parameters for a single gate RNN operation.
func NewMPSGraphSingleGateRNNDescriptor ¶
func NewMPSGraphSingleGateRNNDescriptor() MPSGraphSingleGateRNNDescriptor
NewMPSGraphSingleGateRNNDescriptor creates a new MPSGraphSingleGateRNNDescriptor instance.
func (MPSGraphSingleGateRNNDescriptor) Activation ¶
func (g MPSGraphSingleGateRNNDescriptor) Activation() MPSGraphRNNActivation
A parameter that defines the activation function to use with the RNN operation.
Discussion ¶
Default value: MPSGraphRNNActivationRelu.
func (MPSGraphSingleGateRNNDescriptor) Autorelease ¶
func (g MPSGraphSingleGateRNNDescriptor) Autorelease() MPSGraphSingleGateRNNDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphSingleGateRNNDescriptor) Bidirectional ¶
func (g MPSGraphSingleGateRNNDescriptor) Bidirectional() bool
A parameter that defines a bidirectional RNN layer.
Discussion ¶
If set to [YES] then the input sequence is traversed in both directions and the two results are concatenated together on the channel-axis. Default value: [NO].
func (MPSGraphSingleGateRNNDescriptor) Init ¶
func (g MPSGraphSingleGateRNNDescriptor) Init() MPSGraphSingleGateRNNDescriptor
Init initializes the instance.
func (MPSGraphSingleGateRNNDescriptor) Reverse ¶
func (g MPSGraphSingleGateRNNDescriptor) Reverse() bool
A parameter that defines time direction of the input sequence.
Discussion ¶
If set to [YES] then the input sequence is passed in reverse time order to the layer. Note: Ignored when `bidirectional = YES`. Default value: [NO].
func (MPSGraphSingleGateRNNDescriptor) SetActivation ¶
func (g MPSGraphSingleGateRNNDescriptor) SetActivation(value MPSGraphRNNActivation)
func (MPSGraphSingleGateRNNDescriptor) SetBidirectional ¶
func (g MPSGraphSingleGateRNNDescriptor) SetBidirectional(value bool)
func (MPSGraphSingleGateRNNDescriptor) SetReverse ¶
func (g MPSGraphSingleGateRNNDescriptor) SetReverse(value bool)
func (MPSGraphSingleGateRNNDescriptor) SetTraining ¶
func (g MPSGraphSingleGateRNNDescriptor) SetTraining(value bool)
func (MPSGraphSingleGateRNNDescriptor) Training ¶
func (g MPSGraphSingleGateRNNDescriptor) Training() bool
A parameter that makes the RNN layer support training.
Discussion ¶
If set to [YES] then the layer will produce training state tensor as a secondary output. Default value: [NO].
type MPSGraphSingleGateRNNDescriptorClass ¶
type MPSGraphSingleGateRNNDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphSingleGateRNNDescriptorClass ¶
func GetMPSGraphSingleGateRNNDescriptorClass() MPSGraphSingleGateRNNDescriptorClass
GetMPSGraphSingleGateRNNDescriptorClass returns the class object for MPSGraphSingleGateRNNDescriptor.
func (MPSGraphSingleGateRNNDescriptorClass) Alloc ¶
func (mc MPSGraphSingleGateRNNDescriptorClass) Alloc() MPSGraphSingleGateRNNDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphSingleGateRNNDescriptorClass) Class ¶
func (mc MPSGraphSingleGateRNNDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (MPSGraphSingleGateRNNDescriptorClass) Descriptor ¶
func (_MPSGraphSingleGateRNNDescriptorClass MPSGraphSingleGateRNNDescriptorClass) Descriptor() MPSGraphSingleGateRNNDescriptor
Creates a single gate RNN descriptor with default values.
type MPSGraphSparseStorageType ¶
type MPSGraphSparseStorageType uint64
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphSparseStorageType
const ( // MPSGraphSparseStorageCOO: COO Storage MPSGraphSparseStorageCOO MPSGraphSparseStorageType = 0 // MPSGraphSparseStorageCSC: CSC Storage MPSGraphSparseStorageCSC MPSGraphSparseStorageType = 1 // MPSGraphSparseStorageCSR: CSR Storage MPSGraphSparseStorageCSR MPSGraphSparseStorageType = 2 )
func (MPSGraphSparseStorageType) String ¶
func (e MPSGraphSparseStorageType) String() string
type MPSGraphStencilOpDescriptor ¶
type MPSGraphStencilOpDescriptor struct {
MPSGraphObject
}
The class that defines the parameters for a stencil operation.
Overview ¶
Use this descriptor with the following MPSGraph method:
- MPSGraph.StencilWithSourceTensorWeightsTensorDescriptorName
Instance Properties ¶
- MPSGraphStencilOpDescriptor.BoundaryMode: The property that determines which values to use for padding the input tensor.
- MPSGraphStencilOpDescriptor.SetBoundaryMode
- MPSGraphStencilOpDescriptor.DilationRates: The property that defines dilation rates for spatial dimensions.
- MPSGraphStencilOpDescriptor.SetDilationRates
- MPSGraphStencilOpDescriptor.ExplicitPadding: The property that defines padding values for spatial dimensions.
- MPSGraphStencilOpDescriptor.SetExplicitPadding
- MPSGraphStencilOpDescriptor.Offsets: An array of length four that determines from which offset to start reading the input tensor.
- MPSGraphStencilOpDescriptor.SetOffsets
- MPSGraphStencilOpDescriptor.PaddingConstant: The padding value for `boundaryMode = MPSGraphPaddingModeConstant`.
- MPSGraphStencilOpDescriptor.SetPaddingConstant
- MPSGraphStencilOpDescriptor.PaddingStyle: The property that defines what kind of padding to apply to the stencil operation.
- MPSGraphStencilOpDescriptor.SetPaddingStyle
- MPSGraphStencilOpDescriptor.ReductionMode: The reduction mode to use within the stencil window.
- MPSGraphStencilOpDescriptor.SetReductionMode
- MPSGraphStencilOpDescriptor.Strides: The property that defines strides for spatial dimensions.
- MPSGraphStencilOpDescriptor.SetStrides
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphStencilOpDescriptor
func MPSGraphStencilOpDescriptorFromID ¶
func MPSGraphStencilOpDescriptorFromID(id objc.ID) MPSGraphStencilOpDescriptor
MPSGraphStencilOpDescriptorFromID constructs a MPSGraphStencilOpDescriptor from an objc.ID.
The class that defines the parameters for a stencil operation.
func NewGraphStencilOpDescriptorWithExplicitPadding ¶
func NewGraphStencilOpDescriptorWithExplicitPadding(explicitPadding foundation.NSArray) MPSGraphStencilOpDescriptor
Creates a stencil operation descriptor with default values.
explicitPadding: See `explicitPadding` property.
Return Value ¶
A valid MPSGraphStencilOpDescriptor object ¶
func NewGraphStencilOpDescriptorWithOffsetsExplicitPadding ¶
func NewGraphStencilOpDescriptorWithOffsetsExplicitPadding(offsets foundation.NSArray, explicitPadding foundation.NSArray) MPSGraphStencilOpDescriptor
Creates a stencil operation descriptor with default values.
offsets: See `offsets` property.
explicitPadding: See `explicitPadding` property.
Return Value ¶
A valid MPSGraphStencilOpDescriptor object ¶
func NewGraphStencilOpDescriptorWithPaddingStyle ¶
func NewGraphStencilOpDescriptorWithPaddingStyle(paddingStyle MPSGraphPaddingStyle) MPSGraphStencilOpDescriptor
Creates a stencil operation descriptor with default values.
paddingStyle: See `paddingStyle` property.
Return Value ¶
A valid MPSGraphStencilOpDescriptor object ¶
func NewGraphStencilOpDescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant ¶
func NewGraphStencilOpDescriptorWithReductionModeOffsetsStridesDilationRatesExplicitPaddingBoundaryModePaddingStylePaddingConstant(reductionMode MPSGraphReductionMode, offsets foundation.NSArray, strides foundation.NSArray, dilationRates foundation.NSArray, explicitPadding foundation.NSArray, boundaryMode MPSGraphPaddingMode, paddingStyle MPSGraphPaddingStyle, paddingConstant float32) MPSGraphStencilOpDescriptor
Creates a stencil operation descriptor with given values.
reductionMode: See `reductionMode` property.
offsets: See `offsets` property.
strides: See `strides` property.
dilationRates: See `dilationRates` property.
explicitPadding: See `explicitPadding` property.
boundaryMode: See `boundaryMode` property.
paddingStyle: See `paddingStyle` property.
paddingConstant: See `paddingConstant` property.
Return Value ¶
A valid MPSGraphStencilOpDescriptor object ¶
func NewMPSGraphStencilOpDescriptor ¶
func NewMPSGraphStencilOpDescriptor() MPSGraphStencilOpDescriptor
NewMPSGraphStencilOpDescriptor creates a new MPSGraphStencilOpDescriptor instance.
func (MPSGraphStencilOpDescriptor) Autorelease ¶
func (g MPSGraphStencilOpDescriptor) Autorelease() MPSGraphStencilOpDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphStencilOpDescriptor) BoundaryMode ¶
func (g MPSGraphStencilOpDescriptor) BoundaryMode() MPSGraphPaddingMode
The property that determines which values to use for padding the input tensor.
Discussion ¶
Default value: MPSGraphPaddingModeZero.
func (MPSGraphStencilOpDescriptor) DilationRates ¶
func (g MPSGraphStencilOpDescriptor) DilationRates() foundation.NSArray
The property that defines dilation rates for spatial dimensions.
Discussion ¶
Must be four numbers, one for each spatial dimension, fastest running index last. Default value: `@[ @1, @1, @1, @1 ]`
func (MPSGraphStencilOpDescriptor) ExplicitPadding ¶
func (g MPSGraphStencilOpDescriptor) ExplicitPadding() foundation.NSArray
The property that defines padding values for spatial dimensions.
Discussion ¶
Must be eight numbers, two for each spatial dimension. For example `paddingValues[0]` defines the explicit padding amount before the first spatial dimension (slowest running index of spatial dimensions), `paddingValues[1]` defines the padding amount after the first spatial dimension etc. Used only when `paddingStyle = MPSGraphPaddingStyleExplicit`. Default value: `@[ @0, @0, @0, @0, @0, @0, @0, @0 ]`
func (MPSGraphStencilOpDescriptor) Init ¶
func (g MPSGraphStencilOpDescriptor) Init() MPSGraphStencilOpDescriptor
Init initializes the instance.
func (MPSGraphStencilOpDescriptor) Offsets ¶
func (g MPSGraphStencilOpDescriptor) Offsets() foundation.NSArray
An array of length four that determines from which offset to start reading the input tensor.
Discussion ¶
Only used when `paddingStyle` is MPSGraphPaddingStyleExplicitOffset. For example zero offset means that the first stencil window will align its top-left corner (in 4 dimensions) to the top-left corner of the input tensor. Default value: `@[ @0, @0, @0, @0 ]`
func (MPSGraphStencilOpDescriptor) PaddingConstant ¶
func (g MPSGraphStencilOpDescriptor) PaddingConstant() float32
The padding value for `boundaryMode = MPSGraphPaddingModeConstant`.
Discussion ¶
Default value: 0.
func (MPSGraphStencilOpDescriptor) PaddingStyle ¶
func (g MPSGraphStencilOpDescriptor) PaddingStyle() MPSGraphPaddingStyle
The property that defines what kind of padding to apply to the stencil operation.
Discussion ¶
Default value: MPSGraphPaddingStyleExplicit.
func (MPSGraphStencilOpDescriptor) ReductionMode ¶
func (g MPSGraphStencilOpDescriptor) ReductionMode() MPSGraphReductionMode
The reduction mode to use within the stencil window.
Discussion ¶
Default value: MPSGraphReductionModeSum.
func (MPSGraphStencilOpDescriptor) SetBoundaryMode ¶
func (g MPSGraphStencilOpDescriptor) SetBoundaryMode(value MPSGraphPaddingMode)
func (MPSGraphStencilOpDescriptor) SetDilationRates ¶
func (g MPSGraphStencilOpDescriptor) SetDilationRates(value foundation.NSArray)
func (MPSGraphStencilOpDescriptor) SetExplicitPadding ¶
func (g MPSGraphStencilOpDescriptor) SetExplicitPadding(value foundation.NSArray)
func (MPSGraphStencilOpDescriptor) SetOffsets ¶
func (g MPSGraphStencilOpDescriptor) SetOffsets(value foundation.NSArray)
func (MPSGraphStencilOpDescriptor) SetPaddingConstant ¶
func (g MPSGraphStencilOpDescriptor) SetPaddingConstant(value float32)
func (MPSGraphStencilOpDescriptor) SetPaddingStyle ¶
func (g MPSGraphStencilOpDescriptor) SetPaddingStyle(value MPSGraphPaddingStyle)
func (MPSGraphStencilOpDescriptor) SetReductionMode ¶
func (g MPSGraphStencilOpDescriptor) SetReductionMode(value MPSGraphReductionMode)
func (MPSGraphStencilOpDescriptor) SetStrides ¶
func (g MPSGraphStencilOpDescriptor) SetStrides(value foundation.NSArray)
func (MPSGraphStencilOpDescriptor) Strides ¶
func (g MPSGraphStencilOpDescriptor) Strides() foundation.NSArray
The property that defines strides for spatial dimensions.
Discussion ¶
Must be four numbers, one for each spatial dimension, fastest running index last. Default value: `@[ @1, @1, @1, @1 ]`
type MPSGraphStencilOpDescriptorClass ¶
type MPSGraphStencilOpDescriptorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphStencilOpDescriptorClass ¶
func GetMPSGraphStencilOpDescriptorClass() MPSGraphStencilOpDescriptorClass
GetMPSGraphStencilOpDescriptorClass returns the class object for MPSGraphStencilOpDescriptor.
func (MPSGraphStencilOpDescriptorClass) Alloc ¶
func (mc MPSGraphStencilOpDescriptorClass) Alloc() MPSGraphStencilOpDescriptor
Alloc allocates memory for a new instance of the class.
func (MPSGraphStencilOpDescriptorClass) Class ¶
func (mc MPSGraphStencilOpDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphTensor ¶
type MPSGraphTensor struct {
MPSGraphObject
}
The symbolic representation of a compute data type.
Overview ¶
[NSCopy] will take a refrence, this is so [NSDictionary] can work with the tensor. All tensors are created, owned and destroyed by the MPSGraph
Instance Properties ¶
- MPSGraphTensor.DataType: The data type of the tensor.
- MPSGraphTensor.Operation: The operation responsible for creating this tensor.
- MPSGraphTensor.Shape: The shape of the tensor.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensor
func MPSGraphTensorFromID ¶
func MPSGraphTensorFromID(id objc.ID) MPSGraphTensor
MPSGraphTensorFromID constructs a MPSGraphTensor from an objc.ID.
The symbolic representation of a compute data type.
func NewMPSGraphTensor ¶
func NewMPSGraphTensor() MPSGraphTensor
NewMPSGraphTensor creates a new MPSGraphTensor instance.
func (MPSGraphTensor) Autorelease ¶
func (g MPSGraphTensor) Autorelease() MPSGraphTensor
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphTensor) DataType ¶
func (g MPSGraphTensor) DataType() uint32
The data type of the tensor.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensor/dataType
func (MPSGraphTensor) Init ¶
func (g MPSGraphTensor) Init() MPSGraphTensor
Init initializes the instance.
func (MPSGraphTensor) Operation ¶
func (g MPSGraphTensor) Operation() IMPSGraphOperation
The operation responsible for creating this tensor.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensor/operation
func (MPSGraphTensor) Shape ¶
func (g MPSGraphTensor) Shape() foundation.NSArray
The shape of the tensor.
Discussion ¶
Nil shape represents an unranked tensor. -1 value for a dimension represents that it will be resolved via shape inference at runtime and it can be anything.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensor/shape
type MPSGraphTensorArrayHandler ¶
type MPSGraphTensorArrayHandler = func(*[]MPSGraphTensor) []MPSGraphTensor
MPSGraphTensorArrayHandler handles `afterBlock`, this will execute after the condition evaluation.
Used by:
- [MPSGraph.WhileWithInitialInputsBeforeAfterName]
type MPSGraphTensorClass ¶
type MPSGraphTensorClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphTensorClass ¶
func GetMPSGraphTensorClass() MPSGraphTensorClass
GetMPSGraphTensorClass returns the class object for MPSGraphTensor.
func (MPSGraphTensorClass) Alloc ¶
func (mc MPSGraphTensorClass) Alloc() MPSGraphTensor
Alloc allocates memory for a new instance of the class.
func (MPSGraphTensorClass) Class ¶
func (mc MPSGraphTensorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphTensorData ¶
type MPSGraphTensorData struct {
MPSGraphObject
}
The representation of a compute data type.
Overview ¶
Pass data to a graph using a tensor data, a reference will be taken to your data and used just in time when the graph is run.
Initializers ¶
- MPSGraphTensorData.InitWithMPSMatrix: Initializes a tensor data with an MPS matrix.
- MPSGraphTensorData.InitWithMPSNDArray: Initializes an MPSGraphTensorData with an MPS ndarray.
- MPSGraphTensorData.InitWithMPSImageBatch: Initializes a tensor data with an MPS image batch.
- MPSGraphTensorData.InitWithMTLTensor: Initializes an MPSGraphTensorData with an MTLTensor.
- MPSGraphTensorData.InitWithMPSVector: Initializes a tensor data with an MPS vector.
- MPSGraphTensorData.InitWithMPSVectorRank: Initializes a tensor data with an MPS vector enforcing rank of the result.
- MPSGraphTensorData.InitWithMPSMatrixRank: Initializes a tensor data with an MPS matrix enforcing rank of the result.
- MPSGraphTensorData.InitWithMTLBufferShapeDataType: Initializes an tensor data with a metal buffer.
- MPSGraphTensorData.InitWithMTLBufferShapeDataTypeRowBytes: Initializes an tensor data with a metal buffer.
- MPSGraphTensorData.InitWithDeviceDataShapeDataType: Initializes the tensor data with an [NSData] on a device.
Instance Properties ¶
- MPSGraphTensorData.DataType: The data type of the tensor data.
- MPSGraphTensorData.Device: The device of the tensor data.
- MPSGraphTensorData.Shape: The shape of the tensor data.
Instance Methods ¶
- MPSGraphTensorData.Mpsndarray: Return an mpsndarray object will copy contents if the contents are not stored in an MPS ndarray.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData
func MPSGraphTensorDataFromID ¶
func MPSGraphTensorDataFromID(id objc.ID) MPSGraphTensorData
MPSGraphTensorDataFromID constructs a MPSGraphTensorData from an objc.ID.
The representation of a compute data type.
func NewGraphTensorDataWithDeviceDataShapeDataType ¶
func NewGraphTensorDataWithDeviceDataShapeDataType(device IMPSGraphDevice, data foundation.NSData, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
Initializes the tensor data with an [NSData] on a device.
device: MPSDevice on which the MPSGraphTensorData exists
data: NSData from which to copy the contents
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
func NewGraphTensorDataWithMPSImageBatch ¶
func NewGraphTensorDataWithMPSImageBatch(imageBatch foundation.NSArray) MPSGraphTensorData
Initializes a tensor data with an MPS image batch.
imageBatch: The device on which the kernel will run, unorm8 and unorm16 images will create a float32 tensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The dataLayout used will be NHWC, call a transpose or permute to change to a layout of your choice.
func NewGraphTensorDataWithMPSMatrix ¶
func NewGraphTensorDataWithMPSMatrix(matrix *metalperformanceshaders.MPSMatrix) MPSGraphTensorData
Initializes a tensor data with an MPS matrix.
matrix: MPSMatrix to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSMatrix will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMPSMatrixRank ¶
func NewGraphTensorDataWithMPSMatrixRank(matrix *metalperformanceshaders.MPSMatrix, rank uint) MPSGraphTensorData
Initializes a tensor data with an MPS matrix enforcing rank of the result.
matrix: MPSMatrix to be used within the MPSGraphTensorData
rank: The rank of the resulting TensorData tensor. NOTE: must be within { 1, … ,16 }.
Return Value ¶
A valid MPSGraphTensorData of given rank, or nil if allocation failure.
Discussion ¶
The device of the MPSMatrix will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMPSNDArray ¶
func NewGraphTensorDataWithMPSNDArray(ndarray *metalperformanceshaders.MPSNDArray) MPSGraphTensorData
Initializes an MPSGraphTensorData with an MPS ndarray.
ndarray: MPSNDArray to be used within the MPSGraphTensorData.
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSNDArray will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMPSVector ¶
func NewGraphTensorDataWithMPSVector(vector *metalperformanceshaders.MPSVector) MPSGraphTensorData
Initializes a tensor data with an MPS vector.
vector: MPSVector to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSVector will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMPSVectorRank ¶
func NewGraphTensorDataWithMPSVectorRank(vector *metalperformanceshaders.MPSVector, rank uint) MPSGraphTensorData
Initializes a tensor data with an MPS vector enforcing rank of the result.
vector: MPSVector to be used within the MPSGraphTensorData
rank: The rank of the resulting TensorData tensor. NOTE: must be within { 1, … ,16 }.
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSVector will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMTLBufferShapeDataType ¶
func NewGraphTensorDataWithMTLBufferShapeDataType(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
Initializes an tensor data with a metal buffer.
buffer: MTLBuffer to be used within the MPSGraphTensorData
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MTLBuffer will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMTLBufferShapeDataTypeRowBytes ¶
func NewGraphTensorDataWithMTLBufferShapeDataTypeRowBytes(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32, rowBytes uint) MPSGraphTensorData
Initializes an tensor data with a metal buffer.
buffer: MTLBuffer to be used within the MPSGraphTensorData
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
rowBytes: rowBytes for the fastest moving dimension, must be larger than or equal to sizeOf(dataType)shape[rank - 1] and must be a multiple of sizeOf(dataType)
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MTLBuffer will be used to get the MPSDevice for this MPSGraphTensorData.
func NewGraphTensorDataWithMTLTensor ¶
func NewGraphTensorDataWithMTLTensor(tensor metal.MTLTensor) MPSGraphTensorData
Initializes an MPSGraphTensorData with an MTLTensor.
tensor: MTLTensor to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The internal storage of the MTLTensor will be aliased. Requires tensor to support MTLTensorUsageMachineLearning.
func NewMPSGraphTensorData ¶
func NewMPSGraphTensorData() MPSGraphTensorData
NewMPSGraphTensorData creates a new MPSGraphTensorData instance.
func (MPSGraphTensorData) Autorelease ¶
func (g MPSGraphTensorData) Autorelease() MPSGraphTensorData
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphTensorData) DataType ¶
func (g MPSGraphTensorData) DataType() uint32
The data type of the tensor data.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData/dataType
func (MPSGraphTensorData) Device ¶
func (g MPSGraphTensorData) Device() IMPSGraphDevice
The device of the tensor data.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData/device
func (MPSGraphTensorData) Init ¶
func (g MPSGraphTensorData) Init() MPSGraphTensorData
Init initializes the instance.
func (MPSGraphTensorData) InitWithDeviceDataShapeDataType ¶
func (g MPSGraphTensorData) InitWithDeviceDataShapeDataType(device IMPSGraphDevice, data foundation.NSData, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
Initializes the tensor data with an [NSData] on a device.
device: MPSDevice on which the MPSGraphTensorData exists
data: NSData from which to copy the contents
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
func (MPSGraphTensorData) InitWithMPSImageBatch ¶
func (g MPSGraphTensorData) InitWithMPSImageBatch(imageBatch foundation.NSArray) MPSGraphTensorData
Initializes a tensor data with an MPS image batch.
imageBatch: The device on which the kernel will run, unorm8 and unorm16 images will create a float32 tensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The dataLayout used will be NHWC, call a transpose or permute to change to a layout of your choice.
func (MPSGraphTensorData) InitWithMPSMatrix ¶
func (g MPSGraphTensorData) InitWithMPSMatrix(matrix *metalperformanceshaders.MPSMatrix) MPSGraphTensorData
Initializes a tensor data with an MPS matrix.
matrix: MPSMatrix to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSMatrix will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMPSMatrixRank ¶
func (g MPSGraphTensorData) InitWithMPSMatrixRank(matrix *metalperformanceshaders.MPSMatrix, rank uint) MPSGraphTensorData
Initializes a tensor data with an MPS matrix enforcing rank of the result.
matrix: MPSMatrix to be used within the MPSGraphTensorData
rank: The rank of the resulting TensorData tensor. NOTE: must be within { 1, … ,16 }.
Return Value ¶
A valid MPSGraphTensorData of given rank, or nil if allocation failure.
Discussion ¶
The device of the MPSMatrix will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMPSNDArray ¶
func (g MPSGraphTensorData) InitWithMPSNDArray(ndarray *metalperformanceshaders.MPSNDArray) MPSGraphTensorData
Initializes an MPSGraphTensorData with an MPS ndarray.
ndarray: MPSNDArray to be used within the MPSGraphTensorData.
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSNDArray will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMPSVector ¶
func (g MPSGraphTensorData) InitWithMPSVector(vector *metalperformanceshaders.MPSVector) MPSGraphTensorData
Initializes a tensor data with an MPS vector.
vector: MPSVector to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSVector will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMPSVectorRank ¶
func (g MPSGraphTensorData) InitWithMPSVectorRank(vector *metalperformanceshaders.MPSVector, rank uint) MPSGraphTensorData
Initializes a tensor data with an MPS vector enforcing rank of the result.
vector: MPSVector to be used within the MPSGraphTensorData
rank: The rank of the resulting TensorData tensor. NOTE: must be within { 1, … ,16 }.
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MPSVector will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMTLBufferShapeDataType ¶
func (g MPSGraphTensorData) InitWithMTLBufferShapeDataType(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32) MPSGraphTensorData
Initializes an tensor data with a metal buffer.
buffer: MTLBuffer to be used within the MPSGraphTensorData
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MTLBuffer will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMTLBufferShapeDataTypeRowBytes ¶
func (g MPSGraphTensorData) InitWithMTLBufferShapeDataTypeRowBytes(buffer metal.MTLBuffer, shape foundation.NSArray, dataType uint32, rowBytes uint) MPSGraphTensorData
Initializes an tensor data with a metal buffer.
buffer: MTLBuffer to be used within the MPSGraphTensorData
shape: Shape of the output tensor
dataType: dataType of the placeholder tensor
rowBytes: rowBytes for the fastest moving dimension, must be larger than or equal to sizeOf(dataType)shape[rank - 1] and must be a multiple of sizeOf(dataType)
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The device of the MTLBuffer will be used to get the MPSDevice for this MPSGraphTensorData.
func (MPSGraphTensorData) InitWithMTLTensor ¶
func (g MPSGraphTensorData) InitWithMTLTensor(tensor metal.MTLTensor) MPSGraphTensorData
Initializes an MPSGraphTensorData with an MTLTensor.
tensor: MTLTensor to be used within the MPSGraphTensorData
Return Value ¶
A valid MPSGraphTensorData, or nil if allocation failure.
Discussion ¶
The internal storage of the MTLTensor will be aliased. Requires tensor to support MTLTensorUsageMachineLearning.
func (MPSGraphTensorData) Mpsndarray ¶
func (g MPSGraphTensorData) Mpsndarray() metalperformanceshaders.MPSNDArray
Return an mpsndarray object will copy contents if the contents are not stored in an MPS ndarray.
Return Value ¶
A valid MPSNDArray, or nil if allocation fails.
func (MPSGraphTensorData) Shape ¶
func (g MPSGraphTensorData) Shape() foundation.NSArray
The shape of the tensor data.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorData/shape
type MPSGraphTensorDataArrayErrorHandler ¶
type MPSGraphTensorDataArrayErrorHandler = func(*[]MPSGraphTensorData, error)
MPSGraphTensorDataArrayErrorHandler is the signature for a completion handler block.
type MPSGraphTensorDataClass ¶
type MPSGraphTensorDataClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphTensorDataClass ¶
func GetMPSGraphTensorDataClass() MPSGraphTensorDataClass
GetMPSGraphTensorDataClass returns the class object for MPSGraphTensorData.
func (MPSGraphTensorDataClass) Alloc ¶
func (mc MPSGraphTensorDataClass) Alloc() MPSGraphTensorData
Alloc allocates memory for a new instance of the class.
func (MPSGraphTensorDataClass) Class ¶
func (mc MPSGraphTensorDataClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphTensorDataDictionary ¶
type MPSGraphTensorDataDictionary = foundation.INSDictionary
MPSGraphTensorDataDictionary is a dictionary of tensors and corresponding tensor data.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorDataDictionary
type MPSGraphTensorMPSGraphTensorArrayHandler ¶
type MPSGraphTensorMPSGraphTensorArrayHandler = func(*MPSGraphTensor, *[]MPSGraphTensor) []MPSGraphTensor
MPSGraphTensorMPSGraphTensorArrayHandler handles This block will execute the body of the for loop.
Used by:
- [MPSGraph.ForLoopWithLowerBoundUpperBoundStepInitialBodyArgumentsBodyName]
- [MPSGraph.ForLoopWithNumberOfIterationsInitialBodyArgumentsBodyName]
type MPSGraphTensorMPSGraphTensorDataDictionaryErrorHandler ¶
type MPSGraphTensorMPSGraphTensorDataDictionaryErrorHandler = func(*foundation.INSDictionary, error)
MPSGraphTensorMPSGraphTensorDataDictionaryErrorHandler is the signature for a completion handler block.
type MPSGraphTensorNamedDataLayout ¶
type MPSGraphTensorNamedDataLayout uint
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphTensorNamedDataLayout
const ( // MPSGraphTensorNamedDataLayoutCHW: LayoutCHW MPSGraphTensorNamedDataLayoutCHW MPSGraphTensorNamedDataLayout = 4 // MPSGraphTensorNamedDataLayoutDHWIO: LayoutDHWIO MPSGraphTensorNamedDataLayoutDHWIO MPSGraphTensorNamedDataLayout = 10 // MPSGraphTensorNamedDataLayoutHW: LayoutHW MPSGraphTensorNamedDataLayoutHW MPSGraphTensorNamedDataLayout = 6 // MPSGraphTensorNamedDataLayoutHWC: LayoutHWC MPSGraphTensorNamedDataLayoutHWC MPSGraphTensorNamedDataLayout = 5 // MPSGraphTensorNamedDataLayoutHWIO: LayoutHWIO MPSGraphTensorNamedDataLayoutHWIO MPSGraphTensorNamedDataLayout = 3 // MPSGraphTensorNamedDataLayoutNCDHW: LayoutNCDHW MPSGraphTensorNamedDataLayoutNCDHW MPSGraphTensorNamedDataLayout = 7 // MPSGraphTensorNamedDataLayoutNCHW: LayoutNCHW MPSGraphTensorNamedDataLayoutNCHW MPSGraphTensorNamedDataLayout = 0 // MPSGraphTensorNamedDataLayoutNDHWC: LayoutNDHWC MPSGraphTensorNamedDataLayoutNDHWC MPSGraphTensorNamedDataLayout = 8 // MPSGraphTensorNamedDataLayoutNHWC: LayoutNHWC MPSGraphTensorNamedDataLayoutNHWC MPSGraphTensorNamedDataLayout = 1 // MPSGraphTensorNamedDataLayoutOIDHW: LayoutOIDHW MPSGraphTensorNamedDataLayoutOIDHW MPSGraphTensorNamedDataLayout = 9 // MPSGraphTensorNamedDataLayoutOIHW: LayoutOIHW MPSGraphTensorNamedDataLayoutOIHW MPSGraphTensorNamedDataLayout = 2 )
func (MPSGraphTensorNamedDataLayout) String ¶
func (e MPSGraphTensorNamedDataLayout) String() string
type MPSGraphTensorShapedTypeDictionary ¶
type MPSGraphTensorShapedTypeDictionary = foundation.INSDictionary
MPSGraphTensorShapedTypeDictionary is a dictionary of tensors and corresponding shapes for them.
type MPSGraphTensorVoidHandler ¶
type MPSGraphTensorVoidHandler = func() []MPSGraphTensor
MPSGraphTensorVoidHandler handles MPSGraphControlFlowDependencyBlock which is provided by caller to create dependent ops
Used by:
- [MPSGraph.ControlDependencyWithOperationsDependentBlockName]
- [MPSGraph.IfWithPredicateTensorThenBlockElseBlockName]
- [MPSGraph.WhileWithInitialInputsBeforeAfterName]
type MPSGraphType ¶
type MPSGraphType struct {
MPSGraphObject
}
The base type class for types on tensors.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphType
func MPSGraphTypeFromID ¶
func MPSGraphTypeFromID(id objc.ID) MPSGraphType
MPSGraphTypeFromID constructs a MPSGraphType from an objc.ID.
The base type class for types on tensors.
func NewMPSGraphType ¶
func NewMPSGraphType() MPSGraphType
NewMPSGraphType creates a new MPSGraphType instance.
func (MPSGraphType) Autorelease ¶
func (g MPSGraphType) Autorelease() MPSGraphType
Autorelease adds the receiver to the current autorelease pool.
type MPSGraphTypeClass ¶
type MPSGraphTypeClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphTypeClass ¶
func GetMPSGraphTypeClass() MPSGraphTypeClass
GetMPSGraphTypeClass returns the class object for MPSGraphType.
func (MPSGraphTypeClass) Alloc ¶
func (mc MPSGraphTypeClass) Alloc() MPSGraphType
Alloc allocates memory for a new instance of the class.
func (MPSGraphTypeClass) Class ¶
func (mc MPSGraphTypeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphVariableOp ¶
type MPSGraphVariableOp struct {
MPSGraphOperation
}
The class that defines the parameters for a variable.
Instance Properties ¶
- MPSGraphVariableOp.DataType: The data type of the variable.
- MPSGraphVariableOp.Shape: The shape of the variable.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphVariableOp
func MPSGraphVariableOpFromID ¶
func MPSGraphVariableOpFromID(id objc.ID) MPSGraphVariableOp
MPSGraphVariableOpFromID constructs a MPSGraphVariableOp from an objc.ID.
The class that defines the parameters for a variable.
func NewMPSGraphVariableOp ¶
func NewMPSGraphVariableOp() MPSGraphVariableOp
NewMPSGraphVariableOp creates a new MPSGraphVariableOp instance.
func (MPSGraphVariableOp) Autorelease ¶
func (g MPSGraphVariableOp) Autorelease() MPSGraphVariableOp
Autorelease adds the receiver to the current autorelease pool.
func (MPSGraphVariableOp) DataType ¶
func (g MPSGraphVariableOp) DataType() uint32
The data type of the variable.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphVariableOp/dataType
func (MPSGraphVariableOp) Init ¶
func (g MPSGraphVariableOp) Init() MPSGraphVariableOp
Init initializes the instance.
func (MPSGraphVariableOp) Shape ¶
func (g MPSGraphVariableOp) Shape() foundation.NSArray
The shape of the variable.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphVariableOp/shape
type MPSGraphVariableOpClass ¶
type MPSGraphVariableOpClass struct {
// contains filtered or unexported fields
}
func GetMPSGraphVariableOpClass ¶
func GetMPSGraphVariableOpClass() MPSGraphVariableOpClass
GetMPSGraphVariableOpClass returns the class object for MPSGraphVariableOp.
func (MPSGraphVariableOpClass) Alloc ¶
func (mc MPSGraphVariableOpClass) Alloc() MPSGraphVariableOp
Alloc allocates memory for a new instance of the class.
func (MPSGraphVariableOpClass) Class ¶
func (mc MPSGraphVariableOpClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type MPSGraphWhileAfterBlock ¶
type MPSGraphWhileAfterBlock = func(bodyBlockArguments []MPSGraphTensor) []MPSGraphTensor
MPSGraphWhileAfterBlock is the block that executes after the condition evaluates for each iteration.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphWhileAfterBlock
type MPSGraphWhileBeforeBlock ¶
type MPSGraphWhileBeforeBlock = func(inputTensors []MPSGraphTensor, resultTensors foundation.INSArray) MPSGraphTensor
MPSGraphWhileBeforeBlock is the block that executes before the condition evaluates for each iteration.
See: https://developer.apple.com/documentation/MetalPerformanceShadersGraph/MPSGraphWhileBeforeBlock
Source Files
¶
- blocks.gen.go
- doc.gen.go
- enums.gen.go
- functions.gen.go
- generate.go
- mps_graph.gen.go
- mps_graph_compilation_descriptor.gen.go
- mps_graph_convolution2_d_op_descriptor.gen.go
- mps_graph_convolution3_d_op_descriptor.gen.go
- mps_graph_create_sparse_op_descriptor.gen.go
- mps_graph_depthwise_convolution2_d_op_descriptor.gen.go
- mps_graph_depthwise_convolution3_d_op_descriptor.gen.go
- mps_graph_device.gen.go
- mps_graph_executable.gen.go
- mps_graph_executable_execution_descriptor.gen.go
- mps_graph_executable_serialization_descriptor.gen.go
- mps_graph_execution_descriptor.gen.go
- mps_graph_fft_descriptor.gen.go
- mps_graph_gru_descriptor.gen.go
- mps_graph_im_to_col_op_descriptor.gen.go
- mps_graph_lstm_descriptor.gen.go
- mps_graph_object.gen.go
- mps_graph_operation.gen.go
- mps_graph_pooling2_d_op_descriptor.gen.go
- mps_graph_pooling4_d_op_descriptor.gen.go
- mps_graph_random_op_descriptor.gen.go
- mps_graph_sdpa_descriptor.gen.go
- mps_graph_shaped_type.gen.go
- mps_graph_single_gate_rnn_descriptor.gen.go
- mps_graph_stencil_op_descriptor.gen.go
- mps_graph_tensor.gen.go
- mps_graph_tensor_data.gen.go
- mps_graph_type.gen.go
- mps_graph_variable_op.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go