8000 ENH: add signature argument to vectorize for vectorizing like generalized ufuncs by shoyer · Pull Request #8054 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: add signature argument to vectorize for vectorizing like generalized ufuncs #8054

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 6 commits into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions doc/release/1.12.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Highlights
==========

* Order of operations in ``np.einsum`` now can be optimized for large speed improvements.
* New ``signature`` argument to ``np.vectorize`` for vectorizing with core dimensions.

Dropped Support
===============
Expand Down Expand Up @@ -328,6 +329,16 @@ an intermediate array to reduce this scaling to ``N^3`` or effectively
been applied to the general einsum summation notation. See ``np.einsum_path``
for more details.

New ``signature`` argument to ``np.vectorize``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This argument allows for vectorizing user defined functions with core
dimensions, in the style of NumPy's
:ref:`generalized universal functions<c-api.generalized-ufuncs>`. This allows
for vectorizing a much broader class of functions. For example, an arbitrary
distance metric that combines two vectors to produce a scalar could be
vectorized with ``signature='(n),(n)->()'``. See ``np.vectorize`` for full
details.

Changes
=======

Expand Down
2 changes: 2 additions & 0 deletions doc/source/reference/c-api.generalized-ufuncs.rst
8000
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _c-api.generalized-ufuncs:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add a reference to this doc page from the docstring for guvectorize. Do we have a standard way to do that? I guess a URL under "References" is probably most robust, though I was thinking a sphinx reference might work...


==================================
Generalized Universal Function API
==================================
Expand Down
Loading
0