Skip to content

Commit

Permalink
correct implementation of separate relu unit
Browse files Browse the repository at this point in the history
  • Loading branch information
calebmkim committed Aug 23, 2023
1 parent ebba1d5 commit 502f427
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 1,143 deletions.
8 changes: 8 additions & 0 deletions calyx-py/calyx/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ def get_group(self, name: str) -> GroupBuilder:
f"Group `{name}' not found in component {self.component.name}"
)

def try_get_group(self, name: str) -> GroupBuilder:
"""Tries to get a group builder by name. If cannot find it, return None"""
out = self.index.get(name)
if out and isinstance(out, GroupBuilder):
return out
else:
return None

def group(self, name: str, static_delay: Optional[int] = None) -> GroupBuilder:
"""Create a new group with the given name and (optional) static delay."""
group = ast.Group(ast.CompVar(name), connections=[], static_delay=static_delay)
Expand Down
Loading

0 comments on commit 502f427

Please sign in to comment.