Commit 4cb24a5d authored by Martin Reinecke's avatar Martin Reinecke
Browse files

one more fix

parent 542fba82
......@@ -570,5 +570,8 @@ def norm(arr, ord=2):
return absmax(arr)
tmp = np.asarray(np.linalg.norm(arr._data.reshape(-1), ord=ord) ** ord)
res = np.empty_like(tmp)
_comm.Allreduce(tmp, res, MPI.SUM)
if len(arr._data.shape) == 0:
res = tmp
_comm.Allreduce(tmp, res, MPI.SUM)
return res[()] ** (1./ord)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment