diff --git a/compiler/record-hessian/include/record-hessian/HessianObserver.h b/compiler/record-hessian/include/record-hessian/HessianObserver.h index 6bd9abb3102..bc3159474b1 100644 --- a/compiler/record-hessian/include/record-hessian/HessianObserver.h +++ b/compiler/record-hessian/include/record-hessian/HessianObserver.h @@ -19,6 +19,8 @@ #include "record-hessian/HessianComputer.h" +#include + namespace record_hessian { diff --git a/compiler/record-hessian/src/HessianObserver.cpp b/compiler/record-hessian/src/HessianObserver.cpp index be481969889..6278e45fc2f 100644 --- a/compiler/record-hessian/src/HessianObserver.cpp +++ b/compiler/record-hessian/src/HessianObserver.cpp @@ -29,7 +29,10 @@ void HessianObserver::postTensorWrite(const luci::CircleNode *node, for (auto node_output : node_outputs) { auto cur_node = dynamic_cast(node_output); - assert(cur_node != nullptr); + if (cur_node == nullptr) + { + throw std::runtime_error("Record Hessian: Node shouldn't be null."); + } // TODO : ADD TCONV/DepthCONV cases if (cur_node->opcode() == luci::CircleOpcode::FULLY_CONNECTED || cur_node->opcode() == luci::CircleOpcode::CONV_2D)