Anonymous View
ONNX Runtime JavaScript API
    Preparing search index...

    Interface MLTensorConstructorParameters<T>

    interface MLTensorConstructorParameters<
        T extends MLTensorDataTypes = MLTensorDataTypes,
    > {
        dims: readonly number[];
        location: "ml-tensor";
        mlTensor: MLTensorTypeFallback;
        type: T;
        dispose?(): void;
        download?(): Promise<DataTypeMap[T]>;
    }

    Type Parameters

    Hierarchy

    • CommonConstructorParameters<T>
    • GpuResourceConstructorParameters<T>
      • MLTensorConstructorParameters
    Index

    Properties

    dims: readonly number[]

    Get the dimensions of the tensor.

    location: "ml-tensor"

    Specify the location of the data to be 'ml-tensor'.

    Specify the WebNN MLTensor 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]>