Skip to content

Commit a25184d

Browse files
committed
Implements max dimensions into array API capabilities
1 parent 7b64374 commit a25184d

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

dpctl/tensor/_array_api.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ class Info:
5959

6060
def __init__(self):
6161
self._capabilities = {
62-
"boolean_indexing": True,
63-
"data_dependent_shapes": True,
62+
"boolean indexing": True,
63+
"data-dependent shapes": True,
64+
"max dimensions": 64,
6465
}
6566
self._all_dtypes = {
6667
"bool": dpt.bool,
@@ -84,11 +85,20 @@ def capabilities(self):
8485
8586
Returns a dictionary of ``dpctl``'s capabilities.
8687
88+
The dictionary contains the following keys:
89+
``"boolean indexing"``:
90+
boolean indicating ``dpctl``'s support of boolean indexing.
91+
Value: ``True``
92+
``"data-dependent shapes"``:
93+
boolean indicating ``dpctl``'s support of data-dependent shapes.
94+
Value: ``True``
95+
``max dimensions``:
96+
integer indication the maximum array dimension supported by ``dpctl``.
97+
Value: ``64``
98+
8799
Returns:
88100
dict:
89101
dictionary of ``dpctl``'s capabilities
90-
- ``"boolean_indexing"``: bool
91-
- ``data_dependent_shapes"``: bool
92102
"""
93103
return self._capabilities.copy()
94104

dpctl/tests/test_tensor_array_api_inspection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ def test_array_api_inspection_devices():
7979

8080
def test_array_api_inspection_capabilities():
8181
capabilities = dpt.__array_namespace_info__().capabilities()
82-
assert capabilities["boolean_indexing"]
83-
assert capabilities["data_dependent_shapes"]
82+
assert capabilities["boolean indexing"]
83+
assert capabilities["data-dependent shapes"]
84+
assert capabilities["max dimensions"] == 64
8485

8586

8687
def test_array_api_inspection_default_dtypes():

0 commit comments

Comments
 (0)