This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
/
graphpipe.fbs
128 lines (116 loc) · 3.15 KB
/
graphpipe.fbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
** Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
**
** Licensed under the Universal Permissive License v 1.0 as shown at
** http://oss.oracle.com/licenses/upl.
*/
namespace graphpipe;
/*
Enumeration of supported types.
*/
enum Type:uint8 {
Null,
Uint8,
Int8,
Uint16,
Int16,
Uint32,
Int32,
Uint64,
Int64,
Float16,
Float32,
Float64,
String,
}
/*
Tensor definition.
type: defines what type of data this Tensor holds
shape: an array that describes the shape of the Tensor (like [10, 3, 224, 224])
data: stores the actual tensor data for all types but String
string_val: holds the data for tensors of type String
*/
table Tensor {
type:Type;
shape:[int64];
data:[uint8];
string_val:[string];
}
/*
Req definition, which is a union of an InferRequest and a a MetadataRequest.
*/
union Req {InferRequest, MetadataRequest}
/*
Request definition, which is a container for one of the two allowed request types.
req: a union representing an InferRequest or a MetadataRequest.
*/
table Request {
req:Req;
}
/*
Infer Request definition, which is used to request data from a remote model.
config: application-specific string used for request-specific model configuration.
input_names: a list of input names
input_tensors: a list of input tensors, associated with input_names
output_names: a list of outputs to return in response to the provided inputs
*/
table InferRequest {
config:string; // optional
input_names:[string]; // optional
input_tensors:[Tensor];
output_names:[string]; // optional
}
/*
Error definition
code: integer representation of the error
message: Human-readable message description
*/
table Error {
code:int64;
message:string;
}
/*
InferResponse definition. Should contain either a list of tensors or a list
of errors, but not both.
output_tensors: a list of output_tensors, in the order requested by InferRequest.output_names
errors: A list of errors that occurred during processing, if any
*/
table InferResponse {
output_tensors:[Tensor];
errors:[Error];
}
/*
MetadatRequest. Used to request metadata about a graphpipe model server.
*/
table MetadataRequest {}
/*
IOMetadata definition. Provides info about inputs and outputs of a model.
name: name of the input/output
description: description of the input/output
shape: input or output shape
type: Type of the input/output
*/
table IOMetadata {
name:string; // required
description:string; // optional
shape:[int64]; // required
type:Type; // required
}
/*
MetadataResponse definition. Describes characteristics of the server and the model being served.
name: name of the model being served
version: version of the server
server: name of the server
description: description of the model being served
inputs: metadata about the model's inputs
outputs: metadata about the model's outputs
*/
table MetadataResponse {
name:string; // optional
version:string; // optional
server:string; // optional
description:string; //optional
inputs:[IOMetadata]; // required
outputs:[IOMetadata]; // required
}
root_type Request;