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
30accef1
Commit
30accef1
authored
Feb 15, 2017
by
Theo Steininger
Browse files
Small fixes and optimizations for DiagonalOperator and LinearOperator.
parent
b8b3c138
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty/operators/diagonal_operator/diagonal_operator.py
View file @
30accef1
...
...
@@ -154,9 +154,7 @@ class DiagonalOperator(EndomorphicOperator):
# the one of x, reshape the local data of self and apply it directly
active_axes
=
[]
if
spaces
is
None
:
if
self
.
domain
!=
():
for
axes
in
x
.
domain_axes
:
active_axes
+=
axes
active_axes
=
range
(
len
(
x
.
shape
))
else
:
for
space_index
in
spaces
:
active_axes
+=
x
.
domain_axes
[
space_index
]
...
...
@@ -167,6 +165,8 @@ class DiagonalOperator(EndomorphicOperator):
local_diagonal
=
self
.
_diagonal
.
val
.
get_local_data
(
copy
=
False
)
else
:
# create an array that is sub-slice compatible
self
.
logger
.
warn
(
"The input field is not sub-slice compatible to "
"the distribution strategy of the operator."
)
redistr_diagonal_val
=
self
.
_diagonal
.
val
.
copy
(
distribution_strategy
=
axes_local_distribution_strategy
)
local_diagonal
=
redistr_diagonal_val
.
get_local_data
(
copy
=
False
)
...
...
nifty/operators/linear_operator/linear_operator.py
View file @
30accef1
...
...
@@ -127,7 +127,7 @@ class LinearOperator(Loggable, object):
self_domain
=
self
.
target
if
spaces
is
None
:
if
self_domain
!=
()
and
self_domain
!=
x
.
domain
:
if
self_domain
!=
x
.
domain
:
raise
ValueError
(
"The operator's and and field's domains don't "
"match."
)
...
...
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