Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record autotest wrong code #5923

Merged
merged 29 commits into from
Aug 19, 2021
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
768f997
add log1p autotest
BBuf Aug 17, 2021
e3cea04
add log autotest
BBuf Aug 17, 2021
bcfcd6a
add autotest fake_code_gen
BBuf Aug 17, 2021
72ef599
refine code
BBuf Aug 17, 2021
912dd00
add code color
BBuf Aug 17, 2021
eec0eb4
add clear_note_fake_program
BBuf Aug 17, 2021
092ea7d
code format
BBuf Aug 17, 2021
4324094
fix clear list bug
BBuf Aug 17, 2021
31e241a
fix clear list bug
BBuf Aug 17, 2021
ff1668f
Merge branch 'master' into record_autotest_wrong_code
BBuf Aug 18, 2021
989732f
code format
BBuf Aug 18, 2021
a44b630
delete useless file
BBuf Aug 18, 2021
d9b9047
refine tensor method test
BBuf Aug 18, 2021
0c92e7a
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
1181d16
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
78f6dbd
fix comments
BBuf Aug 18, 2021
f8e6f42
Merge branch 'record_autotest_wrong_code' of github.com:Oneflow-Inc/o…
BBuf Aug 18, 2021
6d093b2
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
716669f
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
aedf013
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
0507a68
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
97d9139
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
62c5436
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
9eb01a3
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
a12126c
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
3198aa2
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
b62b94b
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 18, 2021
687ed9e
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 19, 2021
74f0854
Merge branch 'master' into record_autotest_wrong_code
oneflow-ci-bot Aug 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix comments
BBuf committed Aug 18, 2021
commit 78f6dbdbb5cbe03a1210eed495bf0e4e003ce606
Original file line number Diff line number Diff line change
@@ -166,7 +166,6 @@ def dual_method(self, *args, **kwargs):
try:
pytorch_res = pytorch(*pytorch_args, **pytorch_kwargs)
except Exception as e:
clear_note_fake_program()
raise PyTorchDoesNotSupportError(e)
if name in postulate:
oneflow_res = torch_tensor_to_flow(pytorch_res)
@@ -190,7 +189,6 @@ def dual_method(self, *args, **kwargs):
*pytorch_args, **pytorch_kwargs
)
except Exception as e:
clear_note_fake_program()
raise PyTorchDoesNotSupportError(e)
oneflow_res = oneflow_method(*oneflow_args, **oneflow_kwargs)
return GetDualObject("unused", pytorch_res, oneflow_res)
@@ -203,38 +201,38 @@ def dual_method(self, *args, **kwargs):


def note_print_args(x, end=True):
if end == True:
if type(x) is str:
print("\033[32m'{}'\033[0m".format(x), end=", ")
if end:
if isinstance(x, str):
print(f"\033[32m'{x}, '\033[0m", end="")
else:
print("\033[32m{}\033[0m".format(x), end=", ")
print(f"\033[32m{x}, \033[0m", end="")
else:
if type(x) is str:
print("\033[32m'{}'\033[0m".format(x), end="")
if isinstance(x, str):
print(f"\033[32m'{x}'\033[0m", end="")
else:
print("\033[32m{}\033[0m".format(x), end="")
print(f"\033[32m{x}\033[0m", end="")


def note_print_kwargs(x, y, end=True):
if end == True:
if type(y) is str:
print("\033[32m{}='{}'\033[0m".format(x, y), end=", ")
if end:
if isinstance(y, str):
print(f"\033[32m{x}='{y}, '\033[0m", end="")
else:
print("\033[32m{}={}\033[0m".format(x, y), end=", ")
print(f"\033[32m{x}={y}, \033[0m", end="")
else:
if type(y) is str:
print("\033[32m{}='{}'\033[0m".format(x, y), end="")
if isinstance(y, str):
print(f"\033[32m{x}='{y}'\033[0m", end="")
else:
print("\033[32m{}={}\033[0m".format(x, y), end="")
print(f"\033[32m{x}={y}\033[0m", end="")


def print_note_fake_program():
code_len = len(note_pytorch_method_names)
for i in range(code_len):
note_pytorch_args_len = len(note_pytorch_args[i])
note_pytorch_kwargs_len = len(note_pytorch_kwargs[i])
print("\033[32m{}\033[0m".format(note_pytorch_method_names[i]), end="")
print("\033[32m(\033[0m", end="")
print(f"\033[32m{note_pytorch_method_names[i]}\033[0m", end="")
print(f"\033[32m(\033[0m", end="")
if note_pytorch_args[i]:
index = 0
for x in note_pytorch_args[i]:
@@ -248,7 +246,7 @@ def print_note_fake_program():
note_print_kwargs(
x, note_pytorch_kwargs[i][x], index < note_pytorch_kwargs_len
)
print("\033[32m)\033[0m")
print(f"\033[32m)\033[0m")


def clear_note_fake_program():
@@ -370,7 +368,6 @@ def new_f(test_case):
if verbose:
print(e)
loop += 1
clear_note_fake_program()
continue
if res is not None:
if not isinstance(res, collections.abc.Sequence):