Skip to content
class

OpNode

OpNode

One recorded op in the trace.

Attributes

namestd::string
Op name as passed to OpScopeFull (e.g. "conv2d", "layer_norm"). Matches the schema name in OpRegistry.
inputsstd::vector<TensorId>
Ids of input tensors, in op-defined order. Phase 1.1 records these by appending to the vector after the backend dispatch returns (the Tracer hook in OpScopeFull runs at op entry; input wiring happens later in wire_autograd). An OpNode with a pending input slot indicates an op that did not go through wire_autograd — the builder treats that as an eager-only signature.
outputsstd::vector<TensorMeta>
Per-output metadata snapshots. Phase 1.1 has at most one output per node; the vector is generic so multi-output ops (e.g. topk, lstm) can be added without IR changes.
attrsstd::unordered_map<std::string, AttributeValue>
Optional payload keyed by attribute name. Populated by op forwards via OpScopeFull::set_attr when the emitter needs context that can't be recovered from input + output shapes alone (permutation, axes, stride, padding, eps, …).

Notes

Aggregate — no methods, no invariants enforced at construction. The Tracer is responsible for maintaining well-formedness (no dangling input ids, output ids in monotone increasing order).