介面 GpuBufferConstructorParameters<T>

表示從 WebGPU 緩衝區構造張量的引數

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

型別引數

繼承

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

屬性

dims: readonly number[]

獲取張量的維度。

指定包含張量資料的 WebGPU 緩衝區。

location: "gpu-buffer"

指定資料位置為 'gpu-buffer'。

type: T

指定張量的資料型別。

方法

  • 一個可選的回撥函式,當張量被釋放時將被呼叫。

    如果未提供,張量將把 GPU 資料視為外部資源。

    返回 void

  • 一個可選的回撥函式,用於將資料從 GPU 下載到 CPU。

    如果未提供,張量將把 GPU 資料視為外部資源。

    返回 Promise<DataTypeMap[T]>

使用 TypeDoc 生成