-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (55 loc) · 1.79 KB
/
setup.py
File metadata and controls
58 lines (55 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from setuptools import setup, find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
import sys
compile_args = ["-O2", "-std=c++20"] if sys.platform != "win32" else ["/O2", "/std:c++20"]
version = "0.0.4"
ext_modules = [
Pybind11Extension(
"anygrad.tensor.base.tensor_c",
[
"backend/anygrad/bindings/bind_tensor.cpp",
"backend/anygrad/Th/ThAllocate.cpp",
"backend/anygrad/Th/ThBaseops.cpp",
"backend/anygrad/Th/Thhelpers.cpp",
"backend/anygrad/Th/Thgemm.cpp",
"backend/anygrad/Th/Tharrange.cpp"
],
language="c++",
extra_compile_args=compile_args
),
Pybind11Extension(
"anygrad.utils.utils_c",
[
"backend/anygrad/bindings/utils_bind.cpp",
"backend/anygrad/utils/random_num.cpp",
"backend/anygrad/Th/Thhelpers.cpp",
"backend/anygrad/utils/init_ops.cpp",
"backend/anygrad/utils/log_arithmetic.cpp",
],
language="c++",
extra_compile_args=compile_args
)
]
setup(
name="anygrad",
version=version,
description="A Tensor module that allows a deep learning framework to switch seamlessly between different engines.",
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Ruhaan",
author_email="ruhaan123dalal@gmail.com",
license="MIT",
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
packages=find_packages(),
package_dir={"": "."},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
include_package_data=True,
install_requires=[
"pybind11", "numpy"
]
)