[TensorExpr] Add classes for memory management in tensor expressions. (#33216)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33216

All tensor expressions belong to a kernel arena and are freed when the
arena is destroyed. Until it is destroyed, all expressions stay valid.

Test Plan: Imported from OSS

Differential Revision: D19848382

Pulled By: ZolotukhinM

fbshipit-source-id: a581ea2b635b9ba2cc53949616a13d8d3a47caae
This commit is contained in:
Mikhail Zolotukhin
2020-02-21 13:06:13 -08:00
committed by Facebook Github Bot
parent 616beb1412
commit 089d658153
4 changed files with 121 additions and 0 deletions

View File

@ -454,6 +454,8 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
${TORCH_SRC_DIR}/csrc/jit/fuser/fallback.cpp
${TORCH_SRC_DIR}/csrc/jit/function.cpp
${TORCH_SRC_DIR}/csrc/jit/vararg_functions.cpp
${TORCH_SRC_DIR}/csrc/jit/tensorexpr/mem_arena.cpp
)
if (NOT INTERN_DISABLE_MOBILE_INTERP)