public abstract class BaseNDArray extends Object implements INDArray, Iterable
Modifier and Type | Field and Description |
---|---|
protected long |
arrayId |
protected boolean |
compressed |
protected DataBuffer |
data |
protected JvmShapeInfo |
jvmShapeInfo |
protected boolean |
released |
protected DataBuffer |
shapeInformation |
Constructor and Description |
---|
BaseNDArray() |
BaseNDArray(DataBuffer buffer) |
BaseNDArray(DataBuffer floatBuffer,
char order) |
BaseNDArray(DataBuffer buffer,
DataType dataType,
long[] shape,
long[] stride,
long offset,
char ordering) |
BaseNDArray(DataBuffer data,
int[] shape) |
BaseNDArray(DataBuffer buffer,
int[] shape,
char ordering) |
BaseNDArray(DataBuffer buffer,
int[] shape,
int[] strides) |
BaseNDArray(DataBuffer data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(DataBuffer buffer,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(DataBuffer buffer,
int[] shape,
long offset) |
BaseNDArray(DataBuffer buffer,
int[] shape,
long offset,
char ordering)
Constructor for stride and offset
|
BaseNDArray(DataBuffer data,
long[] shape) |
BaseNDArray(DataBuffer buffer,
long[] shape,
char ordering) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
char ordering,
DataType type) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
char ordering,
DataType type,
MemoryWorkspace workspace) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
long offset,
char ordering) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
long offset,
char ordering,
DataType dataType) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
long offset,
long ews,
char ordering) |
BaseNDArray(DataBuffer buffer,
long[] shape,
long[] stride,
long offset,
long ews,
char ordering,
DataType dataType) |
BaseNDArray(DataType type,
long[] shape,
long[] paddings,
long[] paddingOffsets,
char ordering,
MemoryWorkspace workspace) |
BaseNDArray(DataType type,
long[] shape,
long[] stride,
long offset,
char ordering,
boolean initialize) |
BaseNDArray(DataType type,
long[] shape,
long[] stride,
long offset,
char ordering,
boolean initialize,
MemoryWorkspace workspace) |
BaseNDArray(double[][] data)
Initialize the ndarray as a matrix
with the given data (indices preserved)
|
BaseNDArray(double[][] data,
char ordering) |
BaseNDArray(double[] data,
int[] shape,
char ordering) |
BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(double[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(double[] data,
long[] shape,
char ordering) |
BaseNDArray(double[] data,
long[] shape,
long[] stride,
long offset) |
BaseNDArray(double[] data,
long[] shape,
long[] stride,
long offset,
char ordering) |
BaseNDArray(double[] data,
long[] shape,
long offset,
char ordering) |
BaseNDArray(float[] data) |
BaseNDArray(float[][] data)
Initialize the ndarray
with the given data
|
BaseNDArray(float[][] data,
char ordering) |
BaseNDArray(float[] data,
char order) |
BaseNDArray(float[] data,
int[] shape)
Create this ndarray with the given data and shape and 0 offset
|
BaseNDArray(float[] data,
int[] shape,
char ordering)
Create this ndarray with the given data and shape and 0 offset
|
BaseNDArray(float[] data,
int[] shape,
int[] stride) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
char ordering) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset) |
BaseNDArray(float[] data,
int[] shape,
int[] stride,
long offset,
char ordering) |
BaseNDArray(float[] data,
int[] shape,
long offset) |
BaseNDArray(float[] data,
int[] shape,
long offset,
char ordering) |
BaseNDArray(float[] data,
long[] shape,
char ordering) |
BaseNDArray(float[] data,
long[] shape,
long[] stride,
long offset) |
BaseNDArray(float[] data,
long[] shape,
long[] stride,
long offset,
char ordering) |
BaseNDArray(float[] data,
long[] shape,
long offset,
char ordering) |
BaseNDArray(int[] shape)
Create an ndarray
with the given shape
|
BaseNDArray(int[] shape,
char ordering) |
BaseNDArray(int[] shape,
DataBuffer buffer)
Create with the specified shape and buffer
|
BaseNDArray(int[] shape,
int[] stride)
Create the ndarray with
the specified shape and stride and an offset of 0
|
BaseNDArray(int[] shape,
int[] stride,
char ordering)
Create the ndarray with
the specified shape and stride and an offset of 0
|
BaseNDArray(int[] data,
int[] shape,
int[] strides) |
BaseNDArray(int[] shape,
int[] stride,
long offset)
Construct an ndarray of the specified shape
with an empty data array
|
BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering)
Construct an ndarray of the specified shape
with an empty data array
|
BaseNDArray(int[] shape,
int[] stride,
long offset,
char ordering,
boolean initialize)
Construct an ndarray of the specified shape.
|
BaseNDArray(int[] shape,
long offset) |
BaseNDArray(int[] shape,
long offset,
char ordering) |
BaseNDArray(int newRows,
int newColumns)
Creates a new n times m DoubleMatrix.
|
BaseNDArray(int newRows,
int newColumns,
char ordering)
Creates a new n times m DoubleMatrix.
|
BaseNDArray(List<INDArray> slices,
int[] shape)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
char ordering)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
int[] stride)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
int[] shape,
int[] stride,
char ordering)
Create an ndarray from the specified slices.
|
BaseNDArray(List<INDArray> slices,
long[] shape) |
BaseNDArray(List<INDArray> slices,
long[] shape,
char ordering) |
BaseNDArray(List<INDArray> slices,
long[] shape,
long[] stride) |
BaseNDArray(List<INDArray> slices,
long[] shape,
long[] stride,
char ordering) |
BaseNDArray(long[] shape) |
BaseNDArray(long[] shape,
long[] stride,
long offset) |
BaseNDArray(long[] shape,
long[] stride,
long offset,
char ordering) |
BaseNDArray(long[] shape,
long[] stride,
long offset,
char ordering,
boolean initialize) |
BaseNDArray(long[] shape,
long offset,
char ordering) |
BaseNDArray(long newRows,
long newColumns) |
BaseNDArray(long newRows,
long newColumns,
char ordering) |
Modifier and Type | Method and Description |
---|---|
INDArray |
add(INDArray other)
Element-wise copy addition of two NDArrays
|
INDArray |
add(INDArray other,
INDArray result)
Element-wise copy addition of two NDArrays
|
INDArray |
add(Number n)
Scalar addition (cloning)
|
INDArray |
add(Number n,
INDArray result)
Addition of this ndarray.
|
INDArray |
addColumnVector(INDArray columnVector)
Addition of a column vector (copy)
|
INDArray |
addi(INDArray other)
in place (element wise) addition of two NDArrays
|
INDArray |
addi(INDArray other,
INDArray result)
in place (element wise) addition of two NDArrays
|
INDArray |
addi(Number n)
In place scalar addition
|
INDArray |
addi(Number n,
INDArray result)
In place addition
|
INDArray |
addiColumnVector(INDArray columnVector)
In place addition of a column vector
|
INDArray |
addiRowVector(INDArray rowVector)
In place addition of a row vector
|
INDArray |
addRowVector(INDArray rowVector)
Addition of a row vector (copy)
|
boolean |
all()
This method checks if all elements within this array are non-zero (or true, in case of boolean)
|
INDArray |
amax(int... dimension)
Returns the absolute overall max of this ndarray along given dimensions
|
Number |
amaxNumber()
Returns maximum (absolute) value in this INDArray
|
INDArray |
amean(int... dimension)
Returns the absolute overall mean of this ndarray
|
Number |
ameanNumber()
Returns the absolute overall mean of this ndarray
|
INDArray |
amin(int... dimension)
Returns minimum (absolute) value in this INDArray, along the specified dimensions
|
Number |
aminNumber()
Returns absolute min value in this INDArray
|
boolean |
any()
This method checks if any of the elements within this array are non-zero (or true, in case of boolean)
|
INDArray |
argMax(int... dimension)
This method returns index of highest value along specified dimension(s)
|
protected void |
assertSlice(INDArray put,
long slice) |
INDArray |
assign(boolean value)
Set all entries of the ndarray to the specified value
|
INDArray |
assign(INDArray arr)
Assign all of the elements in the given ndarray to this ndarray
|
INDArray |
assign(Number value)
Set all entries of the ndarray to the specified value
|
INDArray |
assignIf(INDArray arr,
Condition condition)
Assign all elements from given ndarray that are matching given condition,
ndarray to this ndarray
|
void |
assignNewId() |
protected void |
autoProcessScalarCall() |
INDArray |
broadcast(INDArray result)
Broadcasts this ndarray to be the specified shape
|
INDArray |
broadcast(long... shape)
Broadcasts this ndarray to be the specified shape
|
INDArray |
castTo(DataType dataType)
This method cast elements of this INDArray to new data type
|
protected void |
checkArrangeArray(int[] arr) |
void |
close()
This method releases exclusive off-heap resources uses by this INDArray instance.
|
boolean |
closeable()
This method checks, if this INDArray instalce can use close() method
|
int |
columns()
Returns the number of columns in this matrix (throws exception if not 2d)
|
INDArray |
cond(Condition condition)
Returns a binary INDArray with value 'true' if the element matches the specified condition and 'false' otherwise
|
protected static DataTypeEx |
convertType(DataType type) |
protected INDArray |
create(DataBuffer buffer) |
protected INDArray |
create(DataBuffer data,
int[] shape,
int[] strides) |
protected INDArray |
create(DataBuffer data,
int[] newShape,
int[] newStrides,
long offset) |
protected INDArray |
create(DataBuffer data,
int[] newShape,
int[] newStrides,
long offset,
char ordering) |
protected INDArray |
create(DataBuffer data,
int[] shape,
long offset) |
protected INDArray |
create(DataBuffer data,
long[] newShape,
long[] newStrides,
long offset,
char ordering) |
protected INDArray |
create(int[] shape) |
protected INDArray |
create(int[] shape,
char ordering) |
protected INDArray |
create(int[] shape,
int[] strides,
long offset) |
protected INDArray |
create(int rows,
int length) |
protected INDArray |
createScalar(double d) |
protected INDArray |
createScalarForIndex(long i,
boolean applyOffset) |
INDArray |
cumsum(int dimension)
Returns the cumulative sum along a dimension.
|
INDArray |
cumsumi(int dimension)
Returns the cumulative sum along a dimension.
|
DataBuffer |
data()
Returns a linear double array representation of this ndarray
|
DataType |
dataType()
This method returns dtype for this INDArray
|
INDArray |
detach()
This method detaches INDArray from Workspace, returning copy.
|
INDArray |
dimShuffle(Object[] rearrange,
int[] newOrder,
boolean[] broadCastable)
Deprecated.
|
INDArray |
dimShuffle(Object[] rearrange,
long[] newOrder,
boolean[] broadCastable)
Dimshuffle: an extension of permute that adds the ability
to broadcast various dimensions.
|
double |
distance1(INDArray other)
Returns the (1-norm) distance.
|
double |
distance2(INDArray other)
Returns the (euclidean) distance.
|
INDArray |
div(INDArray other)
Copy (element wise) division of two NDArrays
|
INDArray |
div(INDArray other,
INDArray result)
copy (element wise) division of two NDArrays
|
INDArray |
div(Number n)
Division by a number
|
INDArray |
div(Number n,
INDArray result)
Division if ndarray by number
|
INDArray |
divColumnVector(INDArray columnVector)
Division of a column vector (copy)
|
INDArray |
divi(INDArray other)
in place (element wise) division of two NDArrays
|
INDArray |
divi(INDArray other,
INDArray result)
in place (element wise) division of two NDArrays
|
INDArray |
divi(Number n)
In place scalar division
|
INDArray |
divi(Number n,
INDArray result)
In place division of this ndarray
|
INDArray |
diviColumnVector(INDArray columnVector)
In place division of a column vector
|
INDArray |
diviRowVector(INDArray rowVector)
In place division of a row vector
|
INDArray |
divRowVector(INDArray rowVector)
Division of a row vector (copy)
|
protected INDArray |
doColumnWise(INDArray columnVector,
char operation)
Do a row wise op (a,s,m,d)
a : add
s : subtract
m : multiply
d : divide
h : reverse subtraction
t : reverse division
|
protected int[] |
doPermuteSwap(DataBuffer shape,
int[] rearrange)
Deprecated.
|
protected int[] |
doPermuteSwap(IntBuffer shape,
int[] rearrange)
Deprecated.
|
protected long[] |
doPermuteSwap(long[] shape,
int[] rearrange) |
protected long[] |
doPermuteSwap(LongBuffer shape,
int[] rearrange)
Deprecated.
|
protected INDArray |
doRowWise(INDArray rowVector,
char operation)
Do a row wise op (a,s,m,d)
a : add
s : subtract
m : multiply
d : divide
h : reverse subtraction
t : reverse division
|
INDArray |
dup()
Returns a copy of this ndarray
|
INDArray |
dup(char order)
Returns a copy of this ndarray, where the returned ndarray has the specified order
|
Object |
element()
Returns a scalar (individual element)
of a scalar ndarray
|
int |
elementWiseStride()
Element wise stride
|
INDArray |
entropy(int... dimension)
Returns entropy value for this INDArray along specified dimension(s)
|
Number |
entropyNumber()
Returns entropy value for this INDArray
|
INDArray |
eps(INDArray other)
Returns the binary ndarray for "Epsilon equals" comparison.
|
INDArray |
eps(Number other)
Returns the binary ndarray for "Epsilon equals" comparison.
|
INDArray |
eq(INDArray other)
Returns the binary ndarray for "Equals" comparison.
|
INDArray |
eq(Number other)
Returns the binary ndarray for "Equals" comparison.
|
boolean |
equals(Object o)
Compare two matrices.
|
boolean |
equalShapes(@NonNull INDArray other)
This method checks 2 INDArrays for equal shapes.
Shapes are considered equal if: (a) Both arrays have equal rank, and (b) size(0)...size(rank()-1) are equal for both arrays |
boolean |
equalsWithEps(Object o,
double eps)
This method checks 2 INDArrays equality with given eps
|
INDArray |
fmod(INDArray denominator)
remainder of division
|
INDArray |
fmod(INDArray denominator,
INDArray result)
remainder of division
|
INDArray |
fmod(Number denominator)
remainder of division by scalar.
|
INDArray |
fmod(Number denominator,
INDArray result)
remainder of division by scalar.
|
INDArray |
fmodi(INDArray denominator)
In place fmod
|
INDArray |
fmodi(Number denominator)
In place fmod
|
INDArray |
get(INDArray indices)
Get the elements from this ndarray based on the specified indices
|
INDArray |
get(INDArrayIndex... indexes)
Returns a subset of this array based on the specified indexes
|
INDArray |
getColumn(long c)
Returns the specified column.
|
INDArray |
getColumn(long c,
boolean keepDim)
Returns the specified column.
|
INDArray |
getColumns(int... cindices)
Get an INDArray comprised of the specified columns only.
|
double |
getDouble(int... indices)
Get a double value at the specified indices.
|
double |
getDouble(long... indices)
|
double |
getDouble(long i)
Get the double value at the specified linear index in the array
|
double |
getDouble(long i,
long j)
Get the double value at the specified indices.
|
double |
getDoubleUnsafe(long offset)
Get a double at the given linear offset unsafe, without checks.
|
float |
getFloat(int... indices)
Returns the elements at the specified indices
|
float |
getFloat(long... indices)
|
float |
getFloat(long i)
Return the item at the linear index i
|
float |
getFloat(long i,
long j)
Return the item at row i column j
Note that this is the same as calling getScalar(new int[]{i,j}
|
long |
getId()
A unique ID for the INDArray object instance.
|
int |
getInt(int... indices)
Get an integer value at the specified indices.
|
int |
getLeadingOnes()
Get the number of leading ones in the array shape.
|
long |
getLong(long... indices)
Get a long value at the specified indices.
|
long |
getLong(long index)
Get a long value at the specified index.
|
Number |
getNumber(long... idx)
Get a numeric value at the specified indices.
|
Number |
getNumber(long i)
Get the numeric value at the specified index.
|
protected double |
getPercentile(Number quantile,
INDArray sorted) |
INDArray |
getRow(long r)
Returns the specified row as a 1D vector.
|
INDArray |
getRow(long r,
boolean keepDim)
Returns the specified row.
|
INDArray |
getRows(int[] rindices)
Get an INDArray comprised of the specified rows only.
|
INDArray |
getScalar(int[] indexes)
Returns the elements at the specified indices
|
INDArray |
getScalar(long... indexes)
|
INDArray |
getScalar(long i)
Returns the element at the specified index
|
INDArray |
getScalar(long row,
long column)
Returns the element at the specified row/column
|
protected int[] |
getStrides(int[] shape,
char ordering) |
int |
getTrailingOnes()
Get the number of trailing ones in the array shape.
|
INDArray |
getWhere(INDArray comp,
Condition condition)
Boolean indexing:
Return the element if it fulfills the condition in
result array
|
INDArray |
getWhere(Number comp,
Condition condition)
Boolean indexing:
Return the element if it fulfills the condition in
result array
|
INDArray |
gt(INDArray other)
Returns the binary ndarray for "Greater Than" comparison.
|
INDArray |
gt(Number other)
Returns the binary ndarray for "Greater" comparison.
|
INDArray |
gte(Number other)
Returns binary ndarray for "Greter or equals" comparison.
|
int |
hashCode() |
protected void |
init(int[] shape,
int[] stride) |
protected void |
init(long[] shape,
long[] stride) |
protected static DataBuffer |
internalCreateBuffer(double[] data) |
protected static DataBuffer |
internalCreateBuffer(double[] data,
long offset) |
protected static DataBuffer |
internalCreateBuffer(float[] data) |
protected static DataBuffer |
internalCreateBuffer(float[] data,
long offset) |
protected static DataBuffer |
internalCreateBuffer(int[] data) |
boolean |
isAttached()
This method returns True, if this INDArray instance is attached to some Workspace.
|
boolean |
isB()
This method checks if this INDArray instance has boolean type
|
boolean |
isColumnVector()
Returns true if the number of columns is 1
|
boolean |
isColumnVectorOrScalar()
Returns true if the number of columns is 1
|
boolean |
isCompressed()
Check if this array is compressed.
|
boolean |
isEmpty()
This method returns true if this INDArray is special case: no-value INDArray
|
INDArray |
isInfinite()
Returns the binary NDArray with value true where this array's entries are infinite, or false where they
are not infinite
|
boolean |
isInScope()
This method checks, if given attached INDArray is still in scope of its parent Workspace
PLEASE NOTE: if this INDArray isn't attached to any Workspace, this method will return true
|
boolean |
isMatrix()
Returns true if this ndarray is a matrix
|
INDArray |
isNaN()
Returns the binary NDArray with value true where this array's entries are NaN, or false where they
are not infinite
|
boolean |
isR()
This method checks if this INDArray instance is one of Real types
|
boolean |
isRowVector()
Returns true if the number of rows is 1
|
boolean |
isRowVectorOrScalar()
Returns true if the number of rows is 1
|
boolean |
isS()
This method checks if this INDArray instance has String type
|
boolean |
isScalar()
Returns true if this ndarray is a scalar
|
boolean |
isSparse()
Check if this array is sparse
|
boolean |
isSquare()
Returns whether the matrix
has the same rows and columns
|
boolean |
isValid()
Deprecated.
|
boolean |
isVector()
Checks whether the matrix is a vector.
|
boolean |
isVectorOrScalar()
Returns true if this ndarray is a vector or scalar
|
boolean |
isView()
Check if this array is a view or not.
|
boolean |
isZ()
This method checks if this INDArray instance is one of integer types
|
Iterator<Object> |
iterator() |
long |
length()
Returns the total number of elements in the ndarray
|
INDArray |
leverage()
This method detaches INDArray from current Workspace, and attaches it to Workspace above, if any.
|
INDArray |
leverageOrDetach(String id)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id, if a workspace
with the given ID is open and active.
|
INDArray |
leverageTo(String id)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id - if a workspace
with that ID exists.
|
INDArray |
leverageTo(String id,
boolean enforceExistence)
This method detaches INDArray from current Workspace, and attaches it to Workspace with a given Id.
|
INDArray |
like()
This method returns empty array with the same dtype/order/shape as this one
|
long |
linearIndex(long i)
Deprecated.
|
INDArray |
logEntropy(int... dimension)
Returns log entropy value for this INDArray along specified dimension(s)
|
Number |
logEntropyNumber()
Returns log entropy value for this INDArray
|
INDArray |
lt(INDArray other)
Returns the binary ndarray for "Less" comparison.
|
INDArray |
lt(Number other)
Returns the binary ndarray for "Less" comparison.
|
INDArray |
lte(Number other)
Returns the binary ndarray for "Less or equals" comparison.
|
void |
markAsCompressed(boolean reallyCompressed)
This method marks INDArray instance as compressed
PLEASE NOTE: Do not use this method unless you 100% have to
|
INDArray |
match(INDArray comp,
Condition condition)
Return a mask on whether each element matches the given condition
|
INDArray |
match(Number comp,
Condition condition)
Returns a mask
|
INDArray |
max(boolean keepDims,
int... dimension)
Returns the overall max of this ndarray along given dimensions
|
INDArray |
max(int... dimension)
Returns the overall max of this ndarray along given dimensions
|
Number |
maxNumber()
Returns maximum value in this INDArray
|
INDArray |
mean(boolean keepDims,
int... dimension)
Returns the overall mean of this ndarray
|
INDArray |
mean(@NonNull INDArray result,
boolean keepDims,
int... dimension)
Returns the overall mean of this ndarray
|
INDArray |
mean(@NonNull INDArray result,
int... dimension)
Returns the overall mean of this ndarray
|
INDArray |
mean(int... dimension)
Returns the overall mean of this ndarray
|
Number |
meanNumber()
Returns the overall mean of this ndarray
|
INDArray |
median(int... dimension)
This method returns median along given dimension(s)
|
Number |
medianNumber()
This method returns median value for this INDArray
|
INDArray |
migrate()
This method pulls this INDArray into current Workspace.
|
INDArray |
migrate(boolean detachOnNoWs)
This method pulls this INDArray into current Workspace, or optionally detaches if no workspace is present.
That is: If current workspace is present/active, INDArray is migrated to it. If no current workspace is present/active, one of two things occur: 1. |
INDArray |
min(boolean keepDims,
int... dimension)
Returns the overall min of this ndarray
|
INDArray |
min(int... dimension)
Returns the overall min of this ndarray
|
Number |
minNumber()
Returns min value in this INDArray
|
INDArray |
mmul(INDArray other)
Perform a copy matrix multiplication
|
INDArray |
mmul(INDArray other,
char resultOrder)
Perform a copy matrix multiplication
|
INDArray |
mmul(INDArray other,
INDArray result)
Perform an copy matrix multiplication
|
INDArray |
mmul(INDArray other,
INDArray result,
MMulTranspose mMulTranspose)
Perform an copy matrix multiplication
|
INDArray |
mmul(INDArray other,
MMulTranspose mMulTranspose)
Perform a copy matrix multiplication
|
INDArray |
mmuli(INDArray other)
Perform an inplace matrix multiplication
|
INDArray |
mmuli(INDArray other,
INDArray result)
Perform an inplace matrix multiplication
|
INDArray |
mmuli(INDArray other,
INDArray result,
MMulTranspose transpose)
Perform an in place matrix multiplication
|
INDArray |
mmuli(INDArray other,
MMulTranspose transpose)
Perform an copy matrix multiplication
|
INDArray |
mul(INDArray other)
copy (element wise) multiplication of two NDArrays
|
INDArray |
mul(INDArray other,
INDArray result)
copy (element wise) multiplication of two NDArrays
|
INDArray |
mul(Number n)
Scalar multiplication (copy)
|
INDArray |
mul(Number n,
INDArray result)
Multiplication of ndarray.
|
INDArray |
mulColumnVector(INDArray columnVector)
Multiplication of a column vector (copy)
|
INDArray |
muli(INDArray other)
in place (element wise) multiplication of two NDArrays
|
INDArray |
muli(INDArray other,
INDArray result)
in place (element wise) multiplication of two NDArrays
|
INDArray |
muli(Number n)
In place scalar multiplication
|
INDArray |
muli(Number n,
INDArray result)
In place multiplication of this ndarray
|
INDArray |
muliColumnVector(INDArray columnVector)
In place multiplication of a column vector
|
INDArray |
muliRowVector(INDArray rowVector)
In place multiplication of a row vector
|
INDArray |
mulRowVector(INDArray rowVector)
Multiplication of a row vector (copy)
|
INDArray |
neg()
Returns the ndarray negative (cloned)
|
INDArray |
negi()
In place setting of the negative version of this ndarray
|
INDArray |
neq(INDArray other)
Returns the binary ndarray for "Not equals" comparison.
|
INDArray |
neq(Number other)
Returns the binary ndarray for "Not equals" comparison.
|
protected INDArray |
newShape(long[] newShape,
char ordering) |
boolean |
none()
This method checks if any of the elements within this array are non-zero (or true, in case of boolean)
|
INDArray |
norm1(boolean keepDims,
int... dimension)
Returns the norm1 (L1 norm, i.e., sum of absolute values; also known as Taxicab or Manhattan norm) along the
specified dimension
|
INDArray |
norm1(int... dimension)
Returns the norm1 (L1 norm, i.e., sum of absolute values; also known as Taxicab or Manhattan norm) along the
specified dimension
|
Number |
norm1Number()
Calculate and return norm1 (L1 norm, i.e., sum of absolute values; also known as Taxicab or Manhattan norm) for
the entire array
|
INDArray |
norm2(boolean keepDims,
int... dimension)
Returns the norm2 (L2 norm, sqrt(sum(x_i^2), also known as Euclidean norm) along the specified dimension(s)
|
INDArray |
norm2(int... dimension)
Returns the norm2 (L2 norm, sqrt(sum(x_i^2), also known as Euclidean norm) along the specified dimension(s)
|
Number |
norm2Number()
Return the norm2 (L2 norm, sqrt(sum(x_i^2), also known as Euclidean norm) for the entire array
|
INDArray |
normmax(boolean keepDims,
int... dimension)
Returns the max norm (aka infinity norm, equal to the maximum absolute value) along the specified dimension(s)
|
INDArray |
normmax(int... dimension)
Returns the max norm (aka infinity norm, equal to the maximum absolute value) along the specified dimension(s)
|
Number |
normmaxNumber()
Return the max norm (aka infinity norm, equal to the maximum absolute value) for the entire array
|
long |
offset()
Returns the start of where the ndarray is for the underlying data
|
char |
ordering()
Return the ordering (fortran or c 'f' and 'c' respectively) of this ndarray
|
long |
originalOffset()
Returns the start of where the ndarray is for the original data buffer
|
INDArray |
percentile(Number quantile,
int... dimension)
This method returns percentile along given dimension(s)
|
Number |
percentileNumber(Number quantile)
This method returns percentile value for this INDArray
|
INDArray |
permute(int... rearrange)
See: http://www.mathworks.com/help/matlab/ref/permute.html
|
INDArray |
permutei(int... rearrange)
An in-place version of permute.
|
INDArray |
prod(boolean keepDims,
int... dimension)
Returns the product along a given dimension
|
INDArray |
prod(int... dimension)
Returns the product along a given dimension
|
Number |
prodNumber()
Calculate the product of all values in the array
|
INDArray |
put(INDArray indices,
INDArray element)
Put element in to the indices denoted by
the indices ndarray.
|
INDArray |
put(INDArrayIndex[] indices,
INDArray element)
Put the elements of the ndarray in to the specified indices
|
INDArray |
put(INDArrayIndex[] indices,
Number element)
Put the elements of the ndarray in to the specified indices
|
INDArray |
put(int[] indices,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
int j,
INDArray element)
Inserts the element at the specified index
|
INDArray |
put(int i,
int j,
Number element)
Inserts the element at the specified index
|
INDArray |
putColumn(int column,
INDArray toPut)
Insert a column in to this array
Will throw an exception if this ndarray is not a matrix
|
INDArray |
putiColumnVector(INDArray columnVector)
In place assignment of a column vector
|
INDArray |
putiRowVector(INDArray rowVector)
in place assignment of row vector, to each row of this array
|
INDArray |
putRow(long row,
INDArray toPut)
Insert a row in to this array
Will throw an exception if this ndarray is not a matrix
|
INDArray |
putScalar(int[] indexes,
double value)
Insert the item at the specified indices
|
INDArray |
putScalar(int[] indexes,
float value)
Put the specified float value at the specified indices in this array
|
INDArray |
putScalar(int[] indexes,
int value)
Put the specified integer value at the specified indices in this array
|
INDArray |
putScalar(long[] indexes,
double value)
|
INDArray |
putScalar(long[] indexes,
float value)
|
INDArray |
putScalar(long[] indexes,
int value)
|
INDArray |
putScalar(long i,
double value)
Insert the number linearly in to the ndarray
|
INDArray |
putScalar(long i,
float value)
Insert a scalar float at the specified index
|
INDArray |
putScalar(long i,
int value)
Insert a scalar int at the specified index
|
INDArray |
putScalar(long row,
long col,
double value)
Insert the value at the specified indices, in a 2d (rank 2) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalar(long dim0,
long dim1,
long dim2,
double value)
Insert the value at the specified indices, in a 3d (rank 3) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalar(long dim0,
long dim1,
long dim2,
long dim3,
double value)
Insert the value at the specified indices, in a 4d (rank 4) NDArray
Equivalent to INDArray.putScalar(int[], double) but avoids int[] creation |
INDArray |
putScalarUnsafe(long offset,
double value)
Insert a scalar at the given linear offset
|
INDArray |
putSlice(int slice,
INDArray put)
Assigns the given matrix (put) to the specified slice
|
INDArray |
putWhere(INDArray comp,
INDArray put,
Condition condition)
Assign the element according to the comparison array
|
INDArray |
putWhere(Number comp,
INDArray put,
Condition condition)
Assign the element according to the comparison array
|
INDArray |
putWhere(Number comp,
Number put,
Condition condition)
Assign the element according to the comparison array
|
INDArray |
putWhereWithMask(INDArray mask,
INDArray put)
Use a pre computed mask for assigning arrays
|
INDArray |
putWhereWithMask(INDArray mask,
Number put)
Use a pre computed mask for assigning arrays
|
int |
rank()
Returns the rank of the ndarray (the number of dimensions).
|
INDArray |
ravel()
Returns a flattened version (row vector) of this ndarray
|
INDArray |
ravel(char ordering)
Returns a flattened version (row vector) of this ndarray
|
INDArray |
rdiv(INDArray other)
Reverse division, elements wise.
|
INDArray |
rdiv(INDArray other,
INDArray result)
Reverse division
|
INDArray |
rdiv(Number n)
Reverse division with a scalar - i.e., (n / thisArrayValues)
|
INDArray |
rdiv(Number n,
INDArray result)
Reverse division (number / ndarray)
|
INDArray |
rdivColumnVector(INDArray columnVector)
Reverse division of a column vector (copy)
|
INDArray |
rdivi(INDArray other)
Reverse divsion (in place).
|
INDArray |
rdivi(INDArray other,
INDArray result)
Reverse division (in-place)
|
INDArray |
rdivi(Number n)
In place reverse division - i.e., (n / thisArrayValues)
|
INDArray |
rdivi(Number n,
INDArray result)
Reverse in place division
|
INDArray |
rdiviColumnVector(INDArray columnVector)
In place reverse divison of a column vector
|
INDArray |
rdiviRowVector(INDArray rowVector)
In place reverse division of a column vector
|
INDArray |
rdivRowVector(INDArray rowVector)
Reverse division of a column vector (copy)
|
protected void |
read(ObjectInputStream s) |
INDArray |
remainder(INDArray denominator)
Remainder operator
|
INDArray |
remainder(INDArray denominator,
INDArray result)
Remainder operator
|
INDArray |
remainder(Number denominator)
The scalar remainder
|
INDArray |
remainder(Number denominator,
INDArray result)
The scalar remainder
|
INDArray |
remainderi(INDArray denominator)
In place remainder
|
INDArray |
remainderi(Number denominator)
In place remainder
|
INDArray |
repeat(int dimension,
long... repeats)
Repeat elements along a specified dimension.
|
INDArray |
replaceWhere(INDArray arr,
Condition condition)
Replaces all elements in this ndarray that are matching give condition, with corresponding elements from given array
|
INDArray |
repmat(int[] shape)
Deprecated.
|
INDArray |
repmat(long[] shape)
Replicate and tile array to fill out to the given shape
See:
https://github.com/numpy/numpy/blob/master/numpy/matlib.py#L310-L358
|
INDArray |
reshape(char order,
boolean enforceView,
long... newShape)
Reshapes the ndarray (note: it's not possible to change the length of the ndarray).
|
INDArray |
reshape(char order,
int... newShape)
Deprecated.
|
INDArray |
reshape(char order,
int rows,
int columns)
Reshapes the ndarray (can't change the length of the ndarray).
|
INDArray |
reshape(char order,
long... newShape)
Reshapes the ndarray (can't change the length of the ndarray).
|
INDArray |
reshape(int[] shape)
Reshape the ndarray in to the specified dimensions,
possible errors being thrown for invalid shapes
Note here that one dimension can be -1.
|
INDArray |
reshape(long... shape)
Reshapes the ndarray (can't change the length of the ndarray).
|
INDArray |
reshape(long newRows,
long newColumns)
Reshapes the ndarray (can't change the length of the ndarray).
|
int |
rows()
Returns the number of rows in this matrix (throws exception if not 2d)
|
INDArray |
rsub(INDArray other)
Element-wise reverse subtraction (copy op).
|
INDArray |
rsub(INDArray other,
INDArray result)
Reverse subtraction
|
INDArray |
rsub(Number n)
Reverse subtraction with duplicates - i.e., (n - thisArrayValues)
|
INDArray |
rsub(Number n,
INDArray result)
Reverse subtraction
|
INDArray |
rsubColumnVector(INDArray columnVector)
Reverse subtraction of a column vector (copy)
|
INDArray |
rsubi(INDArray other)
Element-wise reverse subtraction (in the place op) - i.e., other - this
|
INDArray |
rsubi(INDArray other,
INDArray result)
Reverse subtraction (in-place)
|
INDArray |
rsubi(Number n)
Reverse subtraction in place - i.e., (n - thisArrayValues)
|
INDArray |
rsubi(Number n,
INDArray result)
Reverse in place subtraction
|
INDArray |
rsubiColumnVector(INDArray columnVector)
In place reverse subtraction of a column vector
|
INDArray |
rsubiRowVector(INDArray rowVector)
In place reverse subtraction of a row vector
|
INDArray |
rsubRowVector(INDArray rowVector)
Reverse subtraction of a row vector (copy)
|
Number |
scan(Condition condition)
This method takes boolean condition, and returns number of elements matching this condition
|
void |
setData(DataBuffer data)
Set the data for this ndarray.
|
void |
setOrder(char order)
Set the ordering
|
void |
setShapeAndStride(int[] shape,
int[] stride)
Shape and stride setter
|
INDArray |
shannonEntropy(int... dimension)
Returns Shannon entropy value for this INDArray along specified dimension(s)
|
Number |
shannonEntropyNumber()
Returns non-normalized Shannon entropy value for this INDArray
|
long[] |
shape()
Returns the shape of this ndarray
|
LongBuffer |
shapeInfo()
Shape info
|
DataBuffer |
shapeInfoDataBuffer()
Shape info
|
long[] |
shapeInfoJava()
This method returns shapeInformation as jvm long array
|
String |
shapeInfoToString()
Returns the shape information debugging information
|
protected DataBuffer |
shapeOf() |
long |
size(int dimension)
Returns the size along a specified dimension
|
INDArray |
slice(long slice)
Returns the specified slice of this ndarray
|
INDArray |
slice(long slice,
int dimension)
Returns the slice of this from the specified dimension
|
long |
slices()
Returns the number of slices in this ndarray
|
void |
sliceVectors(List<INDArray> list)
Flattens the array for linear indexing in list.
|
double |
squaredDistance(INDArray other)
Returns the square of the Euclidean distance.
|
INDArray |
std(boolean biasCorrected,
boolean keepDims,
int... dimension)
Standard deviation of an ndarray along a dimension
|
INDArray |
std(boolean biasCorrected,
int... dimension)
Standard deviation of an ndarray along a dimension
|
INDArray |
std(int... dimension)
Standard deviation of an INDArray along one or more dimensions
|
Number |
stdNumber()
Calculate the standard deviation for the entire array
|
Number |
stdNumber(boolean biasCorrected)
Calculate the standard deviation for the entire array, specifying whether it is bias corrected or not
|
long[] |
stride()
Returns the stride of this ndarray
|
int |
stride(int dimension)
Calculate the stride along a particular dimension
|
protected DataBuffer |
strideOf() |
protected abstract int |
stringBuffer(com.google.flatbuffers.FlatBufferBuilder builder,
DataBuffer buffer) |
INDArray |
sub(INDArray other)
copy subtraction of two NDArrays
|
INDArray |
sub(INDArray other,
INDArray result)
copy subtraction of two NDArrays
|
INDArray |
sub(Number n)
Scalar subtraction (copied)
|
INDArray |
sub(Number n,
INDArray result)
Subtraction of this ndarray
|
INDArray |
subColumnVector(INDArray columnVector)
Subtraction of a column vector (copy)
|
INDArray |
subi(INDArray other)
in place (element wise) subtraction of two NDArrays
|
INDArray |
subi(INDArray other,
INDArray result)
in place subtraction of two matrices
|
INDArray |
subi(Number n)
In place scalar subtraction
|
INDArray |
subi(Number n,
INDArray result)
In place subtraction of this ndarray
|
INDArray |
subiColumnVector(INDArray columnVector)
In place subtraction of a column vector
|
INDArray |
subiRowVector(INDArray rowVector)
In place subtraction of a row vector
|
INDArray |
subRowVector(INDArray rowVector)
Subtraction of a row vector (copy)
|
INDArray |
sum(boolean keepDim,
int... dimension)
Returns the sum along the last dimension of this ndarray
|
INDArray |
sum(@NonNull INDArray result,
boolean keepDims,
int... dimension)
Returns the sum along the last dimension of this ndarray
|
INDArray |
sum(@NonNull INDArray result,
int... dimension)
Returns the sum along the last dimension of this ndarray
|
INDArray |
sum(int... dimension)
Returns the sum along the last dimension of this ndarray
|
Number |
sumNumber()
Sum the entire array
|
INDArray |
swapAxes(int dimension,
int with)
Mainly here for people coming from numpy.
|
INDArray |
tensorAlongDimension(long index,
int... dimension)
Get the vector along a particular dimension
|
long |
tensorsAlongDimension(int... dimension)
Returns the number of possible vectors for a given dimension
|
double[][] |
toDoubleMatrix()
Convert this ndarray to a 2d double matrix.
|
double[] |
toDoubleVector()
Convert this ndarray to a 1d double matrix.
|
int |
toFlatArray(com.google.flatbuffers.FlatBufferBuilder builder)
Add an
INDArray
to flatbuffers builder |
float[][] |
toFloatMatrix()
Convert this ndarray to a 2d float matrix.
|
float[] |
toFloatVector()
Convert this ndarray to a 1d float vector.
|
int[][] |
toIntMatrix()
Convert this ndarray to a 2d int matrix.
|
int[] |
toIntVector()
Convert this ndarray to a 1d int matrix.
|
long[][] |
toLongMatrix()
Convert this ndarray to a 2d int matrix.
|
long[] |
toLongVector()
Convert this ndarray to a 1d long matrix.
|
String |
toString()
Generate string representation of the matrix.
|
String |
toString(long maxElements,
boolean forceSummarize,
int precision)
Get a string representation of the array
|
String |
toString(@NonNull NDArrayStrings options)
Get a string representation of the array with configurable formatting
|
String |
toStringFull()
ToString with unlimited elements and precision
|
INDArray |
transpose()
Flip the rows and columns of a matrix
|
INDArray |
transposei()
Return transposed version of this matrix.
|
INDArray |
ulike()
This method returns uninitialized array with the same dtype/order/shape as this one
|
protected void |
validateNumericalArray(String opName,
boolean allowEmpty)
Validate that the operation is being applied on a numerical array (not boolean or utf8).
|
INDArray |
var(boolean biasCorrected,
int... dimension)
Returns the overall variance of this ndarray
|
INDArray |
var(int... dimension)
Returns the overall variance of this ndarray
|
Number |
varNumber()
Returns the overall variance of all values in this INDArray
|
INDArray |
vectorAlongDimension(int index,
int dimension)
Get the vector along a particular dimension
|
long |
vectorsAlongDimension(int dimension)
Returns the number of possible vectors for a given dimension
|
boolean |
wasClosed()
This method checks if array or its buffer was closed before
|
protected void |
write(ObjectOutputStream out) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getString, shapeDescriptor, unsafeDuplication, unsafeDuplication
forEach, spliterator
protected transient volatile DataBuffer shapeInformation
protected transient volatile DataBuffer data
protected transient boolean compressed
protected transient boolean released
protected transient JvmShapeInfo jvmShapeInfo
protected transient long arrayId
public BaseNDArray()
public BaseNDArray(DataBuffer buffer)
buffer
- public BaseNDArray(DataBuffer buffer, int[] shape, int[] stride, long offset, char ordering)
buffer
- shape
- stride
- offset
- ordering
- public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, long offset, char ordering)
public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, long offset, long ews, char ordering)
public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, long offset, char ordering, DataType dataType)
public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, long offset, long ews, char ordering, DataType dataType)
public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, char ordering, DataType type)
public BaseNDArray(DataBuffer buffer, long[] shape, long[] stride, char ordering, DataType type, MemoryWorkspace workspace)
public BaseNDArray(DataBuffer buffer, DataType dataType, long[] shape, long[] stride, long offset, char ordering)
public BaseNDArray(double[][] data)
data
- public BaseNDArray(double[][] data, char ordering)
data
- ordering
- public BaseNDArray(int[] shape, DataBuffer buffer)
shape
- the shapebuffer
- the bufferpublic BaseNDArray(float[] data, int[] shape, char ordering)
data
- the data to useshape
- the shape of the ndarraypublic BaseNDArray(float[] data, int[] shape, long offset, char ordering)
data
- the data to useshape
- the shape of the ndarrayoffset
- the desired offsetordering
- the ordering of the ndarraypublic BaseNDArray(double[] data, long[] shape, long offset, char ordering)
public BaseNDArray(float[] data, long[] shape, long offset, char ordering)
public BaseNDArray(int[] shape, int[] stride, long offset, char ordering)
shape
- the shape of the ndarraystride
- the stride of the ndarrayoffset
- the desired offsetordering
- the ordering of the ndarraypublic BaseNDArray(long[] shape, long[] stride, long offset, char ordering)
public BaseNDArray(int[] shape, int[] stride, long offset, char ordering, boolean initialize)
shape
- the shape of the ndarraystride
- the stride of the ndarrayoffset
- the desired offsetordering
- the ordering of the ndarrayinitialize
- Whether to initialize the INDArray. If true: initialize. If false: don't.public BaseNDArray(long[] shape, long[] stride, long offset, char ordering, boolean initialize)
public BaseNDArray(DataType type, long[] shape, long[] stride, long offset, char ordering, boolean initialize)
public BaseNDArray(DataType type, long[] shape, long[] stride, long offset, char ordering, boolean initialize, MemoryWorkspace workspace)
public BaseNDArray(DataType type, long[] shape, long[] paddings, long[] paddingOffsets, char ordering, MemoryWorkspace workspace)
public BaseNDArray(int[] shape, int[] stride, char ordering)
shape
- the shape of the ndarraystride
- the stride of the ndarrayordering
- the ordering of the ndarraypublic BaseNDArray(int[] shape, long offset, char ordering)
shape
- offset
- ordering
- public BaseNDArray(long[] shape, long offset, char ordering)
public BaseNDArray(int[] shape)
shape
- public BaseNDArray(long[] shape)
public BaseNDArray(int newRows, int newColumns, char ordering)
newRows
- the number of rows (n) of the new matrix.newColumns
- the number of columns (m) of the new matrix.public BaseNDArray(long newRows, long newColumns, char ordering)
public BaseNDArray(List<INDArray> slices, int[] shape, char ordering)
slices
- the slices to mergeshape
- the shape of the ndarraypublic BaseNDArray(List<INDArray> slices, int[] shape, int[] stride, char ordering)
slices
- the slices to mergeshape
- the shape of the ndarraypublic BaseNDArray(float[] data, int[] shape, int[] stride, char ordering)
data
- shape
- stride
- ordering
- public BaseNDArray(float[] data, int[] shape, int[] stride, long offset, char ordering)
data
- shape
- stride
- offset
- ordering
- public BaseNDArray(float[] data, long[] shape, long[] stride, long offset, char ordering)
public BaseNDArray(double[] data, long[] shape, long[] stride, long offset, char ordering)
public BaseNDArray(DataBuffer data, int[] shape, int[] stride, long offset)
data
- shape
- stride
- offset
- public BaseNDArray(int[] data, int[] shape, int[] strides)
data
- shape
- strides
- public BaseNDArray(DataBuffer data, int[] shape)
data
- shape
- public BaseNDArray(DataBuffer data, long[] shape)
public BaseNDArray(DataBuffer buffer, int[] shape, long offset)
buffer
- shape
- offset
- public BaseNDArray(DataBuffer buffer, int[] shape, char ordering)
buffer
- shape
- ordering
- public BaseNDArray(DataBuffer buffer, long[] shape, char ordering)
public BaseNDArray(double[] data, int[] shape, char ordering)
data
- shape
- ordering
- public BaseNDArray(double[] data, long[] shape, char ordering)
public BaseNDArray(float[] data, long[] shape, char ordering)
public BaseNDArray(double[] data, int[] shape, int[] stride, long offset, char ordering)
data
- shape
- stride
- offset
- ordering
- public BaseNDArray(float[] data, char order)
data
- order
- public BaseNDArray(DataBuffer floatBuffer, char order)
floatBuffer
- order
- public BaseNDArray(DataBuffer buffer, int[] shape, int[] strides)
buffer
- shape
- strides
- public BaseNDArray(float[] data, int[] shape)
data
- the data to useshape
- the shape of the ndarraypublic BaseNDArray(float[] data, int[] shape, long offset)
data
- shape
- offset
- public BaseNDArray(int[] shape, int[] stride, long offset)
shape
- the shape of the ndarraystride
- the stride of the ndarrayoffset
- the desired offsetpublic BaseNDArray(long[] shape, long[] stride, long offset)
public BaseNDArray(int[] shape, int[] stride)
shape
- the shape of the ndarraystride
- the stride of the ndarraypublic BaseNDArray(int[] shape, long offset)
shape
- offset
- public BaseNDArray(int[] shape, char ordering)
shape
- ordering
- public BaseNDArray(int newRows, int newColumns)
newRows
- the number of rows (n) of the new matrix.newColumns
- the number of columns (m) of the new matrix.public BaseNDArray(long newRows, long newColumns)
public BaseNDArray(List<INDArray> slices, int[] shape)
slices
- the slices to mergeshape
- the shape of the ndarraypublic BaseNDArray(List<INDArray> slices, int[] shape, int[] stride)
slices
- the slices to mergeshape
- the shape of the ndarraypublic BaseNDArray(float[] data, int[] shape, int[] stride)
data
- shape
- stride
- public BaseNDArray(float[] data, int[] shape, int[] stride, long offset)
data
- shape
- stride
- offset
- public BaseNDArray(double[] data, long[] shape, long[] stride, long offset)
public BaseNDArray(float[] data, long[] shape, long[] stride, long offset)
public BaseNDArray(float[] data)
data
- public BaseNDArray(float[][] data)
data
- public BaseNDArray(float[][] data, char ordering)
data
- ordering
- public BaseNDArray(DataBuffer buffer, int[] shape, long offset, char ordering)
buffer
- shape
- offset
- ordering
- public BaseNDArray(double[] data, int[] shape, int[] stride, long offset)
public boolean isCompressed()
INDArray
isCompressed
in interface INDArray
public void markAsCompressed(boolean reallyCompressed)
INDArray
markAsCompressed
in interface INDArray
reallyCompressed
- new value for compressed.protected static DataBuffer internalCreateBuffer(float[] data)
protected static DataBuffer internalCreateBuffer(double[] data)
protected static DataBuffer internalCreateBuffer(int[] data)
protected static DataBuffer internalCreateBuffer(float[] data, long offset)
protected static DataBuffer internalCreateBuffer(double[] data, long offset)
@Deprecated public boolean isValid()
protected INDArray create(DataBuffer data, int[] shape, long offset)
public int elementWiseStride()
INDArray
elementWiseStride
in interface INDArray
public long tensorsAlongDimension(int... dimension)
INDArray
tensorsAlongDimension
in interface INDArray
dimension
- the dimension to calculate the number of vectors forpublic INDArray tensorAlongDimension(long index, int... dimension)
INDArray
tensorAlongDimension
in interface INDArray
index
- the index of the vector to getScalardimension
- the dimension to getScalar the vector frompublic long vectorsAlongDimension(int dimension)
INDArray
vectorsAlongDimension
in interface INDArray
dimension
- the dimension to calculate the number of vectors forpublic INDArray vectorAlongDimension(int index, int dimension)
INDArray
vectorAlongDimension
in interface INDArray
index
- the index of the vector to getScalardimension
- the dimension to getScalar the vector frompublic void setOrder(char order)
INDArray
public void setShapeAndStride(int[] shape, int[] stride)
INDArray
setShapeAndStride
in interface INDArray
shape
- new value for shapestride
- new value for stridepublic INDArray cumsumi(int dimension)
INDArray
public Number normmaxNumber()
INDArray
normmaxNumber
in interface INDArray
public Number norm2Number()
INDArray
norm2Number
in interface INDArray
public Number norm1Number()
INDArray
norm1Number
in interface INDArray
public Number stdNumber()
INDArray
public Number prodNumber()
INDArray
prodNumber
in interface INDArray
public Number meanNumber()
INDArray
meanNumber
in interface INDArray
public Number ameanNumber()
INDArray
ameanNumber
in interface INDArray
public Number varNumber()
INDArray
public Number maxNumber()
INDArray
public Number amaxNumber()
INDArray
amaxNumber
in interface INDArray
public Number minNumber()
INDArray
public Number aminNumber()
INDArray
aminNumber
in interface INDArray
public Number scan(Condition condition)
INDArray
public Number sumNumber()
INDArray
public Number entropyNumber()
INDArray
entropyNumber
in interface INDArray
public Number shannonEntropyNumber()
INDArray
shannonEntropyNumber
in interface INDArray
public Number logEntropyNumber()
INDArray
logEntropyNumber
in interface INDArray
public INDArray cumsum(int dimension)
INDArray
public INDArray assign(INDArray arr)
INDArray
public INDArray putScalar(long i, double value)
INDArray
public INDArray putScalar(long i, float value)
INDArray
public INDArray putScalar(long i, int value)
INDArray
public INDArray putScalar(int[] indexes, double value)
INDArray
public INDArray putScalar(long[] indexes, double value)
INDArray
public INDArray putScalar(long[] indexes, float value)
INDArray
public INDArray putScalar(long row, long col, double value)
INDArray
INDArray.putScalar(int[], double)
but avoids int[] creationpublic INDArray putScalar(long dim0, long dim1, long dim2, double value)
INDArray
INDArray.putScalar(int[], double)
but avoids int[] creationpublic INDArray putScalar(long dim0, long dim1, long dim2, long dim3, double value)
INDArray
INDArray.putScalar(int[], double)
but avoids int[] creationpublic INDArray putScalar(int[] indexes, float value)
INDArray
public INDArray putScalar(int[] indexes, int value)
INDArray
public INDArray putScalar(long[] indexes, int value)
INDArray
public INDArray eps(Number other)
INDArray
public INDArray eps(INDArray other)
INDArray
public INDArray lt(Number other)
INDArray
public INDArray lte(Number other)
INDArray
public INDArray eq(Number other)
INDArray
public INDArray gt(Number other)
INDArray
public INDArray gte(Number other)
INDArray
public INDArray lt(INDArray other)
INDArray
public INDArray neq(Number other)
INDArray
public INDArray neq(INDArray other)
INDArray
public INDArray eq(INDArray other)
INDArray
public INDArray gt(INDArray other)
INDArray
public INDArray isInfinite()
INDArray
isInfinite
in interface INDArray
public INDArray isNaN()
INDArray
public INDArray neg()
INDArray
public INDArray negi()
INDArray
public INDArray rdiv(Number n, INDArray result)
INDArray
public INDArray rdivi(Number n, INDArray result)
INDArray
public INDArray rsub(Number n, INDArray result)
INDArray
public INDArray rsubi(Number n, INDArray result)
INDArray
public INDArray div(Number n, INDArray result)
INDArray
public INDArray divi(Number n, INDArray result)
INDArray
public INDArray mul(Number n, INDArray result)
INDArray
public INDArray muli(Number n, INDArray result)
INDArray
public INDArray sub(Number n, INDArray result)
INDArray
public INDArray subi(Number n, INDArray result)
INDArray
public INDArray add(Number n, INDArray result)
INDArray
public INDArray addi(Number n, INDArray result)
INDArray
public INDArray getScalar(long row, long column)
INDArray
public INDArray dup()
INDArray
public INDArray dup(char order)
INDArray
public int getInt(int... indices)
INDArray
public long getLong(long index)
INDArray
public long getLong(long... indices)
INDArray
public double getDouble(int... indices)
INDArray
public double getDouble(long... indices)
INDArray
public float getFloat(int... indices)
INDArray
public float getFloat(long... indices)
INDArray
public boolean isScalar()
INDArray
public INDArray put(int[] indices, INDArray element)
INDArray
public INDArray match(INDArray comp, Condition condition)
INDArray
public INDArray match(Number comp, Condition condition)
INDArray
public INDArray getWhere(INDArray comp, Condition condition)
INDArray
public INDArray getWhere(Number comp, Condition condition)
INDArray
public INDArray putWhere(INDArray comp, INDArray put, Condition condition)
INDArray
public INDArray putWhere(Number comp, INDArray put, Condition condition)
INDArray
public INDArray putWhere(Number comp, Number put, Condition condition)
INDArray
public INDArray putWhereWithMask(INDArray mask, INDArray put)
INDArray
putWhereWithMask
in interface INDArray
mask
- the mask to useput
- the array to putpublic INDArray putWhereWithMask(INDArray mask, Number put)
INDArray
putWhereWithMask
in interface INDArray
mask
- the mask to useput
- the array to putpublic INDArray put(int i, int j, INDArray element)
INDArray
public INDArray put(int i, int j, Number element)
INDArray
public INDArray putSlice(int slice, INDArray put)
INDArray
protected void assertSlice(INDArray put, long slice)
public boolean isMatrix()
INDArray
protected INDArray newShape(long[] newShape, char ordering)
protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset, char ordering)
protected INDArray create(DataBuffer data, long[] newShape, long[] newStrides, long offset, char ordering)
protected INDArray create(DataBuffer data, int[] newShape, int[] newStrides, long offset)
protected INDArray create(int[] shape)
protected INDArray create(int[] shape, int[] strides, long offset)
protected int[] getStrides(int[] shape, char ordering)
public double squaredDistance(INDArray other)
INDArray
squaredDistance
in interface INDArray
public double distance2(INDArray other)
INDArray
public double distance1(INDArray other)
INDArray
public INDArray get(INDArray indices)
INDArray
public INDArray put(INDArray indices, INDArray element)
INDArray
public INDArray put(INDArrayIndex[] indices, INDArray element)
INDArray
public INDArray put(INDArrayIndex[] indices, Number element)
INDArray
public INDArray swapAxes(int dimension, int with)
INDArray
public boolean isView()
INDArray
public boolean isSparse()
INDArray
public DataBuffer data()
INDArray
public void setData(DataBuffer data)
INDArray
public long slices()
INDArray
protected INDArray create(DataBuffer buffer)
public INDArray cond(Condition condition)
INDArray
protected void init(int[] shape, int[] stride)
protected void init(long[] shape, long[] stride)
public INDArray getScalar(long i)
INDArray
protected INDArray doColumnWise(INDArray columnVector, char operation)
columnVector
- the column vectoroperation
- the operationprotected INDArray doRowWise(INDArray rowVector, char operation)
rowVector
- the row vectoroperation
- the operationprotected DataBuffer shapeOf()
protected DataBuffer strideOf()
public int stride(int dimension)
INDArray
public INDArray rdiviColumnVector(INDArray columnVector)
INDArray
rdiviColumnVector
in interface INDArray
columnVector
- the column vector used for divisionpublic INDArray rdivColumnVector(INDArray columnVector)
INDArray
rdivColumnVector
in interface INDArray
columnVector
- the column vector used for divisionpublic INDArray rdiviRowVector(INDArray rowVector)
INDArray
rdiviRowVector
in interface INDArray
rowVector
- the row vector used for divisionpublic INDArray rdivRowVector(INDArray rowVector)
INDArray
rdivRowVector
in interface INDArray
rowVector
- the row vector used for divisionpublic INDArray rsubiColumnVector(INDArray columnVector)
INDArray
rsubiColumnVector
in interface INDArray
columnVector
- the column vector to subtractpublic INDArray rsubColumnVector(INDArray columnVector)
INDArray
rsubColumnVector
in interface INDArray
columnVector
- the column vector to subtractpublic INDArray rsubiRowVector(INDArray rowVector)
INDArray
rsubiRowVector
in interface INDArray
rowVector
- the row vector to subtractpublic INDArray rsubRowVector(INDArray rowVector)
INDArray
rsubRowVector
in interface INDArray
rowVector
- the row vector to subtractpublic INDArray put(int i, INDArray element)
INDArray
public INDArray diviColumnVector(INDArray columnVector)
INDArray
diviColumnVector
in interface INDArray
columnVector
- the column vector used for divisionpublic INDArray divColumnVector(INDArray columnVector)
INDArray
divColumnVector
in interface INDArray
columnVector
- the column vector used for divisionpublic INDArray diviRowVector(INDArray rowVector)
INDArray
diviRowVector
in interface INDArray
rowVector
- the row vector used for divisionpublic INDArray divRowVector(INDArray rowVector)
INDArray
divRowVector
in interface INDArray
rowVector
- the row vector used for divisionpublic INDArray muliColumnVector(INDArray columnVector)
INDArray
muliColumnVector
in interface INDArray
columnVector
- the column vector used for multiplicationpublic INDArray mulColumnVector(INDArray columnVector)
INDArray
mulColumnVector
in interface INDArray
columnVector
- the column vector used for multiplicationpublic INDArray muliRowVector(INDArray rowVector)
INDArray
muliRowVector
in interface INDArray
rowVector
- the row vector used for multiplicationpublic INDArray mulRowVector(INDArray rowVector)
INDArray
mulRowVector
in interface INDArray
rowVector
- the row vector used for multiplicationpublic INDArray subiColumnVector(INDArray columnVector)
INDArray
subiColumnVector
in interface INDArray
columnVector
- the column vector to subtractpublic INDArray subColumnVector(INDArray columnVector)
INDArray
subColumnVector
in interface INDArray
columnVector
- the column vector to subtractpublic INDArray subiRowVector(INDArray rowVector)
INDArray
subiRowVector
in interface INDArray
rowVector
- the row vector to subtractpublic INDArray subRowVector(INDArray rowVector)
INDArray
subRowVector
in interface INDArray
rowVector
- the row vector to subtractpublic INDArray addiColumnVector(INDArray columnVector)
INDArray
addiColumnVector
in interface INDArray
columnVector
- the column vector to addpublic INDArray putiColumnVector(INDArray columnVector)
INDArray
putiColumnVector
in interface INDArray
columnVector
- the column vector to addpublic INDArray addColumnVector(INDArray columnVector)
INDArray
addColumnVector
in interface INDArray
columnVector
- the column vector to addpublic INDArray addiRowVector(INDArray rowVector)
INDArray
addiRowVector
in interface INDArray
rowVector
- the row vector to addpublic INDArray putiRowVector(INDArray rowVector)
INDArray
putiRowVector
in interface INDArray
rowVector
- Row vector to putpublic INDArray addRowVector(INDArray rowVector)
INDArray
addRowVector
in interface INDArray
rowVector
- the row vector to addpublic INDArray mmul(INDArray other, INDArray result, MMulTranspose mMulTranspose)
INDArray
public INDArray mmul(INDArray other, MMulTranspose mMulTranspose)
INDArray
public INDArray mmul(INDArray other, char resultOrder)
INDArray
public INDArray mmul(INDArray other)
INDArray
protected INDArray create(int[] shape, char ordering)
public double[][] toDoubleMatrix()
INDArray
toDoubleMatrix
in interface INDArray
public double[] toDoubleVector()
INDArray
toDoubleVector
in interface INDArray
public float[] toFloatVector()
INDArray
toFloatVector
in interface INDArray
public float[][] toFloatMatrix()
INDArray
toFloatMatrix
in interface INDArray
public int[] toIntVector()
INDArray
toIntVector
in interface INDArray
public long[] toLongVector()
INDArray
toLongVector
in interface INDArray
public long[][] toLongMatrix()
INDArray
toLongMatrix
in interface INDArray
public int[][] toIntMatrix()
INDArray
toIntMatrix
in interface INDArray
public INDArray div(INDArray other)
INDArray
public INDArray div(INDArray other, INDArray result)
INDArray
public INDArray mul(INDArray other)
INDArray
public INDArray mul(INDArray other, INDArray result)
INDArray
public INDArray sub(INDArray other)
INDArray
public INDArray sub(INDArray other, INDArray result)
INDArray
public INDArray add(INDArray other)
INDArray
public INDArray add(INDArray other, INDArray result)
INDArray
public INDArray mmuli(INDArray other, MMulTranspose transpose)
INDArray
public INDArray mmuli(INDArray other)
INDArray
public INDArray mmuli(INDArray other, INDArray result, MMulTranspose transpose)
INDArray
public INDArray mmuli(INDArray other, INDArray result)
INDArray
public INDArray divi(INDArray other)
INDArray
public INDArray divi(INDArray other, INDArray result)
INDArray
public INDArray muli(INDArray other)
INDArray
public INDArray muli(INDArray other, INDArray result)
INDArray
public INDArray subi(INDArray other)
INDArray
public INDArray addi(INDArray other)
INDArray
public INDArray addi(INDArray other, INDArray result)
INDArray
public INDArray normmax(boolean keepDims, int... dimension)
INDArray
public INDArray normmax(int... dimension)
INDArray
public INDArray rdiv(INDArray other)
INDArray
public INDArray rdivi(INDArray other)
INDArray
public INDArray rdiv(INDArray other, INDArray result)
INDArray
public INDArray rdivi(INDArray other, INDArray result)
INDArray
public INDArray rsub(INDArray other, INDArray result)
INDArray
public INDArray rsub(INDArray other)
INDArray
public INDArray rsubi(INDArray other)
INDArray
public INDArray rsubi(INDArray other, INDArray result)
INDArray
public INDArray assign(Number value)
INDArray
public INDArray assign(boolean value)
INDArray
public INDArray assignIf(INDArray arr, Condition condition)
INDArray
public INDArray replaceWhere(INDArray arr, Condition condition)
INDArray
replaceWhere
in interface INDArray
arr
- Source arraycondition
- Condition to apply@Deprecated public long linearIndex(long i)
INDArray
linearIndex
in interface INDArray
i
- the index to getScalarpublic INDArray slice(long slice)
INDArray
protected INDArray createScalarForIndex(long i, boolean applyOffset)
protected INDArray createScalar(double d)
public int getTrailingOnes()
INDArray
getTrailingOnes
in interface INDArray
public int getLeadingOnes()
INDArray
getLeadingOnes
in interface INDArray
public INDArray slice(long slice, int dimension)
INDArray
public INDArray getScalar(int[] indexes)
INDArray
public INDArray rdiv(Number n)
INDArray
public INDArray rdivi(Number n)
INDArray
public INDArray rsub(Number n)
INDArray
public INDArray rsubi(Number n)
INDArray
public INDArray divi(Number n)
INDArray
public INDArray mul(Number n)
INDArray
public INDArray muli(Number n)
INDArray
public INDArray sub(Number n)
INDArray
public INDArray subi(Number n)
INDArray
public INDArray add(Number n)
INDArray
public INDArray addi(Number n)
INDArray
public INDArray repmat(long[] shape)
INDArray
@Deprecated public INDArray repmat(int[] shape)
public INDArray repeat(int dimension, long... repeats)
INDArray
public INDArray putRow(long row, INDArray toPut)
INDArray
public INDArray putColumn(int column, INDArray toPut)
INDArray
public Number getNumber(long i)
INDArray
public Number getNumber(long... idx)
INDArray
public double getDouble(long i)
INDArray
public double getDouble(long i, long j)
INDArray
public float getFloat(long i)
INDArray
public float getFloat(long i, long j)
INDArray
public INDArray transpose()
INDArray
public INDArray transposei()
transposei
in interface INDArray
protected INDArray create(DataBuffer data, int[] shape, int[] strides)
@Deprecated public INDArray reshape(char order, int... newShape)
INDArray
public INDArray reshape(char order, long... newShape)
INDArray
public INDArray reshape(char order, boolean enforceView, long... newShape)
INDArray
public double getDoubleUnsafe(long offset)
INDArray
getDoubleUnsafe
in interface INDArray
offset
- the offset to get atpublic INDArray putScalarUnsafe(long offset, double value)
INDArray
putScalarUnsafe
in interface INDArray
offset
- the offset to insert atvalue
- the value to insertpublic INDArray reshape(char order, int rows, int columns)
INDArray
public INDArray reshape(int[] shape)
public INDArray reshape(long... shape)
INDArray
public INDArray prod(boolean keepDims, int... dimension)
INDArray
public INDArray prod(int... dimension)
INDArray
public INDArray mean(boolean keepDims, int... dimension)
INDArray
public INDArray mean(int... dimension)
INDArray
public INDArray amean(int... dimension)
INDArray
public INDArray mean(@NonNull @NonNull INDArray result, boolean keepDims, int... dimension)
INDArray
public INDArray mean(@NonNull @NonNull INDArray result, int... dimension)
INDArray
public INDArray var(int... dimension)
INDArray
public INDArray var(boolean biasCorrected, int... dimension)
INDArray
public INDArray max(boolean keepDims, int... dimension)
INDArray
public INDArray max(int... dimension)
INDArray
public INDArray amax(int... dimension)
INDArray
public INDArray min(boolean keepDims, int... dimension)
INDArray
public INDArray min(int... dimension)
INDArray
public INDArray amin(int... dimension)
INDArray
public INDArray sum(int... dimension)
INDArray
public INDArray sum(boolean keepDim, int... dimension)
INDArray
public INDArray entropy(int... dimension)
INDArray
public INDArray shannonEntropy(int... dimension)
INDArray
shannonEntropy
in interface INDArray
dimension
- specified dimension(s)public INDArray logEntropy(int... dimension)
INDArray
logEntropy
in interface INDArray
dimension
- specified dimension(s)public INDArray sum(@NonNull @NonNull INDArray result, boolean keepDims, int... dimension)
INDArray
public INDArray sum(@NonNull @NonNull INDArray result, int... dimension)
INDArray
public INDArray norm1(int... dimension)
INDArray
public INDArray norm1(boolean keepDims, int... dimension)
INDArray
public INDArray std(int... dimension)
INDArray
public INDArray std(boolean biasCorrected, int... dimension)
INDArray
public INDArray std(boolean biasCorrected, boolean keepDims, int... dimension)
INDArray
public Number stdNumber(boolean biasCorrected)
INDArray
public INDArray norm2(boolean keepDims, int... dimension)
INDArray
public INDArray norm2(int... dimension)
INDArray
public int columns()
INDArray
public int rows()
INDArray
public INDArray ravel(char ordering)
INDArray
public INDArray ravel()
INDArray
public void sliceVectors(List<INDArray> list)
INDArray
sliceVectors
in interface INDArray
public INDArray reshape(long newRows, long newColumns)
INDArray
public INDArray getColumn(long c)
INDArray
public INDArray getColumn(long c, boolean keepDim)
INDArray
public INDArray getRows(int[] rindices)
INDArray
public INDArray get(INDArrayIndex... indexes)
INDArray
public INDArray getColumns(int... cindices)
INDArray
getColumns
in interface INDArray
cindices
- Columns to extract out of the current arrayprotected INDArray create(int rows, int length)
public INDArray getRow(long r)
INDArray
public INDArray getRow(long r, boolean keepDim)
INDArray
public boolean equalsWithEps(Object o, double eps)
INDArray
equalsWithEps
in interface INDArray
o
- INDArray to compare against.eps
- Epsilon value to use for the quality operationpublic boolean equalShapes(@NonNull @NonNull INDArray other)
INDArray
equalShapes
in interface INDArray
other
- Otherpublic boolean equals(Object o)
public DataBuffer shapeInfoDataBuffer()
INDArray
shapeInfoDataBuffer
in interface INDArray
public LongBuffer shapeInfo()
INDArray
public long[] shape()
INDArray
public String shapeInfoToString()
INDArray
shapeInfoToString
in interface INDArray
public long[] stride()
INDArray
public long offset()
INDArray
public char ordering()
INDArray
public long size(int dimension)
INDArray
public int rank()
INDArray
public long length()
INDArray
public INDArray broadcast(INDArray result)
INDArray
public INDArray broadcast(long... shape)
INDArray
@Deprecated public INDArray dimShuffle(Object[] rearrange, int[] newOrder, boolean[] broadCastable)
INDArray
dimShuffle
in interface INDArray
rearrange
- the dimensions to swap tonewOrder
- the new order (think permute)broadCastable
- (whether the dimension is broadcastable) (must be same length as new order)public INDArray dimShuffle(Object[] rearrange, long[] newOrder, boolean[] broadCastable)
dimShuffle
in interface INDArray
rearrange
- the dimensions to swap topublic INDArray permute(int... rearrange)
INDArray
public INDArray permutei(int... rearrange)
INDArray
@Deprecated protected long[] doPermuteSwap(LongBuffer shape, int[] rearrange)
@Deprecated protected int[] doPermuteSwap(IntBuffer shape, int[] rearrange)
@Deprecated protected int[] doPermuteSwap(DataBuffer shape, int[] rearrange)
protected long[] doPermuteSwap(long[] shape, int[] rearrange)
protected void checkArrangeArray(int[] arr)
protected void autoProcessScalarCall()
public boolean isVector()
public boolean isVectorOrScalar()
INDArray
isVectorOrScalar
in interface INDArray
public boolean isSquare()
INDArray
public boolean isRowVector()
INDArray
isRowVector
in interface INDArray
public boolean isColumnVector()
INDArray
isColumnVector
in interface INDArray
public boolean isColumnVectorOrScalar()
INDArray
isColumnVectorOrScalar
in interface INDArray
public boolean isRowVectorOrScalar()
INDArray
isRowVectorOrScalar
in interface INDArray
public String toString()
NDArrayStrings#setMaxPrintElements(long)
public String toString(@NonNull @NonNull NDArrayStrings options)
INDArray
public String toString(long maxElements, boolean forceSummarize, int precision)
INDArray
toString
in interface INDArray
maxElements
- Summarize if more than maxElements in the arrayforceSummarize
- Force a summary instead of a full printprecision
- The number of decimals to print. Doesn't print trailing 0s if negativepublic String toStringFull()
INDArray
toStringFull
in interface INDArray
toString(long, boolean, int)
public Object element()
INDArray
public INDArray remainder(INDArray denominator)
INDArray
public INDArray remainder(INDArray denominator, INDArray result)
INDArray
public INDArray remainder(Number denominator)
INDArray
public INDArray remainder(Number denominator, INDArray result)
INDArray
public INDArray remainderi(INDArray denominator)
INDArray
remainderi
in interface INDArray
denominator
- the denominatorpublic INDArray remainderi(Number denominator)
INDArray
remainderi
in interface INDArray
denominator
- the denominatorpublic INDArray fmod(INDArray denominator)
INDArray
public INDArray fmod(INDArray denominator, INDArray result)
INDArray
public INDArray fmod(Number denominator)
INDArray
public INDArray fmod(Number denominator, INDArray result)
INDArray
public INDArray fmodi(INDArray denominator)
INDArray
public INDArray fmodi(Number denominator)
INDArray
public long originalOffset()
INDArray
originalOffset
in interface INDArray
protected void write(ObjectOutputStream out) throws IOException
IOException
protected void read(ObjectInputStream s)
public INDArray argMax(int... dimension)
INDArray
public boolean isAttached()
INDArray
isAttached
in interface INDArray
public boolean isInScope()
INDArray
public INDArray detach()
INDArray
public INDArray leverage()
INDArray
public INDArray leverageTo(String id)
INDArray
leverageTo
in interface INDArray
INDArray.leverageTo(String, boolean)
public INDArray leverageTo(String id, boolean enforceExistence) throws Nd4jNoSuchWorkspaceException
INDArray
Nd4jNoSuchWorkspaceException
is thrown. Otherwise, if enforceExistance == false and no workspace with the specified ID exists, then the current
INDArray is returned unmodified (same as INDArray.leverage()
leverageTo
in interface INDArray
id
- ID of the workspace to leverage toenforceExistence
- If true, and the specified workspace does not exist: an Nd4jNoSuchWorkspaceException
will be thrown.Nd4jNoSuchWorkspaceException
INDArray.leverageTo(String)
public INDArray leverageOrDetach(String id)
INDArray
leverageOrDetach
in interface INDArray
id
- ID of the workspace to leverage toINDArray.leverageTo(String)
public INDArray migrate()
INDArray
migrate
in interface INDArray
INDArray.migrate(boolean)
public INDArray migrate(boolean detachOnNoWs)
INDArray
INDArray.migrate()
public Number percentileNumber(Number quantile)
INDArray
percentileNumber
in interface INDArray
quantile
- target percentile in range of 0..100public Number medianNumber()
INDArray
medianNumber
in interface INDArray
public INDArray median(int... dimension)
INDArray
public INDArray percentile(Number quantile, int... dimension)
INDArray
percentile
in interface INDArray
quantile
- target percentile in range of 0..100dimension
- Dimension to calculate percentile forprotected abstract int stringBuffer(com.google.flatbuffers.FlatBufferBuilder builder, DataBuffer buffer)
public int toFlatArray(com.google.flatbuffers.FlatBufferBuilder builder)
INDArray
INDArray
to flatbuffers buildertoFlatArray
in interface INDArray
builder
- the builder to useprotected static DataTypeEx convertType(DataType type)
public boolean isEmpty()
INDArray
public long[] shapeInfoJava()
INDArray
shapeInfoJava
in interface INDArray
public DataType dataType()
INDArray
public boolean isR()
INDArray
public boolean isZ()
INDArray
public boolean isB()
INDArray
public boolean isS()
INDArray
public INDArray castTo(DataType dataType)
INDArray
public boolean all()
INDArray
public boolean any()
INDArray
public boolean none()
INDArray
protected void validateNumericalArray(String opName, boolean allowEmpty)
opName
- Operation name to print in the exceptionpublic boolean closeable()
INDArray
public void close()
INDArray
close
in interface AutoCloseable
close
in interface INDArray
public INDArray like()
INDArray
public INDArray ulike()
INDArray
public boolean wasClosed()
INDArray
public long getId()
INDArray
public void assignNewId()
Copyright © 2022. All rights reserved.