Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Nov 9, 2024
1 parent 0c2e90e commit 7df1e0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions hls4ml/backends/fpga/passes/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def transform(self, model, node):
out_var = node.get_output_variable(output)
attrs = {'size': np.prod(out_var.shape)}

i0 = 1
init_stream_idx = 1
if in_output:
# If the value is used as output, add one extra stream
idx = node.model.outputs.index(node.name)
node.model.outputs[idx] = node.name + '_cpy1'
i0 = 2
for i, layer in enumerate(output_map[output], i0):
init_stream_idx = 2
for i, layer in enumerate(output_map[output], init_stream_idx):
idx = layer.inputs.index(output)
layer.inputs[idx] = output + f'_cpy{i}'

Expand Down
13 changes: 8 additions & 5 deletions hls4ml/model/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,18 @@ def insert_node(self, node, before=None, input_idx=0):
def remove_node(self, node, rewire=True):
"""Remove a node from a graph.
By default, this function can connect the outputs of previous node to the input of next one. If the removed node has multiple inputs/outputs tensors, an exception is raised.
By default, this function can connect the outputs of previous
node to the input of next one. If the removed node has multiple
inputs/outputs tensors, an exception is raised.
Args:
node (Layer): The node to remove
rewire (bool, optional): Deprecated, no effect
node (Layer): The node to remove rewire (bool, optional):
Deprecated, no effect
Raises:
Exception: If an attempt is made to rewire a node with multiple inputs/outputs.
""" # noqa: E501
Exception: If an attempt is made to rewire a node with
multiple inputs/outputs.
"""

inputs = [inp for inp in node.inputs if inp]
outputs = [outp for outp in node.outputs if outp]
Expand Down

0 comments on commit 7df1e0d

Please sign in to comment.