Module org.tensorflow.ndarray
Package org.tensorflow.ndarray
Interface SparseNdArray<T,U extends NdArray<T>>
-
- Type Parameters:
T- the type that the array containsU- the type of dense NdArray
- All Known Implementing Classes:
AbstractSparseNdArray,BooleanSparseNdArray,BooleanSparseSlice,ByteSparseNdArray,ByteSparseSlice,DoubleSparseNdArray,DoubleSparseSlice,FloatSparseNdArray,FloatSparseSlice,IntSparseNdArray,IntSparseSlice,LongSparseNdArray,LongSparseSlice,ObjectSparseSlice,ShortSparseNdArray,ShortSparseSlice,SparseNdArray,SparseSlice
public interface SparseNdArray<T,U extends NdArray<T>> extends NdArray<T>
Interface for Sparse Arrays
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LongNdArraygetIndices()Gets the IndicesUgetValues()Gets the values.
-
-
-
Method Detail
-
getIndices
LongNdArray getIndices()
Gets the IndicesIndices are a A 2-D long array of shape
[N, ndims], that specifies the indices of the elements in the sparse array that contain nonzero values (elements are zero-indexed).For example,
indices=[[1,3], [2,4]]specifies that the elements with indexes of coordinates[1,3]and[2,4]have nonzero values.- Returns:
- the Indices
-
getValues
U getValues()
Gets the values.Values are a 1-D array of any type and shape
[N], that supplies the values for each element in indices.For example, given
indices=[[1,3], [2,4]], andvalues=[18, 3.6]specifies that element[1,3]of the sparse array has a value of18, and element[2,4]of the sparse array has a value of3.6.- Returns:
- the values
-
-