@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
38 lines (37 loc) • 1.4 kB
TypeScript
import { DTypeGpu, GPUTensorConstructor, GPUTensorI } from '../../../tensor/gpu/interface';
import { GPUMemoryAllocator } from '../../../tensor/gpu/memory';
import { Input, Operation } from '../operation';
export interface PoolInfo {
shapeX?: readonly number[];
widthX?: number;
heightX?: number;
shapeOutput?: readonly number[];
widthOutput?: number;
heightOutput?: number;
axes?: readonly number[];
keepDims?: boolean;
mappedInputStrides?: number[];
sumDims?: number[];
sumSize?: number;
}
export interface PoolInput {
X: GPUTensorI;
axes: number[];
keepDims: boolean;
}
export declare abstract class PoolOperation<GPUTensor extends GPUTensorI> extends Operation<GPUTensor, PoolInfo, PoolInput> {
protected maxIterations: number;
constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator);
getVariables(): string;
getFragmentShader(info: PoolInfo): string;
abstract update(a: string, b: string): string;
post(res: string): string;
init(res: string): string;
getTextureNames(): string[];
getUniformAttrs(): Input[];
calc(input: PoolInput): GPUTensor;
getOutputShape(input: PoolInput): readonly number[];
compile(info: PoolInfo): void;
getCompilationInfo(input: PoolInput): PoolInfo;
getInputInfoString(input: PoolInput): string;
}