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

Method deleteAfterExitNodes

source/python.js:18547–18563  ·  view source on GitHub ↗
(block, iter)

Source from the content-addressed store, hash-verified

18545 n.destroy();
18546 }
18547 deleteAfterExitNodes(block, iter) {
18548 const nodes = block.nodes();
18549 if (iter === nodes.end()) {
18550 return;
18551 }
18552 const insert = new torch._C.WithInsertPoint(block.nodes().front());
18553 for (const it of Array.from(nodes).reverse()) {
18554 if (it === iter) {
18555 break;
18556 }
18557 if (it !== block.return_node()) {
18558 this.destroyNodeAfterExit(it);
18559 }
18560 }
18561 this.destroyNodeAfterExit(iter);
18562 insert.dispose();
18563 }
18564 updateTargetBlock(block) {
18565 if (torch._C.ExitTransformer.owningNodeKind(block) === 'prim::Loop' && this._current_exit_kind === 'prim::LoopContinuation') {
18566 this._target_block = block;

Callers 1

transformExitsMethod · 0.80

Calls 6

frontMethod · 0.80
return_nodeMethod · 0.80
destroyNodeAfterExitMethod · 0.80
nodesMethod · 0.45
endMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected