Skip to content
Snippets Groups Projects

Add a sink operation to avoid dangling nodes

Merged Hugo Winbladh requested to merge 132-add-a-sink-operation-to-avoid-dangling-nodes into master
2 unresolved threads

Closes #132 (closed)

Adds a sink operation

No tests were added because I didn't think there was a nice way to test something that does "nothing".

Edited by Hugo Winbladh

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1282
1283 def __init__(self, name: Name = ""):
1284 """Construct a Sink operation."""
1285 super().__init__(
1286 input_count=1,
1287 output_count=0,
1288 name=name,
1289 latency_offsets={"in0": 0},
1290 )
1291
1292 @classmethod
1293 def type_name(cls) -> TypeName:
1294 return TypeName("sink")
1295
1296 def evaluate(self):
1297 return self.param("value")
  • 1285 super().__init__(
    1286 input_count=1,
    1287 output_count=0,
    1288 name=name,
    1289 latency_offsets={"in0": 0},
    1290 )
    1291
    1292 @classmethod
    1293 def type_name(cls) -> TypeName:
    1294 return TypeName("sink")
    1295
    1296 def evaluate(self):
    1297 return self.param("value")
    1298
    1299 @property
    1300 def latency(self) -> int:
  • I think this is a good start. It should ideally be removed from schedules etc, but that can go in a later MR.

  • Btw, I think a suitable test may be like a two-port adaptor or a butterfly, where only one output is connected to an Output and the other to a Sink. Then check that an SFG can be created and that it only has one output etc. (Not sure that it errors currently if not both outputs are connected, but it should ideally...)

  • Hugo Winbladh added 4 commits

    added 4 commits

    • 53ab8d10 - add simple way to insert delays
    • 416dcf82 - Improve Winograd examples slighlty
    • af0213db - Documentation fixes
    • a0edea7c - raise exception for Sink.evaluate() and add simple test

    Compare with previous version

  • Oscar Gustafsson approved this merge request

    approved this merge request

  • Oscar Gustafsson added 6 commits

    added 6 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading