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
103fb0ba
Commit
103fb0ba
authored
Jun 15, 2018
by
Reimar H Leike
Browse files
added sample-functionality to sandwich operator when it is analytically possible
parent
1c04fe20
Pipeline
#31105
passed with stages
in 8 minutes and 49 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
nifty4/operators/sandwich_operator.py
View file @
103fb0ba
...
...
@@ -76,6 +76,12 @@ class SandwichOperator(EndomorphicOperator):
def
draw_sample
(
self
,
from_inverse
=
False
,
dtype
=
np
.
float64
):
# Inverse samples from general sandwiches is not possible
if
from_inverse
:
if
self
.
_bun
.
capabilities
&
self
.
_bun
.
INVERSE_TIMES
:
try
:
s
=
self
.
_cheese
.
draw_sample
(
from_inverse
,
dtype
)
return
self
.
_bun
.
inverse_times
(
s
)
except
:
pass
raise
NotImplementedError
(
"cannot draw from inverse of this operator"
)
...
...
Write
Preview
Markdown
is supported
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