Commit f22dd9ae authored by yan.yan's avatar yan.yan
Browse files

fix setup.py

parent 62359bee
...@@ -19,18 +19,12 @@ SPCONV_FORCE_BUILD_CUDA = os.getenv("SPCONV_FORCE_BUILD_CUDA") ...@@ -19,18 +19,12 @@ SPCONV_FORCE_BUILD_CUDA = os.getenv("SPCONV_FORCE_BUILD_CUDA")
PYTHON_VERSION = "{}.{}".format(sys.version_info.major, sys.version_info.minor) PYTHON_VERSION = "{}.{}".format(sys.version_info.major, sys.version_info.minor)
remove_plus = torch.__version__.find("+dev") remove_device = re.search(r"(\+|\.)(dev|cu|cpu)", torch.__version__)
remove_dot = torch.__version__.find(".dev")
PYTORCH_VERSION = torch.__version__ PYTORCH_VERSION = torch.__version__
if remove_plus != -1: if remove_device is not None:
PYTORCH_VERSION = torch.__version__[:remove_plus] PYTORCH_VERSION = torch.__version__[:remove_device.start()]
if remove_dot != -1:
PYTORCH_VERSION = torch.__version__[:remove_dot]
PYTORCH_VERSION = list(map(int, PYTORCH_VERSION.split("."))) PYTORCH_VERSION = list(map(int, PYTORCH_VERSION.split(".")))
PYTORCH_VERSION_NUMBER = PYTORCH_VERSION[0] * 10000 + PYTORCH_VERSION[1] * 100 + PYTORCH_VERSION[2] PYTORCH_VERSION_NUMBER = PYTORCH_VERSION[0] * 10000 + PYTORCH_VERSION[1] * 100 + PYTORCH_VERSION[2]
class CMakeExtension(Extension): class CMakeExtension(Extension):
def __init__(self, name, sourcedir='', library_dirs=[]): def __init__(self, name, sourcedir='', library_dirs=[]):
Extension.__init__(self, name, sources=[], library_dirs=library_dirs) Extension.__init__(self, name, sources=[], library_dirs=library_dirs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment