Skip to content

Commit 7802060

Browse files
YuanRishengpull[bot]
authored andcommitted
【Fix PIR Unittest No.6-15】Fix book/* and part of test_comp_* in PIR mode (#64124)
* fix unittest * fix unittest * fix cmake
1 parent 8b8e27f commit 7802060

17 files changed

+47
-94
lines changed

python/paddle/autograd/ir_backward.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import annotations
1616

1717
import logging
18+
import warnings
1819

1920
import paddle.pir
2021
from paddle.autograd.backward_utils import (
@@ -166,8 +167,8 @@ def prepare_grad_outputs(grad_outputs, outputs, state):
166167
% (i, str(grad.shape), i, str(output.shape))
167168
)
168169
if output.dtype != grad.dtype:
169-
raise ValueError(
170-
"The dtype of grad_output[%d] %s should be the same as the dtype of output[%d] %s"
170+
warnings.warn(
171+
"The dtype of grad_output[%d] %s is not same as the dtype of output[%d] %s"
171172
% (i, str(grad.dtype), i, str(output.dtype))
172173
)
173174
feedop = grad.get_defining_op()

test/deprecated/book/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ foreach(src ${TEST_OPS})
99
py_test(${src} SRCS ${src}.py)
1010
set_tests_properties(${src} PROPERTIES FIXTURES_SETUP ${src}_infer_model)
1111
endforeach()
12-
set_tests_properties(test_word2vec_book PROPERTIES TIMEOUT 120)
13-
set_tests_properties(test_recognize_digits PROPERTIES TIMEOUT 120)
14-
set_tests_properties(test_image_classification PROPERTIES TIMEOUT 200)
15-
set_tests_properties(test_fit_a_line PROPERTIES TIMEOUT 120)
12+
set_tests_properties(test_word2vec_book_deprecated PROPERTIES TIMEOUT 120)
13+
set_tests_properties(test_recognize_digits_deprecated PROPERTIES TIMEOUT 120)
14+
set_tests_properties(test_image_classification_deprecated PROPERTIES TIMEOUT
15+
200)
16+
set_tests_properties(test_fit_a_line_deprecated PROPERTIES TIMEOUT 120)
File renamed without changes.

test/deprecated/book/test_image_classification.py renamed to test/deprecated/book/test_image_classification_deprecated.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/deprecated/prim/prim/vjp/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ foreach(TEST_OP ${TEST_OPS})
88
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
99
endforeach()
1010

11-
add_subdirectory(eager)
1211
add_subdirectory(static)

test/deprecated/prim/prim/vjp/eager/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/deprecated/prim/prim/vjp/static/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ foreach(TEST_OP ${TEST_OPS})
99
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
1010
endforeach()
1111

12-
set_tests_properties(test_comp_tanh_grad PROPERTIES TIMEOUT 60)
1312
set_tests_properties(test_comp_div_grad PROPERTIES TIMEOUT 60)
1413
set_tests_properties(test_comp_add_grad PROPERTIES TIMEOUT 60)
1514
set_tests_properties(test_comp_sub_grad PROPERTIES TIMEOUT 60)

0 commit comments

Comments
 (0)