This commit introduces erase_annot_data() function to erase already
annotated NodeDataImpl. It also includes test for added function.
Signed-off-by: Cheongyo Bahk <ch.bahk@samsung.com>
return data;
}
+void erase_annot_data(loco::Node *node) { node->annot<NodeDataImpl>(nullptr); }
+
} // namespace locomotiv
/// @brief Wrapper to get NodeDataImpl annotation of node
const NodeData *annot_data(loco::Node *node);
+/// @brief Erase already annotated NodeDataImpl
+void erase_annot_data(loco::Node *node);
+
} // namespace locomotiv
#endif // _LOCOMOTIV_NODEDATAIMPL_H_
ASSERT_EQ(obtained->dtype(), loco::DataType::FLOAT32);
ASSERT_EQ(*(obtained->shape()), shape);
ASSERT_FLOAT_EQ(obtained->as_f32_bufptr()->at(Index{0}), 3.14f);
+
+ // Erase annotation
+ locomotiv::erase_annot_data(node);
+ ASSERT_EQ(locomotiv::annot_data(node), nullptr);
}