forked from mindspore-Ecosystem/mindspore
delete info
This commit is contained in:
parent
d541e261a0
commit
734538c7c5
|
@ -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");
|
||||
|
|
|
@ -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…
Reference in New Issue