Commit 8b1b4165 authored by Scott Cyphers's avatar Scott Cyphers

Simplify expression construction for tests.

parent de672abe
......@@ -28,4 +28,10 @@ namespace ngraph
virtual std::string description() const override { return "Add"; }
};
}
inline std::shared_ptr<ngraph::Node> operator+(const std::shared_ptr<ngraph::Node> arg0,
const std::shared_ptr<ngraph::Node> arg1)
{
return std::make_shared<ngraph::op::Add>(arg0, arg1);
}
}
......@@ -29,4 +29,10 @@ namespace ngraph
virtual std::string description() const override { return "Multiply"; }
};
}
inline std::shared_ptr<ngraph::Node> operator*(const std::shared_ptr<ngraph::Node> arg0,
const std::shared_ptr<ngraph::Node> arg1)
{
return std::make_shared<ngraph::op::Multiply>(arg0, arg1);
}
}
......@@ -25,11 +25,10 @@ TEST(execute, test_abc)
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto B = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto C = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(make_shared<op::Multiply>(make_shared<op::Add>(A, B), C),
op::Parameters{A, B, C});
auto f = make_shared<Function>((A + B) * C, op::Parameters{A, B, C});
auto external = make_shared<ngraph::runtime::eigen::ExternalFunction>(f);
auto cf = external->make_call_frame();
auto cf = external->make_call_frame();
// Create some tensors for input/output
auto a = make_shared<runtime::eigen::PrimaryTensorView<element::Float32>>(shape);
......
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