未验证 提交 07c416c8 编写于 作者: C Charles-hit 提交者: GitHub

fix composite grad maker code gen (#50854)

上级 041ea14c
...@@ -694,7 +694,11 @@ class {{op_name | to_composite_grad_opmaker_name}} : public prim::CompositeGradO ...@@ -694,7 +694,11 @@ class {{op_name | to_composite_grad_opmaker_name}} : public prim::CompositeGradO
{% macro construct_composite_attr(attrs, fluid_attrs, attr_dict) %} {% macro construct_composite_attr(attrs, fluid_attrs, attr_dict) %}
{% set attrs_length = attrs | length %} {% set attrs_length = attrs | length %}
{% for i in range(attrs_length) %} {% for i in range(attrs_length) %}
{% set attrs_data_type = attr_dict[attrs[i]]["typename"] | to_op_attr_type %} {% if "data_type" in attr_dict[attrs[i]] %}
{% set attrs_data_type = attr_dict[attrs[i]]["data_type"]%}
{% else %}
{% set attrs_data_type = attr_dict[attrs[i]]["typename"] | to_op_attr_type %}
{%- endif %}
const {{attrs_data_type}} {{attrs[i]}} = this->Attr<{{attrs_data_type}}>("{{fluid_attrs[i]}}"); const {{attrs_data_type}} {{attrs[i]}} = this->Attr<{{attrs_data_type}}>("{{fluid_attrs[i]}}");
{% endfor %} {% endfor %}
{%- endmacro %} {%- endmacro %}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册