MCPcopy Index your code
hub / github.com/lutzroeder/netron / sweep

Method sweep

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

Source from the content-addressed store, hash-verified

6894 return false;
6895 }
6896 sweep(block, recurse) {
6897 const nodes = Array.from(block.nodes()).reverse();
6898 for (const node of nodes) {
6899 this.removeDeadBlockOutputs(node);
6900 this.removeDeadLoopOutputs(node);
6901 if (recurse) {
6902 for (const block of node.blocks()) {
6903 this.sweep(block, true);
6904 }
6905 }
6906 if (!this._marked.has(node) && !node.hasUses()) {
6907 node.destroy();
6908 }
6909 }
6910 }
6911 hasUntrackedMutation(node) {
6912 if (!this._useAliasDb) {
6913 if (node.kind() === 'prim::SetAttr') {

Callers 1

runMethod · 0.80

Calls 7

removeDeadLoopOutputsMethod · 0.80
blocksMethod · 0.80
hasUsesMethod · 0.80
destroyMethod · 0.80
nodesMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected