Skip to content

Commit 9d2e664

Browse files
[pre-commit.ci] auto fixes from pre-commit hooks
1 parent 5a59f62 commit 9d2e664

30 files changed

+0
-56
lines changed

contrib/kl_layer/kl_layer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def build(self, input_shape):
3434
super().build(input_shape)
3535

3636
def _merge_function(self, inputs):
37-
3837
mean = inputs[0]
3938
log_var = inputs[1]
4039

hls4ml/backends/fpga/fpga_backend.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ def product_type(self, data_T, weight_T):
391391
return product
392392

393393
def compute_conv1d_instructions(self, in_W, in_C, kernel_size=3, stride=1, pad=0):
394-
395394
# Current limitations
396395
assert pad == 0
397396

@@ -427,7 +426,6 @@ def compute_conv1d_instructions(self, in_W, in_C, kernel_size=3, stride=1, pad=0
427426
return (min_W, windows_int)
428427

429428
def compute_conv2d_instructions(self, in_H, in_W, in_C, kernel_size=3, stride=1, pad=0):
430-
431429
if isinstance(kernel_size, Iterable):
432430
kernel_height = kernel_size[0]
433431
kernel_width = kernel_size[1]

hls4ml/backends/quartus/passes/convolution_winograd.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def match(self, node):
8282
def transform(self, model, node):
8383
if isinstance(node, Conv1D):
8484
if node.get_attr('filt_width', 3) == 3:
85-
8685
# First, transpose to a format suitable for the Winograd algorithm (F, C, W)
8786
# Note, this assumes a format post-resource strategy optimizer, that is (F, W, C)
8887
# Therefore, (F, W, C) => (F, C, W)
@@ -127,7 +126,6 @@ def transform(self, model, node):
127126

128127
elif isinstance(node, Conv2D):
129128
if node.get_attr('filt_height', 3) == 3 and node.get_attr('filt_width', 3) == 3:
130-
131129
# First, transpose to a format suitable for the Winograd algorithm (F, C, H, W)
132130
# Note, this assumes a format post-resource strategy optimizer, that is (F, H, W, C)
133131
# Therefore, (F, H, W, C) => (F, C, H, W)

hls4ml/backends/quartus/quartus_backend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def create_initial_config(self, part='Arria10', clock_period=5, io_type='io_para
133133
return config
134134

135135
def build(self, model, synth=True, fpgasynth=False, log_level=1, cont_if_large_area=False):
136-
137136
"""
138137
Builds the project using Intel HLS compiler.
139138

hls4ml/backends/vivado/passes/recurrent_templates.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def __init__(self):
7979
self.mult2_template = recr_mult_config_template
8080

8181
def format(self, node):
82-
8382
params = self._default_config_params(node)
8483

8584
params['n_in'] = node.get_input_variable().dim_names[1]

hls4ml/backends/vivado/passes/resource_strategy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class ApplyResourceStrategy(OptimizerPass):
88
'''Transposes the weights to use the dense_resource matrix multiply routine'''
99

1010
def match(self, node):
11-
1211
node_matches = isinstance(node, (Dense, Conv1D, SeparableConv1D, Conv2D, SeparableConv2D, LSTM, GRU))
1312
is_resource_strategy = node.get_attr('strategy', '').lower() == 'resource'
1413
already_transformed = node.get_attr('_weights_transposed', False) is True

hls4ml/converters/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
# and is defined in this module (i.e., not imported)
5050
if callable(func) and hasattr(func, 'handles') and func.__module__ == lib.__name__:
5151
for layer in func.handles:
52-
5352
if model_type == 'keras':
5453
register_keras_layer_handler(layer, func)
5554
elif model_type == 'pytorch':

hls4ml/converters/keras/qkeras.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def get_quantizer_from_config(keras_layer, quantizer_var):
2020

2121
@keras_handler('QDense')
2222
def parse_qdense_layer(keras_layer, input_names, input_shapes, data_reader):
23-
2423
layer, output_shape = parse_dense_layer(keras_layer, input_names, input_shapes, data_reader)
2524

2625
layer['weight_quantizer'] = get_quantizer_from_config(keras_layer, 'kernel')
@@ -124,7 +123,6 @@ def parse_qactivation_layer(keras_layer, input_names, input_shapes, data_reader)
124123

125124
@keras_handler('QBatchNormalization')
126125
def parse_qbatchnorm_layer(keras_layer, input_names, input_shapes, data_reader):
127-
128126
layer, output_shape = parse_batchnorm_layer(keras_layer, input_names, input_shapes, data_reader)
129127

130128
layer['mean_quantizer'] = get_quantizer_from_config(keras_layer, 'mean')

hls4ml/converters/keras_to_hls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def get_model_arch(config):
191191

192192

193193
def parse_keras_model(model_arch, reader):
194-
195194
# This is a list of dictionaries to hold all the layer info we need to generate HLS
196195
layer_list = []
197196

hls4ml/converters/onnx/convolution.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
@onnx_handler('Conv')
1212
def parse_conv_layer(reader, node, inputs_map, input_shapes, graph, config):
13-
1413
layer = {}
1514
layer['name'] = node.name
1615
layer['data_format'] = 'channels_first' # ONNX's default is channel first
@@ -45,7 +44,6 @@ def parse_conv_layer(reader, node, inputs_map, input_shapes, graph, config):
4544
output_shape = [input_shapes[0][0], layer['n_filt'], layer['out_width']]
4645

4746
elif len(input_shapes[0]) == 4: # Conv2D
48-
4947
layer['class_name'] = 'Conv2D'
5048

5149
layer['in_height'] = input_shapes[0][2]

0 commit comments

Comments
 (0)