Mojo function
coord_to_int_tuple
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,RuntimeInt) become integer values in theIntTuple - Tuple elements (nested
Coord) become nestedIntTuples
Parameters:
- โelement_types (
TypeList): The variadic pack of element types in theCoord.
Args:
- โvalue (
Coord): TheCoordto 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 theIntTuple - Tuple elements (nested
Coord) become nestedIntTuples
Parameters:
- โ*element_types (
CoordLike): The variadic pack of element types in theCoord.
Returns:
IntTuple: An IntTuple with the same structure and values as the input Coord.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!