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
de0a55da
Commit
de0a55da
authored
Jul 11, 2018
by
Martin Reinecke
Browse files
Merge branch 'null_operator' into 'NIFTy_5'
Null operator tweaks See merge request ift/nifty-dev!49
parents
093f8b06
43ce93de
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/operators/selection_operator.py
View file @
de0a55da
...
...
@@ -20,6 +20,7 @@ from __future__ import absolute_import, division, print_function
from
..compat
import
*
from
..multi.multi_domain
import
MultiDomain
from
..field
import
Field
from
.linear_operator
import
LinearOperator
...
...
@@ -53,7 +54,8 @@ class SelectionOperator(LinearOperator):
def
apply
(
self
,
x
,
mode
):
self
.
_check_input
(
x
,
mode
)
if
mode
==
self
.
TIMES
:
return
x
[
self
.
_key
]
f
=
x
[
self
.
_key
]
return
Field
.
full
(
self
.
target
,
0
)
if
f
is
None
else
f
else
:
from
..multi.multi_field
import
MultiField
return
MultiField
.
from_dict
({
self
.
_key
:
x
},
self
.
_domain
)
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