MCPcopy
hub / github.com/lutzroeder/netron / eliminateDeadForkInputs

Method eliminateDeadForkInputs

source/python.js:6770–6788  ·  view source on GitHub ↗
(block, recurse)

Source from the content-addressed store, hash-verified

6768 this._deleteCallback = deleteCallback;
6769 }
6770 eliminateDeadForkInputs(block, recurse) {
6771 for (const node of block.nodes()) {
6772 if (recurse) {
6773 for (const sb of node.blocks()) {
6774 this.eliminateDeadForkInputs(sb, recurse);
6775 }
6776 }
6777 if (node.kind() !== 'prim::fork') {
6778 continue;
6779 }
6780 const g = node.g("Subgraph");
6781 for (let i = 0; i < g.inputs().length; i++) {
6782 if (!g.inputs()[i].hasUses()) {
6783 g.eraseInput(i);
6784 node.removeInput(i);
6785 }
6786 }
6787 }
6788 }
6789 markReturnNode(node) {
6790 if (this._marked.has(node)) {
6791 return false;

Callers 1

runMethod · 0.80

Calls 6

blocksMethod · 0.80
hasUsesMethod · 0.80
removeInputMethod · 0.80
nodesMethod · 0.45
kindMethod · 0.45
inputsMethod · 0.45

Tested by

no test coverage detected