Integer isclose can disagree with the tolerance equation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Reproduce the two examples with array_api_extra.isclose and array_api_strict, then inspect the array-agnostic path and the Notes describing the tolerance equation. Clarify the intended integer semantics, including behavior for large int64/uint64 values; done means the chosen behavior is documented and the reported disagreements have corresponding coverage.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
On current main, the array-agnostic path gives two results that disagree with the displayed tolerance equation when using array_api_strict:
import array_api_extra as xpx
import array_api_strict as xp
def check(a, b, atol, rtol):
return bool(xpx.isclose(xp.asarray(a, dtype=xp.int8),
xp.asarray(b, dtype=xp.int8),
atol=atol, rtol=rtol))
print(check(0, 100, 30, 1.0)) # False; 100 <= 30 + 100
print(check(15, 10, 0, 0.4)) # True; 5 > 0.4 * 10
The first result appears to come from integer overflow in the tolerance sum; the second from truncating 1/rtol to an integer. The Notes currently introduce the tolerance equation for floating-point values. For integer inputs, should the agnostic path compare exact integer differences against the supplied scalar tolerances, or follow NumPy-like floating evaluation (including rounding large int64/uint64 values)? That choice affects a fix that also preserves large-integer comparisons.
- Ngôn ngữ chính
- Python
- Star
- 33
- Fork
- 33
- Merge trung bình
- 1 giờ 16 phút
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của data-apis/array-api-extra
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
data-apis/array-api-extra#1005 · 15 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ENH: new function `replace`Đang mởenhancement new function
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
data-apis/array-api-extra#992 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
data-apis/array-api-extra#1014 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Two small JAX-related cleanupsĐang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 52/100
data-apis/array-api-extra#1011 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ENH, TST: Add support for MLX as array backendCó thể đã có người làm @prady0t đã nhận 6 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
data-apis/array-api-extra#1006 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của data-apis/array-api-extra
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
topoteretes/cognee#5647 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Sendspin/sendspin-python-cli#291 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
awslabs/visual-asset-management-system#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/python-sdk#3670 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aicell-lab/bioengine#232 ·
Maintainer thường phản hồi trong vòng 1 ngày