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

Method propagateNode

source/python.js:7307–7326  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

7305 return this._made_change;
7306 }
7307 propagateNode(n) {
7308 let outputs = [];
7309 const outputs_opt = torch._C.runNodeIfInputsAreConstant(n, this._ignore_custom_classes);
7310 if (outputs_opt) {
7311 outputs = outputs_opt;
7312 const graph = n.owningGraph();
7313 const guard = new torch._C.WithInsertPoint(n);
7314 for (let i = 0; i < outputs.length; i++) {
7315 const new_output = torch._C.tryInsertConstant(graph, outputs[i]);
7316 if (new_output) {
7317 this._made_change = true;
7318 if (outputs[i].isNone()) {
7319 new_output.setType(n.outputs()[i].type());
7320 }
7321 n.outputs()[i].replaceAllUsesWith(new_output);
7322 }
7323 }
7324 guard.dispose();
7325 }
7326 }
7327 removeLoopNode(n) {
7328 const loop_input_offset = 2;
7329 for (let i = 0; i < n.outputs().length; i++) {

Callers 1

ConstantPropagationMethod · 0.80

Calls 7

owningGraphMethod · 0.80
isNoneMethod · 0.80
setTypeMethod · 0.80
replaceAllUsesWithMethod · 0.80
typeMethod · 0.45
outputsMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected