Created by: zhangting2020
According to the current operator unit test requirements, all registered grad op must have check_grad method in its test case. This PR Adds checking for check_grad in Op unit tests.
Only the following cases can be allowed without gradient check:
-
Grad op is not registered https://github.com/PaddlePaddle/Paddle/blob/fbe3ac217e21b3b80f5cd19284ee9c20899ca919/paddle/fluid/operators/fill_constant_op.cc#L120-L131
-
special cases do not need to check grad, for instance, inference test case https://github.com/PaddlePaddle/Paddle/blob/fbe3ac217e21b3b80f5cd19284ee9c20899ca919/python/paddle/fluid/tests/unittests/test_seq_pool.py#L358-L368
For above situation, developers need to add op or test case to the op_check_grad_whitelist.py and changes for op_check_grad_whitelist.py need approval by specified reviewers.