Record Class NodeInfo

java.lang.Object
java.lang.Record
smile.onnx.NodeInfo
Record Components:
name - the node name as used in the session run call.
onnxType - the ONNX value type (e.g. TENSOR, SEQUENCE, MAP).
tensorInfo - tensor type and shape information; non-null only when onnxType == OnnxType.TENSOR.

public record NodeInfo(String name, OnnxType onnxType, TensorInfo tensorInfo) extends Record
Describes a model input or output node, including its name, ONNX value type, and (for tensor nodes) its tensor type/shape information.
  • Constructor Details

    • NodeInfo

      public NodeInfo(String name, TensorInfo tensorInfo)
      Convenience constructor for a tensor node.
      Parameters:
      name - the node name.
      tensorInfo - the tensor type and shape.
    • NodeInfo

      public NodeInfo(String name, OnnxType onnxType, TensorInfo tensorInfo)
      Creates an instance of a NodeInfo record class.
      Parameters:
      name - the value for the name record component
      onnxType - the value for the onnxType record component
      tensorInfo - the value for the tensorInfo record component
  • Method Details

    • isTensor

      public boolean isTensor()
      Returns true if this node carries a tensor value.
      Returns:
      true if this is a tensor node.
    • toString

      public 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. All components in this record class are compared with Objects::equals(Object,Object).
      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
    • onnxType

      public OnnxType onnxType()
      Returns the value of the onnxType record component.
      Returns:
      the value of the onnxType record component
    • tensorInfo

      public TensorInfo tensorInfo()
      Returns the value of the tensorInfo record component.
      Returns:
      the value of the tensorInfo record component