Record Class GgufTensorInfo

java.lang.Object
java.lang.Record
ai.beestream.jitnn.gguf.GgufTensorInfo
Record Components:
name - the tensor's name, for example blk.0.attn_q.weight
shape - the shape in jitNN order, outermost axis first; GGUF lists axes innermost first, so a weight stored as [in, out] there is [out, in] here
typeId - the ggml type id
type - the ggml type, or null for an id this reader does not know
offset - the byte offset of the data from the start of the file
bytes - the size of the data in bytes, or -1 when the type is unknown

public record GgufTensorInfo(String name, long[] shape, int typeId, GgmlType type, long offset, long bytes) extends Record
One tensor listed in a GGUF file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GgufTensorInfo(String name, long[] shape, int typeId, GgmlType type, long offset, long bytes)
    Creates an instance of a GgufTensorInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the bytes record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the name record component.
    long
    Number of values.
    long
    Returns the value of the offset record component.
    long[]
    Returns the value of the shape record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the type record component.
    int
    Returns the value of the typeId record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GgufTensorInfo

      public GgufTensorInfo(String name, long[] shape, int typeId, GgmlType type, long offset, long bytes)
      Creates an instance of a GgufTensorInfo record class.
      Parameters:
      name - the value for the name record component
      shape - the value for the shape record component
      typeId - the value for the typeId record component
      type - the value for the type record component
      offset - the value for the offset record component
      bytes - the value for the bytes record component
  • Method Details

    • numel

      public long numel()
      Number of values.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • shape

      public long[] shape()
      Returns the value of the shape record component.
      Returns:
      the value of the shape record component
    • typeId

      public int typeId()
      Returns the value of the typeId record component.
      Returns:
      the value of the typeId record component
    • type

      public GgmlType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • offset

      public long offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • bytes

      public long bytes()
      Returns the value of the bytes record component.
      Returns:
      the value of the bytes record component