CANONICAL_NODE(Pull, Pull)
CANONICAL_NODE(ReLU, ReLU)
CANONICAL_NODE(ReLU6, ReLU6)
+CANONICAL_NODE(Tanh, Tanh)
CANONICAL_NODE(TensorConcat, TensorConcat)
CANONICAL_NODE(TensorBiasAdd, BiasAdd<Domain::Tensor>)
CANONICAL_NODE(TensorSoftmax, Softmax<Domain::Tensor>)
};
/**
+ * @brief Create a new value that rectifies its input by tanh
+ */
+class Tanh final : public CanonicalNodeDef<CanonicalOpcode::Tanh, FixedArity<1>::Mixin>
+{
+public:
+ Tanh() = default;
+
+public:
+ Node *input(void) const { return at(0)->node(); }
+ void input(Node *node) { at(0)->node(node); }
+};
+
+/**
* @brief Create a value from constant byte array
*
* @note ConstGen assumes "lexical memory layout".
// CASE: ReLU6
loco::NodeShape visit(const loco::ReLU6 *node) final { return loco::shape_get(node->input()); }
+ // CASE: Tanh
+ loco::NodeShape visit(const loco::Tanh *node) final { return loco::shape_get(node->input()); }
+
// CASE: TensorBiasAdd
loco::NodeShape visit(const loco::TensorBiasAdd *node) final
{
loco::DataType visit(const loco::Pull *node) { return node->dtype(); }
loco::DataType visit(const loco::ReLU *node) { return loco::dtype_get(node->input()); }
loco::DataType visit(const loco::ReLU6 *node) { return loco::dtype_get(node->input()); }
+ loco::DataType visit(const loco::Tanh *node) { return loco::dtype_get(node->input()); }
loco::DataType visit(const loco::TensorConcat *node) { return loco::dtype_get(node->lhs()); }
loco::DataType visit(const loco::TensorBiasAdd *node) { return loco::dtype_get(node->value()); }
loco::DataType visit(const loco::TensorSoftmax *node) { return loco::dtype_get(node->input()); }