Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpCompat] add cast and repeat_interleave in op_compat.yaml #55467

Merged
merged 2 commits into from
Jul 18, 2023
Merged
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
14 changes: 14 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@
out : Out
drop_empty_grad : [input_grad]

- op : cast
inputs :
x : X
outputs :
out : Out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要给output也添加映射

  outputs :
    out : Out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legacy_ops.yaml这里需不需要把

- op : cast
  args : (Tensor x, DataType dtype)
  output : Tensor

修改为

- op : cast
  args : (Tensor x, DataType dtype)
  output : Tensor(out)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该不需要, @heavyrain-lzy 麻烦帮忙确认下

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

自动生成静态图代码中,如果output如果只有一个且不配置,默认为是out,不影响静态图代码自动生成;如果在new IR也可以这样使用默认配置的话,这里就可以不用修改

- op : ceil
backward : ceil_grad
inputs :
Expand Down Expand Up @@ -2258,6 +2264,14 @@
extra :
attrs : [bool use_mkldnn = false, bool use_cudnn = false]

- op : repeat_interleave
kangguangli marked this conversation as resolved.
Show resolved Hide resolved
inputs :
x : X
outputs :
out : Out
attrs :
repeats : Repeats

- op : reshape (reshape2)
backward : reshape_grad (reshape2_grad)
inputs:
Expand Down