#include <cassert>
#include <stdexcept>
-namespace moco
-{
-namespace tf
+namespace
{
-/**
- * @brief GraphBuilder for MaxPool node
- */
-class MaxPoolGraphBuilder final : public MaxPoolGraphBuilderBase
-{
-public:
- void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override;
-};
+using namespace moco::tf;
class MaxPoolGraphUpdate final : public GraphUpdate
{
const TensorName _value_name;
};
+void MaxPoolGraphUpdate::input(const SymbolTable *tensor_names) const
+{
+ loco::Node *input_node = tensor_names->node(_input_name);
+ _encode_node->input(input_node);
+}
+
+void TFMaxPoolGraphUpdate::input(const SymbolTable *node_table) const
+{
+ loco::Node *value_node = node_table->node(_value_name);
+ _maxpool_node->value(value_node);
+}
+
+} // namespace
+
+namespace moco
+{
+namespace tf
+{
+
+/**
+ * @brief GraphBuilder for MaxPool node
+ */
+class MaxPoolGraphBuilder final : public MaxPoolGraphBuilderBase
+{
+public:
+ void build(const tensorflow::NodeDef &, GraphBuilderContext *) const override;
+};
+
bool MaxPoolGraphBuilderBase::validate(const tensorflow::NodeDef &node) const
{
// note: even though "data_format" is not entered when a model is written,
updates->enroll(std::move(update));
}
-void MaxPoolGraphUpdate::input(const SymbolTable *tensor_names) const
-{
- loco::Node *input_node = tensor_names->node(_input_name);
- _encode_node->input(input_node);
-}
-
void MaxPoolGraphBuilderImpl<ImportTarget::TensorFlow>::build(const tensorflow::NodeDef &node,
GraphBuilderContext *context) const
{
updates->enroll(std::move(update));
}
-void TFMaxPoolGraphUpdate::input(const SymbolTable *node_table) const
-{
- loco::Node *value_node = node_table->node(_value_name);
- _maxpool_node->value(value_node);
-}
-
} // namespace tf
} // namespace moco