Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
4cb24a5d
Commit
4cb24a5d
authored
Sep 03, 2018
by
Martin Reinecke
Browse files
one more fix
parent
542fba82
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/data_objects/distributed_do.py
View file @
4cb24a5d
...
@@ -570,5 +570,8 @@ def norm(arr, ord=2):
...
@@ -570,5 +570,8 @@ def norm(arr, ord=2):
return
absmax
(
arr
)
return
absmax
(
arr
)
tmp
=
np
.
asarray
(
np
.
linalg
.
norm
(
arr
.
_data
.
reshape
(
-
1
),
ord
=
ord
)
**
ord
)
tmp
=
np
.
asarray
(
np
.
linalg
.
norm
(
arr
.
_data
.
reshape
(
-
1
),
ord
=
ord
)
**
ord
)
res
=
np
.
empty_like
(
tmp
)
res
=
np
.
empty_like
(
tmp
)
_comm
.
Allreduce
(
tmp
,
res
,
MPI
.
SUM
)
if
len
(
arr
.
_data
.
shape
)
==
0
:
res
=
tmp
else
:
_comm
.
Allreduce
(
tmp
,
res
,
MPI
.
SUM
)
return
res
[()]
**
(
1.
/
ord
)
return
res
[()]
**
(
1.
/
ord
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment