triton.language.squeeze

triton.language.squeeze(x, dim: constexpr)

Removes a length-1 dimension from x at index dim.

The selected dimension must have length 1 (checked at compile time). This is the inverse of unsqueeze().

Parameters:
  • x – the input tensor

  • dim (int) – the index of the dimension to remove