| 572 | }; |
| 573 | |
| 574 | void remove_zero_point(module& m) |
| 575 | { |
| 576 | for(auto ins : iterator_for(m)) |
| 577 | { |
| 578 | if(ins->name() != "dequantizelinear") |
| 579 | continue; |
| 580 | if(ins->inputs().size() != 3) |
| 581 | continue; |
| 582 | auto zp = ins->inputs().at(2); |
| 583 | if(not zp->can_eval()) |
| 584 | continue; |
| 585 | auto a = zp->eval(); |
| 586 | bool is_zero = false; |
| 587 | a.visit([&](auto t) { |
| 588 | is_zero = std::all_of(t.begin(), t.end(), [](auto x) { return float_equal(x, 0); }); |
| 589 | }); |
| 590 | if(not is_zero) |
| 591 | continue; |
| 592 | m.replace_instruction(ins, ins->get_operator(), ins->inputs().at(0), ins->inputs().at(1)); |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | void add_int4_pack_unpack_pair(module& m) |
| 597 | { |
no test coverage detected