ExecuTorch Scalar to() supports fewer types than c10::Scalar, breaking source compatibility
Open
Nobody has claimed this yet.
good first issue
module: runtime
triaged
- Dominant language
- Python
- Stars
- 5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 581
Description
🐛 Describe the bug
some_scalar.to<float>() is legal for c10::Scalar, but not ExecuTorch's Scalar. https://github.com/pytorch/executorch/blob/main/runtime/core/portable_type/scalar.h#L26 says it is a "source-compatible subset" of c10::Scalar.
Versions
main
cc @larryliu0820 @JacobSzwejbka
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with runtime/core/portable_type/scalar.h and compare its to() support with the c10::Scalar behavior described in the issue. Verify that to() is covered and that the resulting API remains source-compatible, then run the relevant Scalar tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100