UNPKG

14 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 | string | null);
280 /** TensorInfo tensorShape */
281 tensorShape?: (ITensorShape | null);
282 /** Resource id tensor was originally assigned to. */
283 resourceId?: (number | null);
284}
285export declare namespace TensorInfo {
286 /** Properties of a CooSparse. */
287 interface ICooSparse {
288 /** CooSparse valuesTensorName */
289 valuesTensorName?: (string | null);
290 /** CooSparse indicesTensorName */
291 indicesTensorName?: (string | null);
292 /** CooSparse denseShapeTensorName */
293 denseShapeTensorName?: (string | null);
294 }
295}
296/** Properties of a SignatureDef. */
297export declare interface ISignatureDef {
298 /** SignatureDef inputs */
299 inputs?: ({
300 [k: string]: ITensorInfo;
301 } | null);
302 /** SignatureDef outputs */
303 outputs?: ({
304 [k: string]: ITensorInfo;
305 } | null);
306 /** SignatureDef methodName */
307 methodName?: (string | null);
308}
309/** Properties of an AssetFileDef. */
310export declare interface IAssetFileDef {
311 /** AssetFileDef tensorInfo */
312 tensorInfo?: (ITensorInfo | null);
313 /** AssetFileDef filename */
314 filename?: (string | null);
315}
316/** Properties of an OpDef. */
317export declare interface IOpDef {
318 /** OpDef name */
319 name?: (string | null);
320 /** OpDef inputArg */
321 inputArg?: (OpDef.IArgDef[] | null);
322 /** OpDef outputArg */
323 outputArg?: (OpDef.IArgDef[] | null);
324 /** OpDef attr */
325 attr?: (OpDef.IAttrDef[] | null);
326 /** OpDef deprecation */
327 deprecation?: (OpDef.IOpDeprecation | null);
328 /** OpDef summary */
329 summary?: (string | null);
330 /** OpDef description */
331 description?: (string | null);
332 /** OpDef isCommutative */
333 isCommutative?: (boolean | null);
334 /** OpDef isAggregate */
335 isAggregate?: (boolean | null);
336 /** OpDef isStateful */
337 isStateful?: (boolean | null);
338 /** OpDef allowsUninitializedInput */
339 allowsUninitializedInput?: (boolean | null);
340}
341export declare namespace OpDef {
342 /** Properties of an ArgDef. */
343 interface IArgDef {
344 /** ArgDef name */
345 name?: (string | null);
346 /** ArgDef description */
347 description?: (string | null);
348 /** ArgDef type */
349 type?: (DataType | null);
350 /** ArgDef typeAttr */
351 typeAttr?: (string | null);
352 /** ArgDef numberAttr */
353 numberAttr?: (string | null);
354 /** ArgDef typeListAttr */
355 typeListAttr?: (string | null);
356 /** ArgDef isRef */
357 isRef?: (boolean | null);
358 }
359 /** Properties of an AttrDef. */
360 interface IAttrDef {
361 /** AttrDef name */
362 name?: (string | null);
363 /** AttrDef type */
364 type?: (string | null);
365 /** AttrDef defaultValue */
366 defaultValue?: (IAttrValue | null);
367 /** AttrDef description */
368 description?: (string | null);
369 /** AttrDef hasMinimum */
370 hasMinimum?: (boolean | null);
371 /** AttrDef minimum */
372 minimum?: (number | string | null);
373 /** AttrDef allowedValues */
374 allowedValues?: (IAttrValue | null);
375 }
376 /** Properties of an OpDeprecation. */
377 interface IOpDeprecation {
378 /** OpDeprecation version */
379 version?: (number | null);
380 /** OpDeprecation explanation */
381 explanation?: (string | null);
382 }
383}
384/** Properties of an OpList. */
385export declare interface IOpList {
386 /** OpList op */
387 op?: (IOpDef[] | null);
388}
389/** Properties of a MetaGraphDef. */
390export declare interface IMetaGraphDef {
391 /** MetaGraphDef metaInfoDef */
392 metaInfoDef?: (MetaGraphDef.IMetaInfoDef | null);
393 /** MetaGraphDef graphDef */
394 graphDef?: (IGraphDef | null);
395 /** MetaGraphDef saverDef */
396 saverDef?: (ISaverDef | null);
397 /** MetaGraphDef collectionDef */
398 collectionDef?: ({
399 [k: string]: ICollectionDef;
400 } | null);
401 /** MetaGraphDef signatureDef */
402 signatureDef?: ({
403 [k: string]: ISignatureDef;
404 } | null);
405 /** MetaGraphDef assetFileDef */
406 assetFileDef?: (IAssetFileDef[] | null);
407}
408export declare namespace MetaGraphDef {
409 /** Properties of a MetaInfoDef. */
410 interface IMetaInfoDef {
411 /** MetaInfoDef metaGraphVersion */
412 metaGraphVersion?: (string | null);
413 /** MetaInfoDef strippedOpList */
414 strippedOpList?: (IOpList | null);
415 /** MetaInfoDef anyInfo */
416 anyInfo?: (IAny | null);
417 /** MetaInfoDef tags */
418 tags?: (string[] | null);
419 /** MetaInfoDef tensorflowVersion */
420 tensorflowVersion?: (string | null);
421 /** MetaInfoDef tensorflowGitVersion */
422 tensorflowGitVersion?: (string | null);
423 }
424}
425/** Properties of a SavedModel. */
426export declare interface ISavedModel {
427 /** SavedModel savedModelSchemaVersion */
428 savedModelSchemaVersion?: (number | string | null);
429 /** SavedModel metaGraphs */
430 metaGraphs?: (IMetaGraphDef[] | null);
431}
432/** Properties of a FunctionDefLibrary. */
433export declare interface IFunctionDefLibrary {
434 /** FunctionDefLibrary function */
435 'function'?: (IFunctionDef[] | null);
436 /** FunctionDefLibrary gradient */
437 gradient?: (IGradientDef[] | null);
438}
439/** Properties of a FunctionDef. */
440export declare interface IFunctionDef {
441 /** FunctionDef signature */
442 signature?: (IOpDef | null);
443 /** FunctionDef attr */
444 attr?: ({
445 [k: string]: IAttrValue;
446 } | null);
447 /** FunctionDef nodeDef */
448 nodeDef?: (INodeDef[] | null);
449 /** FunctionDef ret */
450 ret?: ({
451 [k: string]: string;
452 } | null);
453}
454/** Properties of a GradientDef. */
455export declare interface IGradientDef {
456 /** GradientDef functionName */
457 functionName?: (string | null);
458 /** GradientDef gradientFunc */
459 gradientFunc?: (string | null);
460}