This will refine error message using oops
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
target_link_libraries(moco_pass PUBLIC moco_lang)
target_link_libraries(moco_pass PRIVATE moco_support)
target_link_libraries(moco_pass PRIVATE stdex)
+target_link_libraries(moco_pass PRIVATE oops)
install(TARGETS moco_pass DESTINATION lib)
#include <loco.h>
+#include <oops/UserExn.h>
+
#include <cassert>
namespace
for (uint32_t axis = 0; axis < shape_rank; ++axis)
{
int32_t dim = (int32_t)input_tensor_shape.dim(axis).value();
- assert(dim > 0);
+ if (!(dim > 0))
+ {
+ throw oops::UserExn("Invalid input shape", shape_node->name());
+ }
const_node->at<loco::DataType::S32>(axis) = dim;
}
}
else
{
- throw std::runtime_error("ResolveConstantShape: Not supported output data type");
+ throw oops::UserExn("Unsupported data type", shape_node->name());
}
// replace