Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ jobs:

runs-on: ubuntu-latest
strategy:
# do not fail other jobs if one framework / version misbehaves
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.13']
# there was (and likely still is) conflict between tf, oneflow and paddle in protobuf versions.
# cupy is not tested because it demands gpu
# oneflow testing is dropped, see details at https://github.com/Oneflow-Inc/oneflow/issues/10340
# paddle testing is dropped because of divergence with numpy in py3.10, paddle==2.6.1
frameworks: ['numpy pytorch tensorflow jax mlx']
frameworks: ['numpy pytorch tensorflow jax mlx.core']
include:
- python-version: '3.10'
frameworks: 'pytensor'
Expand Down
4 changes: 3 additions & 1 deletion einops/_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,9 @@ def einsum(self, pattern, *x):


class MLXBackend(AbstractBackend):
framework_name = "mlx"
framework_name = "mlx.core"
# we should check for mlx.core, because
# there are other mlx.<submodules> that don't need mlx.core

def __init__(self):
import mlx.core as mx
Expand Down
2 changes: 1 addition & 1 deletion einops/einops.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def reduce(tensor: Union[Tensor, list[Tensor]], pattern: str, reduction: Reducti
```

Parameters:
tensor: tensor: tensor of any supported library (e.g. numpy.ndarray, tensorflow, pytorch).
tensor: tensor of any supported library (e.g. numpy.ndarray, tensorflow, pytorch).
list of tensors is also accepted, those should be of the same type and shape
pattern: string, reduction pattern
reduction: one of available reductions ('min', 'max', 'sum', 'mean', 'prod', 'any', 'all').
Expand Down
4 changes: 2 additions & 2 deletions einops/tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def main():
"pytensor": ["pytensor"],
}
if sys.platform == "darwin":
framework_name2installation["mlx"] = ["mlx"]
framework_name2installation["mlx.core"] = ["mlx"]
if sys.platform.startswith("linux"):
framework_name2installation["mlx"] = ["mlx[cpu]"]
framework_name2installation["mlx.core"] = ["mlx[cpu]"]

usage = f"""
Usage: python -m einops.tests.run_tests <frameworks> [--pip-install]
Expand Down
2 changes: 1 addition & 1 deletion einops/tests/test_einsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_layer():
"tensorflow.keras",
"paddle",
"pytensor",
"mlx",
"mlx.core",
]


Expand Down
Loading