BasicMathConverter

Converter for basic mathematical operations (add, subtract, multiply, divide).

This converter handles the basic arithmetic operations by mapping them to their corresponding StableHLO operations. It supports:

  • Element-wise operations with broadcasting

  • Mixed-type arithmetic with automatic type promotion

  • Rank-differing operands (e.g. bias tensor<C> added to conv output tensor<N,C,L>) — emits stablehlo.broadcast_in_dim before the op so iree-compile accepts the MLIR.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val supportedOperations: Set<String>

Set of operation names this converter supports

Functions

Link copied to clipboard
open override fun convert(node: GraphNode, operands: List<String>, context: ConversionContext): ConversionResult

Convert a graph node to StableHLO operations