---
title: rank
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtltensorextents/rank
---

# rank

Obtains the rank of the tensor.

## Declaration

```swift
var rank: Int { get }
```

## Discussion

Discussion The rank represents the number of dimensions.
