Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Commits
42bd3e20
Commit
42bd3e20
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add first test for operation split
parent
eae8191f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#88148
passed
2 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/operation.py
+1
-1
1 addition, 1 deletion
b_asic/operation.py
test/test_operation.py
+9
-0
9 additions, 0 deletions
test/test_operation.py
with
10 additions
and
1 deletion
b_asic/operation.py
+
1
−
1
View file @
42bd3e20
...
@@ -735,7 +735,7 @@ class AbstractOperation(Operation, AbstractGraphComponent):
...
@@ -735,7 +735,7 @@ class AbstractOperation(Operation, AbstractGraphComponent):
try
:
try
:
result
=
self
.
evaluate
(
*
([
Input
()]
*
self
.
input_count
))
result
=
self
.
evaluate
(
*
([
Input
()]
*
self
.
input_count
))
if
isinstance
(
result
,
collections
.
Sequence
)
and
all
(
if
isinstance
(
result
,
collections
.
abc
.
Sequence
)
and
all
(
isinstance
(
e
,
Operation
)
for
e
in
result
isinstance
(
e
,
Operation
)
for
e
in
result
):
):
return
result
return
result
...
...
This diff is collapsed.
Click to expand it.
test/test_operation.py
+
9
−
0
View file @
42bd3e20
...
@@ -310,3 +310,12 @@ class TestIOCoordinates:
...
@@ -310,3 +310,12 @@ class TestIOCoordinates:
i_c
,
o_c
=
bfly
.
get_io_coordinates
()
i_c
,
o_c
=
bfly
.
get_io_coordinates
()
assert
i_c
==
[[
2
,
0.25
],
[
3
,
0.75
]]
assert
i_c
==
[[
2
,
0.25
],
[
3
,
0.75
]]
assert
o_c
==
[[
5
,
0.25
],
[
10
,
0.75
]]
assert
o_c
==
[[
5
,
0.25
],
[
10
,
0.75
]]
class
TestSplit
:
def
test_simple_case
(
self
):
bfly
=
Butterfly
()
split
=
bfly
.
split
()
assert
len
(
split
)
==
2
assert
sum
(
isinstance
(
op
,
Addition
)
for
op
in
split
)
==
1
assert
sum
(
isinstance
(
op
,
Subtraction
)
for
op
in
split
)
==
1
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