IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

squeeze_shape_gpu

def squeeze_shape_gpu[dtype: DType, indices_type: DType](output: MutPointer[Scalar[dtype]], output_stride: Int, input: ImmPointer[Scalar[dtype]], input_stride: Int, remove_indices: ImmPointer[Scalar[indices_type]], remove_indices_stride: Int, num_input_dims: Int, num_remove_indices: Int, ctx: DeviceContext)

Removes the dimensions at remove_indices from a GPU shape vector.

Parameters:

  • ​dtype (DType): Element type of the input and output shape vectors.
  • ​indices_type (DType): Element type of the indices.

Args:

  • ​output (MutPointer[Scalar[dtype]]): The output shape vector, num_input_dims - num_remove_indices entries long.
  • ​output_stride (Int): Stride between output entries, in elements.
  • ​input (ImmPointer[Scalar[dtype]]): The input shape vector.
  • ​input_stride (Int): Stride between input entries, in elements.
  • ​remove_indices (ImmPointer[Scalar[indices_type]]): The dimensions to remove, possibly negative.
  • ​remove_indices_stride (Int): Stride between indices, in elements.
  • ​num_input_dims (Int): Length of the input shape vector.
  • ​num_remove_indices (Int): Number of indices.
  • ​ctx (DeviceContext): Device context to launch on.

Raises:

If the kernel launch fails.

Was this page helpful?