Skip to content
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

ONNX: fix bug in export of ops involving torch.bool type #40006

wants to merge 2 commits into from


Copy link

yaeldekel commented Jun 14, 2020

When an op involves creating a tensor of a certain type (such as torch.ones(...)), the tracer creates a prim::Constant node with an integer value representing the type. The mapping from the torch type to integers maps:

torch.complex32 -> 8
torch.complex64 -> 9
torch.complex128 -> 10
torch.bool -> 11

However, when the ONNX exporter maps back the integer to torch type, 10 is mapped to bool, 9 is mapped to complex128 and 8 is mapped to complex64.

Copy link

dr-ci bot commented Jun 14, 2020

💊 CI failures summary and remediations

As of commit 25b0cae (more details on the Dr. CI page):

💚 💚 Looks good so far! There are no failures yet. 💚 💚

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 11 times.

Copy link

take-cheeze commented Jun 17, 2020

Seems to solve #32280

Copy link

neginraoof left a comment

Looks good. Thanks!

Copy link

KsenijaS commented Jun 18, 2020

looks good. LGTM!

Copy link

vadimkantorov commented Jun 19, 2020

Currently torch.ones(2, 4, dtype=torch.bool).sum(dim = 1) failed for me (and .to(torch.int32) prior to sum(...) helped). Will this PR fix it as well?

Copy link

houseroad left a comment

Thanks for the fix.

Copy link

facebook-github-bot left a comment

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

Copy link

facebook-github-bot commented Jun 22, 2020

@houseroad merged this pull request in 766889b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.