RFC: specify expected behavior for `matrix_norm` and `vector_norm` when provided an empty array
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Read the specification entries for matrix_norm and vector_norm, then review the linked NumPy pull request and Array API issue #232 for precedent. Done means the RFC reaches a decision and the specification explicitly records behavior for empty inputs across the stated ord and p cases.
Written by the indexing model from the issue text.
Description
It would be useful for the specification to state the expected result of an empty norm (related to the discussion in https://github.com/numpy/numpy/pull/28343)
In https://github.com/data-apis/array-api/issues/232, it was decided that sum and prod of empty arays should return 0 and 1 respectively, as these are the additive and multiplicative identites, and for min and max to leave the behavior explicitly undefined.
If we extend this logic to matrix_norm, it implies that for ord='fro' or ord='nuc', the result for an empty matrix should be 0.0, and for other values of ord the behavior is undefined.
Extending this logic to vector_norm, it implies that for an empty vector the p-norm should be 0.0 for positive p; the correct behavior for negative and infinite p are less clear to me.
- Dominant language
- Python
- Stars
- 281
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Contributor guide
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
-
bug Maintenance Narrative Content
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Maintenance
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in data-apis/array-api
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·