<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 12.3.0 -",
    "tvOS: 15.4.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraph/split(_:numSplits:axis:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)splitTensor:numSplits:axis:name:"
  },
  "title" : "split(_:numSplits:axis:name:)"
}
-->

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

Creates a split operation and returns the result tensor.

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)