Skip to content

Commit 2e71ff4

Browse files
authored
Merge pull request #796 from fastmachinelearning/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents eca1ea3 + 9d2e664 commit 2e71ff4

31 files changed

+3
-59
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ exclude: (^hls4ml\/templates\/(vivado|quartus)\/(ap_types|ac_types)\/|^test/pyte
22

33
repos:
44
- repo: https://github.com/psf/black
5-
rev: 22.12.0
5+
rev: 23.3.0
66
hooks:
77
- id: black
88
language_version: python3
@@ -30,7 +30,7 @@ repos:
3030
args: ["--profile", "black", --line-length=125]
3131

3232
- repo: https://github.com/asottile/pyupgrade
33-
rev: v3.3.1
33+
rev: v3.4.0
3434
hooks:
3535
- id: pyupgrade
3636
args: ["--py36-plus"]
@@ -41,7 +41,7 @@ repos:
4141
- id: setup-cfg-fmt
4242

4343
- repo: https://github.com/pycqa/flake8
44-
rev: 5.0.4
44+
rev: 6.0.0
4545
hooks:
4646
- id: flake8
4747
exclude: docs/conf.py

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

0 commit comments

Comments
 (0)