Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/fluid/prim/api/auto_code_generated/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(prim_api_h_path
"${PADDLE_SOURCE_DIR}/paddle/fluid/prim/api/generated_prim/prim_generated_api.h"
)
set(static_prim_api_template_path
"${PADDLE_SOURCE_DIR}/paddle/fluid/prim/api/auto_code_generated/template/static_prim_api.cc.tpl"
"${PADDLE_SOURCE_DIR}/paddle/fluid/prim/api/auto_code_generated/template/static_prim_api.cc.j2"
)
set(eager_prim_api_gen_file
${PADDLE_SOURCE_DIR}/paddle/fluid/prim/api/auto_code_generated/eager_gen.py)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% from "utils.tpl" import static_prim_api %}
{% from "utils.cc.j2" import static_prim_api %}
// Generated by /paddle/fluid/prim/api/auto_code_generated/static_gen.py.
// DO NOT EDIT!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ std::tuple<{{sequence('', '', ', ', names)}}>
{%- macro static_prim_api_input_optional(input) -%}
{%- if input.typename=='Tensor[]' -%} {#- render the input of type paddle::optional<std::Vector<Tensor>> -#}
if ({{input.name}}) {
std::vector<std::string> {{input.name}}_names;
std::vector<std::string> {{input.name}}_names({{input.name}}.get().size());
std::transform({{input.name}}.get().begin(), {{input.name}}.get().end(), {{input.name}}_names.begin(), [](const Tensor& t) {
return std::static_pointer_cast<prim::DescTensor>(t.impl())->Name();
});
Expand All @@ -91,7 +91,7 @@ if ({{input.name}}) {

{%- macro static_prim_api_input_without_optional(input) -%}
{%- if input.typename is tensor_sequence -%} {#- render the input of type std::Vector<Tensor> -#}
std::vector<std::string> {{input.name}}_names;
std::vector<std::string> {{input.name}}_names({{input.name}}.size());;
std::transform({{input.name}}.begin(), {{input.name}}.end(), {{input.name}}_names.begin(), [](const Tensor& t) {
return std::static_pointer_cast<prim::DescTensor>(t.impl())->Name();
});
Expand Down