public class NDArrayMath extends Object
Modifier and Type | Method and Description |
---|---|
static long |
lengthPerSlice(INDArray arr)
Return the length of a slice
|
static long |
lengthPerSlice(INDArray arr,
int... dimension)
The number of elements in a slice
along a set of dimensions
|
static int |
mapIndexOntoTensor(int index,
INDArray arr,
int... rank)
This maps an index of a vector
on to a vector in the matrix that can be used
for indexing in to a tensor
|
static long |
mapIndexOntoVector(int index,
INDArray arr)
This maps an index of a vector
on to a vector in the matrix that can be used
for indexing in to a tensor
|
static long |
matricesPerSlice(INDArray arr)
The number of vectors
in each slice of an ndarray.
|
static long |
numVectors(INDArray arr)
Return the number of vectors for an array
the number of vectors for an array
|
static long |
offsetForSlice(INDArray arr,
int slice)
Compute the offset for a given slice
|
static long |
sliceOffsetForTensor(int index,
INDArray arr,
int[] tensorShape)
calculates the offset for a tensor
|
static long |
sliceOffsetForTensor(int index,
INDArray arr,
long[] tensorShape) |
static long |
tensorsPerSlice(INDArray arr,
int[] tensorShape)
Computes the tensors per slice
given a tensor shape and array
|
static long |
vectorsPerSlice(INDArray arr)
The number of vectors
in each slice of an ndarray.
|
static long |
vectorsPerSlice(INDArray arr,
int... rank)
The number of vectors
in each slice of an ndarray.
|
public static long offsetForSlice(INDArray arr, int slice)
arr
- the array to compute
the offset frmslice
- the slice to compute the offset forpublic static long lengthPerSlice(INDArray arr, int... dimension)
arr
- the array
to calculate the length per slice fordimension
- the dimensions to do the calculations alongpublic static long lengthPerSlice(INDArray arr)
arr
- the array to get the length of a slice forpublic static long numVectors(INDArray arr)
arr
- the array to calculate the number of vectors forpublic static long vectorsPerSlice(INDArray arr)
arr
- the array to
get the number
of vectors per slice forpublic static long tensorsPerSlice(INDArray arr, int[] tensorShape)
arr
- the array to get the tensors per slice fortensorShape
- the desired tensor shapepublic static long matricesPerSlice(INDArray arr)
arr
- the array to
get the number
of vectors per slice forpublic static long vectorsPerSlice(INDArray arr, int... rank)
arr
- the array to
get the number
of vectors per slice forrank
- the dimensions to get the number of vectors per slice forpublic static long sliceOffsetForTensor(int index, INDArray arr, int[] tensorShape)
index
- arr
- tensorShape
- public static long sliceOffsetForTensor(int index, INDArray arr, long[] tensorShape)
public static int mapIndexOntoTensor(int index, INDArray arr, int... rank)
index
- the index to maparr
- the array to use
for indexingrank
- the dimensions to compute a slice forpublic static long mapIndexOntoVector(int index, INDArray arr)
index
- the index to maparr
- the array to use
for indexingCopyright © 2019. All rights reserved.