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