mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Summary: There is a module called `2to3` which you can target for future specifically to remove these, the directory of `caffe2` has the most redundant imports: ```2to3 -f future -w caffe2``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/45033 Reviewed By: seemethere Differential Revision: D23808648 Pulled By: bugra fbshipit-source-id: 38971900f0fe43ab44a9168e57f2307580d36a38
27 lines
760 B
Python
27 lines
760 B
Python
## @package get_python_cmake_flags
|
|
# Module scripts.get_python_cmake_flags
|
|
##############################################################################
|
|
# Use this script to find your preferred python installation.
|
|
##############################################################################
|
|
#
|
|
# You can use the following to build with your preferred version of python
|
|
# if your installation is not being properly detected by CMake.
|
|
#
|
|
# mkdir -p build && cd build
|
|
# cmake $(python ../scripts/get_python_cmake_flags.py) ..
|
|
# make
|
|
#
|
|
|
|
|
|
|
|
|
|
from distutils import sysconfig
|
|
import sys
|
|
|
|
flags = [
|
|
'-DPYTHON_EXECUTABLE:FILEPATH={}'.format(sys.executable),
|
|
'-DPYTHON_INCLUDE_DIR={}'.format(sysconfig.get_python_inc()),
|
|
]
|
|
|
|
print(' '.join(flags), end='')
|