Modify test framework, test=develop (#21789)

*use dtype to determine whether check_grade is needed, and delete useless class
1.6.2
juncaipeng 5 years ago committed by GitHub
parent 557bce77da
commit fb067fa4d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

File diff suppressed because it is too large Load Diff

@ -108,6 +108,7 @@ def conv2dtranspose_forward_naive(input_, filter_, attrs):
class TestConv2dTransposeOp(OpTest):
def setUp(self):
# init as conv transpose
self.dtype = np.float32
self.is_test = False
self.use_cudnn = False
self.use_mkldnn = False

@ -34,6 +34,7 @@ def fsp_matrix(a, b):
return np.mean(a_r * b_r, axis=1)
@unittest.skip("Disable temporarily.")
class TestFSPOp(OpTest):
def setUp(self):
self.op_type = "fsp"
@ -49,11 +50,9 @@ class TestFSPOp(OpTest):
self.a_shape = (2, 3, 5, 6)
self.b_shape = (2, 4, 5, 6)
@unittest.skip("Disable temporarily.")
def test_check_output(self):
self.check_output()
@unittest.skip("Disable temporarily.")
def test_check_grad_normal(self):
self.check_grad(['X', 'Y'], 'Out')

@ -12,16 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# For op in FP16_CHECK_OP_LIST, the op test of fp16 precision should inherit OpTestFp16
FP16_CHECK_OP_LIST = [
'abs', 'acos', 'asin', 'atan', 'brelu', 'concat', 'cos', 'elementwise_div',
'elementwise_mul', 'elu', 'exp', 'gelu', 'hard_shrink', 'hard_swish', 'log',
'logsigmoid', 'mean', 'mul', 'pad', 'pool2d', 'pow', 'reciprocal', 'relu',
'relu6', 'scale', 'sigmoid', 'sin', 'slice', 'soft_relu', 'softmax',
'softmax_with_cross_entropy', 'softshrink', 'softsign', 'sqrt', 'square',
'stanh', 'sum', 'swish', 'tanh', 'tanh_shrink', 'thresholded_relu'
]
# For op in NO_FP64_CHECK_GRAD_OP_LIST, the op test requires check_grad with fp64 precision
NO_FP64_CHECK_GRAD_OP_LIST = [
'abs', 'acos', 'add_position_encoding', 'affine_grid', 'asin', 'atan',
@ -61,6 +51,3 @@ NO_FP64_CHECK_GRAD_OP_LIST = [
'unsqueeze', 'unsqueeze2', 'unstack', 'var_conv_2d', 'warpctc',
'yolov3_loss'
]
# For cases in NO_FP64_CHECK_GRAD_CASES, the op test requires check_grad with fp64 precision
NO_FP64_CHECK_GRAD_CASES = ['TestFSPOp']

Loading…
Cancel
Save