Update setup.py (#269)

pull/289/head
Mehmet Deniz Birlikci 2023-12-31 04:22:45 +03:00 committed by GitHub
parent 27024e42da
commit 2b62f419c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,18 @@ import glob
import os
import subprocess
import subprocess
import sys
def install_torch():
try:
import torch
except ImportError:
subprocess.check_call([sys.executable, "-m", "pip", "install", "torch"])
# Call the function to ensure torch is installed
install_torch()
import torch
from setuptools import find_packages, setup
from torch.utils.cpp_extension import CUDA_HOME, CppExtension, CUDAExtension