diff --git a/mindspore/ccsrc/runtime/hccl_adapter/converter.cc b/mindspore/ccsrc/runtime/hccl_adapter/converter.cc index d01fdd09303..a6280043fa1 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