Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MLX compatibility: Manipulation functions

Open
#462 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start by running the named compatibility tests: test_broadcast_arrays, test_moveaxis, test_unstack, and the expand_dims, repeat, reshape, and roll tests. Read the implementations and test expectations for each failed or partial case. Done means the MLX compatibility behavior matches the Array API requirements listed in the table, including tuple returns, tuple axes, accepted repeat inputs, copy handling, and keyword-only arguments.

Written by the indexing model from the issue text.

Description

Array API MLX Analog Status Notes Test Node Result
broadcast_arrays(*arrays) broadcast_arrays(*arrays, stream=None) -> list[array] incompatible Array API 2025.12 requires a tuple of arrays; MLX returns a list. test_broadcast_arrays Failed
broadcast_shapes(*shapes) broadcast_shapes(*shapes) compatible MLX returns the expected broadcasted shape. TestBroadcastShapes::test_broadcast_shapes Passed
broadcast_to(x, /, shape) broadcast_to(array, shape, *, stream=None) compatible Required broadcasting behavior passes. MLX adds the optional stream extension. test_broadcast_to Passed
concat(arrays, /, *, axis=0) concat(arrays: list[array], axis: int | None = 0, *, stream=None) compatible Required behavior passes. MLX additionally accepts axis=None, positional axis, and stream. test_concat Passed
expand_dims(x, /, axis) expand_dims(a, /, axis: int | Sequence[int], *, stream=None) partial Tuple-axis coverage passes, but MLX incorrectly rejects a valid negative insertion axis at the lower boundary. TestExpandDims::test_expand_dims; TestExpandDims::test_expand_dims_tuples Failed / Passed
flip(x, /, *, axis=None) flip(a, /, axis: None | int | Sequence[int] = None, *, stream=None) compatible Passes for None, integer, and tuple axes. MLX additionally permits positional axis. test_flip Passed
moveaxis(x, source, destination, /) moveaxis(a, /, source: int, destination: int, *, stream=None) incompatible Array API accepts integers or tuples for source and destination; MLX accepts only scalar integers and rejects valid calls such as moveaxis(x, (), ()). test_moveaxis Failed
permute_dims(x, /, axes) permute_dims(a, /, axes: Sequence[int] | None = None, *, stream=None) compatible Required axis permutation behavior passes. MLX additionally permits omitted or None axes. test_permute_dims Passed
repeat(x, repeats, /, *, axis=None) repeat(array: array, repeats: int, axis: int | None = None, *, stream=None) partial Array API allows scalar or 1D integer-array repeats, while MLX documents only scalar integers. test_repeat Failed
reshape(x, /, shape, *, copy=None) reshape(a, /, shape: Sequence[int], *, stream=None) partial Tested behavior passes, but MLX lacks the standard copy keyword and therefore cannot accept all conforming calls. test_reshape Passed
roll(x, /, shift, *, axis=None) roll(a, shift: int | tuple[int], axis: None | int | tuple[int] = None, /, *, stream=None) partial Tested behavior passes, but MLX makes shift and axis positional-only. Array API permits keyword shift and requires axis to be keyword-only. test_roll Passed
squeeze(x, /, axis) squeeze(a, /, axis: None | int | Sequence[int] = None, *, stream=None) compatible Integer and tuple-axis behavior passes. MLX additionally allows omitted or None axes. test_squeeze Passed
stack(arrays, /, *, axis=0) stack(arrays: list[array], axis: int | None = 0, *, stream=None) compatible Required behavior passes. MLX additionally accepts positional axis, axis=None, and stream. test_stack Passed
tile(x, repetitions, /) tile(a, reps: int | Sequence[int], /, *, stream=None) compatible Required tiling behavior passes. The parameter-name difference is irrelevant because it is positional-only. test_tile Passed
unstack(x, /, *, axis=0) unstack(x, /, *, axis: int = 0, stream=None) -> list[array] incompatible Array API requires a tuple of arrays; MLX returns a list, including [] instead of () for an empty axis. test_unstack Failed
Dominant language
Python
Stars
131
Forks
49
Avg merge
2d 8h
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api-compat

All issues in data-apis/array-api-compat

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.