Integer isclose can disagree with the tolerance equation
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 34
- 分支
- 34
- 平均合併
- 1 小時 11 分鐘
- 30 天內合併 PR
- 33
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
data-apis/array-api-extra 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
data-apis/array-api-extra#1005 · 15 則留言 ·
維護者通常 1 天內回覆
-
enhancement new function
難度 2/5 1-3 小時 新手友好度 72/100
data-apis/array-api-extra#992 · 1 則留言 ·
維護者通常 1 天內回覆
-
`searchsorted` needs to broadcast batch shapes可能已有人在做 @nightcityblade 於 4 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 56/100
data-apis/array-api-extra#1014 · 2 則留言 ·
維護者通常 1 天內回覆
-
Two small JAX-related cleanups可能已有人在做 @nightcityblade 於 4 天前認領。 未關閉
難度 4/5 1-2 天 新手友好度 52/100
data-apis/array-api-extra#1011 · 2 則留言 ·
維護者通常 1 天內回覆
-
ENH, TST: Add support for MLX as array backend可能已有人在做 @prady0t 於 13 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 35/100
data-apis/array-api-extra#1006 ·
維護者通常 1 天內回覆
查看 data-apis/array-api-extra 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 77/100
TomerAberbach/profiler-md#733 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
維護者通常 1 天內回覆
-
area: client bug
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 85/100
leikoilja/ha-google-home#1107 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
Graphify-Labs/graphify#4524 · 1 則留言 ·
維護者通常 1 天內回覆