Commit ec2f69bf authored by Ilya Churaev's avatar Ilya Churaev Committed by Scott Cyphers

Added float16 support for constant op (#3039)

* Added float16 support for constant op

* Fix Compilation issue.

* Style.
parent 40c73f54
......@@ -19,6 +19,7 @@
#include "ngraph/node.hpp"
#include "ngraph/op/broadcast.hpp"
#include "ngraph/op/constant.hpp"
#include "ngraph/type/float16.hpp"
namespace ngraph
{
......@@ -40,6 +41,13 @@ namespace ngraph
val = std::make_shared<ngraph::op::Constant>(
type, ngraph::Shape{}, std::vector<double>{static_cast<double>(num)});
}
else if (type == element::f16)
{
val = std::make_shared<ngraph::op::Constant>(
type,
ngraph::Shape{},
std::vector<ngraph::float16>{ngraph::float16(static_cast<float>(num))});
}
else if (type == element::i64)
{
val = std::make_shared<ngraph::op::Constant>(
......
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