# mlx.core.squeeze — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.squeeze

mlx.core.squeeze(a: array, /, axis: Union[ None , int , List[ int ]] = None, *, stream: Union[ None , Stream , Device ] = None) → array

  Remove length one axes from an array.

  Parameters:

    - a (array) – Input array.

    - axis (int or tuple ( int ), optional) – Axes to remove. Defaults

    - removed. (to `None` in which case all size one axes are) –

  Returns:

    The output array with size one axes removed.

  Return type:

    array