MLX compatibility: Manipulation functions

Đang mở
#462 11 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data

Hướng nghiên cứu

Bắt đầu bằng cách chạy các bài kiểm tra tương thích được nêu tên: test_broadcast_arrays, test_moveaxis, test_unstack và các bài kiểm tra expand_dims, repeat, reshape và roll. Đọc các triển khai và kỳ vọng của bài kiểm tra cho từng trường hợp thất bại hoặc chưa hoàn thiện. Được coi là hoàn tất khi hành vi tương thích của MLX khớp với các yêu cầu của Array API được liệt kê trong bảng, bao gồm giá trị trả về dạng tuple, axes dạng tuple, các đầu vào repeat được chấp nhận, xử lý bản sao và các đối số chỉ dùng theo từ khóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
131
Fork
49
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
6

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của data-apis/array-api-compat

Tất cả issue của data-apis/array-api-compat

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.