Commit 24f0d34
authored
Log dtype names on input dtype mismatch (pytorch#7537)
Log dtype names on input dtype mismatch (pytorch#7537)
Summary:
Update the error message when input tensor scalar type is incorrect. We've seen this get hit a few times and it should be easier to debug than it is.
New Message:
```
[method.cpp:834] Input 0 has unexpected scalar type: expected Float but was Byte.
```
Old Message:
```
[method.cpp:826] The 0-th input tensor's scalartype does not meet requirement: found 0 but expected 6
```
Test Plan:
Built executorch bento kernel locally and tested with an incorrect scalar type to view the new error message.
```
[method.cpp:834] Input 0 has unexpected scalar type: expected Float but was Byte.
```
I also locally patched and built the bento kernel with ET_ENABLE_ENUM_STRINGS=0.
```
[method.cpp:834] Input 0 has unexpected scalar type: expected 6 but was 0.
```
Differential Revision: D67887770
Pulled By: GregoryComer1 parent d999204 commit 24f0d34
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
| 843 | + | |
843 | 844 | | |
844 | 845 | | |
845 | 846 | | |
846 | | - | |
847 | | - | |
| 847 | + | |
848 | 848 | | |
849 | | - | |
850 | | - | |
| 849 | + | |
| 850 | + | |
851 | 851 | | |
852 | 852 | | |
853 | 853 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
0 commit comments