Skip to content

Commit

Permalink
Merge pull request #734 from helmholtz-analytics/bug/731-local_op-out
Browse files Browse the repository at this point in the history
fix local_op + out distributed
  • Loading branch information
coquelin77 authored Mar 16, 2021
2 parents ebaf73c + 12e32ac commit 2f69e2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit 2f69e2e

Please sign in to comment.