Skip to main content

Module ops

Module ops 

Source
Expand description

Per-op kernel dispatch for the CpuBackend.

The 51-op ai.onnx v1 catalog is grouped into category modules. This module routes each declared op to its category-specific kernel; categories that don’t yet have implementations return a clear “not yet implemented” error.

Attribute access limitation. BackendRuntime::dispatch_atomic receives (op_type, inputs, attrs) - no NodeProto, no attribute map. Ops whose semantics depend on attributes (Reshape’s dims, Softmax’s axis, Conv’s kernel_shape, etc.) cannot be fully implemented within this dispatch shape. They report RequiresAttributes so callers can route them through a follow-up channel.

Functions§

dispatch
Route op_type to the matching kernel. attrs is the NodeProto’s attribute slice — ops whose semantics depend on attributes (Reshape’s dims, Softmax’s axis, Gemm’s alpha/beta, …) read it directly. The framework’s per-op dispatch path threads ctx.current.node_attributes here; the execute_graph walker threads node.attribute per node.