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 class

TemplateType

TemplateType​

class max.experimental.custom.TemplateType(dtype, shape)

source

Bases: object

One entry in a CustomOp signature, input or output.

dtype is a concrete DType or a DTypeVar; entries sharing a variable must agree on the actual dtype at call time. shape holds Symbol and Param values, statics, or expressions over them; its length is the entry’s rank. There is no device: the op takes its device from its operands at each call.

Instances are immutable: CustomOp validates a signature once at declaration, so an entry must not change underneath it afterwards.

Parameters:

dtype​

dtype: DType | DTypeVar

source

shape​

shape: tuple[Dim, ...]

source