@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
24 lines (23 loc) • 1.03 kB
TypeScript
import Tensor from '../../types';
import { NodeId } from '../model';
import { OnnxNode } from '../node';
import { Constants, OnnxModelI } from '../types';
export declare abstract class Optimization {
/**
* Finds possible places in the graph for application
*
* @param graph The graph to search for optimization applications
*
* @Returns a list of possible applications
* Each application consists of a list of nodes that will be replaced
*/
abstract findApplications(model: OnnxModelI): NodeId[][];
abstract apply(nodes: OnnxNode[], resolveConstant: (name: string) => Tensor<any> | undefined, constants: Constants, onnxVersion: number): OnnxNode;
}
export declare abstract class SequenceOptimization extends Optimization {
protected nodeTypes: string[];
constructor(nodeTypes: string[]);
findApplications(model: OnnxModelI): NodeId[][];
checkApplication(model: OnnxModelI, nodeId: string): string[] | undefined;
canApply(nodes: OnnxNode[]): boolean;
}