#include "ITensorBuilder.h"
#include "IStage.h"
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
#include "model/operation/Subgraph.h"
#include "cpp14/memory.h"
namespace backend
{
-class IStageGenerator : model::NodeVisitor
+class IStageGenerator : model::OperationVisitor
{
public:
virtual ~IStageGenerator() = default;
{ \
throw std::runtime_error("NYI"); \
}
-#include "model/operation/Op.lst"
+#include "model/Operations.lst"
#undef OP
protected:
{
return _model->operands;
} // TODO Remove this non-const accessor
- const model::operation::Set &operations() const { return _model->operations; }
- model::operation::Set &operations() { return _model->operations; }
+ const model::Operations &operations() const { return _model->operations; }
+ model::Operations &operations() { return _model->operations; }
const compiler::BackendResolver *backend_resolver() const { return _backend_resolver.get(); }
private:
#ifndef __NEURUN_MODEL_MODEL_H__
#define __NEURUN_MODEL_MODEL_H__
-#include "model/operation/Set.h"
+#include "model/Operations.h"
#include "model/operand/IndexSet.h"
#include "model/operand/Set.h"
struct Model
{
- model::operation::Set operations;
+ model::Operations operations;
model::operand::Set operands;
model::operand::IndexSet inputs;
model::operand::IndexSet outputs;
* limitations under the License.
*/
-#ifndef __NEURUN_MODEL_OPERATION_OPERAND_CONSTRAINT_H__
-#define __NEURUN_MODEL_OPERATION_OPERAND_CONSTRAINT_H__
+#ifndef __NEURUN_MODEL_OPERAND_CONSTRAINT_H__
+#define __NEURUN_MODEL_OPERAND_CONSTRAINT_H__
#include <stdint.h>
#include <limits>
} // namespace model
} // namespace neurun
-#endif // __NEURUN_MODEL_OPERATION_OPERAND_CONSTRAINT_H__
+#endif // __NEURUN_MODEL_OPERAND_CONSTRAINT_H__
* limitations under the License.
*/
-#ifndef __NEURUN_MODEL_OPERATION_NODE_H__
-#define __NEURUN_MODEL_OPERATION_NODE_H__
+#ifndef __NEURUN_MODEL_OPERATION_H__
+#define __NEURUN_MODEL_OPERATION_H__
#include <memory>
#include "model/operand/Object.h"
#include "model/operand/IndexSet.h"
-#include "model/operation/OperandConstraint.h"
+#include "model/OperandConstraint.h"
namespace neurun
{
{
namespace model
{
-namespace operation
-{
-struct NodeVisitor;
-} // namespace operation
+struct OperationVisitor;
} // namespace model
} // namespace neurun
namespace model
{
-using NodeVisitor = ::neurun::model::operation::NodeVisitor;
using OperandConstraint = ::neurun::model::operation::OperandConstraint;
class Operation
virtual ~Operation();
public:
- virtual void accept(NodeVisitor &&) const = 0;
+ virtual void accept(OperationVisitor &&) const = 0;
virtual std::string getName() const = 0;
public:
} // namespace model
} // namespace neurun
-#endif // __NEURUN_MODEL_OPERATION_NODE_H__
+#endif // __NEURUN_MODEL_OPERATION_H__
{
namespace model
{
-namespace operation
-{
-class IndexList
+class OperationIndexList
{
public:
- IndexList(void) = default;
- IndexList(std::initializer_list<OperationIndex> list);
+ OperationIndexList(void) = default;
+ OperationIndexList(std::initializer_list<OperationIndex> list);
public:
void append(const OperationIndex &index) { _list.push_back(index); }
std::list<OperationIndex> _list;
};
-} // namespace operation
} // namespace model
} // namespace neurun
* limitations under the License.
*/
-#ifndef __NEURUN_MODEL_OPERATION_NODE_VISITOR_H__
-#define __NEURUN_MODEL_OPERATION_NODE_VISITOR_H__
+#ifndef __NEURUN_MODEL_OPERATION_VISITOR_H__
+#define __NEURUN_MODEL_OPERATION_VISITOR_H__
-#include "Node.Include.h"
-#include "Subgraph.h"
+#include "Operations.Include.h"
+#include "operation/Subgraph.h"
namespace neurun
{
namespace model
{
-namespace operation
-{
-struct NodeVisitor
+struct OperationVisitor
{
- virtual ~NodeVisitor() = default;
+ virtual ~OperationVisitor() = default;
#define OP(InternalName, IsNnApi) \
- virtual void visit(const InternalName &) {}
-#include "model/operation/Op.lst"
+ virtual void visit(const operation::InternalName &) {}
+#include "model/Operations.lst"
#undef OP
// This Subgraph node should be handled specially so that
// Op.lst doesn't have Subgraph
- virtual void visit(const Subgraph &subgraph)
+ virtual void visit(const operation::Subgraph &subgraph)
{
for (const auto &e : subgraph.operations())
{
}
};
-} // namespace operation
} // namespace model
} // namespace neurun
-#endif // __NEURUN_MODEL_OPERATION_NODE_VISITOR_H__
+#endif // __NEURUN_MODEL_OPERATION_VISITOR_H__
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This file has no ifdef guard intentionally
+
+#include "operation/Conv2DNode.h"
+#include "operation/MaxPool2DNode.h"
+#include "operation/AvgPool2DNode.h"
+#include "operation/ConcatNode.h"
+#include "operation/ReshapeNode.h"
+#include "operation/FullyConnectedNode.h"
+#include "operation/SoftmaxNode.h"
+#include "operation/TransposeNode.h"
+#include "operation/PermuteNode.h"
+#include "operation/ReduceSumNode.h"
+#include "operation/AddNode.h"
+#include "operation/SubNode.h"
+#include "operation/DepthwiseConv2DNode.h"
+#include "operation/StridedSliceNode.h"
+#include "operation/MulNode.h"
+#include "operation/SqueezeNode.h"
+#include "operation/TanhNode.h"
+#include "operation/LogisticNode.h"
+#include "operation/CastNode.h"
+#include "operation/DivNode.h"
+#include "operation/ExpNode.h"
+#include "operation/ReduceMaxNode.h"
+#include "operation/ComparisonNode.h"
+#include "operation/LogicalAndNode.h"
+#include "operation/LogicalOrNode.h"
+#include "operation/LogicalNotNode.h"
+#include "operation/RSQRTNode.h"
+#include "operation/ReLUNode.h"
+#include "operation/ResizeBilinearNode.h"
+#include "operation/ReLU1Node.h"
+#include "operation/ReLU6Node.h"
+#include "operation/FloorNode.h"
+#include "operation/SpaceToDepthNode.h"
+#include "operation/L2Pool2DNode.h"
+#include "operation/EmbeddingLookupNode.h"
+#include "operation/L2NormalizationNode.h"
+#include "operation/HashtableLookupNode.h"
+#include "operation/PReLUNode.h"
+#include "operation/TransposeConvNode.h"
+#include "operation/SQRTNode.h"
+#include "operation/SquaredDifferenceNode.h"
+#include "operation/TopKV2Node.h"
+#include "operation/GatherNode.h"
+#include "operation/NegNode.h"
+#include "operation/AbsNode.h"
+#include "operation/ArgMaxNode.h"
+#include "operation/DequantizeNode.h"
+#include "operation/MeanNode.h"
+#include "operation/LocalResponseNormalizationNode.h"
+#include "operation/DepthToSpaceNode.h"
+#include "operation/ReduceMinNode.h"
* limitations under the License.
*/
-#ifndef __NEURUN_MODEL_OPERATION_SET_H__
-#define __NEURUN_MODEL_OPERATION_SET_H__
+#ifndef __NEURUN_MODEL_OPERATIONS_H__
+#define __NEURUN_MODEL_OPERATIONS_H__
#include <memory>
{
namespace model
{
-namespace operation
-{
-class Set
+class Operations
{
public:
- Set() : _index_count(0) {}
+ Operations() : _index_count(0) {}
public:
OperationIndex append(std::unique_ptr<Operation> &&node);
OperationIndex _index_count;
};
-} // namespace operation
} // namespace model
} // namespace neurun
-#endif // __NEURUN_MODEL_OPERATION_SET_H__
+#endif // __NEURUN_MODEL_OPERATION_MANAGER_H__
#include "Data.h"
#include "Info.h"
#include "graph/operand/ParentInfo.h" // TODO Remove this dependency
-#include "model/operation/IndexList.h"
+#include "model/OperationIndexList.h"
#include "model/operand/DataType.h"
namespace neurun
bool usageIsDefined(void) const { return _usage != Usage::NOT_DEFINED; }
bool usage(Usage usage);
- const operation::IndexList &getUses() const { return _uses; }
- const operation::IndexList &getDef() const { return _def; }
+ const OperationIndexList &getUses() const { return _uses; }
+ const OperationIndexList &getDef() const { return _def; }
void appendUse(const OperationIndex &idx);
void removeUse(const OperationIndex &idx);
void appendDef(const OperationIndex &idx);
std::unique_ptr<Data> _data;
Usage _usage;
- operation::IndexList _uses;
- operation::IndexList _def; // size is 0 (constant) or 1 (from def operation)
+ OperationIndexList _uses;
+ OperationIndexList _def; // size is 0 (constant) or 1 (from def operation)
std::unique_ptr<graph::operand::ParentInfo> _parent_info;
};
AbsNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Abs"; }
};
AddNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Add"; }
public:
ArgMaxNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ArgMax"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "AvgPool2D"; }
public:
CastNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Cast"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Comparison"; }
public:
ConcatNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Concat"; }
public:
Conv2DNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Conv2D"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "DepthToSpace"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "DepthwiseConv2D"; }
public:
DequantizeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Dequantize"; }
};
DivNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Div"; }
public:
EmbeddingLookupNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "EmbeddingLookup"; }
};
ExpNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Exp"; }
};
FloorNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Floor"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "FullyConnected"; }
public:
GatherNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Gather"; }
public:
HashtableLookupNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "HashTableLookup"; }
};
L2NormalizationNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "L2Normalization"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "L2Pool2D"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "LocalResponseNormalization"; }
public:
LogicalAndNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "LogicalAnd"; }
};
LogicalNotNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "LogicalNot"; }
};
LogicalOrNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "LogicalOr"; }
};
LogisticNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Logistic"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "MaxPool2D"; }
public:
MeanNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Mean"; }
public:
MulNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Mul"; }
public:
NegNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Neg"; }
};
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// This file has no ifdef guard intentionally
-
-#include "Conv2DNode.h"
-#include "MaxPool2DNode.h"
-#include "AvgPool2DNode.h"
-#include "ConcatNode.h"
-#include "ReshapeNode.h"
-#include "FullyConnectedNode.h"
-#include "SoftmaxNode.h"
-#include "TransposeNode.h"
-#include "PermuteNode.h"
-#include "ReduceSumNode.h"
-#include "AddNode.h"
-#include "SubNode.h"
-#include "DepthwiseConv2DNode.h"
-#include "StridedSliceNode.h"
-#include "MulNode.h"
-#include "SqueezeNode.h"
-#include "TanhNode.h"
-#include "LogisticNode.h"
-#include "CastNode.h"
-#include "DivNode.h"
-#include "ExpNode.h"
-#include "ReduceMaxNode.h"
-#include "ComparisonNode.h"
-#include "LogicalAndNode.h"
-#include "LogicalOrNode.h"
-#include "LogicalNotNode.h"
-#include "RSQRTNode.h"
-#include "ReLUNode.h"
-#include "ResizeBilinearNode.h"
-#include "ReLU1Node.h"
-#include "ReLU6Node.h"
-#include "FloorNode.h"
-#include "SpaceToDepthNode.h"
-#include "L2Pool2DNode.h"
-#include "EmbeddingLookupNode.h"
-#include "L2NormalizationNode.h"
-#include "HashtableLookupNode.h"
-#include "PReLUNode.h"
-#include "TransposeConvNode.h"
-#include "SQRTNode.h"
-#include "SquaredDifferenceNode.h"
-#include "TopKV2Node.h"
-#include "GatherNode.h"
-#include "NegNode.h"
-#include "AbsNode.h"
-#include "ArgMaxNode.h"
-#include "DequantizeNode.h"
-#include "MeanNode.h"
-#include "LocalResponseNormalizationNode.h"
-#include "DepthToSpaceNode.h"
-#include "ReduceMinNode.h"
PReLUNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "PReLU"; }
};
};
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Permute"; }
public:
RSQRTNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "RSQRT"; }
};
ReLU1Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReLU1"; }
};
ReLU6Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReLU6"; }
};
ReLUNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReLU"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReduceMax"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReduceMin"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ReduceSum"; }
public:
ReshapeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Reshape"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "ResizeBilinear"; }
public:
SQRTNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "SQRT"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "SoftMax"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "SpaceToDepth"; }
public:
SquaredDifferenceNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "SquaredDifference"; }
};
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Squeeze"; }
const Param ¶m() const { return _param; }
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "StridedSlice"; }
public:
SubNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Sub"; }
public:
Subgraph(const Subgraph &) = delete;
public:
- virtual void accept(NodeVisitor &&visitor) const override;
+ virtual void accept(OperationVisitor &&visitor) const override;
virtual std::string getName(void) const override { return "Subgraph"; }
TanhNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Tanh"; }
};
TopKV2Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs, const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "TopKV2"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "TransposeConv"; }
public:
const Param ¶m);
public:
- virtual void accept(NodeVisitor &&) const override;
+ virtual void accept(OperationVisitor &&) const override;
virtual std::string getName() const override { return "Transpose"; }
public:
#define OP(InternalName, IsNnApi) \
CONFIG(OP_BACKEND_ ## InternalName, std::string, "acl_cl")
-#include "model/operation/Op.lst"
+#include "model/Operations.lst"
#undef OP
auto backend = _backend_manager->get(backend_all_str); \
_gen_map[typeid(model::operation::InternalName)] = backend; \
}
-#include "model/operation/Op.lst"
+#include "model/Operations.lst"
#undef OP
}
else
_gen_map[typeid(model::operation::InternalName)] = backend; \
}
-#include "model/operation/Op.lst"
+#include "model/Operations.lst"
#undef OP
}
}
#ifndef __NEURUN_COMPILER_OPERATION_VALIDATOR_H__
#define __NEURUN_COMPILER_OPERATION_VALIDATOR_H__
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace compiler
{
-class OperationValidator : public model::NodeVisitor
+class OperationValidator : public model::OperationVisitor
{
public:
OperationValidator(const neurun::model::operand::Set &ctx) : _ctx{ctx} {}
#ifndef __NEURUN_COMPILER_PARAM_CHECKER_H__
#define __NEURUN_COMPILER_PARAM_CHECKER_H__
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace compiler
{
-class ParamChecker : public model::NodeVisitor
+class ParamChecker : public model::OperationVisitor
{
public:
/**
#ifndef __NEURUN_COMPILER_SUBTENSOR_ANALYZER_H__
#define __NEURUN_COMPILER_SUBTENSOR_ANALYZER_H__
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
#include "graph/Graph.h"
namespace neurun
/**
* @brief Class to analyze tensor subsumption
*/
-class SubTensorAnalyzer : public model::NodeVisitor
+class SubTensorAnalyzer : public model::OperationVisitor
{
public:
/**
return "{ " + str + "}";
};
- auto operation_index_to_string = [](const model::operation::IndexList &operations) {
+ auto operation_index_to_string = [](const model::OperationIndexList &operations) {
std::string str;
for (auto op : operations.list())
{
#ifndef __NEURUN_GRAPH_DUMPER_H__
#define __NEURUN_GRAPH_DUMPER_H__
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace dumper
{
-class Dumper : public model::NodeVisitor
+class Dumper : public model::OperationVisitor
{
public:
Dumper() = default;
// Get SubgraphSequence by topological sorting
{
// subg_ctx can't access a subgraph by an operand so that input_to_subgs can offer it
- std::unordered_map<model::operand::Index, model::operation::IndexList> input_to_subgs;
+ std::unordered_map<model::operand::Index, model::OperationIndexList> input_to_subgs;
// Get the relations between input/subgraph to be used for dfs-post-iter
//
auto it = input_to_subgs.find(input);
if (it == input_to_subgs.end())
{
- model::operation::IndexList list{subg_idx};
+ model::OperationIndexList list{subg_idx};
input_to_subgs[input] = list;
}
else
}
}
-void Linear::accept(model::NodeVisitor &&visitor) const
+void Linear::accept(model::OperationVisitor &&visitor) const
{
for (const auto &e : _elements)
{
{
namespace operation
{
-struct NodeVisitor;
+struct OperationVisitor;
} // namespace operation
} // namespace graph
} // namespace neurun
Linear(const Linear &linear) = delete;
public:
- void accept(model::NodeVisitor &&visitor) const;
+ void accept(model::OperationVisitor &&visitor) const;
// TODO Should not return TensorBuilderSet
backend::TensorBuilderSet planTensors();
* limitations under the License.
*/
-#include "model/operation/OperandConstraint.h"
+#include "model/OperandConstraint.h"
namespace neurun
{
* limitations under the License.
*/
-#include "model/operation/IndexList.h"
+#include "model/OperationIndexList.h"
#include <algorithm>
{
namespace model
{
-namespace operation
-{
-IndexList::IndexList(std::initializer_list<OperationIndex> list) : _list(list)
+OperationIndexList::OperationIndexList(std::initializer_list<OperationIndex> list) : _list(list)
{
// DO NOTHING
}
-bool IndexList::contains(const ::neurun::model::OperationIndex &index) const
+bool OperationIndexList::contains(const ::neurun::model::OperationIndex &index) const
{
return std::find(_list.begin(), _list.end(), index) != _list.end();
}
-} // namespace operation
} // namespace model
} // namespace neurun
* limitations under the License.
*/
-#include "model/operation/Set.h"
+#include "model/Operations.h"
#include <cassert>
{
namespace model
{
-namespace operation
-{
-const OperationIndex Set::generateIndex()
+const OperationIndex Operations::generateIndex()
{
assert(_index_count.valid());
return _index_count++;
}
-OperationIndex Set::append(std::unique_ptr<Operation> &&node)
+OperationIndex Operations::append(std::unique_ptr<Operation> &&node)
{
auto index = generateIndex();
return index;
}
-const Operation &Set::at(const OperationIndex &index) const { return *(_nodes.at(index)); }
+const Operation &Operations::at(const OperationIndex &index) const { return *(_nodes.at(index)); }
-Operation &Set::at(const OperationIndex &index) { return *(_nodes.at(index)); }
+Operation &Operations::at(const OperationIndex &index) { return *(_nodes.at(index)); }
-bool Set::exist(const OperationIndex &index) const { return _nodes.find(index) != _nodes.end(); }
+bool Operations::exist(const OperationIndex &index) const
+{
+ return _nodes.find(index) != _nodes.end();
+}
-void Set::iterate(const std::function<void(const OperationIndex &, const Operation &)> &fn) const
+void Operations::iterate(
+ const std::function<void(const OperationIndex &, const Operation &)> &fn) const
{
for (auto it = _nodes.begin(); it != _nodes.end(); ++it)
{
}
}
-void Set::iterate(const std::function<void(const OperationIndex &, Operation &)> &fn)
+void Operations::iterate(const std::function<void(const OperationIndex &, Operation &)> &fn)
{
for (auto it = _nodes.begin(); it != _nodes.end(); ++it)
{
}
}
-} // namespace operation
} // namespace model
} // namespace neurun
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void AbsNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void AbsNode::accept(OperationVisitor &&v) const { v.visit(*this); }
AbsNode::AbsNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void AddNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void AddNode::accept(OperationVisitor &&v) const { v.visit(*this); }
AddNode::AddNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ArgMaxNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ArgMaxNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ArgMaxNode::ArgMaxNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void AvgPool2DNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void AvgPool2DNode::accept(OperationVisitor &&v) const { v.visit(*this); }
AvgPool2DNode::AvgPool2DNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void CastNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void CastNode::accept(OperationVisitor &&v) const { v.visit(*this); }
CastNode::CastNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ComparisonNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ComparisonNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ComparisonNode::ComparisonNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ConcatNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ConcatNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ConcatNode::ConcatNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void Conv2DNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void Conv2DNode::accept(OperationVisitor &&v) const { v.visit(*this); }
Conv2DNode::Conv2DNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void DepthToSpaceNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void DepthToSpaceNode::accept(OperationVisitor &&v) const { v.visit(*this); }
DepthToSpaceNode::DepthToSpaceNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void DepthwiseConv2DNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void DepthwiseConv2DNode::accept(OperationVisitor &&v) const { v.visit(*this); }
DepthwiseConv2DNode::DepthwiseConv2DNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void DequantizeNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void DequantizeNode::accept(OperationVisitor &&v) const { v.visit(*this); }
DequantizeNode::DequantizeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void DivNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void DivNode::accept(OperationVisitor &&v) const { v.visit(*this); }
DivNode::DivNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void EmbeddingLookupNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void EmbeddingLookupNode::accept(OperationVisitor &&v) const { v.visit(*this); }
EmbeddingLookupNode::EmbeddingLookupNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ExpNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ExpNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ExpNode::ExpNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void FloorNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void FloorNode::accept(OperationVisitor &&v) const { v.visit(*this); }
FloorNode::FloorNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void FullyConnectedNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void FullyConnectedNode::accept(OperationVisitor &&v) const { v.visit(*this); }
FullyConnectedNode::FullyConnectedNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void GatherNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void GatherNode::accept(OperationVisitor &&v) const { v.visit(*this); }
GatherNode::GatherNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void HashtableLookupNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void HashtableLookupNode::accept(OperationVisitor &&v) const { v.visit(*this); }
HashtableLookupNode::HashtableLookupNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void L2NormalizationNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void L2NormalizationNode::accept(OperationVisitor &&v) const { v.visit(*this); }
L2NormalizationNode::L2NormalizationNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void L2Pool2DNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void L2Pool2DNode::accept(OperationVisitor &&v) const { v.visit(*this); }
L2Pool2DNode::L2Pool2DNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void LocalResponseNormalizationNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void LocalResponseNormalizationNode::accept(OperationVisitor &&v) const { v.visit(*this); }
LocalResponseNormalizationNode::LocalResponseNormalizationNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs,
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void LogicalAndNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void LogicalAndNode::accept(OperationVisitor &&v) const { v.visit(*this); }
LogicalAndNode::LogicalAndNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(2u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void LogicalNotNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void LogicalNotNode::accept(OperationVisitor &&v) const { v.visit(*this); }
LogicalNotNode::LogicalNotNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void LogicalOrNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void LogicalOrNode::accept(OperationVisitor &&v) const { v.visit(*this); }
LogicalOrNode::LogicalOrNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(2u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void LogisticNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void LogisticNode::accept(OperationVisitor &&v) const { v.visit(*this); }
LogisticNode::LogisticNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void MaxPool2DNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void MaxPool2DNode::accept(OperationVisitor &&v) const { v.visit(*this); }
MaxPool2DNode::MaxPool2DNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void MeanNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void MeanNode::accept(OperationVisitor &&v) const { v.visit(*this); }
MeanNode::MeanNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void MulNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void MulNode::accept(OperationVisitor &&v) const { v.visit(*this); }
MulNode::MulNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void NegNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void NegNode::accept(OperationVisitor &&v) const { v.visit(*this); }
NegNode::NegNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void PReLUNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void PReLUNode::accept(OperationVisitor &&v) const { v.visit(*this); }
PReLUNode::PReLUNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(2u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void PermuteNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void PermuteNode::accept(OperationVisitor &&v) const { v.visit(*this); }
PermuteNode::PermuteNode(const operand::Index &input, const operand::Index &output, Type type,
const backend::Backend *input_backend,
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void RSQRTNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void RSQRTNode::accept(OperationVisitor &&v) const { v.visit(*this); }
RSQRTNode::RSQRTNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReLU1Node::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReLU1Node::accept(OperationVisitor &&v) const { v.visit(*this); }
ReLU1Node::ReLU1Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReLU6Node::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReLU6Node::accept(OperationVisitor &&v) const { v.visit(*this); }
ReLU6Node::ReLU6Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReLUNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReLUNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ReLUNode::ReLUNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReduceMaxNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReduceMaxNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ReduceMaxNode::ReduceMaxNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReduceMinNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReduceMinNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ReduceMinNode::ReduceMinNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReduceSumNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReduceSumNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ReduceSumNode::ReduceSumNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ReshapeNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ReshapeNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ReshapeNode::ReshapeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void ResizeBilinearNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void ResizeBilinearNode::accept(OperationVisitor &&v) const { v.visit(*this); }
ResizeBilinearNode::ResizeBilinearNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SQRTNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SQRTNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SQRTNode::SQRTNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SoftmaxNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SoftmaxNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SoftmaxNode::SoftmaxNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SpaceToDepthNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SpaceToDepthNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SpaceToDepthNode::SpaceToDepthNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SquaredDifferenceNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SquaredDifferenceNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SquaredDifferenceNode::SquaredDifferenceNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs)
*/
#include "model/operation/SqueezeNode.h"
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SqueezeNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SqueezeNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SqueezeNode::SqueezeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void StridedSliceNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void StridedSliceNode::accept(OperationVisitor &&v) const { v.visit(*this); }
StridedSliceNode::StridedSliceNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void SubNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void SubNode::accept(OperationVisitor &&v) const { v.visit(*this); }
SubNode::SubNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
*/
#include "model/operation/Subgraph.h"
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
#include <sstream>
namespace neurun
// DO NOTHING
}
-void Subgraph::accept(NodeVisitor &&v) const { v.visit(*this); }
+void Subgraph::accept(OperationVisitor &&v) const { v.visit(*this); }
// TODO: Impl Dumper instead of this method
std::string Subgraph::getStr() const
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void TanhNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void TanhNode::accept(OperationVisitor &&v) const { v.visit(*this); }
TanhNode::TanhNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs)
: model::Operation{OperandConstraint::createExact(1u), inputs, outputs}
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void TopKV2Node::accept(NodeVisitor &&v) const { v.visit(*this); }
+void TopKV2Node::accept(OperationVisitor &&v) const { v.visit(*this); }
TopKV2Node::TopKV2Node(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void TransposeConvNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void TransposeConvNode::accept(OperationVisitor &&v) const { v.visit(*this); }
TransposeConvNode::TransposeConvNode(const operand::IndexSet &inputs,
const operand::IndexSet &outputs, const Param ¶m)
#include <cassert>
-#include "model/operation/NodeVisitor.h"
+#include "model/OperationVisitor.h"
namespace neurun
{
namespace operation
{
-void TransposeNode::accept(NodeVisitor &&v) const { v.visit(*this); }
+void TransposeNode::accept(OperationVisitor &&v) const { v.visit(*this); }
TransposeNode::TransposeNode(const operand::IndexSet &inputs, const operand::IndexSet &outputs,
const Param ¶m)
#include "OperationFactory.h"
-#include "model/operation/Node.Include.h"
+#include "model/Operations.Include.h"
namespace
{
#include "OperationFactory.h"
#include "NNAPIConvert.h"
-#include "model/operation/Node.Include.h"
+#include "model/Operations.Include.h"
#include "util/logging.h"
#include "cpp14/memory.h"
}
public:
- void accept(neurun::model::operation::NodeVisitor &&) const override {}
+ void accept(neurun::model::OperationVisitor &&) const override {}
std::string getName() const override { return "SimpleMockNode"; }
};
#include <gtest/gtest.h>
#include "../MockNode.h"
-#include "model/operation/Set.h"
+#include "model/Operations.h"
-using neurun::model::operation::Set;
+using neurun::model::Operations;
using neurun::model::Operation;
using neurun::model::OperationIndex;
TEST(graph_operation_Set, operation_test)
{
- Set set;
- set.append(
+ Operations ops;
+ ops.append(
std::unique_ptr<Operation>(new neurun_test::graph::SimpleMockNode({1, 2, 3, 4}, {5, 6, 7})));
OperationIndex idx{0u};
- ASSERT_EQ(set.at(idx).getInputs().size(), 4);
- ASSERT_EQ(set.at(idx).getOutputs().size(), 3);
+ ASSERT_EQ(ops.at(idx).getInputs().size(), 4);
+ ASSERT_EQ(ops.at(idx).getOutputs().size(), 3);
}