File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,9 @@ torch::executor::ScalarType torch_to_executorch_scalar_type(
90
90
case c10::ScalarType::QUInt8:
91
91
return torch::executor::ScalarType::QUInt8;
92
92
default :
93
- ET_ASSERT_UNREACHABLE ();
93
+ ET_ASSERT_UNREACHABLE_MSG (
94
+ " Unrecognized dtype: %hhd" ,
95
+ static_cast <int8_t >(c10::typeMetaToScalarType (type)));
94
96
}
95
97
}
96
98
@@ -122,7 +124,8 @@ c10::ScalarType executorch_to_torch_scalar_type(
122
124
case torch::executor::ScalarType::QUInt8:
123
125
return c10::ScalarType::QUInt8;
124
126
default :
125
- ET_ASSERT_UNREACHABLE ();
127
+ ET_ASSERT_UNREACHABLE_MSG (
128
+ " Unrecognized dtype: %hhd" , static_cast <int8_t >(type));
126
129
}
127
130
}
128
131
Original file line number Diff line number Diff line change @@ -745,8 +745,7 @@ struct PyModule final {
745
745
} else if (py::isinstance<py::int_>(python_input)) {
746
746
cpp_inputs.push_back (EValue (py::cast<int64_t >(python_input)));
747
747
} else {
748
- // Unsupported pytype
749
- ET_ASSERT_UNREACHABLE_MSG (type_str.c_str ());
748
+ ET_ASSERT_UNREACHABLE_MSG (" Unsupported pytype: %s" , type_str.c_str ());
750
749
}
751
750
}
752
751
Original file line number Diff line number Diff line change 114
114
*
115
115
* @param[in] _message Message on how to avoid this assertion error.
116
116
*/
117
- #define ET_ASSERT_UNREACHABLE_MSG (_message ) \
118
- ({ \
119
- ET_CHECK_MSG( \
120
- false, "Execution should not reach this point. %s", _message); \
121
- ET_UNREACHABLE(); \
122
- })
117
+ #define ET_ASSERT_UNREACHABLE_MSG (_format , ...) \
118
+ do { \
119
+ ET_CHECK_MSG( \
120
+ false, \
121
+ "Execution should not reach this point. " _format, \
122
+ ##__VA_ARGS__); \
123
+ ET_UNREACHABLE(); \
124
+ } while (0)
You can’t perform that action at this time.
0 commit comments