---
title: "split(_:numSplits:axis:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/split(_:numsplits:axis:name:)"
---

# split(_:numSplits:axis:name:)

Creates a split operation and returns the result tensor.

## Declaration

```swift
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

Return Value A valid MPSGraphTensor object.

## Discussion

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.
