Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
9b11f80b
Commit
9b11f80b
authored
May 15, 2020
by
Gordian Edenhofer
Browse files
test_einsum.py: Do not call pytest setup-functions
Plus, drop an unused variable.
parent
657e3f58
Pipeline
#75020
passed with stages
in 26 minutes and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_einsum.py
View file @
9b11f80b
...
...
@@ -24,7 +24,6 @@ from nifty6.extra import check_jacobian_consistency, consistency_check
import
nifty6
as
ift
from
..common
import
list2fixture
,
setup_function
,
teardown_function
pmp
=
pytest
.
mark
.
parametrize
spaces
=
(
ift
.
UnstructuredDomain
(
4
),
ift
.
RGSpace
((
3
,
2
)),
ift
.
LMSpace
(
5
),
...
...
@@ -36,8 +35,6 @@ dtype = list2fixture([np.float64, np.complex128])
def
test_linear_einsum_outer
(
space1
,
space2
,
dtype
,
n_invocations
=
10
):
setup_function
()
mf_dom
=
ift
.
MultiDomain
.
make
(
{
"dom01"
:
space1
,
...
...
@@ -65,12 +62,8 @@ def test_linear_einsum_outer(space1, space2, dtype, n_invocations=10):
r_adj
=
ift
.
from_random
(
"normal"
,
le
.
target
,
dtype
=
dtype
)
assert_allclose
(
le
.
adjoint
(
r_adj
).
val
,
le_ift
.
adjoint
(
r_adj
).
val
)
teardown_function
()
def
test_linear_einsum_contraction
(
space1
,
space2
,
dtype
,
n_invocations
=
10
):
setup_function
()
mf_dom
=
ift
.
MultiDomain
.
make
(
{
"dom01"
:
space1
,
...
...
@@ -98,14 +91,10 @@ def test_linear_einsum_contraction(space1, space2, dtype, n_invocations=10):
r_adj
=
ift
.
from_random
(
"normal"
,
le
.
target
,
dtype
=
dtype
)
assert_allclose
(
le
.
adjoint
(
r_adj
).
val
,
le_ift
.
adjoint
(
r_adj
).
val
)
teardown_function
()
def
test_multi_linear_einsum_outer
(
space1
,
space2
,
dtype
,
n_invocations
=
10
,
ntries
=
100
):
setup_function
()
mf_dom
=
ift
.
MultiDomain
.
make
(
{
"dom01"
:
space1
,
...
...
@@ -145,5 +134,3 @@ def test_multi_linear_einsum_outer(
mle_ift_j_val
=
mle_ift_rl
.
jac
.
adjoint
(
rj_adj
).
val
for
k
in
mle_ift
.
domain
.
keys
():
assert_allclose
(
mle_j_val
[
k
],
mle_ift_j_val
[
k
])
teardown_function
()
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