copy(from:sourceOrigin:sourceDimensions:to:destinationOrigin:destinationDimensions:)
Encodes a command to copy data from a slice of one tensor into a slice of another tensor.
Declaration
func copy(from sourceTensor: any MTLTensor, sourceOrigin: MTLTensorExtents, sourceDimensions: MTLTensorExtents, to destinationTensor: any MTLTensor, destinationOrigin: MTLTensorExtents, destinationDimensions: MTLTensorExtents)Parameters
- sourceTensor:
A tensor instance that this command copies data from.
- sourceOrigin:
An array of offsets, in elements, to the first element of the slice of
sourceTensorthat this command copies data from. - sourceDimensions:
An array of sizes, in elements, of the slice
sourceTensorthat this command copies data from. - destinationTensor:
A tensor instance that this command copies data to.
- destinationOrigin:
An array of offsets, in elements, to the first element of the slice of
destinationTensorthat this command copies data to. - destinationDimensions:
An array of sizes, in elements, of the slice of
destinationTensorthat this command copies data to.
Discussion
This command applies reshapes if sourceTensor and destinationTensor are not aliasable.