Record Class OnnxModel.TensorData
java.lang.Object
java.lang.Record
ai.beestream.jitnn.onnx.OnnxModel.TensorData
- Enclosing class:
OnnxModel
public static record OnnxModel.TensorData(String name, long[] dims, int dataType, ByteBuffer raw)
extends Record
A tensor stored in the model: dims, element type and its data as little-endian bytes.
-
Constructor Summary
ConstructorsConstructorDescriptionTensorData(String name, long[] dims, int dataType, ByteBuffer raw) Creates an instance of aTensorDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdataType()Returns the value of thedataTyperecord component.long[]dims()Returns the value of thedimsrecord component.final booleanIndicates whether some other object is "equal to" this one.float[]floats()The values as floats (FLOAT, FLOAT16, BFLOAT16, DOUBLE and the integer types).final inthashCode()Returns a hash code value for this object.long[]longs()The values as longs (INT64, INT32, INT8, UINT8, BOOL, and integral floats).name()Returns the value of thenamerecord component.intnumel()The number of elements: the product of the dims.raw()Returns the value of therawrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TensorData
Creates an instance of aTensorDatarecord class.- Parameters:
name- the value for thenamerecord componentdims- the value for thedimsrecord componentdataType- the value for thedataTyperecord componentraw- the value for therawrecord component
-
-
Method Details
-
numel
public int numel()The number of elements: the product of the dims. -
floats
public float[] floats()The values as floats (FLOAT, FLOAT16, BFLOAT16, DOUBLE and the integer types). -
longs
public long[] longs()The values as longs (INT64, INT32, INT8, UINT8, BOOL, and integral floats). -
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. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
dims
public long[] dims()Returns the value of thedimsrecord component.- Returns:
- the value of the
dimsrecord component
-
dataType
public int dataType()Returns the value of thedataTyperecord component.- Returns:
- the value of the
dataTyperecord component
-
raw
Returns the value of therawrecord component.- Returns:
- the value of the
rawrecord component
-