提交 c3527f55 编写于 作者: Y Yang Zhang 提交者: Tao Luo

Annotate NormOP test to skip grad check (#21894)

上级 fa8bab9c
...@@ -16,7 +16,7 @@ from __future__ import print_function ...@@ -16,7 +16,7 @@ from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
from op_test import OpTest from op_test import OpTest, skip_check_grad_ci
def l2_norm(x, axis, epsilon): def l2_norm(x, axis, epsilon):
...@@ -63,6 +63,8 @@ class TestNormOp3(TestNormOp): ...@@ -63,6 +63,8 @@ class TestNormOp3(TestNormOp):
self.epsilon = 1e-8 self.epsilon = 1e-8
@skip_check_grad_ci(reason="'check_grad' on large inputs is too slow, " +
"however it is desirable to cover the forward pass")
class TestNormOp4(TestNormOp): class TestNormOp4(TestNormOp):
def init_test_case(self): def init_test_case(self):
self.shape = [128, 1024, 14, 14] self.shape = [128, 1024, 14, 14]
...@@ -70,10 +72,11 @@ class TestNormOp4(TestNormOp): ...@@ -70,10 +72,11 @@ class TestNormOp4(TestNormOp):
self.epsilon = 1e-8 self.epsilon = 1e-8
def test_check_grad(self): def test_check_grad(self):
# since the gradient check is very slow in large shape, so skip check_grad
pass pass
@skip_check_grad_ci(reason="'check_grad' on large inputs is too slow, " +
"however it is desirable to cover the forward pass")
class TestNormOp5(TestNormOp): class TestNormOp5(TestNormOp):
def init_test_case(self): def init_test_case(self):
self.shape = [2048, 2048] self.shape = [2048, 2048]
...@@ -81,7 +84,6 @@ class TestNormOp5(TestNormOp): ...@@ -81,7 +84,6 @@ class TestNormOp5(TestNormOp):
self.epsilon = 1e-8 self.epsilon = 1e-8
def test_check_grad(self): def test_check_grad(self):
# since the gradient check is very slow in large shape, so skip check_grad
pass pass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册