Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Container registry
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
esde
machine-learning
MLAir
Commits
f2ccaa3d
Commit
f2ccaa3d
authored
5 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
#56
first test implementations
parent
90d6aa25
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!59
Develop
,
!46
Felix #56 advanced paddings
Pipeline
#30905
passed
5 years ago
Stage: test
Stage: pages
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_model_modules/test_advanced_paddings.py
+46
-0
46 additions, 0 deletions
test/test_model_modules/test_advanced_paddings.py
with
46 additions
and
0 deletions
test/test_model_modules/test_advanced_paddings.py
+
46
−
0
View file @
f2ccaa3d
import
keras
import
numpy
as
np
import
pytest
import
mock
import
os
from
src.model_modules.advanced_paddings
import
*
class
TestPadUtils
:
def
test_get_padding_for_same
(
self
):
with
pytest
.
raises
(
ValueError
):
pad_utils
.
get_padding_for_same
((
-
1
,
2
))
pad_utils
.
get_padding_for_same
((
1
,
0
))
kernel
=
(
1
,
1
)
pad
=
pad_utils
.
get_padding_for_same
(
kernel
)
assert
pad
==
(
0
,
0
)
assert
isinstance
(
pad
,
tuple
)
assert
isinstance
(
pad
[
0
],
int
)
and
isinstance
(
pad
[
1
],
int
)
assert
not
isinstance
(
pad
[
0
],
np
.
int64
)
with
pytest
.
raises
(
NotImplementedError
):
pad_utils
.
get_padding_for_same
(
kernel
,
strides
=
2
)
kernel
=
(
3
,
1
)
pad
=
pad_utils
.
get_padding_for_same
(
kernel
)
assert
pad
==
(
1
,
0
)
assert
isinstance
(
pad
,
tuple
)
assert
isinstance
(
pad
[
0
],
int
)
and
isinstance
(
pad
[
1
],
int
)
assert
not
isinstance
(
pad
[
0
],
np
.
int64
)
kernel
=
(
2
,
2
)
with
pytest
.
raises
(
NotImplementedError
):
pad_utils
.
get_padding_for_same
(
kernel
)
kernel
=
(
3
,
3
,
3
)
pad
=
pad_utils
.
get_padding_for_same
(
kernel
)
assert
pad
==
(
1
,
1
,
1
)
assert
isinstance
(
pad
,
tuple
)
assert
isinstance
(
pad
[
0
],
int
)
and
isinstance
(
pad
[
1
],
int
)
assert
not
(
isinstance
(
pad
[
0
],
np
.
int64
)
and
isinstance
(
pad
[
0
],
np
.
int64
))
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