Class ONNXAttribute
java.lang.Object
org.tribuo.util.onnx.ONNXAttribute
The spec for an attribute, used to produce the attribute proto at construction time.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intValue used to denote a varaidic input in an ONNX operator
- 
Constructor SummaryConstructorsConstructorDescriptionONNXAttribute(String name, OnnxMl.AttributeProto.AttributeType type, boolean mandatory) Constructs an attribute placeholder of the appropriate name and type.
- 
Method Summary
- 
Field Details- 
VARIADIC_INPUTpublic static final int VARIADIC_INPUTValue used to denote a varaidic input in an ONNX operator- See Also:
 
 
- 
- 
Constructor Details- 
ONNXAttributeConstructs an attribute placeholder of the appropriate name and type.- Parameters:
- name- The name of the attribute.
- type- The type of the attribute.
- mandatory- Is this attribute mandatory?
 
 
- 
- 
Method Details- 
getName
- 
getTypeGets the attribute's type.- Returns:
- The attribute's type.
 
- 
isMandatorypublic boolean isMandatory()Is this attribute mandatory?- Returns:
- True if the attribute is mandatory for this operation.
 
- 
buildBuilds the attribute proto using the supplied value.Throws IllegalArgumentExceptionif the value type does not match the expected type, and throwsUnsupportedOperationExceptionif the value type is not supported. Currently supported types are primitives, strings and arrays of primitives and strings. ONNX attributes only support float and int as primitives.- Parameters:
- value- The value
- Returns:
- The AttributeProto.
 
- 
toString
 
-