@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
35 lines (34 loc) • 1.54 kB
TypeScript
import { DTypeGpu, GPUTensorConstructor, GPUTensorI } from '../../../tensor/gpu/interface';
import { GPUMemoryAllocator } from '../../../tensor/gpu/memory';
import { GPUTensor } from '../../../tensor/gpu/tensor';
import { Dispatcher } from '../../gpu/dispatcher';
import { Input, Operation } from '../../gpu/operation';
export interface AddIndexInfo {
shapeA?: readonly number[];
widthA?: number;
heightA?: number;
shapeOutput?: readonly number[];
widthOutput?: number;
heightOutput?: number;
axis?: number;
count?: number;
}
export interface AddIndexInput {
A: GPUTensorI;
axis: number;
count: number;
}
export declare class AddIndexOperation<GPUTensor extends GPUTensorI> extends Operation<GPUTensor, AddIndexInfo, AddIndexInput> {
constructor(tensorConstructor: GPUTensorConstructor<GPUTensor>, dtype: DTypeGpu, allocator?: GPUMemoryAllocator);
getVariables(): string;
getUniformAttrs(): Input[];
getFragmentShader(info: AddIndexInfo): string;
getTextureNames(): string[];
calc(input: AddIndexInput): GPUTensor;
getOutputShape(input: AddIndexInput): readonly number[];
compile(info: AddIndexInfo): void;
getCompilationInfo(input: AddIndexInput): AddIndexInfo;
getInputInfoString(input: AddIndexInput): string;
}
export declare const defaultAddIndexD: Dispatcher<GPUTensorI, unknown, unknown, AddIndexOperation<GPUTensor<DTypeGpu>>>;
export declare function addIndexGPU(indices: GPUTensor<'uint32'>, axis: number, count: number): GPUTensor<'uint32'>;