pytorch/tools/setup_helpers
Joel Schlosser e60f18c2ad Generate header with version #defines for LibTorch (#50073)
Summary:
Uses cmake's `configure_file()` macro to generate a new `torch/csrc/api/include/torch/version.h` header with `TORCH_VERSION_{MAJOR,MINOR,PATCH}` \#defines from an input file `torch/csrc/api/include/torch/version.h.in`.

For Bazel builds, this is accomplished with `header_template_rule()`.

For Buck builds, this is accomplished with `fb_native.genrule()`.

Fixes https://github.com/pytorch/pytorch/issues/44365

<img width="1229" alt="Screen Shot 2021-01-05 at 3 19 24 PM" src="https://user-images.githubusercontent.com/75754324/103809279-3fd80380-5027-11eb-9039-fd23922cebd5.png">

Pull Request resolved: https://github.com/pytorch/pytorch/pull/50073

Reviewed By: glaringlee

Differential Revision: D25855877

Pulled By: jbschlosser

fbshipit-source-id: 6bb792718c97e2c2dbaa74b7b7b831a4f6938e49
2021-02-03 22:18:53 -08:00
..
__init__.py
cmake.py Drop unused imports from leftovers (#49953) 2021-01-04 16:31:48 -08:00
env.py
gen.py
gen_version_header.py Generate header with version #defines for LibTorch (#50073) 2021-02-03 22:18:53 -08:00
generate_code.py [pytorch] clean up unused util srcs under tools/autograd (#50611) 2021-01-18 23:54:02 -08:00
numpy_.py