pytorch/torch/utils/__init__.py
Nikita Shulga bcf8973654 Add torch.utils.cmake_prefix_path pointing to share/cmake folder (#38559)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/38559

Test Plan: Make sure that `cmake path/to/CMakeLists.txt -DCMAKE_PREFIX_PATH=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` succeeds for CMake projects which depends on Torch package

Differential Revision: D21644066

Pulled By: malfet

fbshipit-source-id: c8e3cb2cbd7f969fadea6a3bccc41c4edb3ec546
2020-05-19 16:49:16 -07:00

15 lines
517 B
Python

from __future__ import absolute_import, division, print_function, unicode_literals
from .throughput_benchmark import ThroughputBenchmark
import os.path as _osp
# Set the module for a given object for nicer printing
def set_module(obj, mod):
if not isinstance(mod, str):
raise TypeError("The mod argument should be a string")
obj.__module__ = mod
#: Path to folder containing CMake definitions for Torch package
cmake_prefix_path = _osp.join(_osp.dirname(_osp.dirname(__file__)), 'share', 'cmake')