From 44dd1a422b10dd78d9a7ad39bd39c334abc2c849 Mon Sep 17 00:00:00 2001 From: Sayantan Sarkar Date: Sun, 1 Dec 2019 22:09:48 -0800 Subject: [PATCH] Fix int32-int64 issue. Removing convert op --- ngraph_bridge/ngraph_builder.cc | 13 +++++++++---- ngraph_bridge/ngraph_mark_for_clustering.cc | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ngraph_bridge/ngraph_builder.cc b/ngraph_bridge/ngraph_builder.cc index 587342be5..c47e7395f 100644 --- a/ngraph_bridge/ngraph_builder.cc +++ b/ngraph_bridge/ngraph_builder.cc @@ -3735,8 +3735,15 @@ static Status TranslateReshapeOp( static Status TranslateResizeBilinearOp( const Node* op, const std::vector& static_input_map, Builder::OpMap& ng_op_map) { - shared_ptr images, size; - TF_RETURN_IF_ERROR(GetInputNodes(ng_op_map, op, &images, &size)); + shared_ptr images; + TF_RETURN_IF_ERROR(GetInputNodes(ng_op_map, op, &images, nullptr)); + + std::vector size_vector; + TF_RETURN_IF_ERROR( + GetStaticInputVector(op, 1, static_input_map, &size_vector)); + + auto size_int64 = ConstructNgNode( + op->name(), ngraph::element::i64, ng::Shape{2}, size_vector); bool align_corners; TF_RETURN_IF_ERROR(GetNodeAttr(op->attrs(), "align_corners", &align_corners)); @@ -3751,8 +3758,6 @@ static Status TranslateResizeBilinearOp( attrs.axes = {1, 2}; // TODO: pads_begin and pads_end are not populated. Check correctness - auto size_int64 = - ConstructNgNode(op->name(), size, ngraph::element::i64); SaveNgOp(ng_op_map, op->name(), ConstructNgNode( op->name(), images, size_int64, attrs)); diff --git a/ngraph_bridge/ngraph_mark_for_clustering.cc b/ngraph_bridge/ngraph_mark_for_clustering.cc index ac4144d74..0588bcb74 100644 --- a/ngraph_bridge/ngraph_mark_for_clustering.cc +++ b/ngraph_bridge/ngraph_mark_for_clustering.cc @@ -656,6 +656,7 @@ Status MarkForClustering(Graph* graph, const std::set skip_these_nodes, return Status::OK(); }; set_attributes_map["Reshape"] = SetStaticInputs({1}); + set_attributes_map["ResizeBilinear"] = SetStaticInputs({1}); set_attributes_map["ScatterNd"] = SetStaticInputs({2}); set_attributes_map["Slice"] = SetStaticInputs({1, 2}); set_attributes_map["Split"] = SetStaticInputs({0});