UNPKG

13.8 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2019 Google LLC. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * =============================================================================
17 */
18/// <amd-module name="@tensorflow/tfjs-converter/dist/data/compiled_api" />
19/** Properties of an Any. */
20export declare interface IAny {
21 /** Any typeUrl */
22 typeUrl?: (string | null);
23 /** Any value */
24 value?: (Uint8Array | null);
25}
26/** DataType enum. */
27export declare enum DataType {
28 DT_INVALID = 0,
29 DT_FLOAT = 1,
30 DT_DOUBLE = 2,
31 DT_INT32 = 3,
32 DT_UINT8 = 4,
33 DT_INT16 = 5,
34 DT_INT8 = 6,
35 DT_STRING = 7,
36 DT_COMPLEX64 = 8,
37 DT_INT64 = 9,
38 DT_BOOL = 10,
39 DT_QINT8 = 11,
40 DT_QUINT8 = 12,
41 DT_QINT32 = 13,
42 DT_BFLOAT16 = 14,
43 DT_QINT16 = 15,
44 DT_QUINT16 = 16,
45 DT_UINT16 = 17,
46 DT_COMPLEX128 = 18,
47 DT_HALF = 19,
48 DT_RESOURCE = 20,
49 DT_VARIANT = 21,
50 DT_UINT32 = 22,
51 DT_UINT64 = 23,
52 DT_FLOAT_REF = 101,
53 DT_DOUBLE_REF = 102,
54 DT_INT32_REF = 103,
55 DT_UINT8_REF = 104,
56 DT_INT16_REF = 105,
57 DT_INT8_REF = 106,
58 DT_STRING_REF = 107,
59 DT_COMPLEX64_REF = 108,
60 DT_INT64_REF = 109,
61 DT_BOOL_REF = 110,
62 DT_QINT8_REF = 111,
63 DT_QUINT8_REF = 112,
64 DT_QINT32_REF = 113,
65 DT_BFLOAT16_REF = 114,
66 DT_QINT16_REF = 115,
67 DT_QUINT16_REF = 116,
68 DT_UINT16_REF = 117,
69 DT_COMPLEX128_REF = 118,
70 DT_HALF_REF = 119,
71 DT_RESOURCE_REF = 120,
72 DT_VARIANT_REF = 121,
73 DT_UINT32_REF = 122,
74 DT_UINT64_REF = 123
75}
76/** Properties of a TensorShape. */
77export declare interface ITensorShape {
78 /** TensorShape dim */
79 dim?: (TensorShape.IDim[] | null);
80 /** TensorShape unknownRank */
81 unknownRank?: (boolean | null);
82}
83export declare namespace TensorShape {
84 /** Properties of a Dim. */
85 interface IDim {
86 /** Dim size */
87 size?: (number | string | null);
88 /** Dim name */
89 name?: (string | null);
90 }
91}
92/** Properties of a Tensor. */
93export declare interface ITensor {
94 /** Tensor dtype */
95 dtype?: (DataType | null);
96 /** Tensor tensorShape */
97 tensorShape?: (ITensorShape | null);
98 /** Tensor versionNumber */
99 versionNumber?: (number | null);
100 /** Tensor tensorContent */
101 tensorContent?: (Uint8Array | null);
102 /** Tensor floatVal */
103 floatVal?: (number[] | null);
104 /** Tensor doubleVal */
105 doubleVal?: (number[] | null);
106 /** Tensor intVal */
107 intVal?: (number[] | null);
108 /** Tensor stringVal */
109 stringVal?: (Uint8Array[] | null);
110 /** Tensor scomplexVal */
111 scomplexVal?: (number[] | null);
112 /** Tensor int64Val */
113 int64Val?: ((number | string)[] | null);
114 /** Tensor boolVal */
115 boolVal?: (boolean[] | null);
116 /** Tensor uint32Val */
117 uint32Val?: (number[] | null);
118 /** Tensor uint64Val */
119 uint64Val?: ((number | string)[] | null);
120}
121/** Properties of an AttrValue. */
122export declare interface IAttrValue {
123 /** AttrValue list */
124 list?: (AttrValue.IListValue | null);
125 /** AttrValue s */
126 s?: (string | null);
127 /** AttrValue i */
128 i?: (number | string | null);
129 /** AttrValue f */
130 f?: (number | null);
131 /** AttrValue b */
132 b?: (boolean | null);
133 /** AttrValue type */
134 type?: (DataType | null);
135 /** AttrValue shape */
136 shape?: (ITensorShape | null);
137 /** AttrValue tensor */
138 tensor?: (ITensor | null);
139 /** AttrValue placeholder */
140 placeholder?: (string | null);
141 /** AttrValue func */
142 func?: (INameAttrList | null);
143}
144export declare namespace AttrValue {
145 /** Properties of a ListValue. */
146 interface IListValue {
147 /** ListValue s */
148 s?: (string[] | null);
149 /** ListValue i */
150 i?: ((number | string)[] | null);
151 /** ListValue f */
152 f?: (number[] | null);
153 /** ListValue b */
154 b?: (boolean[] | null);
155 /** ListValue type */
156 type?: (DataType[] | null);
157 /** ListValue shape */
158 shape?: (ITensorShape[] | null);
159 /** ListValue tensor */
160 tensor?: (ITensor[] | null);
161 /** ListValue func */
162 func?: (INameAttrList[] | null);
163 }
164}
165/** Properties of a NameAttrList. */
166export declare interface INameAttrList {
167 /** NameAttrList name */
168 name?: (string | null);
169 /** NameAttrList attr */
170 attr?: ({
171 [k: string]: IAttrValue;
172 } | null);
173}
174/** Properties of a NodeDef. */
175export declare interface INodeDef {
176 /** NodeDef name */
177 name?: (string | null);
178 /** NodeDef op */
179 op?: (string | null);
180 /** NodeDef input */
181 input?: (string[] | null);
182 /** NodeDef device */
183 device?: (string | null);
184 /** NodeDef attr */
185 attr?: ({
186 [k: string]: IAttrValue;
187 } | null);
188}
189/** Properties of a VersionDef. */
190export declare interface IVersionDef {
191 /** VersionDef producer */
192 producer?: (number | null);
193 /** VersionDef minConsumer */
194 minConsumer?: (number | null);
195 /** VersionDef badConsumers */
196 badConsumers?: (number[] | null);
197}
198/** Properties of a GraphDef. */
199export declare interface IGraphDef {
200 /** GraphDef node */
201 node?: (INodeDef[] | null);
202 /** GraphDef versions */
203 versions?: (IVersionDef | null);
204 /** GraphDef library */
205 library?: (IFunctionDefLibrary | null);
206}
207/** Properties of a CollectionDef. */
208export declare interface ICollectionDef {
209 /** CollectionDef nodeList */
210 nodeList?: (CollectionDef.INodeList | null);
211 /** CollectionDef bytesList */
212 bytesList?: (CollectionDef.IBytesList | null);
213 /** CollectionDef int64List */
214 int64List?: (CollectionDef.IInt64List | null);
215 /** CollectionDef floatList */
216 floatList?: (CollectionDef.IFloatList | null);
217 /** CollectionDef anyList */
218 anyList?: (CollectionDef.IAnyList | null);
219}
220export declare namespace CollectionDef {
221 /** Properties of a NodeList. */
222 interface INodeList {
223 /** NodeList value */
224 value?: (string[] | null);
225 }
226 /** Properties of a BytesList. */
227 interface IBytesList {
228 /** BytesList value */
229 value?: (Uint8Array[] | null);
230 }
231 /** Properties of an Int64List. */
232 interface IInt64List {
233 /** Int64List value */
234 value?: ((number | string)[] | null);
235 }
236 /** Properties of a FloatList. */
237 interface IFloatList {
238 /** FloatList value */
239 value?: (number[] | null);
240 }
241 /** Properties of an AnyList. */
242 interface IAnyList {
243 /** AnyList value */
244 value?: (IAny[] | null);
245 }
246}
247/** Properties of a SaverDef. */
248export declare interface ISaverDef {
249 /** SaverDef filenameTensorName */
250 filenameTensorName?: (string | null);
251 /** SaverDef saveTensorName */
252 saveTensorName?: (string | null);
253 /** SaverDef restoreOpName */
254 restoreOpName?: (string | null);
255 /** SaverDef maxToKeep */
256 maxToKeep?: (number | null);
257 /** SaverDef sharded */
258 sharded?: (boolean | null);
259 /** SaverDef keepCheckpointEveryNHours */
260 keepCheckpointEveryNHours?: (number | null);
261 /** SaverDef version */
262 version?: (SaverDef.CheckpointFormatVersion | null);
263}
264export declare namespace SaverDef {
265 /** CheckpointFormatVersion enum. */
266 enum CheckpointFormatVersion {
267 'LEGACY' = 0,
268 'V1' = 1,
269 'V2' = 2
270 }
271}
272/** Properties of a TensorInfo. */
273export declare interface ITensorInfo {
274 /** TensorInfo name */
275 name?: (string | null);
276 /** TensorInfo cooSparse */
277 cooSparse?: (TensorInfo.ICooSparse | null);
278 /** TensorInfo dtype */
279 dtype?: (DataType | null);
280 /** TensorInfo tensorShape */
281 tensorShape?: (ITensorShape | null);
282}
283export declare namespace TensorInfo {
284 /** Properties of a CooSparse. */
285 interface ICooSparse {
286 /** CooSparse valuesTensorName */
287 valuesTensorName?: (string | null);
288 /** CooSparse indicesTensorName */
289 indicesTensorName?: (string | null);
290 /** CooSparse denseShapeTensorName */
291 denseShapeTensorName?: (string | null);
292 }
293}
294/** Properties of a SignatureDef. */
295export declare interface ISignatureDef {
296 /** SignatureDef inputs */
297 inputs?: ({
298 [k: string]: ITensorInfo;
299 } | null);
300 /** SignatureDef outputs */
301 outputs?: ({
302 [k: string]: ITensorInfo;
303 } | null);
304 /** SignatureDef methodName */
305 methodName?: (string | null);
306}
307/** Properties of an AssetFileDef. */
308export declare interface IAssetFileDef {
309 /** AssetFileDef tensorInfo */
310 tensorInfo?: (ITensorInfo | null);
311 /** AssetFileDef filename */
312 filename?: (string | null);
313}
314/** Properties of an OpDef. */
315export declare interface IOpDef {
316 /** OpDef name */
317 name?: (string | null);
318 /** OpDef inputArg */
319 inputArg?: (OpDef.IArgDef[] | null);
320 /** OpDef outputArg */
321 outputArg?: (OpDef.IArgDef[] | null);
322 /** OpDef attr */
323 attr?: (OpDef.IAttrDef[] | null);
324 /** OpDef deprecation */
325 deprecation?: (OpDef.IOpDeprecation | null);
326 /** OpDef summary */
327 summary?: (string | null);
328 /** OpDef description */
329 description?: (string | null);
330 /** OpDef isCommutative */
331 isCommutative?: (boolean | null);
332 /** OpDef isAggregate */
333 isAggregate?: (boolean | null);
334 /** OpDef isStateful */
335 isStateful?: (boolean | null);
336 /** OpDef allowsUninitializedInput */
337 allowsUninitializedInput?: (boolean | null);
338}
339export declare namespace OpDef {
340 /** Properties of an ArgDef. */
341 interface IArgDef {
342 /** ArgDef name */
343 name?: (string | null);
344 /** ArgDef description */
345 description?: (string | null);
346 /** ArgDef type */
347 type?: (DataType | null);
348 /** ArgDef typeAttr */
349 typeAttr?: (string | null);
350 /** ArgDef numberAttr */
351 numberAttr?: (string | null);
352 /** ArgDef typeListAttr */
353 typeListAttr?: (string | null);
354 /** ArgDef isRef */
355 isRef?: (boolean | null);
356 }
357 /** Properties of an AttrDef. */
358 interface IAttrDef {
359 /** AttrDef name */
360 name?: (string | null);
361 /** AttrDef type */
362 type?: (string | null);
363 /** AttrDef defaultValue */
364 defaultValue?: (IAttrValue | null);
365 /** AttrDef description */
366 description?: (string | null);
367 /** AttrDef hasMinimum */
368 hasMinimum?: (boolean | null);
369 /** AttrDef minimum */
370 minimum?: (number | string | null);
371 /** AttrDef allowedValues */
372 allowedValues?: (IAttrValue | null);
373 }
374 /** Properties of an OpDeprecation. */
375 interface IOpDeprecation {
376 /** OpDeprecation version */
377 version?: (number | null);
378 /** OpDeprecation explanation */
379 explanation?: (string | null);
380 }
381}
382/** Properties of an OpList. */
383export declare interface IOpList {
384 /** OpList op */
385 op?: (IOpDef[] | null);
386}
387/** Properties of a MetaGraphDef. */
388export declare interface IMetaGraphDef {
389 /** MetaGraphDef metaInfoDef */
390 metaInfoDef?: (MetaGraphDef.IMetaInfoDef | null);
391 /** MetaGraphDef graphDef */
392 graphDef?: (IGraphDef | null);
393 /** MetaGraphDef saverDef */
394 saverDef?: (ISaverDef | null);
395 /** MetaGraphDef collectionDef */
396 collectionDef?: ({
397 [k: string]: ICollectionDef;
398 } | null);
399 /** MetaGraphDef signatureDef */
400 signatureDef?: ({
401 [k: string]: ISignatureDef;
402 } | null);
403 /** MetaGraphDef assetFileDef */
404 assetFileDef?: (IAssetFileDef[] | null);
405}
406export declare namespace MetaGraphDef {
407 /** Properties of a MetaInfoDef. */
408 interface IMetaInfoDef {
409 /** MetaInfoDef metaGraphVersion */
410 metaGraphVersion?: (string | null);
411 /** MetaInfoDef strippedOpList */
412 strippedOpList?: (IOpList | null);
413 /** MetaInfoDef anyInfo */
414 anyInfo?: (IAny | null);
415 /** MetaInfoDef tags */
416 tags?: (string[] | null);
417 /** MetaInfoDef tensorflowVersion */
418 tensorflowVersion?: (string | null);
419 /** MetaInfoDef tensorflowGitVersion */
420 tensorflowGitVersion?: (string | null);
421 }
422}
423/** Properties of a SavedModel. */
424export declare interface ISavedModel {
425 /** SavedModel savedModelSchemaVersion */
426 savedModelSchemaVersion?: (number | string | null);
427 /** SavedModel metaGraphs */
428 metaGraphs?: (IMetaGraphDef[] | null);
429}
430/** Properties of a FunctionDefLibrary. */
431export declare interface IFunctionDefLibrary {
432 /** FunctionDefLibrary function */
433 'function'?: (IFunctionDef[] | null);
434 /** FunctionDefLibrary gradient */
435 gradient?: (IGradientDef[] | null);
436}
437/** Properties of a FunctionDef. */
438export declare interface IFunctionDef {
439 /** FunctionDef signature */
440 signature?: (IOpDef | null);
441 /** FunctionDef attr */
442 attr?: ({
443 [k: string]: IAttrValue;
444 } | null);
445 /** FunctionDef nodeDef */
446 nodeDef?: (INodeDef[] | null);
447 /** FunctionDef ret */
448 ret?: ({
449 [k: string]: string;
450 } | null);
451}
452/** Properties of a GradientDef. */
453export declare interface IGradientDef {
454 /** GradientDef functionName */
455 functionName?: (string | null);
456 /** GradientDef gradientFunc */
457 gradientFunc?: (string | null);
458}