<!--
{
  "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/MTLTensorReferenceType/dimensions",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLTensorReferenceType(py)dimensions"
  },
  "title" : "dimensions"
}
-->

# dimensions

The array of sizes, in elements, one for each dimension of this tensor.

```
var dimensions: MTLTensorExtents? { get }
```

## Discussion

For shader-bound tensors with dynamic extents, the [`rank`](/documentation/Metal/MTLTensorExtents/rank) of `dimensions` corresponds to the rank the shader
function specifies, and [`extentAtDimensionIndex:`](/documentation/Metal/MTLTensorExtents/extentAtDimensionIndex:) always returns a value of -1.

---

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)