LossOpsLAWS.scalar_matches_same: 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 27-32 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=27&end_line=32 import Base import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise # One-hot: 1.0 where the two words are the same bits, +0.0 elsewhere. law scalar_matches_same: for +left: F32 for +right: F32 for same: {U32.is_eq(Elementwise.bits(left), Elementwise.bits(right)) == True{} : Bool} {Elementwise.scalar(Elementwise.Matches{}, left, right) == 1.0 : F32} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq 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=bits https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=scalar https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=zero_if