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

# expandingShape(at:)

Returns a new shaped array with expanded dimensions

## Declaration

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

## Discussion

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

## See Also

### Shaping the array slice

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