@@ -80,7 +80,7 @@ def trt_transposed_linear_converter(network, target, args, kwargs, name):
80
80
trt .MatrixOperation .NONE ,
81
81
)
82
82
set_layer_name (layer , target , f"{ name } _mm" )
83
- return operator . add_binary_elementwise_layer (
83
+ return add_binary_elementwise_layer (
84
84
network ,
85
85
layer .get_output (0 ),
86
86
bias ,
@@ -679,7 +679,7 @@ def acc_ops_batch_norm(
679
679
680
680
@tensorrt_converter (acc_ops .layer_norm )
681
681
def acc_ops_layer_norm (network , target , args , kwargs , name ):
682
- return operator . add_layer_norm (network , target , kwargs , name )
682
+ return add_layer_norm (network , target , kwargs , name )
683
683
684
684
@tensorrt_converter (acc_ops .softmax )
685
685
def acc_ops_softmax (
@@ -730,7 +730,7 @@ def acc_ops_tile(
730
730
kwargs : Dict [str , Argument ],
731
731
name : str ,
732
732
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
733
- return operator . add_tile (network , target , kwargs , name )
733
+ return add_tile (network , target , kwargs , name )
734
734
735
735
@tensorrt_converter (acc_ops .sign )
736
736
def acc_ops_sign (
@@ -758,7 +758,7 @@ def acc_ops_relu(
758
758
kwargs : Dict [str , Argument ],
759
759
name : str ,
760
760
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
761
- return activation . add_relu (network , target , kwargs , name )
761
+ return add_relu (network , target , kwargs , name )
762
762
763
763
@tensorrt_converter (acc_ops .leaky_relu )
764
764
def acc_ops_leaky_relu (
@@ -768,7 +768,7 @@ def acc_ops_leaky_relu(
768
768
kwargs : Dict [str , Argument ],
769
769
name : str ,
770
770
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
771
- return activation . add_leaky_relu (network , target , kwargs , name )
771
+ return add_leaky_relu (network , target , kwargs , name )
772
772
773
773
@tensorrt_converter (acc_ops .elu )
774
774
def acc_ops_elu (
@@ -778,7 +778,7 @@ def acc_ops_elu(
778
778
kwargs : Dict [str , Argument ],
779
779
name : str ,
780
780
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
781
- return activation . add_elu (network , target , kwargs , name )
781
+ return add_elu (network , target , kwargs , name )
782
782
783
783
@tensorrt_converter (acc_ops .selu )
784
784
def acc_ops_selu (
@@ -788,7 +788,7 @@ def acc_ops_selu(
788
788
kwargs : Dict [str , Argument ],
789
789
name : str ,
790
790
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
791
- return activation . add_selu (network , target , kwargs , name )
791
+ return add_selu (network , target , kwargs , name )
792
792
793
793
@tensorrt_converter (acc_ops .softsign )
794
794
def acc_ops_softsign (
@@ -798,7 +798,7 @@ def acc_ops_softsign(
798
798
kwargs : Dict [str , Argument ],
799
799
name : str ,
800
800
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
801
- return activation . add_softsign (network , target , kwargs , name )
801
+ return add_softsign (network , target , kwargs , name )
802
802
803
803
@tensorrt_converter (acc_ops .sin )
804
804
def acc_ops_sin (
@@ -873,7 +873,7 @@ def acc_ops_tanh(
873
873
kwargs : Dict [str , Argument ],
874
874
name : str ,
875
875
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
876
- return activation . add_tanh (network , target , kwargs , name )
876
+ return add_tanh (network , target , kwargs , name )
877
877
878
878
@tensorrt_converter (acc_ops .asin )
879
879
def acc_ops_asin (
@@ -1190,7 +1190,7 @@ def acc_ops_maximum(
1190
1190
kwargs : Dict [str , Argument ],
1191
1191
name : str ,
1192
1192
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1193
- return operator . add_maximum (network , target , kwargs , name )
1193
+ return add_maximum (network , target , kwargs , name )
1194
1194
1195
1195
@tensorrt_converter (acc_ops .minimum )
1196
1196
def acc_ops_minimum (
@@ -1200,7 +1200,7 @@ def acc_ops_minimum(
1200
1200
kwargs : Dict [str , Argument ],
1201
1201
name : str ,
1202
1202
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1203
- return operator . add_minimum (network , target , kwargs , name )
1203
+ return add_minimum (network , target , kwargs , name )
1204
1204
1205
1205
@tensorrt_converter (acc_ops .dtype )
1206
1206
def acc_ops_dtype (
@@ -1269,7 +1269,7 @@ def acc_ops_logical_and(
1269
1269
kwargs : Dict [str , Argument ],
1270
1270
name : str ,
1271
1271
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1272
- return operator . add_logical_and (network , target , kwargs , name )
1272
+ return add_logical_and (network , target , kwargs , name )
1273
1273
1274
1274
@tensorrt_converter (acc_ops .ne , no_implicit_batch_dim = True )
1275
1275
def acc_ops_ne (
@@ -1279,7 +1279,7 @@ def acc_ops_ne(
1279
1279
kwargs : Dict [str , Argument ],
1280
1280
name : str ,
1281
1281
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1282
- return operator . add_ne (network , target , kwargs , name )
1282
+ return add_ne (network , target , kwargs , name )
1283
1283
1284
1284
@tensorrt_converter (acc_ops .eq , no_implicit_batch_dim = True )
1285
1285
def acc_ops_eq (
@@ -1289,7 +1289,7 @@ def acc_ops_eq(
1289
1289
kwargs : Dict [str , Argument ],
1290
1290
name : str ,
1291
1291
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1292
- return operator . add_eq (network , target , kwargs , name )
1292
+ return add_eq (network , target , kwargs , name )
1293
1293
1294
1294
@tensorrt_converter (acc_ops .gt , no_implicit_batch_dim = True )
1295
1295
def acc_ops_gt (
@@ -1299,7 +1299,7 @@ def acc_ops_gt(
1299
1299
kwargs : Dict [str , Argument ],
1300
1300
name : str ,
1301
1301
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1302
- return operator . add_gt (network , target , kwargs , name )
1302
+ return add_gt (network , target , kwargs , name )
1303
1303
1304
1304
@tensorrt_converter (acc_ops .lt , no_implicit_batch_dim = True )
1305
1305
def acc_ops_lt (
@@ -1309,7 +1309,7 @@ def acc_ops_lt(
1309
1309
kwargs : Dict [str , Argument ],
1310
1310
name : str ,
1311
1311
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1312
- return operator . add_lt (network , target , kwargs , name )
1312
+ return add_lt (network , target , kwargs , name )
1313
1313
1314
1314
1315
1315
@tensorrt_converter (acc_ops .logical_or , no_implicit_batch_dim = True )
@@ -1320,7 +1320,7 @@ def acc_ops_logical_or(
1320
1320
kwargs : Dict [str , Argument ],
1321
1321
name : str ,
1322
1322
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1323
- return operator . add_logical_or (network , target , kwargs , name )
1323
+ return add_logical_or (network , target , kwargs , name )
1324
1324
1325
1325
@tensorrt_converter (acc_ops .logical_xor , no_implicit_batch_dim = True )
1326
1326
def acc_ops_logical_xor (
@@ -1330,7 +1330,7 @@ def acc_ops_logical_xor(
1330
1330
kwargs : Dict [str , Argument ],
1331
1331
name : str ,
1332
1332
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1333
- return operator . add_logical_xor (network , target , kwargs , name )
1333
+ return add_logical_xor (network , target , kwargs , name )
1334
1334
1335
1335
# T113156424 Have some accuracy problems in hf_T5.
1336
1336
# [TRT] [W] Weights [name=isinf_1_inf_t]: Converted FP32 value in weights (either FP32 infinity or FP32 value outside FP16 range) to corresponding FP16 infinity. If this is not the desired behavior, please modify the weights or retrain with regularization to reduce the magnitude of the weights.
@@ -1423,7 +1423,7 @@ def acc_ops_fmod(
1423
1423
kwargs : Dict [str , Argument ],
1424
1424
name : str ,
1425
1425
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1426
- return operator . add_fmod (network , target , kwargs , name )
1426
+ return add_fmod (network , target , kwargs , name )
1427
1427
1428
1428
# T113156424 embedding implemenatation is very limited and shows no usage in hf models due to the indices are int64.
1429
1429
# if we cast to int32, it will create accuracy issues. We'd better leave it to future implementation.
@@ -1651,7 +1651,7 @@ def acc_ops_add(
1651
1651
kwargs : Dict [str , Argument ],
1652
1652
name : str ,
1653
1653
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1654
- return operator . add_add (network , target , kwargs , name )
1654
+ return add_add (network , target , kwargs , name )
1655
1655
1656
1656
@tensorrt_converter (acc_ops .sub )
1657
1657
def acc_ops_sub (
@@ -1661,7 +1661,7 @@ def acc_ops_sub(
1661
1661
kwargs : Dict [str , Argument ],
1662
1662
name : str ,
1663
1663
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1664
- return operator . add_sub (network , target , kwargs , name )
1664
+ return add_sub (network , target , kwargs , name )
1665
1665
1666
1666
@tensorrt_converter (acc_ops .div )
1667
1667
def acc_ops_div (
@@ -1671,7 +1671,7 @@ def acc_ops_div(
1671
1671
kwargs : Dict [str , Argument ],
1672
1672
name : str ,
1673
1673
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1674
- return operator . add_div (network , target , kwargs , name )
1674
+ return add_div (network , target , kwargs , name )
1675
1675
1676
1676
@tensorrt_converter (acc_ops .floor_div )
1677
1677
def acc_ops_floor_div (
@@ -1681,7 +1681,7 @@ def acc_ops_floor_div(
1681
1681
kwargs : Dict [str , Argument ],
1682
1682
name : str ,
1683
1683
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1684
- return operator . add_floor_div (network , target , kwargs , name )
1684
+ return add_floor_div (network , target , kwargs , name )
1685
1685
1686
1686
@tensorrt_converter (acc_ops .trunc_div )
1687
1687
def acc_ops_trunc_div (
@@ -1691,7 +1691,7 @@ def acc_ops_trunc_div(
1691
1691
kwargs : Dict [str , Argument ],
1692
1692
name : str ,
1693
1693
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1694
- return operator . add_trunc_div (network , target , kwargs , name )
1694
+ return add_trunc_div (network , target , kwargs , name )
1695
1695
1696
1696
@tensorrt_converter (acc_ops .mul )
1697
1697
def acc_ops_mul (
@@ -1701,7 +1701,7 @@ def acc_ops_mul(
1701
1701
kwargs : Dict [str , Argument ],
1702
1702
name : str ,
1703
1703
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1704
- return operator . add_mul (network , target , kwargs , name )
1704
+ return add_mul (network , target , kwargs , name )
1705
1705
1706
1706
@tensorrt_converter (acc_ops .pow )
1707
1707
def acc_ops_pow (
@@ -1711,7 +1711,7 @@ def acc_ops_pow(
1711
1711
kwargs : Dict [str , Argument ],
1712
1712
name : str ,
1713
1713
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1714
- return operator . add_pow (network , target , kwargs , name )
1714
+ return add_pow (network , target , kwargs , name )
1715
1715
1716
1716
@tensorrt_converter (acc_ops .unsqueeze )
1717
1717
def acc_ops_unsqueeze (
@@ -1981,7 +1981,7 @@ def acc_ops_slice_tensor(
1981
1981
kwargs : Dict [str , Argument ],
1982
1982
name : str ,
1983
1983
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1984
- return operator . add_slice (network , target , kwargs , name )
1984
+ return add_slice (network , target , kwargs , name )
1985
1985
1986
1986
1987
1987
@tensorrt_converter (acc_ops .expand )
@@ -1992,7 +1992,7 @@ def acc_ops_expand_tensor(
1992
1992
kwargs : Dict [str , Argument ],
1993
1993
name : str ,
1994
1994
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
1995
- return operator . add_expand (network , target , kwargs , name )
1995
+ return add_expand (network , target , kwargs , name )
1996
1996
1997
1997
1998
1998
@tensorrt_converter (acc_ops .where )
@@ -2214,7 +2214,7 @@ def acc_ops_linear(
2214
2214
kwargs : Dict [str , Argument ],
2215
2215
name : str ,
2216
2216
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2217
- return operator . add_linear (network , target , kwargs , name )
2217
+ return add_linear (network , target , kwargs , name )
2218
2218
2219
2219
def add_clamp (network , input , val , op , name ):
2220
2220
if not len (input .shape ):
@@ -2310,7 +2310,7 @@ def acc_ops_getitem(
2310
2310
input_val = kwargs ["input" ]
2311
2311
slices = kwargs ["idx" ]
2312
2312
if not isinstance (input_val , TRTTensor ):
2313
- return operator . getitem (input_val , slices ) # type: ignore[arg-type]
2313
+ return getitem (input_val , slices ) # type: ignore[arg-type]
2314
2314
2315
2315
if not isinstance (slices , tuple ) and not isinstance (slices , list ):
2316
2316
slices = (slices ,)
@@ -2467,7 +2467,7 @@ def acc_ops_matmul(
2467
2467
kwargs : Dict [str , Argument ],
2468
2468
name : str ,
2469
2469
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2470
- return operator . add_matmul (network , target , kwargs , name )
2470
+ return add_matmul (network , target , kwargs , name )
2471
2471
2472
2472
@tensorrt_converter (acc_ops .hardsigmoid )
2473
2473
def acc_ops_hard_sigmoid (
@@ -2477,7 +2477,7 @@ def acc_ops_hard_sigmoid(
2477
2477
kwargs : Dict [str , Argument ],
2478
2478
name : str ,
2479
2479
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2480
- return activation . add_hard_sigmoid (network , target , kwargs , name )
2480
+ return add_hard_sigmoid (network , target , kwargs , name )
2481
2481
2482
2482
2483
2483
@tensorrt_converter (acc_ops .sigmoid )
@@ -2488,7 +2488,7 @@ def acc_ops_sigmoid(
2488
2488
kwargs : Dict [str , Argument ],
2489
2489
name : str ,
2490
2490
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2491
- return activation . add_sigmoid (network , target , kwargs , name )
2491
+ return add_sigmoid (network , target , kwargs , name )
2492
2492
2493
2493
2494
2494
@tensorrt_converter (acc_ops .permute )
@@ -2689,7 +2689,7 @@ def acc_ops_gelu(
2689
2689
kwargs : Dict [str , Argument ],
2690
2690
name : str ,
2691
2691
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2692
- return activation . add_gelu (network , target , kwargs , name )
2692
+ return add_gelu (network , target , kwargs , name )
2693
2693
2694
2694
2695
2695
@tensorrt_converter (acc_ops .chunk )
@@ -2766,7 +2766,7 @@ def acc_ops_cumsum(
2766
2766
kwargs : Dict [str , Argument ],
2767
2767
name : str ,
2768
2768
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2769
- return operator . add_cumsum (network , target , kwargs , name )
2769
+ return add_cumsum (network , target , kwargs , name )
2770
2770
2771
2771
@tensorrt_converter (acc_ops .hardtanh )
2772
2772
def acc_ops_hardtanh (
@@ -2776,7 +2776,7 @@ def acc_ops_hardtanh(
2776
2776
kwargs : Dict [str , Argument ],
2777
2777
name : str ,
2778
2778
) -> Union [TRTTensor , Sequence [TRTTensor ]]:
2779
- return activation . add_hardtanh (network , target , kwargs , name )
2779
+ return add_hardtanh (network , target , kwargs , name )
2780
2780
2781
2781
@tensorrt_converter (acc_ops .interpolate )
2782
2782
def acc_ops_interpolate (
0 commit comments