def target_gradient

bendtorch-core@0.1.0.0 · src/tensor/elementwise.bend:69

import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
import Base

69# -(g / count), the gradient PyTorch's nll_loss with mean reduction gives the
70# target cell of each row.
71def target_gradient(g: F32, +count: F32) -> F32:
72  F32.neg(F32.div(g, count))

Uses (3)

Used by (3)