def test_reshape_configure(backend_default):
 bsz = backend_default.bsz
 reshape_0 = Reshape((0, 10, 10))
 reshape_0.configure((10, 2, 50))
 assert (reshape_0.out_shape == (10, 10, 10))
 reshape_1 = Reshape((10, 25, (-1)))
 reshape_1.configure((10, 2, 50))
 assert (reshape_1.out_shape == (10, 25, 4))
 reshape_2 = Reshape((5, (-1)))
 reshape_2.configure((10, 2, 25))
 assert (reshape_2.out_shape == (5, 100))
 assert (reshape_2.out_shape_t == (5, (100 * bsz)))
 reshape_3 = Reshape((5, (-1), 5))
 reshape_3.configure((10, 25))
 assert (reshape_3.out_shape == (5, 10, 5))

def test_reshape_configure ( backend_default ) : bsz = backend_default . bsz reshape_0 = Reshape ( ( 0 , 10 , 10 ) ) reshape_0 . configure ( ( 10 , 2 , 50 ) ) assert ( reshape_0 . out_shape == ( 10 , 10 , 10 ) ) reshape_1 = Reshape ( ( 10 , 25 , ( - 1 ) ) ) reshape_1 . configure ( ( 10 , 2 , 50 ) ) assert ( reshape_1 . out_shape == ( 10 , 25 , 4 ) ) reshape_2 = Reshape ( ( 5 , ( - 1 ) ) ) reshape_2 . configure ( ( 10 , 2 , 25 ) ) assert ( reshape_2 . out_shape == ( 5 , 100 ) ) assert ( reshape_2 . out_shape_t == ( 5 , ( 100 * bsz ) ) ) reshape_3 = Reshape ( ( 5 , ( - 1 ) , 5 ) ) reshape_3 . configure ( ( 10 , 25 ) ) assert ( reshape_3 . out_shape == ( 5 , 10 , 5 ) )
test cases: - reshape with 0 - reshape with -1 - reshape with collapsing dimensions - reshape with expanding dimensions .