// CANONICAL_NODE(OPCODE, CLASS)
CANONICAL_NODE(AvgPool2D, AvgPool2D)
+CANONICAL_NODE(BiasEncode, BiasEncode)
CANONICAL_NODE(ConstGen, ConstGen)
CANONICAL_NODE(Conv2D, Conv2D)
CANONICAL_NODE(Forward, Forward)
Tensor,
Feature,
Filter,
+ Bias,
/* ... */
};
// TODO Support "Dilation"
};
+/**
+ * @brief Create a "Bias" from a "Tensor"
+ *
+ * BiasEncode currently requires a rank-1 tensor as its input.
+ */
+class BiasEncode final : public FixedArityNode<1, CanonicalNodeImpl<CanonicalOpcode::BiasEncode>>
+{
+public:
+ BiasEncode() = 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__
ASSERT_EQ(conv2d.stride()->vertical(), 1);
ASSERT_EQ(conv2d.stride()->horizontal(), 1);
}
+
+TEST(BiasEncodeTest, constructor)
+{
+ loco::BiasEncode bias_encode;
+
+ ASSERT_EQ(bias_encode.dialect(), loco::CanonicalDialect::get());
+ ASSERT_EQ(bias_encode.opcode(), loco::CanonicalOpcode::BiasEncode);
+
+ ASSERT_EQ(bias_encode.input(), nullptr);
+}