Package org.tribuo.math.onnx
Class ONNXMathUtils
java.lang.Object
org.tribuo.math.onnx.ONNXMathUtils
Tribuo Math specific helper functions for building ONNX protos.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ONNXInitializer
floatMatrix
(ONNXContext context, String name, Matrix matrix, boolean transpose) Builds aONNXInitializer
containing theMatrix
.static ONNXInitializer
floatVector
(ONNXContext context, String name, SGDVector vector) Builds aONNXInitializer
containing theSGDVector
.
-
Method Details
-
floatVector
Builds aONNXInitializer
containing theSGDVector
.- Parameters:
context
- The naming context.name
- The base name for the proto.vector
- the SGDVector to store in the proto.- Returns:
- A TensorProto containing the vector.
-
floatMatrix
public static ONNXInitializer floatMatrix(ONNXContext context, String name, Matrix matrix, boolean transpose) Builds aONNXInitializer
containing theMatrix
.- Parameters:
context
- The naming context.name
- The base name for the proto.matrix
- the matrix to store in the proto.transpose
- Whether to transpose the vector before writing it.- Returns:
- A TensorProto containing the matrix
-