IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Python function

build_max_lengths_tensors

build_max_lengths_tensors()โ€‹

max.nn.build_max_lengths_tensors(max_prompt_length, max_cache_length)

source

Builds two [1] uint32 scalar buffers of maximum lengths.

Parameters:

  • max_prompt_length (int) โ€“ The maximum prompt (query) length.
  • max_cache_length (int) โ€“ The maximum cache length.

Returns:

A tuple (max_prompt_length, max_cache_length) of Buffer, each of shape [1] and dtype uint32.

Return type:

tuple[Buffer, Buffer]