law scalar_matches_same

bendtorch-core@0.1.0.0 · src/tensor/loss_ops_LAWS.bend:27

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

27# One-hot: 1.0 where the two words are the same bits, +0.0 elsewhere.
28law scalar_matches_same:
29  for +left: F32
30  for +right: F32
31  for same: {U32.is_eq(Elementwise.bits(left), Elementwise.bits(right)) == True{} : Bool}
32  {Elementwise.scalar(Elementwise.Matches{}, left, right) == 1.0 : F32}

Uses (9)

Used by (0)

No other definition uses this definition.