Skip to content

[Caffe2] Fix the weird bug in control_flow_op_test.py#26931

Closed
houseroad wants to merge 1 commit intopytorch:masterfrom
houseroad:fix_c2_ctrl_op_test
Closed

[Caffe2] Fix the weird bug in control_flow_op_test.py#26931
houseroad wants to merge 1 commit intopytorch:masterfrom
houseroad:fix_c2_ctrl_op_test

Conversation

@houseroad
Copy link
Member

In some version of python, then_net and else_net may switch the order. Let's make sure we are iterating the right arg node.

@pytorchbot pytorchbot added caffe2 module: pybind Related to our Python bindings / interactions with other Python libraries labels Sep 26, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@houseroad
Copy link
Member Author

The culprit is how we handle extra kwargs in core.CreateOperator. Different version of python has different orders when iterating over the kwargs.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in 7163bfd.

pdlive215 pushed a commit to pdlive215/pytorch that referenced this pull request Nov 27, 2019
Summary:
In some version of python, then_net and else_net may switch the order. Let's make sure we are iterating the right arg node.
Pull Request resolved: pytorch#26931

Reviewed By: hl475

Differential Revision: D17614829

Pulled By: houseroad

fbshipit-source-id: 3f1b4eb91ecf4d808f58c34896d3e628aa2e0af0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caffe2 Merged module: pybind Related to our Python bindings / interactions with other Python libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants