Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
80efa41b
Commit
80efa41b
authored
3 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add a pyfaust unit test of a single factor BSR Faust.
parent
340a3818
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc/test/src/Python/test_FaustPy.py
+12
-0
12 additions, 0 deletions
misc/test/src/Python/test_FaustPy.py
with
12 additions
and
0 deletions
misc/test/src/Python/test_FaustPy.py
+
12
−
0
View file @
80efa41b
...
...
@@ -1684,6 +1684,18 @@ class TestFaustFactory(unittest.TestCase):
err
=
norm
(
F
.
toarray
()
-
DFT
)
/
norm
(
DFT
)
self
.
assertLessEqual
(
err
,
1e-6
)
def
test_single_bsr_Faust
(
self
):
from
scipy.sparse
import
bsr_matrix
from
pyfaust
import
Faust
from
numpy
import
allclose
from
numpy.random
import
rand
nzblocks
=
rand
(
3
,
2
,
3
)
# 3 blocks of size 2x3
# create a scipy BSR matrix
B
=
bsr_matrix
((
nzblocks
,
[
0
,
1
,
2
],
[
0
,
1
,
2
,
3
,
3
,
3
]),
shape
=
(
10
,
9
))
# create the single factor Faust
F
=
Faust
(
B
)
self
.
assertTrue
(
allclose
(
F
.
toarray
(),
B
.
toarray
()))
def
test_bsr_Faust
(
self
):
from
random
import
randint
from
scipy.sparse
import
random
...
...
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