If I want to write a operation by C++ extension, is it necessary to write a corresponding backward function for that operation even if there’re no trainable weights in that operation?
I have dug into the source and found that every built-in loss function comes with a backward function. i.e. the  binary_crosss_entropy_with_logits,and the backward function is binary_cross_entropy_with_logits_backward

image.png1666×835 117 KB