Skip to content

Commit

Permalink
better way to get inp layer name
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Feb 22, 2024
1 parent fce2f7d commit 0ffbdd6
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions hls4ml/backends/vivado/vivado_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,19 +375,8 @@ def init_depconv2d(self, layer):

def _set_pooling_accum_t(self, layer, pool_size):
extra_bits = ceil_log2(pool_size)
if 'inputs' in layer.attributes:
# Functional
input_layer_name = layer.attributes['inputs'][0]
else:
# Sequential
last_layer_name = None
for layer_name in layer.model.graph.keys():
if layer_name == layer.name:
break
last_layer_name = layer_name
assert last_layer_name is not None, 'Could not find previous layer.'
input_layer_name = last_layer_name

input_layer_name = layer.inputs[0]
input_layer = layer.model.graph[input_layer_name]
input_t = input_layer.attributes[input_layer.name].type
accum_t = layer.attributes['accum_t']
Expand Down

0 comments on commit 0ffbdd6

Please sign in to comment.