Class ONNXMathUtils
java.lang.Object
org.tribuo.math.onnx.ONNXMathUtils
Tribuo Math specific helper functions for building ONNX protos.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ONNXInitializerfloatMatrix(ONNXContext context, String name, Matrix matrix, boolean transpose) Builds aONNXInitializercontaining theMatrix.static ONNXInitializerfloatVector(ONNXContext context, String name, SGDVector vector) Builds aONNXInitializercontaining theSGDVector.
-
Method Details
-
floatVector
Builds aONNXInitializercontaining 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 aONNXInitializercontaining 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
-