Skip to content
GitLab
Menu
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
eef0b9c9
Commit
eef0b9c9
authored
Jun 22, 2018
by
Philipp Arras
Browse files
Performance tweak
parent
9f326661
Pipeline
#31628
failed with stages
in 3 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/selection_operator.py
View file @
eef0b9c9
...
...
@@ -17,7 +17,6 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from
..operators
import
LinearOperator
from
..sugar
import
full
class
SelectionOperator
(
LinearOperator
):
...
...
@@ -46,11 +45,5 @@ class SelectionOperator(LinearOperator):
if
mode
==
self
.
TIMES
:
return
x
[
self
.
_key
].
copy
()
else
:
result
=
{}
for
key
,
val
in
self
.
domain
.
items
():
if
key
!=
self
.
_key
:
result
[
key
]
=
full
(
val
,
0.
)
else
:
result
[
key
]
=
x
.
copy
()
from
..multi
import
MultiField
return
MultiField
(
result
)
return
MultiField
(
{
self
.
_key
:
x
}
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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