replace(sliceOrigin:sliceDimensions:withBytes:strides:)
Replaces the contents of a slice of this tensor with data you provide.
Declaration
func replace(sliceOrigin: MTLTensorExtents, sliceDimensions: MTLTensorExtents, withBytes bytes: UnsafeRawPointer, strides: MTLTensorExtents)Parameters
- sliceOrigin:
An array of offsets, in elements, to the first element of the slice that this method writes data to.
- sliceDimensions:
An array of sizes, in elements, of the slice this method writes data to.
- bytes:
A pointer to bytes of data that this method copies into the slice you specify with
sliceOriginandsliceDimensions. - strides:
An array of strides, in elements, that describes the layout of the data in
bytes. You are responsible for ensuringstridesmeets the following requirements:Elements of
stridesare in monotonically non-decreasing order.For any
ilarger than zero,strides[i]is greater than or equal tostrides[i-1] * dimensions[i-1].