Skip to content
class

VjpRegion

VjpRegion

Custom backward subgraph captured for a lucid.autograd.Function with _traced_backward = True.

Forward ops in [fwd_begin, fwd_end) compute the forward outputs output_metas from input_ids. During backward emission, BackwardWalker skips per-op VJP emission for ops[fwd_begin .. fwd_end) and instead binds each output's resolved upstream cotangent (or a zero tensor when unused) to cotangent_ids[j], emits bwd_ops through the forward op emitters, and accumulates each non-negative input_grad_ids[k] onto input_ids[k].