summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZachary DeVito <zdevito@gmail.com>2018-04-13 17:34:50 -0700
committerGitHub <noreply@github.com>2018-04-13 17:34:50 -0700
commit825ce7f1966c2c03c0972cc7bf7bfa341c2d517d (patch)
tree137a009169e650807df7456a5261a4158833ec12 /tools
parent0042851e04634cc765b0893d3b4a2cc5b47aae5d (diff)
downloadpytorch-825ce7f1966c2c03c0972cc7bf7bfa341c2d517d.tar.gz
pytorch-825ce7f1966c2c03c0972cc7bf7bfa341c2d517d.tar.bz2
pytorch-825ce7f1966c2c03c0972cc7bf7bfa341c2d517d.zip
[jit][script] Allow tuples to be re-assigned (#6538)
* Allow tuples to be re-assigned This commit improves our support of tuples by making them more first-class. In particular, it allows tuples to be re-assigned across loops and ifs. It does this by making them first-class values in the Graph IR, and then removing the tuples in a LowerTuples pass. An alternative approach would have added more support for desugaring tuples in the Environment object as they were emitted. Instead, the current approach was chosen anticipating a future when tuples are fully supported (including the interpreter). In that future, the current code can be completly reused with the LowerTuples pass just becoming a optimization that removes unneeded tuple allocations.
Diffstat (limited to 'tools')
-rw-r--r--tools/cpp_build/libtorch/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/cpp_build/libtorch/CMakeLists.txt b/tools/cpp_build/libtorch/CMakeLists.txt
index 6a9d2e91aa..b43f3c7e8f 100644
--- a/tools/cpp_build/libtorch/CMakeLists.txt
+++ b/tools/cpp_build/libtorch/CMakeLists.txt
@@ -134,6 +134,7 @@ set(TORCH_SRCS
${TORCH_SRC_DIR}/csrc/jit/passes/shape_analysis.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/canonicalize.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/dead_code_elimination.cpp
+ ${TORCH_SRC_DIR}/csrc/jit/passes/lower_tuples.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/peephole.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/inplace_check.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/batch_mm.cpp