Commit c393f233 authored by Alan Turner's avatar Alan Turner
Browse files

Formatting

parent 37939805
......@@ -243,19 +243,21 @@ struct find_ck_gemm_softmax_gemm
auto gemm1_ins = r.instructions["gemm1"];
auto scale_ins = r.instructions["scale"];
if (scale_ins->module_inputs().size() != 1 or not is_mul_module(*scale_ins->module_inputs().front()))
if(scale_ins->module_inputs().size() != 1 or
not is_mul_module(*scale_ins->module_inputs().front()))
return;
if (not ck_gemm_softmax_gemm::is_ck_supported_type(gemm1_ins->get_shape().type()))
if(not ck_gemm_softmax_gemm::is_ck_supported_type(gemm1_ins->get_shape().type()))
return;
double scale = 1.0;
for (auto& in: scale_ins->inputs())
for(auto& in : scale_ins->inputs())
{
if (in->can_eval())
if(in->can_eval())
{
in->get_literal().visit([&](const auto s) {
if (std::all_of(
s.begin() + 1, s.end(), [&](auto v) { return float_equal(v, s.front()); }))
if(std::all_of(s.begin() + 1, s.end(), [&](auto v) {
return float_equal(v, s.front());
}))
scale = s.front();
else
return;
......
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