Skip to content
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

Drop repeat in _broadcast_uv #73

Merged
merged 2 commits into from
Oct 7, 2017
Merged

Drop repeat in _broadcast_uv #73

merged 2 commits into from
Oct 7, 2017

Conversation

jakirkham
Copy link
Owner

Drops the calls to repeat in _broadcast_uv and sticks with adding singleton dimensions where the repeat would have been applied. Had to rework the custom metric case with cdist, but otherwise everything worked smoothly with this change. Significantly cuts down on the graph overhead and computation time throughout the distance functions.

Having `repeat` adds a bit of overhead to the Dask. So we drop `repeat`
here and simply stick with adding singleton dimensions where needed. A
few things might need to get reworked as a consequence of this change,
but it is worth it to reduce the overhead.
Makes some changes to the internal `_cdist_apply` function so that it
can work without having `repeat` applied to dimensions. Namely drops the
singleton dimensions in both broadcasted arrays and indexes only into
the first dimension of each to get the point pair to compute the
distance between.
@jakirkham jakirkham merged commit 31d9cc8 into master Oct 7, 2017
@jakirkham jakirkham deleted the drop_broadcast_repeat branch October 7, 2017 00:30
@jakirkham jakirkham changed the title Drop repeat in _broadcast_uv Drop repeat in _broadcast_uv Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant