Skip to content

Commit 3d65e2c

Browse files
committed
Fix the converter issue caused by this missing unset_fake_temporarily
1 parent 468a6e6 commit 3d65e2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/torch_tensorrt/dynamo/conversion/converter_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ def get_trt_tensor(
516516
# If the input is 64-bit, cast it to 32-bit for TRT freezing
517517
if isinstance(input_val, torch.Tensor) and ctx.compilation_settings.truncate_double:
518518
if input_val.dtype == torch.float64:
519-
input_val = input_val.to(torch.float32)
519+
with unset_fake_temporarily():
520+
input_val = input_val.to(torch.float32)
520521
elif isinstance(input_val, np.ndarray) and ctx.compilation_settings.truncate_double:
521522
if input_val.dtype == np.float64:
522523
input_val = input_val.astype(np.float32)

0 commit comments

Comments
 (0)