Skip to content

Commit

Permalink
fix div 0 error in chunk (#49998)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue authored Feb 7, 2023
1 parent 7e4b432 commit 36e5de8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/paddle/fluid/tests/unittests/test_chunk_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def test_axis_type_tensor():

self.assertRaises(TypeError, test_axis_type_tensor)

with paddle.fluid.dygraph.guard():

def test_0_chunks_tensor():
x = paddle.uniform([1, 1, 1], dtype='float32')
paddle.chunk(x, chunks=0)

self.assertRaises(ValueError, test_0_chunks_tensor)


class API_TestChunk(unittest.TestCase):
def test_out(self):
Expand Down

0 comments on commit 36e5de8

Please sign in to comment.