-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodelspec.swagger.yaml
178 lines (175 loc) · 4.41 KB
/
modelspec.swagger.yaml
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
openapi: "3.0.0"
info:
description: "This is the contract for embedded tensor processing tests"
version: "1.0.0"
title: "uTensor-tester"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
tags:
- name: "Embedded Testing"
description: "Client server model for launching and managing embedded tests"
externalDocs:
description: "Find out more"
url: "https://github.com/utensor/utensor-tester"
servers:
- url: https://testlab.utensor.ai/v1
paths:
/generate/test_group_code/{env}/{platform}:
post:
tags:
- "generate"
summary: "Request main.cpp given sequence of tests"
description: "TODO"
parameters:
- in: path
name: env
required: true
schema:
type: string
enum: [tflm, utensor]
description: Target tensor processing environment
- in: path
name: platform
required: true
schema:
type: string
enum: [linux, mbed, arduino, generic]
requestBody:
description: "sequence of tests"
required: true
content:
'application/json':
schema:
$ref: "#/components/schemas/TestGroup"
# Need to figure out how to return as a file, Open API 3.0 is different
responses:
204:
description: "Successfully generated"
400:
description: "Given URL is not accessible or the long polling channel already exists"
401:
description: "Unauthorized"
403:
description: "Forbidden, the authorization token used is not an API key"
415:
description: "Unsupported Medial Type"
components:
schemas:
# Test schema
TestReturnCode:
type: "integer"
TestResponse:
type: "object"
required:
- id
- returnCode
properties:
id:
type: "string"
returnCode:
$ref: "#/components/schemas/TestReturnCode"
log:
type: "string"
TestCase:
type: "object"
properties:
name:
type: "string"
ops:
type: "array"
items:
$ref: "#/components/schemas/Operator"
TestGroup:
type: "object"
properties:
name:
type: "string"
testCases:
type: "array"
items:
$ref: "#/components/schemas/TestCase"
# Data objects
LinearBuffer:
type: "object"
properties:
data:
type: "string"
format: "binary"
length:
type: "integer"
LinearArray:
type: "object"
properties:
data:
type: "array"
items:
type: "number"
example: [1,2,3,4]
length:
type: "integer"
example: "4"
TensorDimensions:
type: "array"
items:
type: "integer"
example: [2, 2]
TensorType:
type: "string"
enum: [uint8, int8, quint8, qint8, uint16, int16, quint16, qint16, uint32, int32, quint32, qint32, float]
TensorReference:
type: "string"
example: "x"
Tensor:
type: "object"
required:
- data
- dimensions
- type
- name
properties:
data:
$ref: "#/components/schemas/LinearArray"
dimensions:
$ref: "#/components/schemas/TensorDimensions"
type:
$ref: "#/components/schemas/TensorType"
name:
type: "string"
example: "x"
attrs: # Havent decided on these yet
type: "object"
TensorIOPair:
type: "object"
required:
- paramId
- tensor
properties:
paramId:
type: "string"
tensor:
$ref: "#/components/schemas/Tensor"
Operator:
# Source operator only has outputs
# Sink operator only has inputs
# process ops have both IO
type: "object"
required:
- name
properties:
name:
type: "string"
example: "NoOp"
inputs:
type: "array"
items:
$ref: "#/components/schemas/TensorIOPair"
outputs:
type: "array"
items:
$ref: "#/components/schemas/TensorIOPair"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"