Contents

split(_:numSplits:axis:name:)

Creates a split operation and returns the result tensor.

Declaration

func split(_ tensor: MPSGraphTensor, numSplits: Int, axis: Int, name: String?) -> [MPSGraphTensor]

Parameters

  • tensor:

    The input tensor.

  • numSplits:

    The number of result tensors to split to.

  • axis:

    The dimension along which MPSGraph splits the input tensor.

  • name:

    The name for the operation.

Return Value

A valid MPSGraphTensor object.

Discussion

Splits the input tensor along axis into numsplits result tensors of equal size. Requires that the lenth of the input along axis is divisible by numSplits.