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

kind

kind()​

max.tree.kind(name)

source

Names a node class, so a serialized tree structure can refer to it.

@tree.kind("paged_kv")
@tree.dataclass
class KVCacheInputs: ...

Parameters:

name (str) – The class’s name in serialized structures, unique among registered classes.

Returns:

A decorator that registers the class and returns it.

Raises:

ValueError – If another class is registered under name.

Return type:

Callable[[type[_T]], type[_T]]