接口 TextureConstructorParameters<T>

表示用于从 WebGL 纹理构造张量的参数

interface TextureConstructorParameters<T> {
    dims: readonly number[];
    location: "texture";
    texture: WebGLTexture;
    type: T;
    dispose?(): void;
    download?(): Promise<DataTypeMap[T]>;
}

类型参数

继承关系

  • CommonConstructorParameters<T>
  • GpuResourceConstructorParameters<T>
    • TextureConstructorParameters

属性

dims: readonly number[]

获取张量的维度。

location: "texture"

指定数据位置为 'texture'。

texture: WebGLTexture

指定包含张量数据的 WebGL 纹理。

type: T

指定张量的数据类型。

方法

  • 一个可选的回调函数,将在张量被释放时调用。

    如果未提供,张量将把 GPU 数据视为外部资源。

    返回 void

  • 一个可选的回调函数,用于将数据从 GPU 下载到 CPU。

    如果未提供,张量将把 GPU 数据视为外部资源。

    返回 Promise<DataTypeMap[T]>

使用 TypeDoc 生成