MCPcopy Create free account
hub / github.com/pytorch/pytorch / build_caffe2

Function build_caffe2

tools/build_pytorch_libs.py:74–94  ·  view source on GitHub ↗
(
    version: Optional[str],
    cmake_python_library: Optional[str],
    build_python: bool,
    rerun_cmake: bool,
    cmake_only: bool,
    cmake: CMake,
)

Source from the content-addressed store, hash-verified

72
73
74def build_caffe2(
75 version: Optional[str],
76 cmake_python_library: Optional[str],
77 build_python: bool,
78 rerun_cmake: bool,
79 cmake_only: bool,
80 cmake: CMake,
81) -> None:
82 my_env = _create_build_env()
83 build_test = not check_negative_env_flag("BUILD_TEST")
84 cmake.generate(
85 version, cmake_python_library, build_python, build_test, my_env, rerun_cmake
86 )
87 if cmake_only:
88 return
89 cmake.build(my_env)
90 if build_python:
91 caffe2_proto_dir = os.path.join(cmake.build_dir, "caffe2", "proto")
92 for proto_file in glob(os.path.join(caffe2_proto_dir, "*.py")):
93 if proto_file != os.path.join(caffe2_proto_dir, "__init__.py"):
94 shutil.copy(proto_file, os.path.join("caffe2", "proto"))

Callers 2

build_depsFunction · 0.90
build_libtorch.pyFile · 0.90

Calls 6

_create_build_envFunction · 0.85
check_negative_env_flagFunction · 0.85
generateMethod · 0.45
buildMethod · 0.45
joinMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…