1 #include <torch/csrc/jit/passes/onnx/fixup_onnx_loop.h> 6 void FixupONNXLoops(Block* block) {
7 for (
auto* node : block->nodes()) {
8 if (node->kind() == ::c10::onnx::Loop) {
9 AT_ASSERT(node->blocks().size() == 1);
10 auto* sub_block = node->blocks()[0];
11 sub_block->insertInput(1,
"cond");
13 for (Block* block : node->blocks()) {
14 FixupONNXLoops(block);
19 void FixupONNXLoops(std::shared_ptr<Graph>& graph) {
20 FixupONNXLoops(graph->block());