@@ -116,7 +116,7 @@ def acc_ops_conv1d(
116
116
# right now
117
117
if kwargs ["bias" ] is not None and not isinstance (kwargs ["bias" ], torch .Tensor ):
118
118
raise RuntimeError (
119
- f"linear { name } has bias of type { type (kwargs ['bias' ])} , Expect Optional[Tenosr ]"
119
+ f"linear { name } has bias of type { type (kwargs ['bias' ])} , Expect Optional[Tensor ]"
120
120
)
121
121
bias = to_numpy (kwargs ["bias" ]) # type: ignore[arg-type]
122
122
if bias is not None :
@@ -146,7 +146,7 @@ def acc_ops_conv1d(
146
146
else :
147
147
if not isinstance (kwargs ["weight" ], torch .Tensor ):
148
148
raise RuntimeError (
149
- f"linear { name } has weight of type { type (kwargs ['weight' ])} , Expect Optional[Tenosr ]"
149
+ f"linear { name } has weight of type { type (kwargs ['weight' ])} , Expect Optional[Tensor ]"
150
150
)
151
151
weight = to_numpy (weight )
152
152
weight = np .expand_dims (weight , - 1 )
@@ -202,11 +202,11 @@ def acc_ops_convnd(
202
202
# right now
203
203
if kwargs ["bias" ] is not None and not isinstance (kwargs ["bias" ], torch .Tensor ):
204
204
raise RuntimeError (
205
- f"linear { name } has bias of type { type (kwargs ['bias' ])} , Expect Optional[Tenosr ]"
205
+ f"linear { name } has bias of type { type (kwargs ['bias' ])} , Expect Optional[Tensor ]"
206
206
)
207
207
bias = to_numpy (kwargs ["bias" ]) # type: ignore[arg-type]
208
208
209
- if network .has_explicit_precision :
209
+ if network .has_explicit_precision or isinstance ( kwargs [ "weight" ], TRTTensor ) :
210
210
weight = get_trt_tensor (network , kwargs ["weight" ], f"{ name } _weight" )
211
211
weight_shape = tuple (kwargs ["weight" ].shape ) # type: ignore[union-attr]
212
212
# will need to use uninitialized weight and set it later to support
@@ -224,7 +224,7 @@ def acc_ops_convnd(
224
224
else :
225
225
if not isinstance (kwargs ["weight" ], torch .Tensor ):
226
226
raise RuntimeError (
227
- f"linear { name } has weight of type { type (kwargs ['weight' ])} , Expect Optional[Tenosr ]"
227
+ f"linear { name } has weight of type { type (kwargs ['weight' ])} , Expect Optional[Tensor ]"
228
228
)
229
229
weight = to_numpy (kwargs ["weight" ])
230
230
layer = network .add_convolution_nd (
@@ -276,7 +276,7 @@ def acc_ops_conv_transposend(
276
276
)
277
277
bias = to_numpy (kwargs ["bias" ]) # type: ignore[arg-type]
278
278
279
- if network .has_explicit_precision :
279
+ if network .has_explicit_precision or isinstance ( kwargs [ "weight" ], TRTTensor ) :
280
280
weight = get_trt_tensor (network , kwargs ["weight" ], f"{ name } _weight" )
281
281
weight_shape = tuple (kwargs ["weight" ].shape ) # type: ignore[union-attr]
282
282
# will need to use uninitialized weight and set it later to support
0 commit comments