Browse Source

!4816 delete info

Merge pull request !4816 from hexia/fix_log
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
9b9d7be73d
2 changed files with 3 additions and 5 deletions
  1. +0
    -3
      serving/core/http_process.cc
  2. +3
    -2
      serving/example/cpp_client/ms_client.cc

+ 0
- 3
serving/core/http_process.cc View File

@@ -102,7 +102,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE
}
auto s_data = json_data.get<int32_t>();
data->append(reinterpret_cast<char *>(&s_data), sizeof(int32_t));
MSI_LOG(INFO) << "data size " << data->size();
} else if (json_data.is_number_float()) {
if (*type == HTTP_DATA_NONE) {
*type = HTTP_DATA_FLOAT;
@@ -112,7 +111,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE
}
auto s_data = json_data.get<float>();
data->append(reinterpret_cast<char *>(&s_data), sizeof(float));
MSI_LOG(INFO) << "data size " << data->size();
} else {
ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input data type should be int or float");
return status;
@@ -227,7 +225,6 @@ Status TransTensorToPredictRequest(const json &message_info, PredictRequest *req
std::string msg_data;
HTTP_DATA_TYPE type{HTTP_DATA_NONE};
RecusiveGetTensor(tensor, 0, &shape, &msg_data, &type);
MSI_LOG(INFO) << shape << ", data = " << msg_data.size();
auto iter = http_to_infer_map.find(type);
if (iter == http_to_infer_map.end()) {
ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input type is not supported right now");


+ 3
- 2
serving/example/cpp_client/ms_client.cc View File

@@ -41,7 +41,8 @@ class MSClient {

Tensor data;
TensorShape shape;
shape.add_dims(4);
shape.add_dims(2);
shape.add_dims(2);
*data.mutable_tensor_shape() = shape;
data.set_tensor_type(ms_serving::MS_FLOAT32);
std::vector<float> input_data{1, 2, 3, 4};
@@ -58,7 +59,7 @@ class MSClient {

// The actual RPC.
Status status = stub_->Predict(&context, request, &reply);
std::cout << "Compute [1, 2, 3, 4] + [1, 2, 3, 4]" << std::endl;
std::cout << "Compute [[1, 2], [3, 4]] + [[1, 2], [3, 4]]" << std::endl;

// Act upon its status.
if (status.ok()) {


Loading…
Cancel
Save