int32_t _h;
};
-// TODO TFLAdd
+/**
+ * @brief ADD in TensorFlow Lite
+ */
+class TFLAdd final : public FixedArityNode<2, TFLNodeImpl<TFLOpcode::ADD>>
+{
+public:
+ TFLAdd() = default;
+
+public:
+ loco::Node *x(void) const { return at(0)->node(); }
+ void x(loco::Node *node) { at(0)->node(node); }
+
+ loco::Node *y(void) const { return at(1)->node(); }
+ void y(loco::Node *node) { at(1)->node(node); }
+};
/**
* @brief AVERAGE_POOL_2D in TensorFlow Lite
//
// PLEASE SORT NODE DECLS IN ALPHABETICAL ORDER
//
-// TODO TFLAdd
+TFL_NODE(ADD, locoex::TFLAdd)
TFL_NODE(AVERAGE_POOL_2D, locoex::TFLAveragePool2D)
// TODO TFLConcatenation
// TODO TFLConv2D
#include <gtest/gtest.h>
-// TODO TFLAdd
+TEST(TFLAddTest, constructor)
+{
+ locoex::TFLAdd add_node;
+
+ ASSERT_EQ(add_node.dialect(), locoex::TFLDialect::get());
+ ASSERT_EQ(add_node.opcode(), locoex::TFLOpcode::ADD);
+
+ ASSERT_EQ(add_node.x(), nullptr);
+ ASSERT_EQ(add_node.y(), nullptr);
+}
// TODO TFLAveragePool2D
return false;
}
-// TODO TFLAdd
+bool TFLNodeSummaryBuilder::summary(const locoex::TFLAdd *node, locop::NodeSummary &s) const
+{
+ s.opname("TFL.ADD");
+ s.args().append("x", tbl()->lookup(node->x()));
+ s.args().append("y", tbl()->lookup(node->y()));
+ s.state(locop::NodeSummary::State::Complete);
+ return true;
+}
bool TFLNodeSummaryBuilder::summary(const locoex::TFLAveragePool2D *node,
locop::NodeSummary &s) const