Expand description
A backend that records Burn operation graphs instead of executing them.
Tensors moved to a CaptureDevice are recorded rather than computed. Each
CaptureDevice::capture_scope call delimits one capture: the closure runs ordinary tensor
code, declares the graph’s inputs and outputs through CaptureScope::complete, and the
scope returns a CapturedGraph: the recorded burn_ir::GraphIr plus the recorded tensor
data, such as model weights. This is for tools that need a model’s computation as a graph,
such as exporters, rather than its results.
Applications enable the capture feature of burn and use Device::capture() and
Device::capture_scope. Inputs and outputs are declared by TensorId; with the
extension feature, tensor.clone().try_into_primitive::<CaptureBackend>()?.id() gives a
tensor’s ID. A runtime input must come from outside the scope, for example a tensor moved
onto the capture device; tensors created inside the scope are recorded as constants.
Structs§
- Capture
Bridge - Bridge for materialized values between independent capture devices.
- Capture
Channel - Router channel selecting the non-executing capture client.
- Capture
Client - Client that records router operations and locally retains initialized values.
- Capture
Device - Reusable logical device for isolated graph-capture scopes.
- Capture
Scope - Token passed to a
CaptureDevice::capture_scopeclosure. - Captured
Graph - Final result of a capture scope.
- Completed
Capture Scope - Completion token required from a
CaptureDevice::capture_scopeclosure. - Tensor
Id - The tensor unique identifier.
Enums§
- Capture
Error - Error returned while finalizing a capture.
Type Aliases§
- Capture
Backend - Backend type that records operations instead of executing them.