---
title: "expandingShape(at:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mlshapedarray/expandingshape(at:)"
---

# expandingShape(at:)

Returns a new shaped array with expanded dimensions.

## Declaration

```swift
func expandingShape(at axis: Int) -> MLShapedArray<Scalar>
```

## Discussion

Discussion The shape of the new MLShapedArray gets a new dimension of 1 at the specified axis index. let original = MLShapedArray<Int32>(scalars: 0..., shape: [2, 3]) let expanded = original.expandingShape(at: 0) expanded.shape // [1, 2, 3]

## See Also

### Shaping the array

- [changingLayout(to:)](coreml/mlshapedarray/changinglayout(to:).md)
- [reshaped(to:)](coreml/mlshapedarray/reshaped(to:).md)
- [squeezingShape()](coreml/mlshapedarray/squeezingshape().md)
- [transposed()](coreml/mlshapedarray/transposed().md)
- [transposed(permutation:)](coreml/mlshapedarray/transposed(permutation:).md)
