---
title: shape
framework: coreml
role: symbol
role_heading: Instance Property
path: coreml/mltensor/shape
---

# shape

The shape of the tensor.

## Declaration

```swift
var shape: [Int] { get }
```

## Discussion

Discussion For example, 2 x 3 matrix may be represented as a tensor with the shape of [2, 3].

## See Also

### Accessing tensor properties

- [isScalar](coreml/mltensor/isscalar.md)
- [rank](coreml/mltensor/rank.md)
- [scalarCount](coreml/mltensor/scalarcount.md)
- [scalarType](coreml/mltensor/scalartype.md)
