Skip to content

Commit 844b0ad

Browse files
committed
fix: replace add_identity by add_cast for type cast
1 parent cc328e2 commit 844b0ad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

py/torch_tensorrt/fx/converters/converter_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,6 @@ def type_cast(
909909
"""
910910
This function helps to cast the input type to cast_type
911911
"""
912-
layer_i = network.add_identity(input)
913-
layer_i.set_output_type(0, cast_type)
912+
layer_i = network.add_cast(input, cast_type)
914913
set_layer_name(layer_i, target, f"{name}_dtype_change")
915914
return layer_i.get_output(0)

0 commit comments

Comments
 (0)