Skip to content

Commit 655aef6

Browse files
committed
precommit
1 parent a9bfc6a commit 655aef6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

hls4ml/converters/pytorch/core.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ def parse_activation_layer(operation, layer_name, input_names, input_shapes, nod
6161
layer['class_name'] = 'ThresholdedReLU'
6262
layer['activation'] = 'ThresholdedReLU'
6363
if layer['activ_param'] < 0:
64-
raise Exception('negative threshold values not supported')
64+
raise Exception('negative threshold values not supported')
6565
if hasattr(class_object, 'dim'):
6666
layer['axis'] = class_object.dim
6767
if layer['class_name'] == 'Softmax' and layer['axis'] is None:
68-
layer['axis'] = -1
69-
if 'IOType' in config:
70-
if layer['class_name'] == 'Softmax' and config['IOType'] == 'io_stream' and layer['axis'] != -1:
71-
raise Exception('dim needs to be -1 for io_stream')
68+
layer['axis'] = -1
69+
if 'IOType' in config:
70+
if layer['class_name'] == 'Softmax' and config['IOType'] == 'io_stream' and layer['axis'] != -1:
71+
raise Exception('dim needs to be -1 for io_stream')
7272
else:
7373
if layer['class_name'] in ['ReLU', 'Sigmoid', 'Tanh']:
7474
layer['class_name'] = 'Activation'
7575
if layer['class_name'] == 'LeakyReLU':
7676
layer['activ_param'] = node.kwargs['negative_slope']
7777
if layer['class_name'] == 'ELU':
78-
layer['activ_param'] = node.kwargs['alpha']
78+
layer['activ_param'] = node.kwargs['alpha']
7979
if layer['class_name'] == 'Threshold':
8080
layer['activ_param'] = node.args[1]
8181
if layer['activ_param'] < 0:
@@ -85,11 +85,11 @@ def parse_activation_layer(operation, layer_name, input_names, input_shapes, nod
8585
if 'dim' in node.kwargs:
8686
layer['axis'] = node.kwargs['dim']
8787
if layer['class_name'] == 'Softmax' and layer['axis'] is None:
88-
layer['axis'] = -1
89-
if 'IOType' in config:
90-
if layer['class_name'] == 'Softmax' and config['IOType'] == 'io_stream' and layer['axis'] != -1:
91-
raise Exception('dim needs to be -1 for io_stream')
92-
88+
layer['axis'] = -1
89+
if 'IOType' in config:
90+
if layer['class_name'] == 'Softmax' and config['IOType'] == 'io_stream' and layer['axis'] != -1:
91+
raise Exception('dim needs to be -1 for io_stream')
92+
9393
output_shape = input_shapes[0]
9494
return layer, output_shape
9595

0 commit comments

Comments
 (0)