diff --git a/caffe2/onnx/onnx_exporter.cc b/caffe2/onnx/onnx_exporter.cc index 16cdd622707..f9e322924a0 100644 --- a/caffe2/onnx/onnx_exporter.cc +++ b/caffe2/onnx/onnx_exporter.cc @@ -1367,13 +1367,13 @@ ConvertedResult OnnxExporter::CreateGemmNodes( // capture the outer shape if needed. if (axis > 1) { - const auto x_shape = dummy_->NewDummyName(); - nodes.emplace_back(MakeNode("Shape", {x}, {x_shape})); + const auto x_shape_2 = dummy_->NewDummyName(); + nodes.emplace_back(MakeNode("Shape", {x}, {x_shape_2})); const auto x_shape_outer = dummy_->NewDummyName(); nodes.emplace_back(MakeNode( "Slice", - {x_shape}, + {x_shape_2}, {x_shape_outer}, std::vector{ MakeAttribute("starts", std::vector{0}),