---
title: "squeeze(_:axesTensor:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/squeeze(_:axestensor:name:)"
---

# squeeze(_:axesTensor:name:)

Creates a squeeze operation and returns the result tensor.

## Declaration

```swift
func squeeze(_ tensor: MPSGraphTensor, axesTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `axesTensor`: The tensor containing the axes to squeeze.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object

## Discussion

Discussion Squeezes the tensor, removing dimensions with size 1 at specified axes. The size of the input tensor must be 1 at all specified axes.
