Interface GpuBufferConstructorParameters<T>

represent the parameter for constructing a tensor from a WebGPU buffer

interface GpuBufferConstructorParameters<T> {
    dims: readonly number[];
    gpuBuffer: GpuBufferType;
    location: "gpu-buffer";
    type: T;
    dispose?(): void;
    download?(): Promise<DataTypeMap[T]>;
}

Type Parameters

Hierarchy

  • CommonConstructorParameters<T>
  • GpuResourceConstructorParameters<T>
    • GpuBufferConstructorParameters

Properties

dims: readonly number[]

Get the dimensions of the tensor.

gpuBuffer: GpuBufferType

Specify the WebGPU buffer that holds the tensor data.

location: "gpu-buffer"

Specify the location of the data to be 'gpu-buffer'.

type: T

Specify the data type of the tensor.

Methods

  • an optional callback function that will be called when the tensor is disposed.

    If not provided, the tensor treat the GPU data as external resource.

    Returns void

  • an optional callback function to download data from GPU to CPU.

    If not provided, the tensor treat the GPU data as external resource.

    Returns Promise<DataTypeMap[T]>

Generated using TypeDoc