pytorch / pytorch/executorch

ExecuTorch Scalar to() supports fewer types than c10::Scalar, breaking source compatibility

Open
#9,500 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.