Skip to content

🐛 [Bug] LongType introduced in Conversion process by prim::NumToTensor #956

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

Closed
bowang007 opened this issue Apr 1, 2022 · 0 comments · Fixed by #972
Closed

🐛 [Bug] LongType introduced in Conversion process by prim::NumToTensor #956

bowang007 opened this issue Apr 1, 2022 · 0 comments · Fixed by #972
Assignees
Labels
bug Something isn't working

Comments

@bowang007
Copy link
Collaborator

bowang007 commented Apr 1, 2022

Bug Description

We have a graph like this:

  %14 : int = aten::size(%t.1, %15) 
  %16 : Tensor = prim::NumToTensor(%14) 
  %17 : Tensor[] = prim::ListConstruct(%13, %16)
  %image_size.1 : Tensor = aten::stack(%17, %3) 

This fails with an error:

terminate called after throwing an instance of 'c10::bad_optional_access'
  what():  bad optional access

This happens because we get an int from aten::size, then in prim::NumtoTensor we are using this function https://github.com/pytorch/pytorch/blob/8a7c9a5e01a24d465126210234aa9d3775b25032/aten/src/ATen/ScalarOps.h#L29, which will introduce a long tensor that incur the error.

Expected behavior

Truncate the long type here, should be fixed soon.

@bowang007 bowang007 added the bug Something isn't working label Apr 1, 2022
@bowang007 bowang007 changed the title 🐛 [Bug] LongType introduced in Conversion process 🐛 [Bug] LongType introduced in Conversion process by prim::NumToTensor Apr 1, 2022
@bowang007 bowang007 self-assigned this Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant