Class SparseTensorIndexCSF

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.
  • Constructor Details

    • SparseTensorIndexCSF

      public SparseTensorIndexCSF()
  • Method Details

    • ValidateVersion

      public static void ValidateVersion()
    • getRootAsSparseTensorIndexCSF

      public static SparseTensorIndexCSF getRootAsSparseTensorIndexCSF(ByteBuffer _bb)
    • getRootAsSparseTensorIndexCSF

      public static SparseTensorIndexCSF getRootAsSparseTensorIndexCSF(ByteBuffer _bb, SparseTensorIndexCSF obj)
    • __init

      public void __init(int _i, ByteBuffer _bb)
    • __assign

      public SparseTensorIndexCSF __assign(int _i, ByteBuffer _bb)
    • indptrType

      public Int 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

      public Int indptrType(Int obj)
    • indptrBuffers

      public Buffer indptrBuffers(int j)
      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

      public Buffer indptrBuffers(Buffer obj, int j)
    • indptrBuffersLength

      public int indptrBuffersLength()
    • indptrBuffersVector

      public Buffer.Vector indptrBuffersVector()
    • indptrBuffersVector

      public Buffer.Vector indptrBuffersVector(Buffer.Vector obj)
    • indicesType

      public Int indicesType()
      The type of values in indicesBuffers
    • indicesType

      public Int indicesType(Int obj)
    • indicesBuffers

      public Buffer indicesBuffers(int j)
      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

      public Buffer indicesBuffers(Buffer obj, int j)
    • indicesBuffersLength

      public int indicesBuffersLength()
    • indicesBuffersVector

      public Buffer.Vector indicesBuffersVector()
    • indicesBuffersVector

      public Buffer.Vector indicesBuffersVector(Buffer.Vector obj)
    • 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

      public ByteBuffer axisOrderAsByteBuffer()
    • axisOrderInByteBuffer

      public ByteBuffer axisOrderInByteBuffer(ByteBuffer _bb)
    • 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)