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

Method addControlFlowLoadStores

source/python.js:18268–18300  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

18266 }
18267 }
18268 addControlFlowLoadStores(block) {
18269 this.pushFrame(block);
18270 for (const n of block.nodes()) {
18271 switch (n.kind()) {
18272 case 'prim::If': {
18273 this.addIfLoadStores(n);
18274 break;
18275 }
18276 case 'prim::Loop': {
18277 this.addLoopLoadStores(n);
18278 break;
18279 }
18280 case 'prim::Closure': {
18281 for (const b of n.blocks()) {
18282 this.addControlFlowLoadStores(b);
18283 }
18284 break;
18285 }
18286 case 'prim::Store': {
18287 this.environment_stack.setVar(n.s('name'), n.input().type());
18288 break;
18289 }
18290 case 'prim::ComprehensionScope': {
18291 this.addControlFlowLoadStores(n.blocks().at(0));
18292 break;
18293 }
18294 default: {
18295 break;
18296 }
18297 }
18298 }
18299 return this.popFrame();
18300 }
18301 run(graph) {
18302 this.addControlFlowLoadStores(graph.block());
18303 }

Callers 3

addIfLoadStoresMethod · 0.80
addLoopLoadStoresMethod · 0.80
runMethod · 0.80

Calls 12

pushFrameMethod · 0.80
addIfLoadStoresMethod · 0.80
addLoopLoadStoresMethod · 0.80
blocksMethod · 0.80
setVarMethod · 0.80
sMethod · 0.80
atMethod · 0.80
popFrameMethod · 0.80
nodesMethod · 0.45
kindMethod · 0.45
typeMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected