moose
moose copied to clipboard
Fix `Hash` and `Eq` for `ConstantOp` and `FillOp`
The way that Hash
and Eq
are currently implemented is not ideal, the former going through the (slower) textual representation and the latter not supposed to be implemented manually as it is now.
One root problem is around floating point values in constants, which are neither Hash
nor Eq
.
Maybe a solution would be to not have these values live directly on ConstantOp
and FillOp
, but rather keep a list of constants on the computation that ConstantOp
and FillOp
index into. Correctness would require this list of constants to be unique, so it's also worth considering other solutions that doesn't have this requirement (say, not using floating points in constants).