Skip to content

Commit a6a2f67

Browse files
committed
fix typos
1 parent 68c3645 commit a6a2f67

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/legacy_test/test_cumprod_op.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def init_dtype(self):
261261

262262
def setUp(self):
263263
paddle.enable_static()
264-
self.target_shape = None
264+
self.target_dtype = None
265265
self.init_dtype()
266266
self.x = (np.random.rand(2, 3, 10, 10) + 0.5).astype(self.dtype)
267267
self.place = []
@@ -282,10 +282,10 @@ def test_static_api(self):
282282
def run(place):
283283
with paddle.static.program_guard(paddle.static.Program()):
284284
x = paddle.static.data('X', self.shape, dtype=self.dtype)
285-
out = paddle.cumprod(x, -2, self.target_shape)
285+
out = paddle.cumprod(x, -2, self.target_dtype)
286286
exe = paddle.static.Executor(place)
287287
res = exe.run(feed={'X': self.x}, fetch_list=[out])
288-
out_ref = np.cumprod(self.x, -2, self.target_shape)
288+
out_ref = np.cumprod(self.x, -2, self.target_dtype)
289289

290290
for r in res:
291291
np.testing.assert_allclose(out_ref, r, rtol=1e-05)
@@ -298,8 +298,8 @@ def test_dygraph_api(self):
298298
def run(place):
299299
paddle.disable_static(place)
300300
x = paddle.to_tensor(self.x)
301-
out = paddle.cumprod(x, 1, self.target_shape)
302-
out_ref = np.cumprod(self.x, 1, self.target_shape)
301+
out = paddle.cumprod(x, 1, self.target_dtype)
302+
out_ref = np.cumprod(self.x, 1, self.target_dtype)
303303
np.testing.assert_allclose(out_ref, out.numpy(), rtol=1e-05)
304304
paddle.enable_static()
305305

@@ -329,7 +329,7 @@ class TestCumprodAPICase4(TestCumprodAPI):
329329
def init_dtype(self):
330330
self.dtype = 'float32'
331331
self.shape = [2, 3, 10, 10]
332-
self.target_shape = 'float64'
332+
self.target_dtype = 'float64'
333333

334334

335335
# test function.

0 commit comments

Comments
 (0)