forked from mindspore-Ecosystem/mindspore
!31610 clean code
Merge pull request !31610 from jiaorui/clean-code-master
This commit is contained in:
commit
2266dfc7f3
|
@ -131,7 +131,7 @@ std::string GetOpDebugLevel() {
|
|||
}
|
||||
|
||||
nlohmann::json TbeUtils::GenSocInfo() {
|
||||
static nlohmann::json soc_info_json;
|
||||
static nlohmann::json soc_info_json = nlohmann::json();
|
||||
if (!soc_info_json.empty()) {
|
||||
return soc_info_json;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ CNodePtr CreateSplitNode(const FuncGraphPtr &graph, const std::vector<AnfNodePtr
|
|||
} else {
|
||||
common::AnfAlgo::SetOutputInferTypeAndShape(dtypes, shapes, split_v.get());
|
||||
}
|
||||
common::AnfAlgo::SetNodeAttr(kAttrSplitDim, MakeValue<int64_t>(split_dim), split_v);
|
||||
common::AnfAlgo::SetNodeAttr(kAttrSplitDim, MakeValue<int64_t>(SizeToLong(split_dim)), split_v);
|
||||
common::AnfAlgo::SetNodeAttr(kAttrNumSplit, MakeValue<int64_t>(*num_split), split_v);
|
||||
common::AnfAlgo::SetNodeAttr(kAttrSizeSplits, MakeValue<std::vector<int64_t>>(size_splits), split_v);
|
||||
common::AnfAlgo::SetNodeAttr("is_backend_insert", MakeValue(true), split_v);
|
||||
|
@ -563,9 +563,9 @@ CNodePtr NeighborExchangeV2UnifyMindIR::CreateLeftRightConcat(const FuncGraphPtr
|
|||
all_to_all_v_outputs.begin() + input_num + AllToAllRealIds(1, recv_rank_ids));
|
||||
}
|
||||
|
||||
std::vector<TypeId> concat_output_dtype = {
|
||||
common::AnfAlgo::GetOutputInferDataType(all_to_all_v_outputs[AllToAllRealIds(middle_ids, recv_rank_ids)], 0)};
|
||||
auto concat = CreateConcatNode(graph, concat_input, kHDim, input_num);
|
||||
std::vector<TypeId> concat_output_dtype = {common::AnfAlgo::GetOutputInferDataType(
|
||||
all_to_all_v_outputs[LongToSize(AllToAllRealIds(middle_ids, recv_rank_ids))], 0)};
|
||||
auto concat = CreateConcatNode(graph, concat_input, SizeToLong(kHDim), input_num);
|
||||
if (is_dynamic) {
|
||||
ShapeVector shape;
|
||||
std::transform(single_shape.begin(), single_shape.end(), std::back_inserter(shape), SizeToLong);
|
||||
|
@ -615,7 +615,7 @@ CNodePtr NeighborExchangeV2UnifyMindIR::CreateMiddleConcat(
|
|||
(void)concat_input_all.insert(concat_input_all.end(), all_to_all_v_outputs.begin(),
|
||||
all_to_all_v_outputs.begin() + 1);
|
||||
} else {
|
||||
int64_t bottom_num = AllToAllRealIds(4, recv_rank_ids);
|
||||
int64_t bottom_num = AllToAllRealIds(kRankIdFour, recv_rank_ids);
|
||||
(void)concat_input_all.insert(concat_input_all.end(), all_to_all_v_outputs.begin() + bottom_num,
|
||||
all_to_all_v_outputs.begin() + bottom_num + 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue