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

coord_to_int_tuple

def coord_to_int_tuple[element_types: TypeList[element_types.values], //](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, Scalar) become integer values in the IntTuple
  • Tuple elements (nested Coord) become nested IntTuples

Parameters:

Args:

Returns:

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

def 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, Scalar) become integer values in the IntTuple
  • Tuple elements (nested Coord) become nested IntTuples

Parameters:

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

Returns:

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

Was this page helpful?