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
354f8482
Commit
354f8482
authored
Jul 20, 2019
by
Philipp Arras
Browse files
Support operators in tests which do not implement TIMES
parent
e7f235e5
Pipeline
#52199
passed with stages
in 8 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/extra.py
View file @
354f8482
...
...
@@ -70,6 +70,9 @@ def _full_implementation(op, domain_dtype, target_dtype, atol, rtol,
def
_check_linearity
(
op
,
domain_dtype
,
atol
,
rtol
):
needed_cap
=
op
.
TIMES
if
(
op
.
capability
&
needed_cap
)
!=
needed_cap
:
return
fld1
=
from_random
(
"normal"
,
op
.
domain
,
dtype
=
domain_dtype
)
fld2
=
from_random
(
"normal"
,
op
.
domain
,
dtype
=
domain_dtype
)
alpha
=
np
.
random
.
random
()
# FIXME: this can break badly with MPI!
...
...
@@ -121,6 +124,9 @@ def consistency_check(op, domain_dtype=np.float64, target_dtype=np.float64,
raise
TypeError
(
'This test tests only linear operators.'
)
_domain_check
(
op
)
_check_linearity
(
op
,
domain_dtype
,
atol
,
rtol
)
_check_linearity
(
op
.
adjoint
,
domain_dtype
,
atol
,
rtol
)
_check_linearity
(
op
.
inverse
,
domain_dtype
,
atol
,
rtol
)
_check_linearity
(
op
.
adjoint
.
inverse
,
domain_dtype
,
atol
,
rtol
)
_full_implementation
(
op
,
domain_dtype
,
target_dtype
,
atol
,
rtol
,
only_r_linear
)
_full_implementation
(
op
.
adjoint
,
target_dtype
,
domain_dtype
,
atol
,
rtol
,
...
...
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