op.c.j2 1.3 KB
Newer Older
1
{% from "operator_utils.c.j2" import op_maker, backward_op_maker, operator, register_op_with_components, register_op_version %}
2
// this file is generated by paddle/phi/api/yaml/generator/generate_op.py, do not edit.
3 4 5
#include <string>
#include "paddle/fluid/framework/infershape_utils.h"
#include "paddle/fluid/framework/op_registry.h"
6
#include "paddle/fluid/framework/op_version_registry.h"
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#include "paddle/fluid/framework/convert_utils.h"
#include "paddle/phi/core/infermeta_utils.h"
#include "paddle/phi/infermeta/nullary.h"
#include "paddle/phi/infermeta/unary.h"
#include "paddle/phi/infermeta/binary.h"
#include "paddle/phi/infermeta/ternary.h"
#include "paddle/phi/infermeta/multiary.h"
#include "paddle/phi/infermeta/backward.cc"

namespace paddle {
namespace operators {

using paddle::framework::GradVarName;

{% for api in apis %}
  {% if api is base_api %}

{{op_maker(api)}}

{{operator(api)}}
  {% endif %}
{% endfor %}

{% for api in backward_apis %}
  {% if api is base_api %}

{{backward_op_maker(api, api_dict[api["forward"]["name"]])}}

{{operator(api)}}
  {% endif %}
{% endfor %}
}  // namespace operators
}  // namespace paddle

namespace ops = paddle::operators;
{% for api in apis + backward_apis %}
{% if api is base_api %}
{{register_op_with_components(api)}}
45
{{register_op_version(api)}}
46 47
{% endif %}
{% endfor %}