Skip to content

Commit 868efb7

Browse files
committed
add reviews
1 parent 2573d57 commit 868efb7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import inspect
2020
import itertools
2121
import operator
22+
import random
2223
import sys
2324
import types
2425
from functools import partial, reduce
@@ -325,8 +326,6 @@ def main_info(self) -> dict[str, Any]:
325326

326327
@staticmethod
327328
def __is_random_function(value) -> bool:
328-
import random
329-
330329
return value.__qualname__ in [
331330
f"{random._inst.__class__.__name__}.{name}"
332331
for name in dir(random._inst)

test/sot/test_force_breakgraph_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525

2626
def fn_randint(x):
2727
x = x + 1
28-
x = random.randint(0, 100)
28+
x = x + random.randint(0, 100)
2929
x = x + 2
3030
return x
3131

3232

3333
def fn_random(x):
3434
x = x + 3
35-
x = random.random()
35+
x = x + random.random()
3636
x = x + 4
3737
return x
3838

0 commit comments

Comments
 (0)