Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Missing outputs of input placeholder #1045

Conversation

nlpng
Copy link
Contributor

@nlpng nlpng commented May 22, 2020

What this patch does to fix the issue.

This PR is to deal with cases that the input placeholder has two or more shared branches, as the branches maybe removed during the optimization pass.

Link to any relevant issues or pull requests.

@blueoil-butler blueoil-butler bot added the CI: auto-run Run CI automatically label May 22, 2020
@nlpng nlpng changed the title [WIP] Missing outputs of input placeholder Missing outputs of input placeholder May 26, 2020
@bo-code-review-bot
Copy link

This PR needs Approvals as follows.

  • Ownership Approval for / from iizukak, tkng, ruimashita
  • Readability Approval for Python from tkng, tsawada, tfujiwar

Please choose reviewers and requet reviews!

Click to see how to approve each reviews

You can approve this PR by triggered comments as follows.

  • Approve all reviews requested to you (readability and ownership) and LGTM review
    Approval, LGTM

  • Approve all ownership reviews
    Ownership Approval or OA

  • Approve all readability reviews
    Readability Approval or RA

  • Approve specified review targets

    • Example of Ownership Reviewer of /: Ownership Approval for / or OA for /
    • Example of Readability Reviewer of Python: Readability Approval for Python or RA for Python
  • Approve LGTM review
    LGTM

See all trigger comments

Please replace [Target] to review target

  • Ownership Approval
    • Ownership Approval for [Target]
    • OA for [Target]
    • Ownership Approval
    • OA
    • Approval
  • Readability Approval
    • Readability Approval for [Target]
    • RA for [Target]
    • [Target] Readability Approval
    • [Target] RA
    • Readability Approval
    • RA
    • Approval
  • LGTM
    • LGTM
    • lgtm

@nlpng nlpng requested review from iizukak and tfujiwar May 26, 2020 02:58
Comment on lines 638 to 641
reserved_placeholder_ops = []
for out_op in placeholder[0].output_op_list:
if out_op not in to_be_removed:
reserved_placeholder_ops.append(out_op)
Copy link
Contributor

Choose a reason for hiding this comment

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

Usign list comprehension is better for readability and efficiency.

reserved_placeholder_ops = [
    out_op
    for out_op in placeholder[0].output_op_list
    if out_op not in to_be_removed
]

or

reserved_placeholder_ops = [
    out_op for out_op in placeholder[0].output_op_list
    if out_op not in to_be_removed
]

Copy link
Member

@iizukak iizukak left a comment

Choose a reason for hiding this comment

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

OA

@lm-tajimi lm-tajimi requested a review from tfujiwar June 1, 2020 04:33
Comment on lines 638 to 644
reserved_placeholder_ops = [
out_op for out_op in placeholder[0].output_op_list
if out_op not in to_be_removed
]
placeholder[0].remove_output('output')
placeholder[0].add_output('output', pe)
for add_to_placeholder in reserved_placeholder_ops:
placeholder[0].add_output('output', add_to_placeholder)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh sorry, my previous review was bad...
Those two loops are not needed to be separated. Could you make them into one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I fixed in commit db82531, not sure it is the fix you are looking for, but now it is only one for loop.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you.

@lm-tajimi lm-tajimi requested a review from tfujiwar June 3, 2020 07:28
Copy link
Contributor

@tfujiwar tfujiwar left a comment

Choose a reason for hiding this comment

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

RA

@lm-tajimi
Copy link
Contributor

/ready

@bo-mergebot
Copy link
Contributor

bo-mergebot bot commented Jun 3, 2020

⏳Merge job is queued...

@bo-mergebot bo-mergebot bot merged commit 0e43db8 into blue-oil:master Jun 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI: auto-run Run CI automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants