构造函数
constructor(构造函数)
- new NDArray(handle, isView, lib, ctx): NDArray
-
参数
-
handle: number
-
isView: boolean
-
-
属性
dtype(数据类型)
dtype: string
isView(是否为视图)
isView: boolean
shape(形状)
shape: number[]
方法
copyFrom(从...复制)
- copyFrom(data): NDArray
-
参数
-
data: number[] | Uint8Array | Int32Array | Float32Array | Float64Array | NDArray | Int8Array | Uint8ClampedArray
this
copyFromRawBytes(从原始字节复制)
- copyFromRawBytes(data): NDArray
-
this
getDataPtr(获取数据指针)
- getDataPtr(): number
-
返回值 number
句柄。
getHandle(获取句柄)
- getHandle(requireNotNull?): number
-
参数
-
requireNotNull: boolean = true
返回值 number
句柄。
toArray(转换为数组)
- toArray(): Uint8Array | Int32Array | Float32Array | Float64Array | Int8Array
-
返回值 Uint8Array | Int32Array | Float32Array | Float64Array | Int8Array
结果数组。
toRawBytes(转换为原始字节)
- toRawBytes(): Uint8Array
-
返回值 Uint8Array
结果数组。
view(视图)
- view(shape, dtype?): NDArray
-
参数
-
shape: number[]
-
Optional
dtype: string
新的切片 ndarray。
n 维数组。