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

fill_like

fill_like(src: IntTuple, 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): The source IntTuple whose structure will be copied.
  • val (Int): The integer value to fill the new IntTuple with.

Returns:

IntTuple: A new IntTuple with the same structure as src but filled with val.