Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
a162837 committed Oct 25, 2024
1 parent dfedbc9 commit 9e52394
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/legacy_test/test_clip_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def test_tensor_none_clip(self):
)
out = paddle.clip(images, min, max)
res = exe.run(
feed={"image": data, 'min': min_data}, fetch_list=[out]
feed={"image": data, 'min': min_data, 'max': None}, fetch_list=[out]
)
res_np = np.clip(data, min_data)
np.testing.assert_allclose(res_np, res[0], rtol=1e-05)
Expand All @@ -566,7 +566,7 @@ def test_shapeerror_clip(self):
data = np.random.random(data_shape).astype('float32')
data = paddle.to_tensor(data)
with self.assertRaises(ValueError):
paddle.clip(data, paddle.to_tensor([2]))
paddle.clip(data, paddle.rand([2]))

data_shape = [1, 9, 9, 4]
data = np.random.random(data_shape).astype('float32')
Expand All @@ -580,7 +580,7 @@ def test_shapeerror_clip(self):
class TestInplaceClipAPI(TestClipAPI):
def _executed_api(self, x, min=None, max=None):
return x.clip_(min, max)

def test_tensor_clip_(self):
data_shape = [1, 9, 9, 4]
data = paddle.to_tensor(np.random.random(data_shape).astype('float32'))
Expand Down

0 comments on commit 9e52394

Please sign in to comment.