"test/gemm/gemm_xdl_fp64.cpp" did not exist on "2206136628827a028384ebf07c225327dc9e62a8"
Unverified Commit 49a31c65 authored by kahmed10's avatar kahmed10 Committed by GitHub
Browse files

Gelu matcher fix (#583)



* fix matcher

* formatting

* change has_value function

* formatting

* check for literal in matcher
Co-authored-by: default avatarmvermeulen <5479696+mvermeulen@users.noreply.github.com>
parent c02c4dc3
......@@ -556,13 +556,16 @@ template <class T>
inline auto has_value(T x, float tolerance = 1e-6)
{
return make_basic_pred_matcher([=](instruction_ref ins) {
if(ins->get_shape().elements() != 1)
if(ins->name() != "@literal")
return false;
auto l = ins->get_literal();
if(l.empty())
return false;
bool b = false;
l.visit([&](auto v) { b = v.front() - x < tolerance; });
l.visit([&](auto v) {
if(std::all_of(v.begin(), v.end(), [&](auto val) { return val - x < tolerance; }))
b = true;
});
return b;
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment