<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLTensorUsage/compute",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLTensorUsage@MTLTensorUsageCompute"
  },
  "title" : "compute"
}
-->

# compute

A tensor context that applies to compute encoders.

```
static var compute: MTLTensorUsage { get }
```

## Discussion

You can use tensors with this context in [`MTL4ComputeCommandEncoder`](/documentation/Metal/MTL4ComputeCommandEncoder) or [`MTLComputeCommandEncoder`](/documentation/Metal/MTLComputeCommandEncoder) instances.

---

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)