From f3197104e7695a4f0dd2475b6359802801b402e7 Mon Sep 17 00:00:00 2001 From: zhoufeng Date: Mon, 30 Nov 2020 21:08:48 +0800 Subject: [PATCH] fix hccl ge stub node shape and type Signed-off-by: zhoufeng --- mindspore/ccsrc/runtime/hccl_adapter/converter.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/runtime/hccl_adapter/converter.cc b/mindspore/ccsrc/runtime/hccl_adapter/converter.cc index d01fdd0930..a6280043fa 100644 --- a/mindspore/ccsrc/runtime/hccl_adapter/converter.cc +++ b/mindspore/ccsrc/runtime/hccl_adapter/converter.cc @@ -133,14 +133,13 @@ std::tuple GenerateStubGeNode(const AnfNodePtr ge::OpDescPtr op_desc = std::make_shared(kStubDataStructureName, ge_node_name); MS_EXCEPTION_IF_NULL(op_desc); for (size_t i = 1; i < cnode->size(); ++i) { - auto &input = cnode->input(i); std::vector ge_shape; - auto ms_shape = AnfAlgo::GetOutputInferShape(input, 0); + auto ms_shape = AnfAlgo::GetInputDeviceShape(cnode, i - 1); std::transform(ms_shape.begin(), ms_shape.end(), std::back_inserter(ge_shape), [](size_t in) { return static_cast(in); }); op_desc->AddInputDesc( ge::GeTensorDesc(ge::GeShape(ge_shape), ge::Format::FORMAT_NCHW, - transform::TransformUtil::ConvertDataType(AnfAlgo::GetOutputInferDataType(input, 0)))); + transform::TransformUtil::ConvertDataType(AnfAlgo::GetInputDeviceDataType(cnode, i - 1)))); } // set node data type