ONNX Runtime JavaScript API
    Preparing search index...

    Interface TextureConstructorParameters<T>

    represent the parameter for constructing a tensor from a WebGL texture

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

    Type Parameters

    Hierarchy

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

    Properties

    dims: readonly number[]

    Get the dimensions of the tensor.

    location: "texture"

    Specify the location of the data to be 'texture'.

    texture: WebGLTexture

    Specify the WebGL texture that holds the tensor data.

    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]>