latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.compiler API
Functions 26
allow_in_graph
functionFull reference ↗assume_constant_result
functionFull reference ↗compile
functionFull reference ↗- tensorplay.compiler.compile(model: Callable[[...], Any] | None = None, *, fullgraph: bool = False, dynamic: bool | None = None, backend: str | Callable[[...], Any] | None = None, mode: str | None = None, options: dict[str, Any] | None = None, name: str | None = None, disable: bool = False, recompile_limit: int | None = None, isolate_recompiles: bool = False, strict_native: bool = False, dynamic_shapes: Any = None) Callable[[...], Any][source]
Compile a callable through the TensorPlay capture and lowering pipeline.
disable_capture
functionFull reference ↗disable
functionFull reference ↗disallow_in_graph
functionFull reference ↗- tensorplay.compiler.disallow_in_graph(fn: Callable[[...], Any]) Callable[[...], Any][source]
Declare that a callable must not be absorbed into a captured graph.
The tracer is meant to treat calls to
fnas region boundaries: the surrounding pieces are captured as separate graphs andfnitself runs eagerly between them. Under eager execution the marker is inert metadata, so the callable is returned unchanged.
export
functionFull reference ↗get_backend_capabilities
functionFull reference ↗get_default_backend
functionFull reference ↗is_compiling
functionFull reference ↗is_exporting
functionFull reference ↗list_backends
functionFull reference ↗- tensorplay.compiler.list_backends(exclude_tags: tuple[str, ...] | list[str] | None = ('debug', 'experimental'), *, include_unavailable: bool = False) list[str][source]
Return registered backend names accepted by
compile().Backends whose optional dependencies are missing are hidden unless
include_unavailableis set; selecting one by name produces an error naming what to install.
list_mode_options
functionFull reference ↗lookup_backend
functionFull reference ↗mark_static
functionFull reference ↗- tensorplay.compiler.mark_static(tensor: Any, dim: int | None = None) Any[source]
Mark a tensor (or one dimension of it) as fixed for shape policies.
A marked dimension is meant to be treated as a compile-time constant rather than a symbolic size. Eager execution has no dynamic shape environment, so the marker records nothing here and the input is returned unchanged; it matters only to a capture that resolves symbolic sizes.
nested_compile_region
functionFull reference ↗nonstrict_trace
functionFull reference ↗overload_method
functionFull reference ↗register_backend
functionFull reference ↗register_debug_backend
functionFull reference ↗register_experimental_backend
functionFull reference ↗reset
functionFull reference ↗set_default_backend
functionFull reference ↗substitute_in_graph
functionFull reference ↗unregister_backend
functionFull reference ↗unused
functionFull reference ↗Classes 1
NestedCompileRegionOptions
classFull reference ↗Exceptions 2
GraphCaptureError
exceptionFull reference ↗- exception tensorplay.compiler.GraphCaptureError[source]
Raised when Python code cannot be represented by the current graph.
InvalidBackend
exceptionFull reference ↗- exception tensorplay.compiler.InvalidBackend(name: str, suggestions: Sequence[str] | None = None)[source]
A backend name that no registered, built-in or entry-point backend owns.
Derives from
ValueError(what unknown names raised historically) andRuntimeError(the compiler error family), so either handler works.
Help improve this page
Found an error, an unclear step, or a missing example?

