I tried using the
SameOperandAndResultTypes trait assuming it verified that the Op has the same number and types for its operands and results. So something like (f32, i32) -> (f32, i32) would conform to the trait. However, looks like the trait checks that all operand and result types have the same uniform element type and compatible shapes. Looks like there is no trait that simply checks that operand and result counts are equal and their types are pair-wise identical.
Given what the
SameOperandAndResultTypes checks, would
UniformOperandAndResultTypes be a more appropriate name? From a cursory look, other traits like
SameOperandAndResultShapes also have similar behavior: they check uniformity of a particular property across all input and output types. And then
Same would perform pair-wise check and would always be something like
Other name for the simple trait I was looking for could be
PairwiseSameOperandAndResultXXX if we do not want to rename the Same* traits.