File tree 1 file changed +7
-11
lines changed
python/paddle/jit/sot/opcode_translator/executor/variables
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -1001,24 +1001,20 @@ def make_stringified_guard(self) -> list[StringifiedExpression]:
1001
1001
1002
1002
if self .need_guard_value :
1003
1003
return super ().make_stringified_guard ()
1004
- _type = self .get_py_type ()
1005
1004
guards = [
1006
1005
FasterStringifiedExpression (
1007
- f"id(type({{}})) == { id ( _type )} " ,
1006
+ f"id(type({{}})) == { self . get_py_type ( )} " ,
1008
1007
paddle .core .TypeMatchGuard (self .get_py_type ()),
1009
1008
[frame_value_tracer ],
1010
1009
union_free_vars (frame_value_tracer .free_vars ),
1011
1010
),
1011
+ # TODO: replace it with FasterStringifiedExpression
1012
+ StringifiedExpression (
1013
+ "{} >= 2" ,
1014
+ [frame_value_tracer ],
1015
+ union_free_vars (frame_value_tracer .free_vars ),
1016
+ ),
1012
1017
]
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
- )
1022
1018
return guards
1023
1019
1024
1020
@staticmethod
You can’t perform that action at this time.
0 commit comments