Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
91c0f4fe
Commit
91c0f4fe
authored
5 years ago
by
Vincent Eberle
Browse files
Options
Downloads
Patches
Plain Diff
Test integration
parent
f3195322
No related branches found
No related tags found
1 merge request
!464
Integration operator
Pipeline
#75193
passed
5 years ago
Stage: build_docker
Stage: test
Stage: demo_runs
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_operators/test_integration.py
+15
-15
15 additions, 15 deletions
test/test_operators/test_integration.py
with
15 additions
and
15 deletions
test/test_operators/test_integration.py
+
15
−
15
View file @
91c0f4fe
...
@@ -25,24 +25,24 @@ from ..common import setup_function, teardown_function
...
@@ -25,24 +25,24 @@ from ..common import setup_function, teardown_function
def
test_integration_operator
():
def
test_integration_operator
():
x1
=
ift
.
RGSpace
((
9
,),
distances
=
2.
)
# FIXME: it works for distances = 1
x1
=
ift
.
RGSpace
((
9
,),
distances
=
2.
)
# FIXME: it works for distances = 1
#
x2 = ift.RGSpace((2, 12), distances=(0.3,))
x2
=
ift
.
RGSpace
((
2
,
12
),
distances
=
(
0.3
,))
dom1
=
ift
.
makeDomain
(
x1
)
dom1
=
ift
.
makeDomain
(
x1
)
#
dom2 = ift.makeDomain((x1, x2))
dom2
=
ift
.
makeDomain
((
x1
,
x2
))
f1
=
ift
.
from_random
(
'
normal
'
,
dom1
)
f1
=
ift
.
from_random
(
'
normal
'
,
dom1
)
#
f2 = ift.from_random('normal', dom2)
f2
=
ift
.
from_random
(
'
normal
'
,
dom2
)
op1
=
ift
.
ScalingOperator
(
dom1
,
1
)
op1
=
ift
.
ScalingOperator
(
dom1
,
1
)
#
op2 = ift.ScalingOperator(dom2, 1)
op2
=
ift
.
ScalingOperator
(
dom2
,
1
)
res1
=
f1
.
integrate
()
res1
=
f1
.
integrate
()
res2
=
op1
.
integrate
()(
f1
)
res2
=
op1
.
integrate
()(
f1
)
assert_allclose
(
res1
.
val
,
res2
.
val
)
assert_allclose
(
res1
.
val
,
res2
.
val
)
#
res3 = f2.integrate()
res3
=
f2
.
integrate
()
#
res4 = op2.integrate()(f2)
res4
=
op2
.
integrate
()(
f2
)
#
assert_allclose(res3.val, res4.val)
assert_allclose
(
res3
.
val
,
res4
.
val
)
#
res5 = f2.integrate(spaces=1)
res5
=
f2
.
integrate
(
spaces
=
1
)
#
res6 = op2.integrate(spaces=1)(f)
res6
=
op2
.
integrate
(
spaces
=
1
)(
f
2
)
#
assert_allclose(res5.val, res6.val)
assert_allclose
(
res5
.
val
,
res6
.
val
)
#
for op in [op1, op2]:
for
op
in
[
op1
,
op2
]:
#
ift.extra.consistency_check(op, domain_dtype=np.float64,
ift
.
extra
.
consistency_check
(
op
,
domain_dtype
=
np
.
float64
,
#
target_dtype=np.float64)
target_dtype
=
np
.
float64
)
#
ift.extra.consistency_check(op, domain_dtype=np.complex128,
ift
.
extra
.
consistency_check
(
op
,
domain_dtype
=
np
.
complex128
,
#
target_dtype=np.comple
y
128)
target_dtype
=
np
.
comple
x
128
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment