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(
9090 case c10::ScalarType::QUInt8:
9191 return torch::executor::ScalarType::QUInt8;
9292 default :
93- ET_ASSERT_UNREACHABLE ();
93+ ET_ASSERT_UNREACHABLE_MSG (
94+ " Unrecognized dtype: %hhd" ,
95+ static_cast <int8_t >(c10::typeMetaToScalarType (type)));
9496 }
9597}
9698
@@ -122,7 +124,8 @@ c10::ScalarType executorch_to_torch_scalar_type(
122124 case torch::executor::ScalarType::QUInt8:
123125 return c10::ScalarType::QUInt8;
124126 default :
125- ET_ASSERT_UNREACHABLE ();
127+ ET_ASSERT_UNREACHABLE_MSG (
128+ " Unrecognized dtype: %hhd" , static_cast <int8_t >(type));
126129 }
127130}
128131
Original file line number Diff line number Diff line change @@ -745,8 +745,7 @@ struct PyModule final {
745745 } else if (py::isinstance<py::int_>(python_input)) {
746746 cpp_inputs.push_back (EValue (py::cast<int64_t >(python_input)));
747747 } 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 ());
750749 }
751750 }
752751
Original file line number Diff line number Diff line change 114114 *
115115 * @param[in] _message Message on how to avoid this assertion error.
116116 */
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