"...csrc/git@developer.sourcefind.cn:change/sglang.git" did not exist on "a2ffdd604e4b1e3fbb54d90c1ea555b597fa5ed0"
Commit d1e0225d authored by Paul's avatar Paul
Browse files

Formatting

parent 379ef733
...@@ -16,7 +16,6 @@ struct rewrite_pooling ...@@ -16,7 +16,6 @@ struct rewrite_pooling
{ {
std::string name() const { return "rewrite_pooling"; } std::string name() const { return "rewrite_pooling"; }
void apply(program& prog) const; void apply(program& prog) const;
}; };
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
......
...@@ -12,21 +12,21 @@ void rewrite_pooling::apply(program& prog) const ...@@ -12,21 +12,21 @@ void rewrite_pooling::apply(program& prog) const
{ {
for(auto ins : iterator_for(prog)) for(auto ins : iterator_for(prog))
{ {
if (ins->name() != "pooling") if(ins->name() != "pooling")
continue; continue;
if (ins->get_shape().lens().size() != 4) if(ins->get_shape().lens().size() != 4)
continue; continue;
if (ins->inputs().empty()) if(ins->inputs().empty())
continue; continue;
auto&& s = ins->inputs().front()->get_shape(); auto&& s = ins->inputs().front()->get_shape();
auto&& op = any_cast<op::pooling>(ins->get_operator()); auto&& op = any_cast<op::pooling>(ins->get_operator());
if (op.mode != "average") if(op.mode != "average")
continue; continue;
if (op.padding[0] != 0 and op.padding[1] != 0) if(op.padding[0] != 0 and op.padding[1] != 0)
continue; continue;
if (op.stride[0] != 1 and op.stride[1] != 1) if(op.stride[0] != 1 and op.stride[1] != 1)
continue; continue;
if (s.lens()[2] != op.lengths[0] and s.lens()[3] != op.lengths[1]) if(s.lens()[2] != op.lengths[0] and s.lens()[3] != op.lengths[1])
continue; continue;
prog.replace_instruction(ins, op::reduce_mean{{2, 3}}, ins->inputs().front()); prog.replace_instruction(ins, op::reduce_mean{{2, 3}}, ins->inputs().front());
} }
......
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