Contents

reshape(withMTL4CommandEncoder:sourceArray:shape:destinationArray:)

Declaration

func reshape(withMTL4CommandEncoder encoder: any MTL4ComputeCommandEncoder, sourceArray: MPSNDArray, shape: [NSNumber], destinationArray: MPSNDArray)

Parameters

  • encoder:

    The MTL4ComputeCommandEncoder to encode the kernel with.

  • sourceArray:

    The source NDArray.

  • shape:

    The new shape in Tensorflow dimension order.

  • destinationArray:

    The destination NDArray. The shape of destinationArray must match shape.

Discussion

Encode a reshape operation. The encoder associates the commands with MTLStageDispatch. Synchronize your workloads against this stage when using this function to prevent race conditions.