-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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] test_ifelse ut add pir test branch #58163
[PIR] test_ifelse ut add pir test branch #58163
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -259,6 +259,9 @@ pir::OpInfo OpTranscriber::LoopkUpOpInfo(pir::IrContext* ctx, | |||
continue; | |||
} | |||
VarDesc* var = op_desc.Block()->FindVarRecursive(legacy_input_vars[0]); | |||
IR_ENFORCE(var != nullptr, | |||
"Can't find var recursivelly from current block."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Can't find var recursivelly from current block."); | |
"Can't find var recursively from current block."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return self._run_dygraph(to_static=True) | ||
|
||
def _run_dygraph(self, to_static=False): | ||
with base.dygraph.guard(place): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里新增的代码可以按照Paddle最新的API来写。比如:
- base.dygraph.guard → paddle.set_device()
- to_variable → to_tensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
追加commit或者新PR都可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
def _run_dygraph(self, to_static=False): | ||
with base.dygraph.guard(place): | ||
x_v = base.dygraph.to_variable(self.x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
* fix * fix * fix * fix * fix * fix * fix * fix bug * fix bug * fix bug * fix bug * fix bug * add * fix * fix * fix * fix * refine code
* fix * fix * fix * fix * fix * fix * fix * fix bug * fix bug * fix bug * fix bug * fix bug * add * fix * fix * fix * fix * refine code
* fix * fix * fix * fix * fix * fix * fix * fix bug * fix bug * fix bug * fix bug * fix bug * add * fix * fix * fix * fix * refine code
PR types
Others
PR changes
Others
Description
随着 PIR 完成对 IF 前向执行的支持,将 test_ifelse 单测添加 PIR 的测试分支
TODO:本 PR 尚有5个测试 case 待开启 PIR 的测试分支,具体包括:
Pcard-67164