@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
26 lines (25 loc) • 1.12 kB
TypeScript
import { DTypeGpu, GPUTensorConstructor, GPUTensorI } from '../../../tensor/gpu/interface';
import { GPUMemoryAllocator } from '../../../tensor/gpu/memory';
import { Operation } from '../operation';
export interface UnaryOpInfo {
shapeX?: readonly number[];
widthX?: number;
heightX?: number;
shapeOutput?: readonly number[];
widthOutput?: number;
heightOutput?: number;
}
export interface UnaryOpInput {
input: GPUTensorI;
}
export declare abstract class UnaryOperation<GPUTensor extends GPUTensorI, UInfo extends UnaryOpInfo = UnaryOpInfo, UInput extends UnaryOpInput = UnaryOpInput> extends Operation<GPUTensor, UInfo, UInput> {
constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator);
abstract operation(input: string): string;
getFragmentShader(info: UInfo): string;
getTextureNames(): string[];
calc(input: UInput): GPUTensor;
getOutputShape(input: UInput): readonly number[];
compile(info: UInfo): void;
getCompilationInfo(input: UInput): UInfo;
getInputInfoString(input: UInput): string;
}