Mojo function
fill_like
fill_like(src: IntTuple[origin], val: Int) -> IntTuple
Creates an IntTuple
with the same structure as the source but filled with a specified value.
This function recursively traverses the source IntTuple
and creates a new IntTuple
with identical structure, but with all leaf values replaced by the specified value.
Args:
- src (
IntTuple[origin]
): The sourceIntTuple
whose structure will be copied. - val (
Int
): The integer value to fill the newIntTuple
with.
Returns:
A new IntTuple
with the same structure as src but filled with val.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!