Ai
1 Star 0 Fork 0

zhangming8/Pytorch-Correlation-extension

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 1.84 KB
一键复制 编辑 原始数据 按行查看 历史
Clément Pinard 提交于 2022-05-17 17:24 +08:00 . tag 0.4.0
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
from os.path import join
CPU_ONLY = False
project_root = 'Correlation_Module'
source_files = ['correlation.cpp', 'correlation_sampler.cpp']
with open("README.md", "r") as fh:
long_description = fh.read()
def launch_setup():
if CPU_ONLY:
Extension = CppExtension
macro = []
else:
Extension = CUDAExtension
source_files.append('correlation_cuda_kernel.cu')
macro = [("USE_CUDA", None)]
sources = [join(project_root, file) for file in source_files]
setup(
name='spatial_correlation_sampler',
version="0.4.0",
author="Clément Pinard",
author_email="clement.pinard@ensta-paristech.fr",
description="Correlation module for pytorch",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ClementPinard/Pytorch-Correlation-extension",
install_requires=['torch>=1.1', 'numpy'],
ext_modules=[
Extension('spatial_correlation_sampler_backend',
sources,
define_macros=macro,
extra_compile_args={'cxx': ['-fopenmp'], 'nvcc':[]},
extra_link_args=['-lgomp'])
],
package_dir={'': project_root},
packages=['spatial_correlation_sampler'],
cmdclass={
'build_ext': BuildExtension
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
])
if __name__ == '__main__':
launch_setup()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangming8/Pytorch-Correlation-extension.git
git@gitee.com:zhangming8/Pytorch-Correlation-extension.git
zhangming8
Pytorch-Correlation-extension
Pytorch-Correlation-extension
master

搜索帮助