<!--
{
  "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/bandPart(_:numLowerTensor:numUpperTensor:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal Performance Shaders Graph",
      "MetalPerformanceShadersGraph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraph(im)bandPartWithTensor:numLowerTensor:numUpperTensor:name:"
  },
  "title" : "bandPart(_:numLowerTensor:numUpperTensor:name:)"
}
-->

# bandPart(_:numLowerTensor:numUpperTensor:name:)

Creates the band part operation and returns the result.

```
func bandPart(_ inputTensor: MPSGraphTensor, numLowerTensor: MPSGraphTensor, numUpperTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

`inputTensor`

The source tensor to copy.

`numLowerTensor`

Scalar Int32 tensor. The number of diagonals in the lower triangle to keep. If -1, keep all.

`numUpperTensor`

Scalar Int32 tensor. The number of diagonals in the upper triangle to keep. If -1, keep all.

`name`

The name for the operation.

## Return Value

A valid MPSGraphTensor object.

## Discussion

See above discussion of bandPartWithTensor: numLower: numUpper: name:

---

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)