---
title: shape
framework: coreai
role: symbol
role_heading: Instance Property
path: coreai/ndarraydescriptor/shape
---

# shape

The length of each dimension of the array.

## Declaration

```swift
var shape: [Int]
```

## Discussion

Discussion The shape contains rank elements. A value of -1 in any dimension indicates a dynamic size.

## See Also

### Inspecting descriptor properties

- [scalarType](coreai/ndarraydescriptor/scalartype.md)
- [rank](coreai/ndarraydescriptor/rank.md)
- [hasDynamicShape](coreai/ndarraydescriptor/hasdynamicshape.md)
