Skip to content

Commit 28813ab

Browse files
842974287Wei Wei
authored andcommitted
[fx2trt] fix test failures (#65)
Summary: Pull Request resolved: pytorch/fx2trt#65 pytorch/pytorch#73433 changes the default argument value of `value` in functional.pad from `0` to `None` which breaks fx2trt tests. Reviewed By: frank-wei, wushirong Differential Revision: D36076942 fbshipit-source-id: f6f6f869deb106e90b484fc07574790c0b6df46e
1 parent aecbd21 commit 28813ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fx/converters/acc_ops_converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def acc_ops_pad_with_padding_layer(
261261
input_val = kwargs["input"]
262262
pad = cast(Sequence[int], kwargs["pad"])
263263
mode = kwargs["mode"]
264-
value = kwargs["value"]
264+
value = kwargs["value"] if kwargs["value"] is not None else 0
265265
rank = len(input_val.shape) # type: ignore[union-attr]
266266

267267
if not isinstance(input_val, TRTTensor):
@@ -311,7 +311,7 @@ def acc_ops_pad_with_slice_layer(
311311
input_val = kwargs["input"]
312312
pad = cast(Sequence[int], kwargs["pad"])
313313
mode = kwargs["mode"]
314-
value = kwargs["value"]
314+
value = kwargs["value"] if kwargs["value"] is not None else 0
315315
rank = len(input_val.shape) # type: ignore[union-attr]
316316

317317
if not isinstance(input_val, TRTTensor):

0 commit comments

Comments
 (0)