8000 MAINT: Fix computation of numpy.array_api.linalg.vector_norm by asmeurer · Pull Request #21084 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Fix computation of numpy.array_api.linalg.vector_norm #21084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into array-api-vector_norm-fix
  • Loading branch information
asmeurer committed Jun 15, 2022
commit 54e11844f0252c7f9b13badeb899beb416aaecf9
4 changes: 2 additions & 2 deletions numpy/linalg/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2562,8 +2562,8 @@ def norm(x, ord=None, axis=None, keepdims=False):
else:
absx = abs(x)
absx **= ord
ret = asarray(add.reduce(absx, axis=axis, keepdims=keepdims))
ret **= (1 / ord)
ret = add.reduce(absx, axis=axis, keepdims=keepdims)
ret **= reciprocal(ord, dtype=ret.dtype)
return ret
elif len(axis) == 2:
row_axis, col_axis = axis
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0