Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
8088a64
Add graphblas.array_api: an Array API namespace over Tensor (skeleton)
eriknw Nov 11, 2026
0149fbb
array_api: test the element-wise functions against numpy, and match n…
eriknw Nov 11, 2026
3325298
array_api: statistical functions, all, any and diff
eriknw Nov 11, 2026
6bbbb70
array_api: test creation, data type functions, the Array object and b…
eriknw Nov 11, 2026
6b30d8c
array_api: devices() and meshgrid return tuples, as the 2025.12 stand…
eriknw Nov 11, 2026
df280d4
array_api: multiply floats on the intersection when that is exact
eriknw Nov 11, 2026
23bd854
array_api: maximum and minimum of floats in GraphBLAS when no NaN or …
eriknw Nov 11, 2026
de48d91
array_api: less overhead per call
eriknw Nov 11, 2026
9026d24
array_api: declare the graphblas.array_api package in pyproject.toml
eriknw Nov 11, 2026
f4f84b0
array_api: a fill that is never seen does not raise
eriknw Nov 11, 2026
5ff2822
array_api: test argument checking and rare storage cases; unload a sh…
eriknw Nov 11, 2026
7b2d3ad
array_api: var and std broadcast the stored means instead of storing …
eriknw Nov 11, 2026
ec6c5a3
array_api: where, concat and stack
eriknw Nov 11, 2026
83cd44b
array_api: broadcast_*, flip, moveaxis, repeat, roll, tile and unstack
eriknw Nov 11, 2026
16d4878
array_api: advanced indexing, assignment by index, take and take_alon…
eriknw Nov 11, 2026
a5da9a8
array_api: argmax, argmin, count_nonzero, nonzero and searchsorted
eriknw Nov 11, 2026
35a4b17
array_api: sort, which keeps sparsity, and argsort
eriknw Nov 11, 2026
cc388a7
array_api: isin and unique_*
eriknw Nov 11, 2026
ea0fdcc
array_api: matmul, tensordot, vecdot, matrix_transpose and the linalg…
eriknw Nov 11, 2026
b4d0938
array_api: test thread 3's argument checks and edge cases; ndarray @ …
eriknw Nov 11, 2026
4f6e29e
Tensor: dup(dtype=...) keeps an n x 1 stored Matrix held by row
eriknw Nov 11, 2026
f1f1992
array_api: signed zeros give way to sparsity by default; guard outer …
eriknw Nov 11, 2026
2a5fba9
array_api: reductions as numpy for signed zeros, complex infinities a…
eriknw Nov 11, 2026
084b647
array_api: cumulative_sum and cumulative_prod stay sparse when the fi…
eriknw Nov 11, 2026
4e5c3df
Tensor: ewise_mult of broadcast operands into a shape with no positions
eriknw Nov 11, 2026
8af3562
array_api: fixes from the conformance suite: clip broadcasts, from_dl…
eriknw Nov 11, 2026
85da672
array_api: an operand that stores every position keeps products sparse
eriknw Nov 11, 2026
44b0744
array_api: one-sided products stay sparse; fills take numpy's loop fo…
eriknw Nov 11, 2026
a037a29
array_api: semiring= on matmul, tensordot and vecdot, and einsum
eriknw Nov 11, 2026
7d09925
array_api: keep each Array's shape and dtype on the Array
eriknw Nov 11, 2026
09de9b2
array_api: defer contractions; multiply and slicing compute only what…
eriknw Nov 11, 2026
1f3c1bb
array_api: copy.copy and copy.deepcopy of an Array copy its data
eriknw Nov 11, 2026
f9df0b2
array_api: drop the array_api_signed_zeros option and its strict paths
eriknw Nov 11, 2026
5d987aa
array_api: facts about stored values from one GraphBLAS pass each
eriknw Nov 11, 2026
f7bab1b
array_api: an SDDMM is computed under S only when no product can over…
eriknw Nov 11, 2026
6b8ccfc
array_api: transcendental functions by SuiteSparse's unary ops
eriknw Nov 11, 2026
476da93
array_api: a one-sided product stores a broadcast operand in full
eriknw Nov 11, 2026
3482f82
array_api: pow follows the Array API for an exponent of 0.5
eriknw Nov 11, 2026
39e38aa
array_api: xp.prune drops stored entries equal to the fill
eriknw Nov 11, 2026
526fdea
Tensor: a private _map_values; the namespace stops reaching into Tens…
eriknw Nov 11, 2026
742ec69
array_api: concat by one GxB_Matrix_concat of the stored Matrices
eriknw Nov 11, 2026
e16d7cd
array_api: complex transcendental functions stay on numpy
eriknw Nov 11, 2026
8f152c4
array_api: a "..." that covers no axis separates advanced indices, as…
eriknw Nov 11, 2026
9740574
array_api: an SDDMM asks for dot products when they are much cheaper
eriknw Nov 11, 2026
4701b65
array_api: test the empty-ellipsis key with list, ndarray and Array i…
eriknw Nov 11, 2026
28d02ec
array_api: a fully stored bool result takes its common value as the fill
eriknw Nov 11, 2026
43c4303
array_api: the SDDMM overflow bound reads magnitudes by two reductions
eriknw Nov 11, 2026
51d8df2
array_api: an in-place operator on a pending product forgets the product
eriknw Nov 11, 2026
6bdea28
array_api: a fully stored bool result takes fill False, never True
eriknw Nov 11, 2026
2e47d32
array_api: an SDDMM with inf, or that may overflow, computes the spar…
eriknw Nov 11, 2026
b919461
array_api: a one-sided product gathers a broadcast operand at the ent…
eriknw Nov 11, 2026
db32ee9
array_api: contractions ignore explicit fills, propagate NaN terms, a…
eriknw Nov 11, 2026
88a39a8
array_api: abs of a complex array keeps only the "zero" fact
eriknw Nov 11, 2026
64ffd58
array_api: semiring checks per object, a batched dot hint, and P * P …
eriknw Nov 11, 2026
86b1b80
array_api: setitem with None in a basic key takes numpy's value shape
eriknw Nov 11, 2026
767d33b
array_api: row sums and scalar factors keep contractions sparse
eriknw Nov 11, 2026
3a14c18
array_api: Arrays pickle through their coordinates
eriknw Nov 11, 2026
06bc3f8
array_api: einsum factors out only finite scalars
eriknw Nov 11, 2026
237b54d
array_api: a fully stored bool result decides on dropping False by a …
eriknw Nov 11, 2026
55c5c51
array_api: finite fills store in full under the limit; gather only pa…
eriknw Nov 11, 2026
7f3080e
array_api: a three-operand einsum computes the pair under the third's…
eriknw Nov 11, 2026
ad859dd
array_api: where stores the condition's entries over the operand its …
eriknw Nov 11, 2026
9c81ea4
array_api: fills that absorb the op make add, maximum and minimum int…
eriknw Nov 11, 2026
ca4f1c8
array_api: a semiring accepts an operand that stores every position
eriknw Nov 11, 2026
73aa5af
array_api: xp.refill changes an Array's fill and keeps its values
eriknw Nov 11, 2026
3a97822
array_api: a bool result with fill True that stores mostly False flip…
eriknw Nov 11, 2026
e0be977
array_api: xp.compute computes a pending Array now
eriknw Nov 11, 2026
aa1a776
array_api: from_coo sums the values at a repeated coordinate
eriknw Nov 11, 2026
e244ac0
array_api: 0-d Arrays share one empty Tensor per dtype, copy-on-write
eriknw Nov 11, 2026
c159459
array_api: the masked three-operand einsum leaves out 0-d operands
eriknw Nov 11, 2026
be267a3
array_api: where stores only the condition's entries that select the …
eriknw Nov 11, 2026
e45ac15
array_api: where with a bool condition and an unbroadcast branch stay…
eriknw Nov 11, 2026
ef2030e
array_api: argmax and argmin along an axis run in GraphBLAS
eriknw Nov 11, 2026
8bf0c0b
array_api: where reads a broadcast branch in GraphBLAS
eriknw Nov 11, 2026
35c602b
array_api: where stores a broadcast branch in full before scaling by it
eriknw Nov 11, 2026
d475b66
array_api: where over a base with entries selects and unions in Graph…
eriknw Nov 11, 2026
f87c013
Tensor: wide column MAX and MIN reductions keep every thread
eriknw Nov 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions graphblas/array_api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""An Array API (2025.12) namespace over ``graphblas.Tensor``: ``import graphblas.array_api as xp``.

**THIS API IS EXPERIMENTAL AND MAY CHANGE.**

An Array is logically dense: its value at a position is its stored entry there, or its
``fill_value`` where it stores none (pydata/sparse's model). Results equal numpy's on the same
dense data, and keep the stored entries sparse where the fill values allow.
"""

from . import (
_constants,
_creation,
_dtypes,
_elementwise,
_indexing,
_info,
_linalg,
_manipulation,
_searching,
_set,
_sorting,
_statistical,
linalg,
)
from ._array import Array
from ._constants import * # noqa: F403
from ._creation import * # noqa: F403
from ._dtypes import * # noqa: F403
from ._dtypes import DTYPES as _DTYPES
from ._elementwise import * # noqa: F403
from ._indexing import * # noqa: F403
from ._info import * # noqa: F403
from ._linalg import * # noqa: F403
from ._manipulation import * # noqa: F403
from ._searching import * # noqa: F403
from ._set import * # noqa: F403
from ._sorting import * # noqa: F403
from ._statistical import * # noqa: F403
from ._utils import DensifyError

__array_api_version__ = "2025.12"

bool = _DTYPES["bool"] # noqa: A001 (the Array API's name)
int8 = _DTYPES["int8"]
int16 = _DTYPES["int16"]
int32 = _DTYPES["int32"]
int64 = _DTYPES["int64"]
uint8 = _DTYPES["uint8"]
uint16 = _DTYPES["uint16"]
uint32 = _DTYPES["uint32"]
uint64 = _DTYPES["uint64"]
float32 = _DTYPES["float32"]
float64 = _DTYPES["float64"]
complex64 = _DTYPES["complex64"]
complex128 = _DTYPES["complex128"]

__all__ = [
"Array",
"DensifyError",
"__array_api_version__",
"bool",
"complex64",
"complex128",
"float32",
"float64",
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
]
__all__ += _constants.__all__
__all__ += _creation.__all__
__all__ += _dtypes.__all__
__all__ += _elementwise.__all__
__all__ += _indexing.__all__
__all__ += _info.__all__
__all__ += _linalg.__all__
__all__ += _manipulation.__all__
__all__ += _searching.__all__
__all__ += _set.__all__
__all__ += _sorting.__all__
__all__ += _statistical.__all__
Loading
Loading