Commit 688f5144 authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

Make Node's type_info mandatory (#3891)

* Make Node's type_info mandatory

* Add ReplaceSlice to ZeroDimTensorEliminiation pass (#3899)

* Add ReplaceSlice to ZeroDimTensorEliminiation pass

* style

* Force Gelu decompose on CPU (#3902)
parent 65456b05
...@@ -178,7 +178,7 @@ namespace ngraph ...@@ -178,7 +178,7 @@ namespace ngraph
/// Returns the NodeTypeInfo for the node's class. /// Returns the NodeTypeInfo for the node's class.
/// During transition to type_info, returns a dummy type_info for Node if the class /// During transition to type_info, returns a dummy type_info for Node if the class
/// has not been updated yet. /// has not been updated yet.
virtual const NodeTypeInfo& get_type_info() const { return type_info; } virtual const NodeTypeInfo& get_type_info() const = 0;
virtual const char* get_type_name() const virtual const char* get_type_name() const
{ {
auto& info = get_type_info(); auto& info = get_type_info();
......
...@@ -47,6 +47,8 @@ using namespace std; ...@@ -47,6 +47,8 @@ using namespace std;
class ControlDependencyOp : public ngraph::op::Op class ControlDependencyOp : public ngraph::op::Op
{ {
public: public:
static constexpr NodeTypeInfo type_info{"ControlDependencyOp", 0};
const NodeTypeInfo& get_type_info() const override { return type_info; }
virtual std::shared_ptr<Node> copy_with_new_args(const NodeVector& new_args) const override virtual std::shared_ptr<Node> copy_with_new_args(const NodeVector& new_args) const override
{ {
auto clone = make_shared<ControlDependencyOp>(new_args, std::set<std::shared_ptr<Node>>{}); auto clone = make_shared<ControlDependencyOp>(new_args, std::set<std::shared_ptr<Node>>{});
...@@ -77,6 +79,7 @@ public: ...@@ -77,6 +79,7 @@ public:
} }
} }
}; };
constexpr NodeTypeInfo ControlDependencyOp::type_info;
TEST(control_dependencies, cdep_ops) TEST(control_dependencies, cdep_ops)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment