Skip to content

Commit 4e69a90

Browse files
committed
WIP: Dockerfile
1 parent e2913e3 commit 4e69a90

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Dockerfile.gpu

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.12-slim
2+
3+
ADD . .
4+
5+
RUN pip install ".[cuda-12]"
6+
7+
CMD ["python"]

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "sparse"
77
dynamic = ["version"]
88
description = "Sparse n-dimensional arrays for the PyData ecosystem"
99
readme = "README.md"
10-
dependencies = ["numpy>=1.17", "numba>=0.49"]
10+
dependencies = ["numpy>=1.17", "numba>=0.49", "array_api_compat>=1.11"]
1111
maintainers = [{ name = "Hameer Abbasi", email = "[email protected]" }]
1212
requires-python = ">=3.10"
1313
license = { file = "LICENSE" }
@@ -51,6 +51,8 @@ tests = [
5151
"pre-commit",
5252
"pytest-codspeed",
5353
]
54+
cuda-12 = ["cupy-cuda12x"]
55+
cuda-11 = ["cupy-cuda11x"]
5456
tox = ["sparse[tests]", "tox"]
5557
notebooks = ["sparse[tests]", "nbmake", "matplotlib"]
5658
all = ["sparse[docs,tox,notebooks,mlir]", "matrepr"]

sparse/numba_backend/_sparse_array.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ def __init__(self, shape, fill_value=None):
5353
if data is not None:
5454
import array_api_compat
5555

56-
self.fill_value = array_api_compat.array_namespace(data).asarray(self.fill_value)
56+
xp = array_api_compat.array_namespace(data)
57+
else:
58+
xp = np
5759

60+
self.fill_value = xp.asarray(self.fill_value)
5861
self.device # noqa: B018
5962

6063
dtype = None

0 commit comments

Comments
 (0)