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

Python function

kv_input_values

kv_input_values()​

max.nn.common_layers.kv_cache.kv_input_values(kv)

source

Returns a decoder’s KV cache inputs for its params to unflatten.

A traced decoder gets each input’s graph value. A decoder called eagerly gets the real tensors, which have no graph values.

Parameters:

kv (tree.Tree[Tensor] | Sequence[Tensor]) – The decoder’s KV cache inputs.

Returns:

One value per input, in order.

Return type:

list[Any]