native_tensor.proto 2.1 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";
W
serving  
wangguibao 已提交
16 17 18 19 20 21
import "pds_option.proto";
package baidu.paddle_serving.predictor.native_tensor;

option cc_generic_services = true;

enum TensorType {
W
wangguibao 已提交
22 23 24 25 26 27
  FLOAT = 0;
  DOUBLE = 1;
  INT32 = 2;
  INT64 = 3;
  UINT32 = 4;
  UINT64 = 5;
W
serving  
wangguibao 已提交
28 29 30
};

message DenseTensor {
W
wangguibao 已提交
31 32 33 34 35 36 37 38 39
  optional string name = 1;
  repeated uint32 shape = 2;
  required TensorType type = 3;
  repeated float float_data = 4;
  repeated double double_data = 5;
  repeated int32 int32_data = 6;
  repeated int64 int64_data = 7;
  repeated uint32 uint32_data = 8;
  repeated uint64 uint64_data = 9;
W
serving  
wangguibao 已提交
40 41
};

W
wangguibao 已提交
42
message DenseRequest { repeated DenseTensor tensors = 1; };
W
serving  
wangguibao 已提交
43

W
wangguibao 已提交
44
message DenseResponse { repeated DenseTensor tensors = 1; };
W
serving  
wangguibao 已提交
45 46

service BuiltinDenseFormatService {
W
wangguibao 已提交
47 48 49
  rpc inference(DenseRequest) returns (DenseResponse);
  rpc debug(DenseRequest) returns (DenseResponse);
  option (pds.options).generate_impl = true;
W
serving  
wangguibao 已提交
50 51 52
};

message SparseTensor {
W
wangguibao 已提交
53 54 55 56 57 58 59 60 61 62
  required string name = 1;
  repeated uint32 keys = 2;
  repeated uint32 shape = 3;
  required TensorType type = 4;
  repeated float float_data = 5;
  repeated double double_data = 6;
  repeated int32 int32_data = 7;
  repeated int64 int64_data = 8;
  repeated uint32 uint32_data = 9;
  repeated uint64 uint64_data = 10;
W
serving  
wangguibao 已提交
63 64
};

W
wangguibao 已提交
65
message SparseRequest { repeated SparseTensor tensors = 1; };
W
serving  
wangguibao 已提交
66

W
wangguibao 已提交
67
message SparseResponse { repeated SparseTensor tensors = 1; };
W
serving  
wangguibao 已提交
68 69

service BuiltinSparseFormatService {
W
wangguibao 已提交
70 71 72
  rpc inference(SparseRequest) returns (SparseResponse);
  rpc debug(SparseRequest) returns (SparseResponse);
  option (pds.options).generate_impl = true;
W
serving  
wangguibao 已提交
73
};