1 | #pragma once |
2 | |
3 | #include <torch/csrc/jit/ir/ir.h> |
4 | |
5 | namespace torch { |
6 | namespace jit { |
7 | |
8 | // removes tuples where TupleConstruct and TupleUnpack are matched |
9 | // but leaves tuples in place across if statements, loops, and as inputs/outputs |
10 | TORCH_API void LowerSimpleTuples(const std::shared_ptr<Graph>& graph); |
11 | |
12 | // removes _all_ tuples and raises an error if some cannot be removed |
13 | // this is used by ONNX to ensure there are not tuples before conversion, |
14 | // but will not work on graphs whose inputs contain tuples. |
15 | TORCH_API void LowerAllTuples(const std::shared_ptr<Graph>& graph); |
16 | |
17 | TORCH_API void LowerSimpleTuples(Block* block); |
18 | |
19 | } // namespace jit |
20 | } // namespace torch |
21 | |