onnx_ir.analysis¶

See Subgraphs and functions for implicit-capture analysis in nested graphs.

onnx_ir.analysis.analyze_implicit_usage(graph)¶

Analyze implicit usage of values in sub-graphs.

This function returns a mapping from each sub-graph to a set of Value objects that are captured from outer scopes (i.e., not defined within the sub-graph itself).

Parameters:

graph (Graph) – The graph to analyze.

Returns:

A dictionary mapping sub-graphs to sets of implicitly used values.

Return type:

dict[Graph, set[Value]]