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

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

Creates a split operation and returns the result tensor.

## Declaration

```swift
func split(_ tensor: MPSGraphTensor, splitSizes: [NSNumber], axis: Int, name: String?) -> [MPSGraphTensor]
```

## Parameters

- `tensor`: The input tensor.
- `splitSizes`: The lengths of the result tensors along the split axis.
- `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 multiple result tensors of size determined by splitSizes. Requires that the sum of splitSizes is equal to the lenth of the input along axis.
