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

[JIT] Fix torch.tensor for empty multidimensional-typed lists #44652

Closed

Conversation

eellison
Copy link
Contributor

We were hitting an assert error when you passed in an empty List[List[int]] - this fixes that error by not recursing into 0-element tensors.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 14, 2020
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.

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

@SplitInfinity
Copy link

Out of curiosity, is this the assert in question: https://fburl.com/diffusion/am1ysuge

@eellison
Copy link
Contributor Author

It was this assert failure: https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/runtime/register_special_ops.cpp#L181 bc ndim = 1, dim=0, so we are expecting to find the list containing the actual data (IntList/BoolList/DoubleList), but instead we find a int[][].

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #44652 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #44652   +/-   ##
=======================================
  Coverage   67.97%   67.97%           
=======================================
  Files         384      384           
  Lines       49579    49579           
=======================================
+ Hits        33702    33703    +1     
+ Misses      15877    15876    -1     
Impacted Files Coverage Δ
torch/testing/_internal/expecttest.py 78.57% <0.00%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 192c411...db0cd6b. Read the comment docs.

@facebook-github-bot
Copy link
Contributor

@eellison merged this pull request in 551494b.

xuzhao9 pushed a commit that referenced this pull request Sep 18, 2020
Summary:
We were hitting an assert error when you passed in an empty `List[List[int]]` - this fixes that error by not recursing into 0-element tensors.

Pull Request resolved: #44652

Reviewed By: ZolotukhinM

Differential Revision: D23688247

Pulled By: eellison

fbshipit-source-id: d48ea24893044fae96bc39f76c0f1f9726eaf4c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants