java.lang.Object
com.google.flatbuffers.Table
org.apache.arrow.flatbuf.SparseTensorIndexCSF
public final class SparseTensorIndexCSF
extends com.google.flatbuffers.Table
Compressed Sparse Fiber (CSF) sparse tensor index.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.google.flatbuffers.Table
bb, bb_pos -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription__assign(int _i, ByteBuffer _bb) void__init(int _i, ByteBuffer _bb) static voidaddAxisOrder(com.google.flatbuffers.FlatBufferBuilder builder, int axisOrderOffset) static voidaddIndicesBuffers(com.google.flatbuffers.FlatBufferBuilder builder, int indicesBuffersOffset) static voidaddIndicesType(com.google.flatbuffers.FlatBufferBuilder builder, int indicesTypeOffset) static voidaddIndptrBuffers(com.google.flatbuffers.FlatBufferBuilder builder, int indptrBuffersOffset) static voidaddIndptrType(com.google.flatbuffers.FlatBufferBuilder builder, int indptrTypeOffset) intaxisOrder(int j) axisOrder stores the sequence in which dimensions were traversed to produce the prefix tree.intcom.google.flatbuffers.IntVectorcom.google.flatbuffers.IntVectoraxisOrderVector(com.google.flatbuffers.IntVector obj) static intcreateAxisOrderVector(com.google.flatbuffers.FlatBufferBuilder builder, int[] data) static intcreateSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder, int indptrTypeOffset, int indptrBuffersOffset, int indicesTypeOffset, int indicesBuffersOffset, int axisOrderOffset) static intendSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder) static SparseTensorIndexCSFstatic SparseTensorIndexCSFindicesBuffers(int j) indicesBuffers stores values of nodes.indicesBuffers(Buffer obj, int j) intThe type of values in indicesBuffersindicesType(Int obj) indptrBuffers(int j) indptrBuffers stores the sparsity structure.indptrBuffers(Buffer obj, int j) intCSF is a generalization of compressed sparse row (CSR) index.indptrType(Int obj) static voidstartAxisOrderVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) static voidstartIndicesBuffersVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) static voidstartIndptrBuffersVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) static voidstartSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder) static voidMethods inherited from class com.google.flatbuffers.Table
__has_identifier, __indirect, __indirect, __offset, __offset, __reset, __reset, __string, __string, __union, __union, __vector, __vector_as_bytebuffer, __vector_in_bytebuffer, __vector_len, compareStrings, compareStrings, getByteBuffer, keysCompare, sortTables
-
Constructor Details
-
SparseTensorIndexCSF
public SparseTensorIndexCSF()
-
-
Method Details
-
ValidateVersion
public static void ValidateVersion() -
getRootAsSparseTensorIndexCSF
-
getRootAsSparseTensorIndexCSF
public static SparseTensorIndexCSF getRootAsSparseTensorIndexCSF(ByteBuffer _bb, SparseTensorIndexCSF obj) -
__init
-
__assign
-
indptrType
CSF is a generalization of compressed sparse row (CSR) index. See [smith2017knl](http://shaden.io/pub-files/smith2017knl.pdf) CSF index recursively compresses each dimension of a tensor into a set of prefix trees. Each path from a root to leaf forms one tensor non-zero index. CSF is implemented with two arrays of buffers and one arrays of integers. For example, let X be a 2x3x4x5 tensor and let it have the following 8 non-zero values: ```text X[0, 0, 0, 1] := 1 X[0, 0, 0, 2] := 2 X[0, 1, 0, 0] := 3 X[0, 1, 0, 2] := 4 X[0, 1, 1, 0] := 5 X[1, 1, 1, 0] := 6 X[1, 1, 1, 1] := 7 X[1, 1, 1, 2] := 8 ``` As a prefix tree this would be represented as: ```text 0 1 / \ | 0 1 1 / / \ | 0 0 1 1 /| /| | /| | 1 2 0 2 0 0 1 2 ``` The type of values in indptrBuffers -
indptrType
-
indptrBuffers
indptrBuffers stores the sparsity structure. Each two consecutive dimensions in a tensor correspond to a buffer in indptrBuffers. A pair of consecutive values at `indptrBuffers[dim][i]` and `indptrBuffers[dim][i + 1]` signify a range of nodes in `indicesBuffers[dim + 1]` who are children of `indicesBuffers[dim][i]` node. For example, the indptrBuffers for the above X is: ```text indptrBuffer(X) = [ [0, 2, 3], [0, 1, 3, 4], [0, 2, 4, 5, 8] ]. ``` -
indptrBuffers
-
indptrBuffersLength
public int indptrBuffersLength() -
indptrBuffersVector
-
indptrBuffersVector
-
indicesType
The type of values in indicesBuffers -
indicesType
-
indicesBuffers
indicesBuffers stores values of nodes. Each tensor dimension corresponds to a buffer in indicesBuffers. For example, the indicesBuffers for the above X is: ```text indicesBuffer(X) = [ [0, 1], [0, 1, 1], [0, 0, 1, 1], [1, 2, 0, 2, 0, 0, 1, 2] ]. ``` -
indicesBuffers
-
indicesBuffersLength
public int indicesBuffersLength() -
indicesBuffersVector
-
indicesBuffersVector
-
axisOrder
public int axisOrder(int j) axisOrder stores the sequence in which dimensions were traversed to produce the prefix tree. For example, the axisOrder for the above X is: ```text axisOrder(X) = [0, 1, 2, 3]. ``` -
axisOrderLength
public int axisOrderLength() -
axisOrderVector
public com.google.flatbuffers.IntVector axisOrderVector() -
axisOrderVector
public com.google.flatbuffers.IntVector axisOrderVector(com.google.flatbuffers.IntVector obj) -
axisOrderAsByteBuffer
-
axisOrderInByteBuffer
-
createSparseTensorIndexCSF
public static int createSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder, int indptrTypeOffset, int indptrBuffersOffset, int indicesTypeOffset, int indicesBuffersOffset, int axisOrderOffset) -
startSparseTensorIndexCSF
public static void startSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder) -
addIndptrType
public static void addIndptrType(com.google.flatbuffers.FlatBufferBuilder builder, int indptrTypeOffset) -
addIndptrBuffers
public static void addIndptrBuffers(com.google.flatbuffers.FlatBufferBuilder builder, int indptrBuffersOffset) -
startIndptrBuffersVector
public static void startIndptrBuffersVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) -
addIndicesType
public static void addIndicesType(com.google.flatbuffers.FlatBufferBuilder builder, int indicesTypeOffset) -
addIndicesBuffers
public static void addIndicesBuffers(com.google.flatbuffers.FlatBufferBuilder builder, int indicesBuffersOffset) -
startIndicesBuffersVector
public static void startIndicesBuffersVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) -
addAxisOrder
public static void addAxisOrder(com.google.flatbuffers.FlatBufferBuilder builder, int axisOrderOffset) -
createAxisOrderVector
public static int createAxisOrderVector(com.google.flatbuffers.FlatBufferBuilder builder, int[] data) -
startAxisOrderVector
public static void startAxisOrderVector(com.google.flatbuffers.FlatBufferBuilder builder, int numElems) -
endSparseTensorIndexCSF
public static int endSparseTensorIndexCSF(com.google.flatbuffers.FlatBufferBuilder builder)
-