UNPKG

3.2 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2018 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/// <amd-module name="@tensorflow/tfjs-converter/dist/operations/operation_mapper" />
18import { DataType } from '@tensorflow/tfjs-core';
19import * as tensorflow from '../data/compiled_api';
20import { Graph } from './types';
21export declare class OperationMapper {
22 private static _instance;
23 private opMappers;
24 static get Instance(): OperationMapper;
25 private constructor();
26 transformGraph(graph: tensorflow.IGraphDef, signature?: tensorflow.ISignatureDef): Graph;
27 private mapSignatureEntries;
28 private mapNode;
29 private mapFunction;
30 private mapArgsToSignature;
31 private mapArgToTensorInfo;
32}
33export declare function decodeBase64(text: string): string;
34export declare function parseStringParam(s: [] | string, keepCase: boolean): string;
35export declare function getStringParam(attrs: {
36 [key: string]: tensorflow.IAttrValue;
37}, name: string, def: string, keepCase?: boolean): string;
38export declare function getBoolParam(attrs: {
39 [key: string]: tensorflow.IAttrValue;
40}, name: string, def: boolean): boolean;
41export declare function getNumberParam(attrs: {
42 [key: string]: tensorflow.IAttrValue;
43}, name: string, def: number): number;
44export declare function parseDtypeParam(value: string | tensorflow.DataType): DataType;
45export declare function getFuncParam(attrs: {
46 [key: string]: tensorflow.IAttrValue;
47}, name: string, def: string): string;
48export declare function getDtypeParam(attrs: {
49 [key: string]: tensorflow.IAttrValue;
50}, name: string, def: DataType): DataType;
51export declare function getDtypeArrayParam(attrs: {
52 [key: string]: tensorflow.IAttrValue;
53}, name: string, def: DataType[]): DataType[];
54export declare function parseTensorShapeParam(shape: tensorflow.ITensorShape): number[] | undefined;
55export declare function getTensorShapeParam(attrs: {
56 [key: string]: tensorflow.IAttrValue;
57}, name: string, def?: number[]): number[] | undefined;
58export declare function getNumericArrayParam(attrs: {
59 [key: string]: tensorflow.IAttrValue;
60}, name: string, def: number[]): number[];
61export declare function getStringArrayParam(attrs: {
62 [key: string]: tensorflow.IAttrValue;
63}, name: string, def: string[], keepCase?: boolean): string[];
64export declare function getTensorShapeArrayParam(attrs: {
65 [key: string]: tensorflow.IAttrValue;
66}, name: string, def: number[][]): number[][];
67export declare function getBoolArrayParam(attrs: {
68 [key: string]: tensorflow.IAttrValue;
69}, name: string, def: boolean[]): boolean[];