ML::Autograd::GradFn
Base class for gradient functions Each operation creates a GradFn that knows how to compute gradients
Constructors
Instance methods
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)
Inputs that contributed to this operation Stored as weak references to avoid cycles