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

# squeezingShape()

Removes all dimensions of size 1 from the shape of the tensor.

## Declaration

```swift
func squeezingShape() -> MLTensor
```

## Discussion

Discussion For example: let x = MLTensor(shape: [1, 2, 1], scalars: [1, 2], scalarType: Float.self) let y = x.squeezingShape() y.shape // is [2]

## See Also

### Removing dimensions from the shape of the tensor

- [squeezingShape(at:)](coreml/mltensor/squeezingshape(at:).md)
