<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShadersGraph",
  "identifier" : "/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/maskTensor",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal Performance Shaders Graph"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSGraphSDPADescriptor(py)maskTensor"
  },
  "title" : "maskTensor"
}
-->

# maskTensor

An optional additive mask tensor applied to the scaled QK^T scores before softmax.
Must be broadcast-compatible with shape `[batch, heads, T_q, T_kv]`.
Mutually exclusive with [`isCausal`](/documentation/MetalPerformanceShadersGraph/MPSGraphSDPADescriptor/isCausal).

```
var maskTensor: MPSGraphTensor? { get set }
```

---

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)