Readonly dataGet the buffer data of the tensor.
If the data is not on CPU (eg. it's in the form of WebGL texture or WebGPU buffer), throw error.
Readonly dimsGet the dimensions of the tensor.
Readonly gpuGet the WebGPU buffer that holds the tensor data.
If the data is not on GPU as WebGPU buffer, throw error.
Readonly locationGet the location of the data.
Readonly mlGet the WebNN MLTensor that holds the tensor data.
If the data is not in a WebNN MLTensor, throw error.
Readonly sizeGet the number of elements in the tensor.
Readonly textureGet the WebGL texture that holds the tensor data.
If the data is not on GPU as WebGL texture, throw error.
Readonly typeGet the data type of the tensor.
Get the buffer data of the tensor.
If the data is on CPU, returns the data immediately. If the data is on GPU, downloads the data and returns the promise.
Optional releaseData: booleanwhether release the data on GPU. Ignore if data is already on CPU.
Create a new tensor with the same data buffer and specified dims.
New dimensions. Size should match the old one.
creates a DataURL instance from tensor
Optional options: TensorToDataUrlOptionsAn optional object representing options for creating a DataURL instance from the tensor.
The following default settings will be applied:
format: 'RGB'tensorLayout: 'NCHW'a DataURL string representing the image converted from tensor data
creates an ImageData instance from tensor
Optional options: TensorToImageDataOptionsAn optional object representing options for creating an ImageData instance from the tensor.
The following default settings will be applied:
format: 'RGB'tensorLayout: 'NCHW'an ImageData instance representing the image converted from tensor data
Generated using TypeDoc
Represent multi-dimensional arrays to feed to or fetch from model inferencing.