Skip to content

Commit adc7295

Browse files
committed
minor fix and issue #2185
1 parent 9d52c6a commit adc7295

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

py/torch_tensorrt/dynamo/conversion/converter_utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ def extend_attr_to_tuple(
175175
"""
176176
if not isinstance(val, (tuple, list)):
177177
val = (val,) * num_elem
178+
elif len(val) == 1:
179+
val = (val[0],) * num_elem
180+
178181
if isinstance(val, list):
179182
val = tuple(val)
180183
return val

py/torch_tensorrt/dynamo/conversion/impl/conv.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def convNd(
4646
)
4747

4848
# Process bias terms
49-
if isinstance(bias, torch.Tensor):
49+
if isinstance(bias, (torch.Tensor, np.ndarray)):
5050
# Transform the bias constant into a Numpy array
5151
bias = to_numpy(bias)
5252

@@ -67,7 +67,7 @@ def convNd(
6767
network, target, (weight, -1), {}, name + "_unsqueeze_weight"
6868
)
6969

70-
elif isinstance(weight, torch.Tensor):
70+
elif isinstance(weight, (torch.Tensor, np.ndarray)):
7171
# Transform the weight constant into a Numpy array
7272
weight = to_numpy(weight)
7373

0 commit comments

Comments
 (0)