@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
36 lines (35 loc) • 1.38 kB
TypeScript
import { CPUTensor } from '../../../tensor/cpu/tensor';
import { DTypeGpu, GPUTensorConstructor, GPUTensorI } from '../../../tensor/gpu/interface';
import { GPUMemoryAllocator } from '../../../tensor/gpu/memory';
import { Input, Operation } from '../operation';
export interface GatherInfo {
shapeX?: readonly number[];
widthX?: number;
heightX?: number;
shapeOutput?: readonly number[];
widthOutput?: number;
heightOutput?: number;
indices?: CPUTensor<'uint32'>;
axis?: number;
indexValues?: number[];
mappedInputStrides?: number[];
mappedIndexStrides?: number[];
}
export interface GatherInput {
X: GPUTensorI;
indices: CPUTensor<'uint32'>;
axis: number;
}
export declare class GatherOperation<GPUTensor extends GPUTensorI> extends Operation<GPUTensor, GatherInfo, GatherInput> {
protected gatherMaxIxSize: number;
constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator);
getVariables(): string;
getUniformAttrs(): Input[];
getFragmentShader(info: GatherInfo): string;
getTextureNames(): string[];
calc(input: GatherInput): GPUTensor;
getOutputShape(input: GatherInput): readonly number[];
compile(info: GatherInfo): void;
getCompilationInfo(input: GatherInput): GatherInfo;
getInputInfoString(input: GatherInput): string;
}