RFC: specify expected behavior for `matrix_norm` and `vector_norm` when provided an empty array

未关闭
#901 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
documentation

调研方向

阅读 matrix_norm 和 vector_norm 的规范条目,然后参考已链接的 NumPy pull request 和 Array API issue #232。完成的标准是 RFC 得出决定,并且规范明确记录在所述 ord 和 p 情况下对空输入的行为。

由索引模型根据 Issue 内容生成。

描述

RFC

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.

主要语言
Python
星标
281
派生
52
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

data-apis/array-api 的其他 Issue

查看 data-apis/array-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。