Record Class TensorDescriptor
java.lang.Object
java.lang.Record
io.github.kirstenali.deepj.tensor.TensorDescriptor
Validated logical checkpoint metadata; reading it never allocates tensor values.
-
Constructor Summary
ConstructorsConstructorDescriptionTensorDescriptor(DType dtype, int[] shape) Creates an instance of aTensorDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongbytes()dtype()Returns the value of thedtyperecord component.intelements()booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.static TensorDescriptorvoidrequireMatches(DType expectedType, int[] expectedShape) voidrequireMatches(Tensor tensor) int[]shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.voidwrite(DataOutput output)
-
Constructor Details
-
TensorDescriptor
Creates an instance of aTensorDescriptorrecord class.- Parameters:
dtype- the value for thedtyperecord componentshape- the value for theshaperecord component
-
-
Method Details
-
shape
public int[] shape()Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-
elements
public int elements() -
bytes
public long bytes() -
requireMatches
- Throws:
IOException
-
requireMatches
- Throws:
IOException
-
write
- Throws:
IOException
-
read
- Throws:
IOException
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
dtype
Returns the value of thedtyperecord component.- Returns:
- the value of the
dtyperecord component
-