!31172 [FL][master] signds clean code

Merge pull request !31172 from emmmmtang/master
This commit is contained in:
i-robot 2022-03-14 04:53:32 +00:00 committed by Gitee
commit f8d5ffe48a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 12 deletions

View File

@ -356,15 +356,7 @@ std::map<std::string, UploadData> UpdateModelKernel::ParseSignDSFeatureMap(
std::map<std::string, UploadData> feature_map;
auto sign = update_model_req->sign();
if (sign == 0) {
for (uint32_t i = 0; i < fbs_feature_map->size(); i++) {
std::string weight_full_name = fbs_feature_map->Get(i)->weight_fullname()->str();
float *weight_data = const_cast<float *>(fbs_feature_map->Get(i)->data()->data());
size_t weight_size = fbs_feature_map->Get(i)->data()->size() * sizeof(float);
UploadData upload_data;
upload_data[kNewWeight].addr = weight_data;
upload_data[kNewWeight].size = weight_size;
feature_map[weight_full_name] = upload_data;
}
feature_map = ParseFeatureMap(update_model_req);
return feature_map;
}

View File

@ -320,7 +320,7 @@ public class UpdateModel {
this.fmOffset = RequestUpdateModel.createFeatureMapVector(builder, fmOffsetsDP);
LOGGER.info(Common.addTag("[Encrypt] DP mask model ok!"));
endTime = System.currentTimeMillis();
LOGGER.info(Common.addTag("dp time is" + (endTime - startTime) + "ms"));
LOGGER.info(Common.addTag("[Encrypt] dp time is: " + (endTime - startTime) + "ms"));
return this;
case SIGNDS:
startTime = System.currentTimeMillis();
@ -352,7 +352,7 @@ public class UpdateModel {
this.fmOffset = RequestUpdateModel.createFeatureMapVector(builder, fmOffsetsSignds);
LOGGER.info(Common.addTag("[Encrypt] SignDS mask model ok!"));
endTime = System.currentTimeMillis();
LOGGER.info(Common.addTag("signds time is" + (endTime - startTime) + "ms"));
LOGGER.info(Common.addTag("[Encrypt] signds time is: " + (endTime - startTime) + "ms"));
return this;
case NOT_ENCRYPT:
default:
@ -374,7 +374,7 @@ public class UpdateModel {
}
this.fmOffset = RequestUpdateModel.createFeatureMapVector(builder, fmOffsets);
endTime = System.currentTimeMillis();
LOGGER.info(Common.addTag("not encrypt time is" + (endTime - startTime) + "ms"));
LOGGER.info(Common.addTag("[Encrypt] not encrypt time is: " + (endTime - startTime) + "ms"));
return this;
}
}