Skip to content

Commit

Permalink
fix .test=develop
Browse files Browse the repository at this point in the history
  • Loading branch information
zmxdream committed Nov 29, 2021
1 parent 69f298f commit b82b1fa
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions python/paddle/fluid/tests/unittests/test_rot90_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def test_static_graph(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=1, dims=[0, 1])
output = paddle.rot90(output, k=1, dims=[0, 1])
output = output.rot90(k=1, dims=[0, 1])
output = paddle.rot90(input, k=1, axes=[0, 1])
output = paddle.rot90(output, k=1, axes=[0, 1])
output = output.rot90(k=1, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -59,7 +59,7 @@ def test_static_k_0(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=0, dims=[0, 1])
output = paddle.rot90(input, k=0, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -85,7 +85,7 @@ def test_static_k_2(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=2, dims=[0, 1])
output = paddle.rot90(input, k=2, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -111,7 +111,7 @@ def test_static_k_3(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=3, dims=[0, 1])
output = paddle.rot90(input, k=3, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -137,7 +137,7 @@ def test_static_neg_k_1(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=-1, dims=[0, 1])
output = paddle.rot90(input, k=-1, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -163,7 +163,7 @@ def test_static_neg_k_2(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=-2, dims=[0, 1])
output = paddle.rot90(input, k=-2, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -189,7 +189,7 @@ def test_static_neg_k_3(self):
train_program = fluid.Program()
with fluid.program_guard(train_program, startup_program):
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=-3, dims=[0, 1])
output = paddle.rot90(input, k=-3, axes=[0, 1])
place = fluid.CPUPlace()
if fluid.core.is_compiled_with_cuda():
place = fluid.CUDAPlace(0)
Expand All @@ -214,32 +214,32 @@ def test_error_api(self):
## dims error
def run1():
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=1, dims=[0])
output = paddle.rot90(input, k=1, axes=[0])

self.assertRaises(ValueError, run1)

## input dims error
def run2():
input = fluid.data(name='input', dtype='float32', shape=[2])
output = paddle.rot90(input, k=1, dims=[0, 1])
output = paddle.rot90(input, k=1, axes=[0, 1])

self.assertRaises(ValueError, run2)

def run3():
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=1, dims=[0, 0])
output = paddle.rot90(input, k=1, axes=[0, 0])

self.assertRaises(ValueError, run3)

def run4():
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=1, dims=[3, 1])
output = paddle.rot90(input, k=1, axes=[3, 1])

self.assertRaises(ValueError, run4)

def run5():
input = fluid.data(name='input', dtype='float32', shape=[2, 3])
output = paddle.rot90(input, k=1, dims=[0, 3])
output = paddle.rot90(input, k=1, axes=[0, 3])

self.assertRaises(ValueError, run5)

Expand All @@ -248,9 +248,9 @@ def test_dygraph(self):
with fluid.dygraph.guard():
inputs = fluid.dygraph.to_variable(img)

ret = paddle.rot90(inputs, k=1, dims=[0, 1])
ret = ret.rot90(1, dims=[0, 1])
ret = paddle.rot90(ret, k=1, dims=[0, 1])
ret = paddle.rot90(inputs, k=1, axes=[0, 1])
ret = ret.rot90(1, axes=[0, 1])
ret = paddle.rot90(ret, k=1, axes=[0, 1])
out_ref = np.array([[4, 1], [5, 2], [6, 3]]).astype(np.float32)

self.assertTrue(
Expand Down

1 comment on commit b82b1fa

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on b82b1fa Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #37634 Commit ID: b82b1fa contains failed CI.

🔹 Failed: PR-CI-CINN

test_failed
2021-11-29 17:56:11 The following tests FAILED:
2021-11-29 17:56:11 179 - cinn_lib_test (Child aborted)
2021-11-29 17:56:11 183 - cinn_graph_symbolization_test (SEGFAULT)
2021-11-29 17:56:11 Errors while running CTest
2021-11-29 17:56:11 paddle/scripts/paddle_build.sh: line 1024: warning: run_pending_traps: bad value in trap_list[17]: 0x558fea3dec30
2021-11-29 17:56:11 At least one test failed with exit code => 0
2021-11-29 17:56:11 paddle/scripts/paddle_build.sh: line 1023: warning: run_pending_traps: bad value in trap_list[17]: 0x558fea3dec30
2021-11-29 17:56:11 1 card TestCases Total Time: 1s
2021-11-29 17:56:11 1 card TestCases finished!!!!
2021-11-29 17:56:11 ++ date +%s
2021-11-29 17:56:11 + ut_endTime_s=1638179771
2021-11-29 17:56:11 + echo 'CINN testCase Time: 1s'
2021-11-29 17:56:11 CINN testCase Time: 1s
2021-11-29 17:56:11 + [[ 1 != \0 ]]
2021-11-29 17:56:11 + exit 8
2021-11-29 17:56:11 + EXCODE=8
2021-11-29 17:56:11 + echo 8
2021-11-29 17:56:11 8
2021-11-29 17:56:11 + echo 'ipipe_log_param_EXCODE: 8'
2021-11-29 17:56:11 ipipe_log_param_EXCODE: 8
2021-11-29 17:56:11 + set +x

Please sign in to comment.