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

Method removeLoopNode

source/python.js:7327–7334  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

7325 }
7326 }
7327 removeLoopNode(n) {
7328 const loop_input_offset = 2;
7329 for (let i = 0; i < n.outputs().length; i++) {
7330 n.outputs()[i].replaceAllUsesWith(n.inputs()[i + loop_input_offset]);
7331 }
7332 this._made_change = true;
7333 n.destroy();
7334 }
7335 loopWillNotRun(node) {
7336 const [trip_count, start_cond] = node.inputs();
7337 const iter_len = torch._C.constant_as(trip_count, 'toInt', 1);

Callers 1

ConstantPropagationMethod · 0.80

Calls 4

replaceAllUsesWithMethod · 0.80
destroyMethod · 0.80
outputsMethod · 0.45
inputsMethod · 0.45

Tested by

no test coverage detected