Elementwise.target_gradient: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise Lines 69-72 of bendtorch-core@0.1.0.0/src/tensor/elementwise.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&start_line=69&end_line=72 import Base # -(g / count), the gradient PyTorch's nll_loss with mean reduction gives the # target cell of each row. def target_gradient(g: F32, +count: F32) -> F32: F32.neg(F32.div(g, count)) Uses (3): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg