Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NDArray

n-dimnesional array.

Hierarchy

  • NDArray

Implements

Index

Constructors

constructor

Properties

device

device: DLDevice

Device of the array.

dtype

dtype: string

Data type of the array.

ndim

ndim: number

Number of dimensions.

shape

shape: Array<number>

Shape of the array.

Methods

copyFrom

  • copyFrom(data: NDArray | Array<number> | Float32Array): this
  • Copy data from another NDArray or javascript array. The number of elements must match.

    Parameters

    • data: NDArray | Array<number> | Float32Array

      The source data array.

    Returns this

    this

copyFromRawBytes

  • copyFromRawBytes(data: Uint8Array): this
  • Copy data from raw bytes.

    Parameters

    • data: Uint8Array

      Uint8Array of bytes.

    Returns this

    this

dispose

  • dispose(): void

getHandle

  • getHandle(requireNotNull?: boolean): Pointer
  • Get handle of ndarray, check it is not null.

    Parameters

    • Default value requireNotNull: boolean = true

      require handle is not null.

    Returns Pointer

    The handle.

toArray

  • toArray(): Float32Array | Float64Array | Int32Array | Int8Array | Uint8Array
  • Return a TypedArray copy of the NDArray, the specific type depends on the dtype of the NDArray.

    Returns Float32Array | Float64Array | Int32Array | Int8Array | Uint8Array

    The result array.

toRawBytes

  • toRawBytes(): Uint8Array
  • Return a copied Uint8Array of the raw bytes in the NDArray.

    Returns Uint8Array

    The result array.

Generated using TypeDoc