tvmjs
    Preparing search index...

    Class Tensor

    Tensor( n-dimnesional array).

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    device: DLDevice

    Device of the array.

    dtype: string

    Data type of the array.

    isView: boolean

    Whether it is a temporary view that can become invalid after the call.

    ndim: number

    Number of dimensions.

    shape: number[]

    Shape of the array.

    Methods

    • Copy data from another Tensor or javascript array. The number of elements must match.

      Parameters

      • data:
            | number[]
            | Uint8Array<ArrayBufferLike>
            | Int32Array<ArrayBufferLike>
            | Float32Array<ArrayBufferLike>
            | Float64Array<ArrayBufferLike>
            | Tensor
            | Int8Array<ArrayBufferLike>
            | Uint8ClampedArray<ArrayBufferLike>

        The source data array.

      Returns this

      this

    • Copy data from raw bytes.

      Parameters

      • data: Uint8Array

        Uint8Array of bytes.

      Returns this

      this

    • Dispose the internal resource This function can be called multiple times, only the first call will take effect.

      Returns void

    • Get dataPtr of NDarray

      Returns number

      The handle.

    • Get handle of module, check it is not null.

      Parameters

      • requireNotNull: boolean = true

        require handle is not null.

      Returns number

      The handle.

    • Return a TypedArray copy of the Tensor, the specific type depends on the dtype of the Tensor.

      Returns
          | Uint8Array<ArrayBufferLike>
          | Int32Array<ArrayBufferLike>
          | Float32Array<ArrayBufferLike>
          | Float64Array<ArrayBufferLike>
          | Int8Array<ArrayBufferLike>

      The result array.

    • Return a copied Uint8Array of the raw bytes in the Tensor.

      Returns Uint8Array

      The result array.

    • Create a view of the array.

      Parameters

      • shape: number[]

        The shape of the view.

      • Optionaldtype: string

        The data type of the new array.

      Returns Tensor

      The new sliced ndarray.