| 64 | // a + 0 => a, a * 1 => a |
| 65 | template <int id_val> |
| 66 | SymbolVar identical_op( |
| 67 | const SymbolVarArrayView& inp, const OperatorNodeConfig& config) { |
| 68 | auto lhs = inp[0], rhs = inp[1]; |
| 69 | auto k = lhs.as_immutable_scalar(); |
| 70 | if (!k.valid()) { |
| 71 | std::swap(lhs, rhs); |
| 72 | k = lhs.as_immutable_scalar(); |
| 73 | } |
| 74 | if (k.valid() && almost_equal(k->get_cast<float>(), static_cast<float>(id_val))) { |
| 75 | return broadcast_tshp(rhs, inp); |
| 76 | } |
| 77 | return {}; |
| 78 | } |
| 79 | |
| 80 | template <int zero_val> |
| 81 | SymbolVar absorbing_element( |
nothing calls this directly
no test coverage detected