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

[PIR] add some backward api for controw flow op #59231

Merged
merged 3 commits into from Nov 22, 2023

Conversation

winter-wang
Copy link
Contributor

@winter-wang winter-wang commented Nov 21, 2023

PR types

New features

PR changes

Others

Description

  • 增加python api:
    • cvt_as_if_op, 用来将operation转换为if_op
    • build_pipe_for_block, 在该block的尾端添加cf.tuple_push算子,将所有该block中定义的局部变量压栈。
    • get_used_external_value, 获得该op及其嵌套op中中用到的所有该op之外定义的变量。
  • 修改region、block的front()和back()接口。 返回类型调整为 Block& 和Operation&, 跟*begin()和*rbegin()的结果保持一致。

Other

Pcard-67164

@winter-wang winter-wang force-pushed the cf_develop branch 2 times, most recently from b37885b to 19fa5b8 Compare November 22, 2023 01:55
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 left a comment

Choose a reason for hiding this comment

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

LGTM

zhangbo9674
zhangbo9674 previously approved these changes Nov 22, 2023
paddle/fluid/pybind/control_flow_api.cc Outdated Show resolved Hide resolved
Aurelius84
Aurelius84 previously approved these changes Nov 22, 2023
paddle/fluid/pybind/control_flow_api.cc Outdated Show resolved Hide resolved
zhangbo9674
zhangbo9674 previously approved these changes Nov 22, 2023
Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

我的意思是:cvt_to_if_op → as_if_op 微笑, LGTM overall

@winter-wang
Copy link
Contributor Author

我的意思是:cvt_to_if_op → as_if_op 微笑, LGTM overall

下个pr改为as_if_op.

@winter-wang winter-wang merged commit 98706c1 into PaddlePaddle:develop Nov 22, 2023
28 checks passed
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants