Contents

getBytes(_:strides:sliceOrigin:sliceDimensions:)

Copies the data corresponding to a slice of this tensor into a pointer you provide.

Declaration

func getBytes(_ bytes: UnsafeMutableRawPointer, strides: MTLTensorExtents, sliceOrigin: MTLTensorExtents, sliceDimensions: MTLTensorExtents)

Parameters

  • bytes:

    A pointer to bytes of data that this method copies into the slice you specify with sliceOrigin and sliceDimensions.

  • strides:

    An array of strides, in elements, that describes the layout of the data in bytes. You are responsible for ensuring strides meets the following requirements:

    • Elements of stridesare in monotonically non-decreasing order.

    • For any i larger than zero, strides[i] is greater than or equal to strides[i-1] * dimensions[i-1].

  • sliceOrigin:

    An array of offsets, in elements, to the first element of the slice that this method reads data from.

  • sliceDimensions:

    An array of sizes, in elements, of the slice this method reads data from.