TorchLean API

NN.Kernel.Graph

Resident execution of custom-operation graphs #

The canonical graph supplies shapes and dependencies. Custom nodes use NVRTC; established operations use the existing LibTorch buffer interface. Preparation checks the whole graph before launching a node. This is a forward runner, not an automatic custom-operation VJP or a proof about native execution. Buffer aliases remain reference counted; the runner never explicitly releases borrowed inputs or view aliases.

Execute the canonical graph on resident binary32 buffers, returning every node's value.

Inputs are keyed by node id and validated before execution. All shape, payload and operation coverage checks run before any graph node is launched. Established operations retain the existing LibTorch FFI trust and failure policy; custom compilation and checked-read failures are IO errors. This runner neither records a differentiation tape nor invents gradients for custom bodies.

Instances For