LossOpsLAWS.scalar_mse_grad: law of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/loss_ops_LAWS.bend as LossOpsLAWS Lines 57-63 of bendtorch-core@0.1.0.0/src/tensor/loss_ops_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/loss_ops_LAWS.bend&start_line=57&end_line=63 import Base import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise # PyTorch's mse_loss backward: (scale * d) * g, scale = 2 / N, for g on the # left and d on the right. law scalar_mse_grad: for +scale: F32 for +left: F32 for +right: F32 {Elementwise.scalar(Elementwise.MseGrad{scale}, left, right) == F32.mul(F32.mul(scale, right), left) : F32} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=Operation https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=scalar