Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.ap
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
Model registry
Operate
Environments
Monitor
Incidents
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
bob
bob.ap
Commits
3a13d7a0
There was a problem fetching the pipeline summary.
Commit
3a13d7a0
authored
8 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-issue4' into 'master'
Fix crash of get_shape and add test. Fix for issue
#4
See merge request
!4
parents
3f422732
ada2453a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!4
Fix crash of get_shape and add test. Fix for issue #4
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/ap/frame_extractor.cpp
+1
-1
1 addition, 1 deletion
bob/ap/frame_extractor.cpp
bob/ap/test_energy.py
+3
-0
3 additions, 0 deletions
bob/ap/test_energy.py
with
4 additions
and
1 deletion
bob/ap/frame_extractor.cpp
+
1
−
1
View file @
3a13d7a0
...
@@ -468,7 +468,7 @@ static PyObject* PyBobApFrameExtractor_GetShapeArray
...
@@ -468,7 +468,7 @@ static PyObject* PyBobApFrameExtractor_GetShapeArray
PyBlitzArrayObject
*
input
=
0
;
PyBlitzArrayObject
*
input
=
0
;
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O&"
,
kwlist
,
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"O&"
,
kwlist
,
&
input
,
&
PyBlitzArray_Converter
))
return
0
;
&
PyBlitzArray_Converter
,
&
input
))
return
0
;
auto
input_
=
make_safe
(
input
);
auto
input_
=
make_safe
(
input
);
if
(
input
->
ndim
!=
1
||
input
->
type_num
!=
NPY_FLOAT64
)
{
if
(
input
->
ndim
!=
1
||
input
->
type_num
!=
NPY_FLOAT64
)
{
...
...
This diff is collapsed.
Click to expand it.
bob/ap/test_energy.py
+
3
−
0
View file @
3a13d7a0
...
@@ -61,10 +61,13 @@ def energy_computation(rate_wavsample, win_length_ms, win_shift_ms, normalize_me
...
@@ -61,10 +61,13 @@ def energy_computation(rate_wavsample, win_length_ms, win_shift_ms, normalize_me
def
energy_comparison_run
(
rate_wavsample
,
win_length_ms
,
win_shift_ms
,
normalize_mean
):
def
energy_comparison_run
(
rate_wavsample
,
win_length_ms
,
win_shift_ms
,
normalize_mean
):
c
=
Energy
(
rate_wavsample
[
0
],
win_length_ms
,
win_shift_ms
,
normalize_mean
)
c
=
Energy
(
rate_wavsample
[
0
],
win_length_ms
,
win_shift_ms
,
normalize_mean
)
shape_a
=
c
.
get_shape
(
rate_wavsample
[
1
])
A
=
c
(
rate_wavsample
[
1
])
A
=
c
(
rate_wavsample
[
1
])
B
=
energy_computation
(
rate_wavsample
,
win_length_ms
,
win_shift_ms
,
normalize_mean
)
B
=
energy_computation
(
rate_wavsample
,
win_length_ms
,
win_shift_ms
,
normalize_mean
)
shape_b
=
B
.
shape
assert
shape_a
!=
shape_b
diff
=
numpy
.
sum
(
numpy
.
sum
((
A
-
B
)
*
(
A
-
B
)))
diff
=
numpy
.
sum
(
numpy
.
sum
((
A
-
B
)
*
(
A
-
B
)))
assert
numpy
.
allclose
(
diff
,
0.
,
rtol
=
1e-07
,
atol
=
1e-05
)
assert
numpy
.
allclose
(
diff
,
0.
,
rtol
=
1e-07
,
atol
=
1e-05
)
...
...
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