Skip to content

Commit d22a7f5

Browse files
committed
add back Vivado to tests, change pointwise to conv notation
1 parent ac70217 commit d22a7f5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

hls4ml/model/optimizer/passes/multi_dense.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def transform(self, model, node):
1818
dim = len(node.get_input_variable().shape) - 1
1919
input_shape = node.get_input_variable().shape
2020

21-
pointwise_attrs = {
21+
conv_attrs = {
2222
'data_format': 'channels_last',
2323
'padding': 'valid',
2424
'n_chan': input_shape[-1],
@@ -28,7 +28,7 @@ def transform(self, model, node):
2828
}
2929

3030
if dim == 1:
31-
pointwise_attrs.update(
31+
conv_attrs.update(
3232
{
3333
'in_width': input_shape[0],
3434
'out_width': input_shape[0],
@@ -39,7 +39,7 @@ def transform(self, model, node):
3939
}
4040
)
4141
elif dim == 2:
42-
pointwise_attrs.update(
42+
conv_attrs.update(
4343
{
4444
'in_height': input_shape[0],
4545
'in_width': input_shape[1],
@@ -59,7 +59,7 @@ def transform(self, model, node):
5959
raise Exception('Cannot replace Dense over {dim}D tensor with Conv{dim}D.'.format(dim=dim))
6060

6161
class_name = 'Conv' + str(dim) + 'D'
62-
pw_node = model.make_node(class_name, node.name, pointwise_attrs, node.inputs.copy())
63-
model.replace_node(node, pw_node)
62+
conv_node = model.make_node(class_name, node.name, conv_attrs, node.inputs.copy())
63+
model.replace_node(node, conv_node)
6464

6565
return True

test/pytest/test_multi_dense.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@pytest.mark.parametrize(
1414
'backend, strategy',
1515
[
16+
('Vivado', 'Latency'),
17+
('Vivado', 'Resource'),
1618
('Vitis', 'Latency'),
1719
('Vitis', 'Resource'),
1820
('Quartus', 'Resource'),

0 commit comments

Comments
 (0)