Commit 77b2b8bd authored by fenglei's avatar fenglei

add to op_tbl, add to serializer

parent d7eb9439
...@@ -127,6 +127,7 @@ NGRAPH_OP(QuantizedConvolution, ngraph::op) ...@@ -127,6 +127,7 @@ NGRAPH_OP(QuantizedConvolution, ngraph::op)
NGRAPH_OP(QuantizedDotBias, ngraph::op) NGRAPH_OP(QuantizedDotBias, ngraph::op)
NGRAPH_OP(QuantizedDot, ngraph::op) NGRAPH_OP(QuantizedDot, ngraph::op)
NGRAPH_OP(QuantizedMaxPool, ngraph::op) NGRAPH_OP(QuantizedMaxPool, ngraph::op)
NGRAPH_OP(Recv, ngraph::op)
NGRAPH_OP(Relu, ngraph::op) NGRAPH_OP(Relu, ngraph::op)
NGRAPH_OP(ReluBackprop, ngraph::op) NGRAPH_OP(ReluBackprop, ngraph::op)
NGRAPH_OP(ReplaceSlice, ngraph::op) NGRAPH_OP(ReplaceSlice, ngraph::op)
...@@ -138,6 +139,7 @@ NGRAPH_OP(ScalarConstantLike, ngraph::op) ...@@ -138,6 +139,7 @@ NGRAPH_OP(ScalarConstantLike, ngraph::op)
NGRAPH_OP(ScatterAdd, ngraph::op) NGRAPH_OP(ScatterAdd, ngraph::op)
NGRAPH_OP(ScatterNDAdd, ngraph::op) NGRAPH_OP(ScatterNDAdd, ngraph::op)
NGRAPH_OP(Select, ngraph::op) NGRAPH_OP(Select, ngraph::op)
NGRAPH_OP(Send, ngraph::op)
NGRAPH_OP(ShapeOf, ngraph::op) NGRAPH_OP(ShapeOf, ngraph::op)
NGRAPH_OP(Sigmoid, ngraph::op) NGRAPH_OP(Sigmoid, ngraph::op)
NGRAPH_OP(SigmoidBackprop, ngraph::op) NGRAPH_OP(SigmoidBackprop, ngraph::op)
......
...@@ -113,6 +113,7 @@ ...@@ -113,6 +113,7 @@
#include "ngraph/op/power.hpp" #include "ngraph/op/power.hpp"
#include "ngraph/op/product.hpp" #include "ngraph/op/product.hpp"
#include "ngraph/op/quantize.hpp" #include "ngraph/op/quantize.hpp"
#include "ngraph/op/recv.hpp"
#include "ngraph/op/relu.hpp" #include "ngraph/op/relu.hpp"
#include "ngraph/op/replace_slice.hpp" #include "ngraph/op/replace_slice.hpp"
#include "ngraph/op/reshape.hpp" #include "ngraph/op/reshape.hpp"
...@@ -122,6 +123,7 @@ ...@@ -122,6 +123,7 @@
#include "ngraph/op/scatter_add.hpp" #include "ngraph/op/scatter_add.hpp"
#include "ngraph/op/scatter_nd_add.hpp" #include "ngraph/op/scatter_nd_add.hpp"
#include "ngraph/op/select.hpp" #include "ngraph/op/select.hpp"
#include "ngraph/op/send.hpp"
#include "ngraph/op/sigmoid.hpp" #include "ngraph/op/sigmoid.hpp"
#include "ngraph/op/sign.hpp" #include "ngraph/op/sign.hpp"
#include "ngraph/op/sin.hpp" #include "ngraph/op/sin.hpp"
...@@ -1406,6 +1408,12 @@ static shared_ptr<ngraph::Function> ...@@ -1406,6 +1408,12 @@ static shared_ptr<ngraph::Function>
break; break;
} }
case OP_TYPEID::Recv:
{
auto src_id = node_js.at("source_id").get<vector<size_t>>();
node = make_shared<op::Relu>(args[0], src_id);
break;
}
case OP_TYPEID::Relu: case OP_TYPEID::Relu:
{ {
node = make_shared<op::Relu>(args[0]); node = make_shared<op::Relu>(args[0]);
...@@ -1479,6 +1487,12 @@ static shared_ptr<ngraph::Function> ...@@ -1479,6 +1487,12 @@ static shared_ptr<ngraph::Function>
node = make_shared<op::Select>(args[0], args[1], args[2]); node = make_shared<op::Select>(args[0], args[1], args[2]);
break; break;
} }
case OP_TYPEID::Send:
{
auto dest_id = node_js.at("dest_id").get<vector<size_t>>();
node = make_shared<op::Relu>(args[0], dest_id);
break;
}
case OP_TYPEID::ShapeOf: case OP_TYPEID::ShapeOf:
{ {
node = make_shared<op::ShapeOf>(args[0]); node = make_shared<op::ShapeOf>(args[0]);
...@@ -2356,6 +2370,12 @@ static json write(const Node& n, bool binary_constant_data) ...@@ -2356,6 +2370,12 @@ static json write(const Node& n, bool binary_constant_data)
} }
case OP_TYPEID::Relu: { break; case OP_TYPEID::Relu: { break;
} }
case OP_TYPEID::Recv:
{
auto tmp = dynamic_cast<const op::Recv*>(&n);
node["source_id"] = tmp->get_src_id();
break;
}
case OP_TYPEID::ReluBackprop: { break; case OP_TYPEID::ReluBackprop: { break;
} }
case OP_TYPEID::ReplaceSlice: case OP_TYPEID::ReplaceSlice:
...@@ -2408,6 +2428,12 @@ static json write(const Node& n, bool binary_constant_data) ...@@ -2408,6 +2428,12 @@ static json write(const Node& n, bool binary_constant_data)
} }
case OP_TYPEID::Select: { break; case OP_TYPEID::Select: { break;
} }
case OP_TYPEID::Send:
{
auto tmp = dynamic_cast<const op::Send*>(&n);
node["dest_id"] = tmp->get_dest_id();
break;
}
case OP_TYPEID::ShapeOf: { break; case OP_TYPEID::ShapeOf: { break;
} }
case OP_TYPEID::ShuffleChannels: case OP_TYPEID::ShuffleChannels:
......
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