-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Support copy in Fluid channels #9138
Conversation
python/paddle/fluid/concurrency.py
Outdated
capacity=value.capacity) | ||
|
||
assign_op = channel_send_block.append_op( | ||
type="assign_op", inputs={"X": value, }, outputs={"Out": copied_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.
although this is valid python syntax, I'm wondering if we can remove the extra "," after value
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.
@@ -141,6 +141,8 @@ def channel_send(channel, value): | |||
channel (Variable|Channel): Channel variable created using | |||
`make_channel`. | |||
value (Variable): Value to send to channel | |||
copy (bool): Copy data while channel send. If False, then data | |||
is moved. The input cannot be used after move. |
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.
Please add the default value of copy
at the end of line145.
Maybe replacing copy
with copy_mode
is better.
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.
Sorry, I just realized that I missed your comment and merged the PR. I agree with you. Let me correct it and send you the review separately.
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.
it doesn't matter, the current scenario for using channel is still less.
Fixes #9085