coreai_opt.inspection.OpInfo¶
- class coreai_opt.inspection.OpInfo(op_name, op_type, module_stack, source_frames, inputs, outputs, is_state)[source]¶
Bases:
objectInformation about a single operation discovered in a model.
- Parameters:
op_name (str)
op_type (str | None)
module_stack (tuple[ModuleContext, ...])
source_frames (tuple[SourceFrame, ...])
inputs (tuple[InputEdge, ...])
outputs (dict[int, tuple[OpInfo, ...]])
is_state (bool)
- op_name¶
The operation name that
op_name_configregex patterns match against (e.g.,"add_1","linear").- Type:
str
- op_type¶
The operation type that
op_type_configkeys match against (e.g.,"add","linear").Noneif the type could not be determined.- Type:
str | None
- module_stack¶
The
nn.Modulenesting hierarchy from outermost to innermost. The innermost entry’smodule_nameis the string thatmodule_name_configswould match, and itsmodule_typeis the string thatmodule_type_configswould match.- Type:
tuple[ModuleContext, …]
- source_frames¶
Source code locations from outermost
forward()to innermost, showing the call chain that produced this op. May be empty if source information is unavailable.- Type:
tuple[SourceFrame, …]
- inputs¶
Ordered input edges. Each
InputEdgecarries the producing op and the output slot of that op the tensor came from.- Type:
tuple[InputEdge, …]
- outputs¶
Dictionary mapping op outputs to a tuple of ops consuming the output.
- Type:
dict[int, tuple[OpInfo, …]]
- is_state¶
Trueif this op represents a model parameter or buffer rather than a computation. State ops have an emptymodule_stackand do not appear in module tree or boundary lists.- Type:
bool
- __init__(op_name, op_type, module_stack, source_frames, inputs, outputs, is_state)¶
- Parameters:
op_name (str)
op_type (str | None)
module_stack (tuple[ModuleContext, ...])
source_frames (tuple[SourceFrame, ...])
inputs (tuple[InputEdge, ...])
outputs (dict[int, tuple[OpInfo, ...]])
is_state (bool)
- Return type:
None
- is_state: bool¶
- module_stack: tuple[ModuleContext, ...]¶
- op_name: str¶
- op_type: str | None¶
- source_frames: tuple[SourceFrame, ...]¶