Filter#

filter module#

Filters that used to create subgraph.

mmodel.filter.subnodes_by_inputs(graph, inputs: list) list[source]#

Obtain a list of subgraph nodes based on node inputs.

If a parent node is included, so are the child nodes.

Returns:

list of node names

mmodel.filter.subnodes_by_outputs(graph, outputs: list) list[source]#

Obtain a list of subgraph nodes based on node outputs.

For mmodel graphs, outputs from all the internal nodes are unique. Therefore the function only checks if function nodes overlap with the target return list. If a child node is included, so are the parent nodes.

Returns:

list of node names