@@ -218,7 +218,7 @@ def do_transformation(self):
218
218
219
219
if self .new_api and new_node .op in ('_QuantizedConv2D' , '_QuantizedDepthwiseConv2D' ):
220
220
input_data_type = dtypes .qint8 if new_node .attr ["Tinput" ].type == dtypes .qint8 else dtypes .quint8
221
- Helper .set_attr_type_list (new_node , 'input_types ' , [
221
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
222
222
input_data_type .as_datatype_enum ,
223
223
dtypes .qint8 .as_datatype_enum ,
224
224
dtypes .float32 .as_datatype_enum if new_node .attr ["Tbias" ].type == dtypes .float32 \
@@ -232,12 +232,12 @@ def do_transformation(self):
232
232
])
233
233
234
234
if quantized_node_op not in ('_QuantizedConv2D' , '_QuantizedDepthwiseConv2D' ):
235
- Helper .set_attr_type_list (new_node , 'out_types ' , self .output_types )
235
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , self .output_types )
236
236
new_node .attr ["Tsummand" ].CopyFrom (attr_value_pb2 .AttrValue (type = self .output_types [0 ]))
237
237
else :
238
238
if str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"_FusedHardSwish" ]):
239
239
self .fused_ops = [b"BiasAdd" , b"_FusedHardSwish" , b"Requantize" ]
240
- Helper .set_attr_type_list (new_node , 'out_types ' , [
240
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
241
241
requantize_node .attr ['out_type' ].type ,
242
242
dtypes .float32 .as_datatype_enum ,
243
243
dtypes .float32 .as_datatype_enum ])
@@ -247,7 +247,7 @@ def do_transformation(self):
247
247
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
248
248
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"_FusedSwish" ]):
249
249
self .fused_ops = [b"BiasAdd" , b"_FusedSwish" , b"Requantize" ]
250
- Helper .set_attr_type_list (new_node , 'out_types ' , [
250
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
251
251
requantize_node .attr ['out_type' ].type ,
252
252
dtypes .float32 .as_datatype_enum ,
253
253
dtypes .float32 .as_datatype_enum ])
@@ -257,7 +257,7 @@ def do_transformation(self):
257
257
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
258
258
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"Relu" ]):
259
259
self .fused_ops = [b"BiasAdd" , b"Relu" , b"Requantize" ]
260
- Helper .set_attr_type_list (new_node , 'out_types ' , [
260
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
261
261
requantize_node .attr ['out_type' ].type ,
262
262
dtypes .float32 .as_datatype_enum ,
263
263
dtypes .float32 .as_datatype_enum ])
@@ -267,7 +267,7 @@ def do_transformation(self):
267
267
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
268
268
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"LeakyRelu" ]):
269
269
self .fused_ops = [b"BiasAdd" , b"LeakyRelu" , b"Requantize" ]
270
- Helper .set_attr_type_list (new_node , 'out_types ' , [
270
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
271
271
requantize_node .attr ['out_type' ].type ,
272
272
dtypes .float32 .as_datatype_enum ,
273
273
dtypes .float32 .as_datatype_enum ])
@@ -277,7 +277,7 @@ def do_transformation(self):
277
277
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
278
278
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"Elu" ]):
279
279
self .fused_ops = [b"BiasAdd" , b"Elu" , b"Requantize" ]
280
- Helper .set_attr_type_list (new_node , 'out_types ' , [
280
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
281
281
requantize_node .attr ['out_type' ].type ,
282
282
dtypes .float32 .as_datatype_enum ,
283
283
dtypes .float32 .as_datatype_enum ])
@@ -287,7 +287,7 @@ def do_transformation(self):
287
287
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
288
288
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" ]):
289
289
self .fused_ops = [b"BiasAdd" , b"Requantize" ]
290
- Helper .set_attr_type_list (new_node , 'out_types ' , [
290
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
291
291
requantize_node .attr ['out_type' ].type ,
292
292
dtypes .float32 .as_datatype_enum ,
293
293
dtypes .float32 .as_datatype_enum ])
@@ -296,7 +296,7 @@ def do_transformation(self):
296
296
Helper .set_attr_dtype (new_node , "Tsummand" , \
297
297
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
298
298
elif len (quantized_node .attr ['fused_ops' ].list .s ) == 0 :
299
- Helper .set_attr_type_list (new_node , 'input_types ' , [
299
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
300
300
input_data_type .as_datatype_enum ,
301
301
dtypes .qint8 .as_datatype_enum ,
302
302
#dtypes.float32.as_datatype_enum if new_node.attr["Tbias"].type == dtypes.float32 \
@@ -309,7 +309,7 @@ def do_transformation(self):
309
309
dtypes .float32 .as_datatype_enum ,
310
310
])
311
311
self .fused_ops = [b"Requantize" ]
312
- Helper .set_attr_type_list (new_node , 'out_types ' , [
312
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
313
313
requantize_node .attr ['out_type' ].type ,
314
314
dtypes .float32 .as_datatype_enum ,
315
315
dtypes .float32 .as_datatype_enum ])
@@ -326,7 +326,7 @@ def do_transformation(self):
326
326
input_data_type = dtypes .qint8 if new_node .attr ["Tinput" ].type == dtypes .qint8 else dtypes .quint8
327
327
if len (quantized_node .attr ['fused_ops' ].list .s ) == 0 :
328
328
Helper .set_attr_string_list (new_node , 'fused_ops' , [ b'Requantize' ])
329
- Helper .set_attr_type_list (new_node , 'input_types ' , [
329
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
330
330
input_data_type .as_datatype_enum ,
331
331
dtypes .qint8 .as_datatype_enum ,
332
332
dtypes .float32 .as_datatype_enum ,
@@ -336,7 +336,7 @@ def do_transformation(self):
336
336
dtypes .float32 .as_datatype_enum ,
337
337
dtypes .float32 .as_datatype_enum ,
338
338
])
339
- Helper .set_attr_type_list (new_node , 'out_types ' , [
339
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
340
340
requantize_node .attr ['out_type' ].type ,
341
341
dtypes .float32 .as_datatype_enum ,
342
342
dtypes .float32 .as_datatype_enum ])
@@ -346,7 +346,7 @@ def do_transformation(self):
346
346
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
347
347
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" ]):
348
348
Helper .set_attr_string_list (new_node , 'fused_ops' , [b'BiasAdd' , b'Requantize' ])
349
- Helper .set_attr_type_list (new_node , 'input_types ' , [
349
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
350
350
input_data_type .as_datatype_enum ,
351
351
dtypes .qint8 .as_datatype_enum ,
352
352
dtypes .float32 .as_datatype_enum if new_node .attr ["Tbias" ].type == dtypes .float32 else \
@@ -358,7 +358,7 @@ def do_transformation(self):
358
358
dtypes .float32 .as_datatype_enum ,
359
359
dtypes .float32 .as_datatype_enum ,
360
360
])
361
- Helper .set_attr_type_list (new_node , 'out_types ' , [
361
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
362
362
requantize_node .attr ['out_type' ].type ,
363
363
dtypes .float32 .as_datatype_enum ,
364
364
dtypes .float32 .as_datatype_enum ])
@@ -368,7 +368,7 @@ def do_transformation(self):
368
368
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
369
369
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b"BiasAdd" , b"Relu" ]):
370
370
Helper .set_attr_string_list (new_node , 'fused_ops' , [b'BiasAdd' , b'Relu' , b'Requantize' ])
371
- Helper .set_attr_type_list (new_node , 'input_types ' , [
371
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
372
372
input_data_type .as_datatype_enum ,
373
373
dtypes .qint8 .as_datatype_enum ,
374
374
dtypes .float32 .as_datatype_enum if new_node .attr ["Tbias" ].type == dtypes .float32 else \
@@ -380,7 +380,7 @@ def do_transformation(self):
380
380
dtypes .float32 .as_datatype_enum ,
381
381
dtypes .float32 .as_datatype_enum ,
382
382
])
383
- Helper .set_attr_type_list (new_node , 'out_types ' , [
383
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
384
384
requantize_node .attr ['out_type' ].type ,
385
385
dtypes .float32 .as_datatype_enum ,
386
386
dtypes .float32 .as_datatype_enum ])
@@ -497,7 +497,7 @@ def do_transformation(self):
497
497
new_node .ClearField ('input' )
498
498
new_node .input .extend (new_input )
499
499
input_data_type = dtypes .qint8 if new_node .attr ["Tinput" ].type == dtypes .qint8 else dtypes .quint8
500
- Helper .set_attr_type_list (new_node , 'input_types ' , [
500
+ Helper .set_attr_type_list (new_node , 'Thost_inputs ' , [
501
501
input_data_type .as_datatype_enum ,
502
502
dtypes .qint8 .as_datatype_enum ,
503
503
dtypes .float32 .as_datatype_enum ,
@@ -515,23 +515,23 @@ def do_transformation(self):
515
515
else dtypes .qint8 )
516
516
if str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b'BiasAdd' , b'Sum' , b'Relu' ]):
517
517
self .fused_ops = [b'BiasAdd' , b'Sum' , b'Relu' , b'Requantize' ]
518
- Helper .set_attr_type_list (new_node , 'out_types ' , [
518
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
519
519
requantize_node .attr ['out_type' ].type ,
520
520
dtypes .float32 .as_datatype_enum ,
521
521
dtypes .float32 .as_datatype_enum ])
522
522
Helper .set_attr_dtype (new_node , "out_type" , \
523
523
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
524
524
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b'BiasAdd' , b'Relu' , b'Sum' ]):
525
525
self .fused_ops = [b'BiasAdd' , b'Relu' , b'Sum' , b'Requantize' ]
526
- Helper .set_attr_type_list (new_node , 'out_types ' , [
526
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
527
527
requantize_node .attr ['out_type' ].type ,
528
528
dtypes .float32 .as_datatype_enum ,
529
529
dtypes .float32 .as_datatype_enum ])
530
530
Helper .set_attr_dtype (new_node , "out_type" , \
531
531
dtype_map_dict [requantize_node .attr ['out_type' ].type ])
532
532
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b'BiasAdd' , b'LeakyRelu' , b'Sum' ]):
533
533
self .fused_ops = [b'BiasAdd' , b'LeakyRelu' , b'Sum' , b'Requantize' ]
534
- Helper .set_attr_type_list (new_node , 'out_types ' , [
534
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
535
535
requantize_node .attr ['out_type' ].type ,
536
536
dtypes .float32 .as_datatype_enum ,
537
537
dtypes .float32 .as_datatype_enum ])
@@ -543,7 +543,7 @@ def do_transformation(self):
543
543
544
544
elif str (quantized_node .attr ['fused_ops' ].list .s ) == str ([b'BiasAdd' , b'Sum' ]):
545
545
self .fused_ops = [b'BiasAdd' , b'Sum' , b'Requantize' ]
546
- Helper .set_attr_type_list (new_node , 'out_types ' , [
546
+ Helper .set_attr_type_list (new_node , 'Thost_outputs ' , [
547
547
requantize_node .attr ['out_type' ].type ,
548
548
dtypes .float32 .as_datatype_enum ,
549
549
dtypes .float32 .as_datatype_enum ])
0 commit comments