(n)
| 18226 | n.addInput(inp); |
| 18227 | } |
| 18228 | addIfLoadStores(n) { |
| 18229 | const [true_block, false_block] = n.blocks(); |
| 18230 | const true_vars = this.addControlFlowLoadStores(true_block); |
| 18231 | const false_vars = this.addControlFlowLoadStores(false_block); |
| 18232 | const mutated_variables = new Set(); |
| 18233 | for (const v of true_vars.definedVariables()) { |
| 18234 | if (false_vars.findInAnyFrame(v)) { |
| 18235 | mutated_variables.add(v); |
| 18236 | } |
| 18237 | } |
| 18238 | for (const v of false_vars.definedVariables()) { |
| 18239 | if (true_vars.findInAnyFrame(v)) { |
| 18240 | mutated_variables.add(v); |
| 18241 | } |
| 18242 | } |
| 18243 | for (const x of mutated_variables) { |
| 18244 | const true_type = true_vars.findInAnyFrame(x); |
| 18245 | const false_type = false_vars.findInAnyFrame(x); |
| 18246 | const unified = torch._C.unifyTypes(true_type, false_type, /*default_to_union=*/true); |
| 18247 | this.addBlockOutput(true_block, true_type, x); |
| 18248 | this.addBlockOutput(false_block, false_type, x); |
| 18249 | this.addNodeOutput(n, unified, x); |
| 18250 | } |
| 18251 | } |
| 18252 | addLoopLoadStores(n) { |
| 18253 | const [body_block] = n.blocks(); |
| 18254 | const loop_vars = this.addControlFlowLoadStores(body_block); |
no test coverage detected