Skip to content

Commit

Permalink
fix strided_slice ut (#53553)
Browse files Browse the repository at this point in the history
* fix strided_slice ut

* remove check_dygraph
  • Loading branch information
USTCKAY authored May 6, 2023
1 parent a5a0e8f commit 1d8c82b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/paddle/fluid/tests/unittests/test_strided_slice_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,10 @@ def test_check_grad_normal(self):
class TestStridedSliceAPI(unittest.TestCase):
def test_1(self):
input = np.random.random([3, 4, 5, 6]).astype("float64")
minus_1 = paddle.tensor.fill_constant([1], "int32", -1)
minus_3 = paddle.tensor.fill_constant([1], "int32", -3)
minus_1 = paddle.tensor.fill_constant([], "int32", -1)
minus_3 = paddle.tensor.fill_constant([], "int32", -3)
starts = paddle.static.data(name='starts', shape=[3], dtype='int32')
ends = paddle.static.data(name='ends', shape=[3], dtype='int64')
ends = paddle.static.data(name='ends', shape=[3], dtype='int32')
strides = paddle.static.data(name='strides', shape=[3], dtype='int32')

x = paddle.static.data(
Expand Down Expand Up @@ -1032,10 +1032,10 @@ def setUp(self):
}

def test_check_output(self):
self.check_output(check_eager=True)
self.check_output()

def test_check_grad(self):
self.check_grad({'Input'}, 'Out', check_eager=True)
self.check_grad({'Input'}, 'Out')

def initTestCase(self):
self.input = np.random.rand(100)
Expand Down Expand Up @@ -1069,10 +1069,10 @@ def setUp(self):
}

def test_check_output(self):
self.check_output(check_eager=True)
self.check_output()

def test_check_grad(self):
self.check_grad({'Input'}, 'Out', check_eager=True)
self.check_grad({'Input'}, 'Out')

def initTestCase(self):
self.input = np.random.rand(100)
Expand Down

0 comments on commit 1d8c82b

Please sign in to comment.