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

fill_like

def 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.

Was this page helpful?