Return an NDArray
that lives in the target context.
Return an NDArray
that lives in the target context. If the array
is already in that context, self
is returned. Otherwise, a copy is made.
The target context we want the return value to live in.
A copy or self
as an NDArray
that lives in the target context.
Return a copied numpy array of current array with specified type.
Return a copied numpy array of current array with specified type.
Desired type of result array.
A copy of array content.
Return a sub NDArray that shares memory with current one.
Return a sub NDArray that shares memory with current one. the first axis will be rolled up, which causes its shape different from slice(i, i+1)
index of sub array.
Off-Heap Bytes Allocated for this object
Off-Heap Bytes Allocated for this object
Get context of current NDArray.
Clone the current array
Copy the content of current array to a new NDArray in the context.
Copy the content of current array to a new NDArray in the context.
Target context we want to copy data to.
The copy target NDArray
Copy the content of current array to other.
Copy the content of current array to other.
Target NDArray or context we want to copy data to.
The copy target NDArray
Release the native memory.
Release the native memory.
The NDArrays it depends on will NOT be disposed.
The object shall never be used after it is disposed.
Dispose all NDArrays who help to construct this array.
Dispose all NDArrays who help to construct this array.
e.g. (a * b + c).disposeDeps() will dispose a, b, c (including their deps) and a * b
this NDArray
Dispose all NDArrays who help to construct this array, excepts those in the arguments.
Dispose all NDArrays who help to construct this array, excepts those in the arguments.
e.g. (a * b + c).disposeDepsExcept(a, b)
will dispose c and a * b.
Note that a, b's dependencies will not be disposed either.
array of NDArrays
this array
Get data type of current NDArray.
Get data type of current NDArray.
class representing type of current ndarray
Get the Data portion from a Row Sparse NDArray
Get the Data portion from a Row Sparse NDArray
NDArray
Get the indice Array
Get the indice Array
NDArray
Get the indptr Array from a CSR NDArray
Get the indptr Array from a CSR NDArray
NDArray
check if NDArray is SparseNDArray
native Address associated with this object
native Address associated with this object
Function Pointer to the NativeDeAllocator of nativeAddress
Function Pointer to the NativeDeAllocator of nativeAddress
Call NativeResource.register to get the reference
Call NativeResource.register to get the reference
Register this object for PhantomReference tracking and in ResourceScope if used inside ResourceScope.
Register this object for PhantomReference tracking and in ResourceScope if used inside ResourceScope.
NativeResourceRef that tracks reachability of this object using PhantomReference
Return a reshaped NDArray that shares memory with current one.
Return a reshaped NDArray that shares memory with current one.
New shape.
a reshaped NDArray that shares memory with current one.
Return a reshaped NDArray that shares memory with current one.
Return a reshaped NDArray that shares memory with current one.
New shape.
whether to inplace reshape
a reshaped NDArray that shares memory with current one.
Return a reshaped NDArray that shares memory with current one.
Return a reshaped NDArray that shares memory with current one.
New shape.
a reshaped NDArray that shares memory with current one.
Set the values of the NDArray
Get shape of current NDArray.
Get shape of current NDArray.
an array representing shape of current ndarray
Return a sliced NDArray that shares memory with current one.
Return a sliced NDArray that shares memory with current one. NDArray only support continuous slicing on axis 0
Starting index of slice.
a sliced NDArray that shares memory with current one.
Return a sliced NDArray at the ith position of axis0
Return a sliced NDArray at the ith position of axis0
a sliced NDArray that shares memory with current one.
Return a copied flat java array of current array (row-major).
Return a copied flat java array of current array (row-major).
A copy of array content.
Convert a SparseNDArray to dense NDArray
Convert a SparseNDArray to dense NDArray
NDArray
Return a copied flat java array of current array (row-major) with datatype as Float64/Double.
Return a copied flat java array of current array (row-major) with datatype as Float64/Double.
A copy of array content.
Return a CPU scalar(float) of current ndarray.
Return a CPU scalar(float) of current ndarray. This ndarray must have shape (1,)
The scalar representation of the ndarray.
Convert a NDArray to SparseNDArray
Convert a NDArray to SparseNDArray
the target sparse type
SparseNDArray
Visualize the internal structure of NDArray
Visualize the internal structure of NDArray
String that show the structure
Block until all pending writes operations on current NDArray are finished.
Block until all pending writes operations on current NDArray are finished. This function will return when all the pending writes to the current NDArray finishes. There can still be pending read going on when the function returns.
whether the NDArray is writable
whether the NDArray is writable
Sparse NDArray is the child class of NDArray designed to hold the Sparse format
Currently, Rowsparse and CSR typed NDArray is supported. Most of the Operators will convert Sparse NDArray to dense. Basic operators like
add
will have optimization for sparse operattions