signature tests for floor_divide and remainder divide by 0
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the signature tests around _test_uninspectable_func and the cases for remainder and floor_divide. Reproduce the reported inputs with torch.tensor values and inspect array_api_compat/torch/_aliases.py:75. Done means the relevant tests explicitly handle the divide-by-zero behavior without an unexpected test failure.
Written by the indexing model from the issue text.
Description
This is a problem for torch, which raises ZeroDivisionError in this case (note that the spec leaves integer division by 0 unspecified).
For example:
x1 = tensor(0, dtype=torch.uint8), x2 = tensor(0, dtype=torch.uint8), kwargs = {}
@wraps(f)
def _f(x1, x2, /, **kwargs):
x1, x2 = _fix_promotion(x1, x2)
> return f(x1, x2, **kwargs)
E RuntimeError: ZeroDivisionError
E Falsifying example: _test_uninspectable_func(
E data=data(...),
E func_name='remainder',
E func=remainder,
E stub_sig=<Signature (x1: ~array, x2: ~array, /) -> ~array>,
E array=None,
E )
E Draw 1 (x1): tensor(0, dtype=torch.uint8)
E Draw 2 (x2): tensor(0, dtype=torch.uint8)
E trying remainder(tensor(0, dtype=torch.uint8), tensor(0, dtype=torch.uint8))
../array-api-compat/array_api_compat/torch/_aliases.py:75: RuntimeError
And similarly for floor_divide.
- Dominant language
- Python
- Stars
- 74
- Forks
- 54
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api-tests
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
data-apis/array-api-tests#465 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#460 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
data-apis/array-api-tests#455 · 2 comments ·
-
tracking
Difficulty 5/5 Over a week Newbie friendliness 25/100
data-apis/array-api-tests#381 · 9 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
data-apis/array-api-tests#379 · 10 comments ·
All issues in data-apis/array-api-tests
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/skills#1811 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
datalayer/mcp-compose#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UKGovernmentBEIS/inspect_evals#2523 ·