xref: /aosp_15_r20/external/pytorch/torch/csrc/lazy/python/README.md (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1# Lazy Tensor Python Code
2
3Lazy Tensor Core is part of libtorch, which can not depend on python.
4
5Parts of lazy tensor core use python for 2 purposes
6A) py bindings let python programs call into lazy tensor c++ code
7B) lazy tensor core calls into python to use it (e.g. for grabbing stack traces)
8
9(A) is trivial since the python bindings only depend on libtorch;
10(B) requires making libtorch_python register a function with libtorch if loaded, and having a default (no-op) function otherwise.  Any functionality that strictly needs to depend on python should be part of the 'python' folder.
11