Skip to main content

Mojo function

coord_to_int_tuple

coord_to_int_tuple[*element_types: CoordLike](value: Coord[element_types]) -> IntTuple

Convert a Coord to an IntTuple, preserving the nested structure.

This function recursively traverses the Coord and converts each element:

  • Value elements (ComptimeInt, RuntimeInt) become integer values in the IntTuple
  • Tuple elements (nested Coord) become nested IntTuples

Parameters:

  • โ€‹*element_types (CoordLike): The variadic pack of element types in the Coord.

Args:

  • โ€‹value (Coord): The Coord to convert.

Returns:

IntTuple: An IntTuple with the same structure and values as the input Coord.

coord_to_int_tuple[*element_types: CoordLike]() -> IntTuple

Convert a Coord to an IntTuple, preserving the nested structure.

This function recursively traverses the Coord and converts each element:

  • Value elements (ComptimeInt, RuntimeInt) become integer values in the IntTuple
  • Tuple elements (nested Coord) become nested IntTuples

Parameters:

  • โ€‹*element_types (CoordLike): The variadic pack of element types in the Coord.

Returns:

IntTuple: An IntTuple with the same structure and values as the input Coord.

Was this page helpful?