license import { Tensor } from '@tensorflow/tfjs-core' ; import * as tensorflow from '../data/compiled_api' ; import { NamedTensorsMap } from '../data/types' ; import { ExecutionContext } from '../executor/execution_context' ; import { ResourceManager } from '../executor/resource_manager' ; export type ParamType = 'number' | 'string' | 'string[]' | 'number[]' | 'bool' | 'bool[]' | 'shape' | 'shape[]' | 'tensor' | 'tensors' | 'dtype' | 'dtype[]' | 'func' ; export type Category = 'arithmetic' | 'basic_math' | 'control' | 'convolution' | 'creation' | 'custom' | 'dynamic' | 'evaluation' | 'graph' | 'hash_table' | 'image' | 'logical' | 'matrices' | 'normalization' | 'reduction' | 'slice_join' | 'sparse' | 'spectral' | 'string' | 'transformation' ; export declare interface ParamMapper { name : string ; type : ParamType ; defaultValue ? : ValueType ; notSupported ? : boolean ; } export declare interface InputParamMapper extends ParamMapper { start : number ; end ? : number ; } export declare interface AttrParamMapper extends ParamMapper { tfName ? : string ; tfDeprecatedName ? : string ; } export interface InternalOpExecutor { ( node , tensorMap , context ) : Tensor | Tensor [ ] ; } export interface InternalOpAsyncExecutor { ( node , tensorMap , context , resourceManager ? ) : Promise < Tensor [ ] > ; } export declare interface OpMapper { tfOpName : string ; category ? : Category ; inputs ? : InputParamMapper [ ] ; attrs ? : AttrParamMapper [ ] ; outputs ? : string [ ] ; customExecutor ? : OpExecutor ; } export declare interface Node { signatureKey ? : string ; name : string ; op : string ; category : Category ; inputNames : string [ ] ; inputs : Node [ ] ; inputParams : { [ key ] : InputParamValue ; } ; attrParams : { [ key ] : ParamValue ; } ; children : Node [ ] ; rawAttrs ? : { [ k ] : tensorflow . IAttrValue ; } ; defaultOutput ? : number ; outputs ? : string [ ] ; } export declare interface Graph { nodes : { [ key ] : Node ; } ; placeholders : Node [ ] ; inputs : Node [ ] ; outputs : Node [ ] ; weights : Node [ ] ; signature ? : tensorflow . ISignatureDef ; functions ? : { [ key ] : Graph ; } ; initNodes ? : Node [ ] ; } export type ValueType = string | string [ ] | number | number [ ] | number [ ] [ ] | boolean | boolean [ ] | Tensor | Tensor [ ] ; export declare interface ParamValue { value ? : ValueType ; type : ParamType ; } export declare interface InputParamValue extends ParamValue { inputIndexStart ? : number ; inputIndexEnd ? : number ; } export interface OpExecutor { ( node ) : Tensor | Tensor [ ] | Promise < Tensor | Tensor [ ] > ; } export interface GraphNode { inputs : Tensor [ ] ; attrs : { [ key ] : ValueType ; } ; }