{% from "operator_utils.c.j2" import op_maker, backward_op_maker, backward_op_reused_maker, operator, register_op_with_components, register_op_version %} // this file is generated by paddle/phi/api/yaml/generator/generate_op.py, do not edit. #include #include "paddle/fluid/framework/infershape_utils.h" #include "paddle/fluid/framework/op_registry.h" #include "paddle/phi/core/infermeta_utils.h" #include "paddle/phi/infermeta/backward.h" #include "paddle/phi/infermeta/binary.h" #include "paddle/phi/infermeta/multiary.h" #include "paddle/phi/infermeta/sparse/backward.h" #include "paddle/phi/infermeta/sparse/binary.h" #include "paddle/phi/infermeta/sparse/multiary.h" #include "paddle/phi/infermeta/sparse/unary.h" #include "paddle/phi/infermeta/ternary.h" #include "paddle/phi/infermeta/unary.h" namespace paddle { namespace operators { using paddle::framework::GradVarName; {% for op in ops %} {% if op is base_op %} {{op_maker(op)}} {{operator(op)}} {% endif %} {% endfor %} {% for op in backward_ops %} {% if op is base_op %} {{backward_op_maker(op, op_dict[op["forward"]["name"]])}} {{operator(op)}} {% else %} {{backward_op_reused_maker(op, op_dict[op["forward"]["name"]], op["invoke"])}} {% endif %} {% endfor %} } // namespace operators } // namespace paddle namespace ops = paddle::operators; {% for op in ops + backward_ops %} {% if op is base_op %} {{register_op_with_components(op)}} {% endif %} {% endfor %}