Currently, when a module is provided with input of a wrong type (ex. long instead of integer), an error is raised with a message like below:
The 0-th input tensor's scalartype does not meet requirement: found 3 but expected 4
It is not immediately obvious that 3 corresponds to Int and 4 corresponds to Long. This lack of clarity can cause confusion
Possible solutions
Replace numbers with string representations. For example by defining a function with a switch condition for every enum value. I see that this may become a maintainance disaster, but there are better options too like boost/preprocessor usage in this stack overflow answer.
🚀 The feature, motivation and pitch
Currently, when a module is provided with input of a wrong type (ex. long instead of integer), an error is raised with a message like below:
It is not immediately obvious that
3
corresponds toInt
and4
corresponds toLong
. This lack of clarity can cause confusionPossible solutions
boost/preprocessor
usage in this stack overflow answer.ScalarType
class (as far as I can see the link is: https://github.com/pytorch/pytorch/blob/main/torchgen/executorch/model.py)While this is a small improvement, I believe it would make the error message more clear and helpful
Thank you for executorch :)
Alternatives
No response
Additional context
No response
RFC (Optional)
No response