---
title: squeezingShape()
framework: coreml
role: symbol
role_heading: Instance Method
path: coreml/mlshapedarray/squeezingshape()
---

# squeezingShape()

Returns a new squeezed shaped array.

## Declaration

```swift
func squeezingShape() -> MLShapedArray<Scalar>
```

## Discussion

Discussion The new shape removes 1s in the original shape. let original = MLShapedArray<Int32>(scalars: 0..., shape: [1, 2, 1, 2]) let squeezed = original.squeezingShape() squeezed.shape // [2, 2] When all the dimensions of the original shape is one, the resultant shaped array is a scalar. let original = MLShapedArray<Int32>(scalars: 42, shape: [1, 1]) let squeezed = original.squeezingShape() squeezed.scalar // 42

## See Also

### Shaping the array

- [changingLayout(to:)](coreml/mlshapedarray/changinglayout(to:).md)
- [expandingShape(at:)](coreml/mlshapedarray/expandingshape(at:).md)
- [reshaped(to:)](coreml/mlshapedarray/reshaped(to:).md)
- [transposed()](coreml/mlshapedarray/transposed().md)
- [transposed(permutation:)](coreml/mlshapedarray/transposed(permutation:).md)
