Record Class SafeTensors.Entry
java.lang.Object
java.lang.Record
ai.beestream.jitnn.io.SafeTensors.Entry
- Enclosing class:
SafeTensors
public static record SafeTensors.Entry(DType dtype, String typeName, long[] shape, long offset, long bytes)
extends Record
One tensor of a file: its type (null when jitNN has no such type, e.g. I64 or BOOL buffers:
listed, but an error to read), the file's name for it, its shape, and where its bytes are.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongbytes()Returns the value of thebytesrecord component.dtype()Returns the value of thedtyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longnumel()The number of elements: the product of the shape.longoffset()Returns the value of theoffsetrecord component.long[]shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.typeName()Returns the value of thetypeNamerecord component.
-
Constructor Details
-
Entry
Creates an instance of aEntryrecord class.- Parameters:
dtype- the value for thedtyperecord componenttypeName- the value for thetypeNamerecord componentshape- the value for theshaperecord componentoffset- the value for theoffsetrecord componentbytes- the value for thebytesrecord component
-
-
Method Details
-
numel
public long numel()The number of elements: the product of the shape. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
dtype
Returns the value of thedtyperecord component.- Returns:
- the value of the
dtyperecord component
-
typeName
Returns the value of thetypeNamerecord component.- Returns:
- the value of the
typeNamerecord component
-
shape
public long[] shape()Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
offset
public long offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
bytes
public long bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-