CANONICAL_NODE(EltwiseAdd, EltwiseAdd)
CANONICAL_NODE(EltwiseDiv, EltwiseDiv)
CANONICAL_NODE(EltwiseMul, EltwiseMul)
+CANONICAL_NODE(EltwiseSqrt, EltwiseSqrt)
CANONICAL_NODE(EltwiseSub, EltwiseSub)
CANONICAL_NODE(FeatureBiasAdd, BiasAdd<Domain::Feature>)
CANONICAL_NODE(FeatureDecode, FeatureDecode)
void rhs(Node *node) { return at(1)->node(node); }
};
+/**
+ * @brief Elementwise Sqrt of input
+ */
+class EltwiseSqrt final
+ : public CanonicalNodeDef<CanonicalOpcode::EltwiseSqrt, FixedArity<1>::Mixin>
+{
+public:
+ EltwiseSqrt() = default;
+
+public:
+ Node *input(void) const { return at(0)->node(); }
+ void input(Node *node) { at(0)->node(node); }
+};
+
} // namespace loco
#endif // __LOCO_IR_NODES_H__
SUCCEED();
}
+
+TEST(EltwiseSqrtTest, constructor)
+{
+ loco::EltwiseSqrt sqrt_node;
+
+ ASSERT_EQ(sqrt_node.dialect(), loco::CanonicalDialect::get());
+ ASSERT_EQ(sqrt_node.opcode(), loco::CanonicalOpcode::EltwiseSqrt);
+
+ ASSERT_EQ(sqrt_node.input(), nullptr);
+}