提交 734538c7 编写于 作者: H hexia

delete info

上级 d541e261
...@@ -102,7 +102,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE ...@@ -102,7 +102,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE
} }
auto s_data = json_data.get<int32_t>(); auto s_data = json_data.get<int32_t>();
data->append(reinterpret_cast<char *>(&s_data), sizeof(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()) { } else if (json_data.is_number_float()) {
if (*type == HTTP_DATA_NONE) { if (*type == HTTP_DATA_NONE) {
*type = HTTP_DATA_FLOAT; *type = HTTP_DATA_FLOAT;
...@@ -112,7 +111,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE ...@@ -112,7 +111,6 @@ Status GetDataFromJson(const json &json_data, std::string *data, HTTP_DATA_TYPE
} }
auto s_data = json_data.get<float>(); auto s_data = json_data.get<float>();
data->append(reinterpret_cast<char *>(&s_data), sizeof(float)); data->append(reinterpret_cast<char *>(&s_data), sizeof(float));
MSI_LOG(INFO) << "data size " << data->size();
} else { } else {
ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input data type should be int or float"); ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input data type should be int or float");
return status; return status;
...@@ -227,7 +225,6 @@ Status TransTensorToPredictRequest(const json &message_info, PredictRequest *req ...@@ -227,7 +225,6 @@ Status TransTensorToPredictRequest(const json &message_info, PredictRequest *req
std::string msg_data; std::string msg_data;
HTTP_DATA_TYPE type{HTTP_DATA_NONE}; HTTP_DATA_TYPE type{HTTP_DATA_NONE};
RecusiveGetTensor(tensor, 0, &shape, &msg_data, &type); RecusiveGetTensor(tensor, 0, &shape, &msg_data, &type);
MSI_LOG(INFO) << shape << ", data = " << msg_data.size();
auto iter = http_to_infer_map.find(type); auto iter = http_to_infer_map.find(type);
if (iter == http_to_infer_map.end()) { if (iter == http_to_infer_map.end()) {
ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input type is not supported right now"); ERROR_INFER_STATUS(status, INVALID_INPUTS, "the input type is not supported right now");
......
...@@ -41,7 +41,8 @@ class MSClient { ...@@ -41,7 +41,8 @@ class MSClient {
Tensor data; Tensor data;
TensorShape shape; TensorShape shape;
shape.add_dims(4); shape.add_dims(2);
shape.add_dims(2);
*data.mutable_tensor_shape() = shape; *data.mutable_tensor_shape() = shape;
data.set_tensor_type(ms_serving::MS_FLOAT32); data.set_tensor_type(ms_serving::MS_FLOAT32);
std::vector<float> input_data{1, 2, 3, 4}; std::vector<float> input_data{1, 2, 3, 4};
...@@ -58,7 +59,7 @@ class MSClient { ...@@ -58,7 +59,7 @@ class MSClient {
// The actual RPC. // The actual RPC.
Status status = stub_->Predict(&context, request, &reply); 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. // Act upon its status.
if (status.ok()) { if (status.ok()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册