Contents

transpose(_:permutation:name:)

Creates a permutation operation and returns the result tensor.

Declaration

func transpose(_ tensor: MPSGraphTensor, permutation: [NSNumber], name: String?) -> MPSGraphTensor

Parameters

  • 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.