The current implementation of translateLocoTypeToTFLite may return an
invalid value if the code is built with release configuration.
This commit replaces assert with throw to prevent undefined behavior.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
#include <stdex/Memory.h>
+#include <stdexcept>
#include <type_traits>
namespace
return tflite::TensorType_FLOAT32;
// case loco::DataType::FLOAT64: unsupported
default:
- assert(false && "unsupported data type");
+ break;
}
+
+ throw std::invalid_argument{"dtype"};
}
} // namespace