Skip to content

Commit da8f019

Browse files
committed
remove unnecessary cache
1 parent 330fe1c commit da8f019

File tree

1 file changed

+7
-11
lines changed
  • python/paddle/jit/sot/opcode_translator/executor/variables

1 file changed

+7
-11
lines changed

python/paddle/jit/sot/opcode_translator/executor/variables/basic.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,24 +1001,20 @@ def make_stringified_guard(self) -> list[StringifiedExpression]:
10011001

10021002
if self.need_guard_value:
10031003
return super().make_stringified_guard()
1004-
_type = self.get_py_type()
10051004
guards = [
10061005
FasterStringifiedExpression(
1007-
f"id(type({{}})) == {id(_type)}",
1006+
f"id(type({{}})) == {self.get_py_type()}",
10081007
paddle.core.TypeMatchGuard(self.get_py_type()),
10091008
[frame_value_tracer],
10101009
union_free_vars(frame_value_tracer.free_vars),
10111010
),
1011+
# TODO: replace it with FasterStringifiedExpression
1012+
StringifiedExpression(
1013+
"{} >= 2",
1014+
[frame_value_tracer],
1015+
union_free_vars(frame_value_tracer.free_vars),
1016+
),
10121017
]
1013-
# TODO: replace it with FasterStringifiedExpression
1014-
if _type is int:
1015-
guards.append(
1016-
StringifiedExpression(
1017-
"{} >= 2",
1018-
[frame_value_tracer],
1019-
union_free_vars(frame_value_tracer.free_vars),
1020-
)
1021-
)
10221018
return guards
10231019

10241020
@staticmethod

0 commit comments

Comments
 (0)