Skip to content
class

ScalarBackward

extendskernel::NaryKernel<ScalarBackward<K>, 2>
ScalarBackward

One node per op. Slot t_index_ is T; slot 1 - t_index_ is the 0-d operand S, whose gradient is reduced in float32 (and cast back to s_dtype_ when S is float64 on the CPU).

Methods

8
fn

apply_for_graph

int apply_for_graph(const int & grad_out)
fnconst

graph_grad_s

int graph_grad_s(const int & grad_out, const int & t, const int & s)
fnconst

graph_grad_t

int graph_grad_t(const int & grad_out, const int & t, const int & s)