提交 b1ec1d54 编写于 作者: J juncaipeng 提交者: Tao Luo

Delete check grad for int, collect op for now (#21922)

上级 2df4be5d
......@@ -202,8 +202,8 @@ class OpTest(unittest.TestCase):
if not hasattr(cls, "no_need_check_grad") \
and cls.op_type not in op_check_grad_white_list.EMPTY_GRAD_OP_LIST:
if cls.dtype is None or \
(cls.dtype in [np.float16, np.int64, np.int32, np.int16] \
and cls.op_type not in op_accuracy_white_list.NO_CHECK_GRAD_OP_LIST \
(cls.dtype == np.float16 \
and cls.op_type not in op_accuracy_white_list.NO_FP16_CHECK_GRAD_OP_LIST \
and not hasattr(cls, "exist_check_grad")):
raise AssertionError("This test of %s op needs check_grad." %
cls.op_type)
......
......@@ -16,7 +16,7 @@ from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest, skip_check_grad_ci
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid
......@@ -315,7 +315,6 @@ class TestBilinearInterpCase1Uint8(TestBilinearInterpOpUint8):
self.align_mode = 1
@skip_check_grad_ci(reason="uint8 type only be used in test and inference.")
class TestBilinearInterpCase2Uint8(TestBilinearInterpOpUint8):
def init_test_case(self):
self.interp_method = 'bilinear'
......
......@@ -180,7 +180,6 @@ class TestEmbedOpError(unittest.TestCase):
fluid.layers.embedding(input=input3, size=(10, 64), dtype='float16')
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestLookupTableOpInt8(OpTest):
def setUp(self):
self.op_type = "lookup_table"
......@@ -200,7 +199,6 @@ class TestLookupTableOpInt8(OpTest):
pass
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestLookupTableOpWithTensorIdsInt8(OpTest):
def setUp(self):
self.op_type = "lookup_table"
......@@ -220,7 +218,6 @@ class TestLookupTableOpWithTensorIdsInt8(OpTest):
pass
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestLookupTableOpWithPaddingInt8(TestLookupTableOpInt8):
def test_check_output(self):
ids = np.squeeze(self.inputs['Ids'])
......@@ -235,7 +232,6 @@ class TestLookupTableOpWithPaddingInt8(TestLookupTableOpInt8):
pass
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestLookupTableOpWithTensorIdsAndPaddingInt8(
TestLookupTableOpWithTensorIdsInt8):
def test_check_output(self):
......
......@@ -16,7 +16,7 @@ from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest, skip_check_grad_ci
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid
......@@ -278,7 +278,6 @@ class TestNearestNeighborInterpCase1Uint8(TestNearestInterpOpUint8):
self.align_corners = True
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestNearestNeighborInterpCase2Uint8(TestNearestInterpOpUint8):
def init_test_case(self):
self.interp_method = 'nearest'
......
......@@ -16,7 +16,7 @@ from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest, skip_check_grad_ci
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid
......@@ -381,7 +381,6 @@ class TestTrilinearInterpCase1Uint8(TestTrilinearInterpOpUint8):
self.align_mode = 1
@skip_check_grad_ci(reason="int8 type only be used in test and inference.")
class TestTrilinearInterpCase2Uint8(TestTrilinearInterpOpUint8):
def init_test_case(self):
self.interp_method = 'trilinear'
......
......@@ -33,9 +33,6 @@ NO_FP64_CHECK_GRAD_OP_LIST = [
'trilinear_interp', 'var_conv_2d', 'warpctc'
]
NO_CHECK_GRAD_OP_LIST = [
'cudnn_lstm', 'elementwise_div', 'elementwise_mul', 'elementwise_pow',
'expand', 'fused_elemwise_activation', 'increment', 'match_matrix_tensor',
'mul', 'pool2d', 'pool3d', 'relu', 'sigmoid', 'softmax', 'sqrt', 'tanh',
'transpose2', 'var_conv_2d'
NO_FP16_CHECK_GRAD_OP_LIST = [
'fused_elemwise_activation', 'pool2d', 'pool3d', 'softmax'
]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册