diff options
author | Nico Schlömer <nico.schloemer@gmail.com> | 2017-08-11 03:01:06 +0200 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-08-10 20:01:06 -0500 |
commit | 029863eae86b9df2de4b9a9843ca8f88c99130df (patch) | |
tree | ced3f88544979e2dc6f7eb327963c5d2688374ef /numpy/linalg/linalg.py | |
parent | 4c18530b1e3e428a3755c6847f70322ec12bdbc2 (diff) | |
download | numpy-029863eae86b9df2de4b9a9843ca8f88c99130df.tar.gz |
MAINT: Use moveaxis instead of rollaxis internally (#9475)
Also add a hint to the documentation advising the use of moveaxis over rollaxis.
Tests for rollaxis are left alone.
Diffstat (limited to 'numpy/linalg/linalg.py')
-rw-r--r-- | numpy/linalg/linalg.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index cd8999785..dd5ac6255 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -22,7 +22,7 @@ from numpy.core import ( array, asarray, zeros, empty, empty_like, transpose, intc, single, double, csingle, cdouble, inexact, complexfloating, newaxis, ravel, all, Inf, dot, add, multiply, sqrt, maximum, fastCopyAndTranspose, sum, isfinite, size, - finfo, errstate, geterrobj, longdouble, rollaxis, amin, amax, product, abs, + finfo, errstate, geterrobj, longdouble, moveaxis, amin, amax, product, abs, broadcast, atleast_2d, intp, asanyarray, isscalar, object_, ones ) from numpy.core.multiarray import normalize_axis_index @@ -2004,9 +2004,7 @@ def _multi_svd_norm(x, row_axis, col_axis, op): is `numpy.amin` or `numpy.amax` or `numpy.sum`. """ - if row_axis > col_axis: - row_axis -= 1 - y = rollaxis(rollaxis(x, col_axis, x.ndim), row_axis, -1) + y = moveaxis(x, (row_axis, col_axis), (-2, -1)) result = op(svd(y, compute_uv=0), axis=-1) return result |