class

ML::Autograd::CustomBackward

Inherits ML::Autograd::GradFn / Reference / Object

Placeholder for custom backward functions (e.g., rasterizer)

Constructors

new(name : String, backward_fn : Proc(Tensor, Array(Tensor | Nil)))
Source

Instance methods

backward(grad_output : Tensor) : Array(Tensor | Nil)

Compute gradients w.r.t. inputs given gradient of output Returns array of gradients, one per input (or nil if input doesn't require grad)

Source