UNPKG

@hoff97/tensor-js

Version:

PyTorch like deep learning inferrence library

65 lines (64 loc) 2.48 kB
import { DTypeGpu, GPUTensorConstructor, GPUTensorI } from '../../../tensor/gpu/interface'; import { GPUMemoryAllocator } from '../../../tensor/gpu/memory'; import { Input, Operation } from '../operation'; import { Activation } from '../../../types'; export interface ConvInfo { shapeX?: readonly number[]; widthX?: number; heightX?: number; shapeW?: readonly number[]; widthW?: number; heightW?: number; shapeOutput?: readonly number[]; widthOutput?: number; heightOutput?: number; pads?: readonly number[]; dilations?: readonly number[]; strides?: readonly number[]; CG?: number; kernelSize?: number; dataRank?: number; C?: number; activation?: Activation | number; } export interface ConvInput { X: GPUTensorI; W: GPUTensorI; pads: readonly number[]; dilations: readonly number[]; strides: readonly number[]; activation: Activation; } export declare class ConvOperation<GPUTensor extends GPUTensorI, ConvInf extends ConvInfo = ConvInfo, ConvIn extends ConvInput = ConvInput> extends Operation<GPUTensor, ConvInf, ConvIn> { protected maxIterations: number; constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator); updateInputIx(): string; getMainBody(): string; getVariables(): string; getFragmentShader(info: ConvInfo): string; getTextureNames(): string[]; getUniformAttrs(): Input[]; getActivationFlag(activation: Activation): 0 | 1 | 2; calc(input: ConvInput): GPUTensor; getOutputShape(input: ConvIn): readonly number[]; compile(info: ConvInf): void; getCompilationInfo(input: ConvIn): ConvInf; getInputInfoString(input: ConvInput): string; } export interface ConvBiasInput extends ConvInput { B: GPUTensorI; } export interface ConvBiasInfo extends ConvInfo { shapeB?: readonly number[]; widthB?: number; heightB?: number; } export declare class ConvBiasOperation<GPUTensor extends GPUTensorI> extends ConvOperation<GPUTensor, ConvBiasInfo, ConvBiasInput> { protected maxIterations: number; constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator); getFragmentShader(info: ConvBiasInfo): string; getTextureNames(): string[]; calc(input: ConvBiasInput): GPUTensor; getCompilationInfo(input: ConvBiasInput): ConvBiasInfo; getInputInfoString(input: ConvBiasInput): string; }