From 6858f0a06ab8f833de7171dba2f4c86319fb159c Mon Sep 17 00:00:00 2001 From: Tianlei Wu Date: Tue, 10 Dec 2019 10:29:41 -0800 Subject: [PATCH] Add support for opset 11 in reshape fusion (#2592) Support opset verion 11 in reshape fusion --- onnxruntime/core/optimizer/reshape_fusion.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onnxruntime/core/optimizer/reshape_fusion.cc b/onnxruntime/core/optimizer/reshape_fusion.cc index 0b54e46745..0b0172792c 100644 --- a/onnxruntime/core/optimizer/reshape_fusion.cc +++ b/onnxruntime/core/optimizer/reshape_fusion.cc @@ -72,7 +72,7 @@ bool ReshapeFusion::Fuse_Subgraph1(Node& reshape, Graph& graph, const logging::L } const Node& concat = *p_concat; - if (!graph_utils::IsSupportedOptypeVersionAndDomain(concat, "Concat", {1, 4})) { + if (!graph_utils::IsSupportedOptypeVersionAndDomain(concat, "Concat", {1, 4, 11})) { return false; } @@ -83,8 +83,8 @@ bool ReshapeFusion::Fuse_Subgraph1(Node& reshape, Graph& graph, const logging::L // path 1: [Root] --> Shape --> Gather(indices=0) --> Unsqueeze (axes=0) --> Concat [input 0] std::vector parent_path{ - {0, 0, "Unsqueeze", {1}, kOnnxDomain}, - {0, 0, "Gather", {1}, kOnnxDomain}, + {0, 0, "Unsqueeze", {1, 11}, kOnnxDomain}, + {0, 0, "Gather", {1, 11}, kOnnxDomain}, {0, 0, "Shape", {1}, kOnnxDomain}}; std::vector edges; @@ -114,8 +114,8 @@ bool ReshapeFusion::Fuse_Subgraph1(Node& reshape, Graph& graph, const logging::L // path 2: [Root] --> Shape --> Gather(indices=1) --> Unsqueeze (axes=0) --> Concat [input 1] std::vector parent_path2 { - {0, 1, "Unsqueeze", {1}, kOnnxDomain}, - {0, 0, "Gather", {1}, kOnnxDomain}, + {0, 1, "Unsqueeze", {1, 11}, kOnnxDomain}, + {0, 0, "Gather", {1, 11}, kOnnxDomain}, {0, 0, "Shape", {1}, kOnnxDomain}}; if (!graph_utils::FindPath(concat, true, parent_path2, edges, logger)) {