diff options
author | Tina Oberoi <55803680+tinaoberoi@users.noreply.github.com> | 2020-05-09 11:16:58 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-09 08:46:58 +0300 |
commit | e66453568b685dee47d6e6e634b3a47edffcaeed (patch) | |
tree | 34c34c2061843da2bff0e1d5f88c70828b344829 /numpy | |
parent | d3e64fcf2b1c97d75bae731107cf01d6c0e37caa (diff) | |
download | numpy-e66453568b685dee47d6e6e634b3a47edffcaeed.tar.gz |
Update Docs : point users of np.outer to np.multiply.outer (#16182)
* Update notes for numpy.outer and numpy.multiply.outer
* Add tenserdot to numpy.outer documentation
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/_add_newdocs.py | 10 | ||||
-rw-r--r-- | numpy/core/numeric.py | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py index e54103634..f43b77c44 100644 --- a/numpy/core/_add_newdocs.py +++ b/numpy/core/_add_newdocs.py @@ -5009,7 +5009,7 @@ add_newdoc('numpy.core', 'ufunc', ('reduceat', """)) add_newdoc('numpy.core', 'ufunc', ('outer', - """ + r""" outer(A, B, **kwargs) Apply the ufunc `op` to all pairs (a, b) with a in `A` and b in `B`. @@ -5043,7 +5043,13 @@ add_newdoc('numpy.core', 'ufunc', ('outer', See Also -------- - numpy.outer + numpy.outer : A less powerful version of ``np.multiply.outer`` + that `ravel`\ s all inputs to 1D. This exists + primarily for compatibility with old code. + + tensordot : ``np.tensordot(a, b, axes=((), ()))`` and + ``np.multiply.outer(a, b)`` behave same for all + dimensions of a and b. Examples -------- diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 83d985a7c..17b435c74 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -857,8 +857,11 @@ def outer(a, b, out=None): -------- inner einsum : ``einsum('i,j->ij', a.ravel(), b.ravel())`` is the equivalent. - ufunc.outer : A generalization to N dimensions and other operations. - ``np.multiply.outer(a.ravel(), b.ravel())`` is the equivalent. + ufunc.outer : A generalization to dimensions other than 1D and other + operations. ``np.multiply.outer(a.ravel(), b.ravel())`` + is the equivalent. + tensordot : ``np.tensordot(a.ravel(), b.ravel(), axes=((), ()))`` + is the equivalent. References ---------- |