Commit 67163443 authored by Scott Cyphers's avatar Scott Cyphers

Rename comparison method

parent 3ce0e496
......@@ -65,11 +65,11 @@ namespace ngraph
void name(const std::string& name) { m_name = name; }
/**
** Return true if this has the same implementing class as call. This
** Return true if this has the same implementing class as node. This
** will be used by the pattern matcher when comparing a pattern
** graph against the graph.
**/
bool has_same_op(const Node::ptr& node) const { return typeid(*this) == typeid(*node.get()); }
bool is_same_op_type(const Node::ptr& node) const { return typeid(*this) == typeid(*node.get()); }
protected:
std::vector<Node::ptr> m_arguments;
......
......@@ -29,11 +29,9 @@ TEST(build_graph, build_simple)
cluster_0->parameter(2)->type(element::float32_t, {32, 7});
cluster_0->parameter(3)->type(element::float32_t, {32, 7});
auto arg3 = cluster_0->parameter(3);
// call broadcast op on arg3, broadcasting on axis 0.
auto broadcast_1 = op::broadcast(arg3, {10, 32, 7}, {0});
auto arg2 = cluster_0->parameter(2);
auto arg0 = cluster_0->parameter(0);
// call dot op
auto dot = op::dot(arg2, arg0);
ASSERT_EQ(dot->arguments()[0], arg2);
ASSERT_EQ(dot->arguments()[1], arg0);
......@@ -61,8 +59,8 @@ TEST(build_graph, as_type)
ASSERT_EQ(tp_vt, tp_tp);
}
// Check Call comparisons
TEST(build_graph, call_comparison)
// Check node comparisons
TEST(build_graph, node_comparison)
{
auto fun = make_shared<Function>(3);
fun->parameter(0)->type(element::float32_t, {32, 3});
......@@ -79,10 +77,10 @@ TEST(build_graph, call_comparison)
pattern->parameter(0)->type(element::float32_t, {});
auto parg = pattern->parameter(0);
auto pattern_dot = op::dot(parg, parg);
ASSERT_TRUE(pattern_dot->has_same_op(dot));
ASSERT_TRUE(pattern_dot->is_same_op_type(dot));
// TODO This passes because typeid is not behaving as documented.
// Need to figure out what's wrong.
ASSERT_FALSE(pattern_dot->has_same_op(add));
ASSERT_FALSE(pattern_dot->is_same_op_type(add));
}
// Check argument inverses
......
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