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
[ Dy2static ] select input fix and while_op memory bug fixed. #45380
[ Dy2static ] select input fix and while_op memory bug fixed. #45380
Conversation
It is convenient to convert more dynamic graph codes into static graphs.
2. add warning in while_loop risky assign
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -1190,6 +1190,13 @@ def assign_skip_lod_tensor_array(input, output): | |||
""" | |||
Assign input to output, but skip the process of copying LoDTensorArray unless it's created in while_block. | |||
""" | |||
|
|||
def _shape_diff(vara, varb): |
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.
def _shape_diff(vara, varb): | |
def has_shape_diff(x, y): |
|
||
def _shape_diff(vara, varb): | ||
if len(vara.shape) != len(varb.shape): return True | ||
for sa, sb in zip(vara.shape, varb.shape): |
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.
for sa, sb in zip(vara.shape, varb.shape): | |
for a, b in zip(x.shape, y.shape): |
1. a bug in while_op no_need_copy_var, which causes gpu memory leakage 2. a bug in undefined_var where the stop_gradient should be False.
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.
LGTM
PR types
Others
PR changes
Others
Describe
select input fix + while_loop risky assign warning