@@ -110,22 +110,22 @@ def reader():
110110 ):
111111 data_lines = df .readlines ()
112112 labels_lines = lf .readlines ()
113- assert len (data_lines ) == len (
114- labels_lines
115- ), "The number of labels does not match the length of the dataset."
113+ assert len (data_lines ) == len (labels_lines ), (
114+ "The number of labels does not match the length of the dataset."
115+ )
116116
117117 for i in range (len (data_lines )):
118118 data_fields = data_lines [i ].split (';' )
119- assert (
120- len ( data_fields ) >= 2
121- ), "The number of data fields in the dataset is less than 2"
119+ assert len ( data_fields ) >= 2 , (
120+ "The number of data fields in the dataset is less than 2"
121+ )
122122 buffers = []
123123 shape = []
124124 for j in range (2 ):
125125 data = data_fields [j ].split (':' )
126- assert (
127- len ( data ) >= 2
128- ), "Size of data in the dataset is less than 2"
126+ assert len ( data ) >= 2 , (
127+ "Size of data in the dataset is less than 2"
128+ )
129129 # Shape is stored under index 0, while data under 1
130130 shape = data [0 ].split ()
131131 shape .pop (0 )
@@ -287,13 +287,13 @@ def test_graph_transformation(self):
287287 return
288288
289289 quant_model_path = test_case_args .quant_model
290- assert (
291- quant_model_path
292- ), 'The Quant model path cannot be empty. Please, use the --quant_model option.'
290+ assert quant_model_path , (
291+ 'The Quant model path cannot be empty. Please, use the --quant_model option.'
292+ )
293293 data_path = test_case_args .infer_data
294- assert (
295- data_path
296- ), 'The dataset path cannot be empty. Please, use the --infer_data option.'
294+ assert data_path , (
295+ 'The dataset path cannot be empty. Please, use the --infer_data option.'
296+ )
297297 fp32_model_path = test_case_args .fp32_model
298298 labels_path = test_case_args .labels
299299 batch_size = test_case_args .batch_size
@@ -315,9 +315,9 @@ def test_graph_transformation(self):
315315 )
316316
317317 self ._targets = self ._strings_from_csv (test_case_args .targets )
318- assert self ._targets .intersection (
319- { ' quant' , ' int8' , ' fp32' }
320- ), 'The --targets option, if used, must contain at least one of the targets: "quant", "int8", "fp32".'
318+ assert self ._targets .intersection ({ 'quant' , 'int8' , 'fp32' }), (
319+ 'The --targets option, if used, must contain at least one of the targets: " quant", " int8", " fp32".'
320+ )
321321
322322 _logger .info ('Quant & INT8 prediction run.' )
323323 _logger .info (f'Quant model: { quant_model_path } ' )
0 commit comments