Skip to content

Commit

Permalink
Add header for unique_ptr, change assert to throw.
Browse files Browse the repository at this point in the history
Add header for unique_ptr, change assert to throw.

ONE-DCO-1.0-Signed-off-by: Banseok Lee <[email protected]>
  • Loading branch information
BLee-bot committed Nov 4, 2024
1 parent 4ff4986 commit 99ea1df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include "record-hessian/HessianComputer.h"

#include <memory>

namespace record_hessian
{

Expand Down
5 changes: 4 additions & 1 deletion compiler/record-hessian/src/HessianObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ void HessianObserver::postTensorWrite(const luci::CircleNode *node,
for (auto node_output : node_outputs)
{
auto cur_node = dynamic_cast<luci::CircleNode *>(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)
Expand Down

0 comments on commit 99ea1df

Please sign in to comment.