triton.language.unsqueeze

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

Inserts a length-1 dimension into x at index dim.

This is the inverse of squeeze() and is equivalent to expand_dims().

Parameters:
  • x – the input tensor

  • dim (int) – the index at which the new dimension is inserted