# Library Source: https://www.tensorplay.cn/docs/generated/tensorplay.library.Library.html ```python class tensorplay.library.Library(namespace: str, kind: str = 'DEF') ``` one DEF library per process/namespace), "IMPL" adds kernels, and "FRAGMENT" extends an existing namespace from multiple locations. ```python define(schema: str, *, alias_analysis: str = '', tags: Any = ()) → None ``` 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. ```python fallback(kind: str) → None ``` TensorPlay’s dispatcher has no per-key fallthrough table, so this of silently mis-dispatching. ```python impl(op_name: str, fn: Callable[[...], Any] | None = None, *, device_type: str = 'CompositeExplicitAutograd', dispatch_key: str = '', allow_override: bool = True) → Callable[[...], Any] ``` 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.