CINN
CINN copied to clipboard
Compiler Infrastructure for Neural Networks
[An extra null pointer check is not needed in functions](https://isocpp.org/wiki/faq/freestore-mgmt#delete-handles-null "Do I need to check for null before delete p?") like the following. - [Buffer::DeallocHost](https://github.com/PaddlePaddle/CINN/blob/85ab4981a38926dc5c1dbf672762cec335d2b857/cinn/runtime/buffer.h#L77 "Buffer::DeallocHost function") - [Shape::Resize](https://github.com/PaddlePaddle/CINN/blob/85ab4981a38926dc5c1dbf672762cec335d2b857/cinn/runtime/buffer.cc#L29 "Shape::Resize...

本PR主要是重新对OP的进行梳理和整理。
我在开发[argmin](https://github.com/PaddlePaddle/community/pull/192)算子时。参考了min等同类算子的实现方法后,发现这些全部都涉及到了更底层的开发, 需要改动的地方非常多,似乎不是本次任务所希望的实现方法。 开发中遇到的问题核心就是不知道在Compute中如何正确的使用与具体尺寸相关的循环, 若直接使用普通的for循环,对`shape`取值得到的是`Expr(n)`,而使用`for(Expr i = Expr(0); i< shape[aixs]; i++)`不能正确编译程序, 于是考虑使用 ir::For,但是对其的原理不理解,不知道其 Expr类型的返回值的含义,编写如下代码仍然无法获得理想的结果。 我在对已经实现的所有compute中均未发现类似的可以参考的用法,多数都采用Reduce方法,但是Reduce只支持max/min/sum/mul等,如果要扩展需要修改较多底层的实现,似乎不是本次任务所希望的实现方法, 因此希望可以得到一个在compute中使用与具体尺寸相关的循环的例子参考,或者有一些其他方向上的指导。 ```c++ auto temp_tensor = Compute( {shape[real_axis] + 1}, [=](const std::vector &indices) -> Expr { return...
As the title
将graph_compiler中生成单算子lower function的逻辑统一到op_lowering中,便于后续代码维护 将graph_compiler中未开启fusion时默认group升级为fusion group,并使用op_lowering进行lower 修复相关单测
修复elementwise融合broadcast: 如果elementwise有多个consumer,则禁止融合。