TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

Library

class tensorplay.library.Library(namespace: str, kind: str = 'DEF')[source]

one DEF library per process/namespace), "IMPL" adds kernels, and "FRAGMENT" extends an existing namespace from multiple locations.

define(schema: str, *, alias_analysis: str = '', tags: Any = ()) → None[source]

Define an operator from a schema like "ns::add(Tensor, Tensor)".

Only the qualified name is meaningful (TensorPlay models no schema schema strings can be pasted verbatim. alias_analysis and tags are accepted and ignored for call-site compatibility.

fallback(kind: str) → None[source]

TensorPlay’s dispatcher has no per-key fallthrough table, so this of silently mis-dispatching.

impl(op_name: str, fn: Callable[[...], Any] | None = None, *, device_type: str = 'CompositeExplicitAutograd', dispatch_key: str = '', allow_override: bool = True) → Callable[[...], Any][source]

device_type accepts composite spellings (Composite… → the device-agnostic slot) or concrete devices ("CPU"/"CUDA"); (non-empty wins). May be used directly or as a decorator.

On this page

Ask DeepWiki