diff --git a/ge/offline/single_op_parser.cc b/ge/offline/single_op_parser.cc index 94d4d579..38ac5a39 100644 --- a/ge/offline/single_op_parser.cc +++ b/ge/offline/single_op_parser.cc @@ -203,16 +203,11 @@ void SetAttrValue(const Json &j, SingleOpAttr &attr) { // when attr type is "data_type", we support two kinds of attr value. // 1. value: "DT_FLOAT", "DT_INT32", "DT_INT8" ... // 2. value: 1, 3 ... - if (j.at(kKeyType).get() == "data_type") { - if (AttrValueIsString(j, kKeyValue)) { - string type_str = j.at(kKeyValue).get(); - DataType dtype = GetValue(kDataTypeStringToEnum, type_str, DT_UNDEFINED); - attr.value.SetValue(dtype); - return; - } else { - attr.value.SetValue(j.at(kKeyValue).get()); - return; - } + if (j.at(kKeyType).get() == "data_type" && AttrValueIsString(j, kKeyValue)) { + string type_str = j.at(kKeyValue).get(); + DataType dtype = GetValue(kDataTypeStringToEnum, type_str, DT_UNDEFINED); + attr.value.SetValue(dtype); + return; } attr.value.SetValue(j.at(kKeyValue).get()); }