toStableHlo

fun toStableHlo(graph: ComputeGraph, functionName: String = "main"): StableHloModule(source)

Export a ComputeGraph into a minimal StableHLO MLIR module text.

Notes:

  • This function now uses the new modular converter architecture for better extensibility.

  • It maintains backward compatibility with the original implementation.

  • Currently supports: input, add, matmul, relu. Unsupported ops are emitted as comments.

  • DType mapping expects TensorSpec.dtype to be strings like "FP32", "F32", "F64", "I32".