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

fix local_op + out distributed #734

Merged
merged 4 commits into from
Mar 16, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
## Bug fixes
- [#709](https://github.com/helmholtz-analytics/heat/pull/709) Set the encoding for README.md in setup.py explicitly.
- [#716](https://github.com/helmholtz-analytics/heat/pull/716) Bugfix: Finding clusters by spectral gap fails when multiple diffs identical
- [#734](https://github.com/helmholtz-analytics/heat/pull/734) Fix division by zero error in `__local_op` with out != None on empty local arrays.
- [#735](https://github.com/helmholtz-analytics/heat/pull/735) Set return type to bool in relational functions.

# v0.5.2
Expand Down
2 changes: 1 addition & 1 deletion heat/core/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __local_op(operation, x, out, no_cast=False, **kwargs):
# PyTorch always recreates the input shape and ignores broadcasting for too large buffers
broadcast_shape = stride_tricks.broadcast_shape(x.lshape, out.lshape)
padded_shape = (1,) * (len(broadcast_shape) - len(x.lshape)) + x.lshape
multiples = [int(a / b) for a, b in zip(broadcast_shape, padded_shape)]
multiples = [(int(a / b) if b > 0 else 0) for a, b in zip(broadcast_shape, padded_shape)]
needs_repetition = builtins.any(multiple > 1 for multiple in multiples)

# do an inplace operation into a provided buffer
Expand Down