提交 f424ef1a 编写于 作者: S ShiningZhang

java client proto extend elem_type

上级 b77f39b9
...@@ -12,41 +12,96 @@ ...@@ -12,41 +12,96 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
syntax = "proto2"; syntax = "proto3";
package baidu.paddle_serving.predictor.general_model; package baidu.paddle_serving.predictor.general_model;
option java_multiple_files = true; option java_multiple_files = true;
message Tensor { message Tensor {
repeated string data = 1; // VarType: INT64
repeated int32 int_data = 2; repeated int64 int64_data = 1;
repeated int64 int64_data = 3;
repeated float float_data = 4; // VarType: FP32
optional int32 elem_type = repeated float float_data = 2;
5; // 0 means int64, 1 means float32, 2 means int32, 3 means string
repeated int32 shape = 6; // shape should include batch // VarType: INT32
repeated int32 lod = 7; // only for fetch tensor currently repeated int32 int_data = 3;
optional string name = 8; // get from the Model prototxt
optional string alias_name = 9; // get from the Model prototxt // VarType: FP64
repeated double float64_data = 4;
// VarType: UINT32
repeated uint32 uint32_data = 5;
// VarType: BOOL
repeated bool bool_data = 6;
// (No support)VarType: COMPLEX64, 2x represents the real part, 2x+1
// represents the imaginary part
repeated float complex64_data = 7;
// (No support)VarType: COMPLEX128, 2x represents the real part, 2x+1
// represents the imaginary part
repeated double complex128_data = 8;
// VarType: STRING
repeated string data = 9;
// Element types:
// 0 => INT64
// 1 => FP32
// 2 => INT32
// 3 => FP64
// 4 => INT16
// 5 => FP16
// 6 => BF16
// 7 => UINT8
// 8 => INT8
// 9 => BOOL
// 10 => COMPLEX64
// 11 => COMPLEX128
// 20 => STRING
int32 elem_type = 10;
// Shape of the tensor, including batch dimensions.
repeated int32 shape = 11;
// Level of data(LOD), support variable length data, only for fetch tensor
// currently.
repeated int32 lod = 12;
// Correspond to the variable 'name' in the model description prototxt.
string name = 13;
// Correspond to the variable 'alias_name' in the model description prototxt.
string alias_name = 14; // get from the Model prototxt
// VarType: FP16, INT16, INT8, BF16, UINT8
bytes tensor_content = 15;
}; };
message Request { message Request {
repeated Tensor tensor = 1; repeated Tensor tensor = 1;
repeated string fetch_var_names = 2; repeated string fetch_var_names = 2;
optional bool profile_server = 3 [ default = false ]; bool profile_server = 3;
required uint64 log_id = 4 [ default = 0 ]; uint64 log_id = 4;
}; };
message Response { message Response {
repeated ModelOutput outputs = 1; repeated ModelOutput outputs = 1;
repeated int64 profile_time = 2; repeated int64 profile_time = 2;
// Error code
int32 err_no = 3;
// Error messages
string err_msg = 4;
}; };
message ModelOutput { message ModelOutput {
repeated Tensor tensor = 1; repeated Tensor tensor = 1;
optional string engine_name = 2; string engine_name = 2;
} }
service GeneralModelService { service GeneralModelService {
rpc inference(Request) returns (Response) {} rpc inference(Request) returns (Response);
rpc debug(Request) returns (Response) {} rpc debug(Request) returns (Response);
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册