efe5916109e220a429a2cff110edb952d747466f,tests/keras/layers/test_convolutional.py,,test_upsampling_3d,#,395

Before Change


                        size=(length_dim1, length_dim2, length_dim3),
                        input_shape=input.shape[1:],
                        dim_ordering=dim_ordering)
                    layer.input = K.variable(input)
                    for train in [True, False]:
                        out = K.eval(layer.get_output(train))
                        if dim_ordering == "th":
                            assert out.shape[2] == length_dim1 * input_len_dim1
                            assert out.shape[3] == length_dim2 * input_len_dim2
                            assert out.shape[4] == length_dim3 * input_len_dim3
                        else:  // tf
                            assert out.shape[1] == length_dim1 * input_len_dim1
                            assert out.shape[2] == length_dim2 * input_len_dim2
                            assert out.shape[3] == length_dim3 * input_len_dim3

                        // compare with numpy
                        if dim_ordering == "th":
                            expected_out = np.repeat(input, length_dim1, axis=2)
                            expected_out = np.repeat(expected_out, length_dim2, axis=3)
                            expected_out = np.repeat(expected_out, length_dim3, axis=4)
                        else:  // tf
                            expected_out = np.repeat(input, length_dim1, axis=1)
                            expected_out = np.repeat(expected_out, length_dim2, axis=2)
                            expected_out = np.repeat(expected_out, length_dim3, axis=3)

                        assert_allclose(out, expected_out)

                    layer.get_config()


if __name__ == "__main__":

After Change


        for length_dim1 in [2, 3, 9]:
            for length_dim2 in [2, 3, 9]:
                for length_dim3 in [2, 3, 9]:
                    layer = convolutional.UpSampling3D(
                        size=(length_dim1, length_dim2, length_dim3),
                        dim_ordering=dim_ordering)
                    layer.set_input(K.variable(input), shape=input.shape)

                    out = K.eval(layer.output)
                    if dim_ordering == "th":
                        assert out.shape[2] == length_dim1 * input_len_dim1
                        assert out.shape[3] == length_dim2 * input_len_dim2
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: keras-team/keras
Commit Name: efe5916109e220a429a2cff110edb952d747466f
Time: 2016-04-01
Author: francois.chollet@gmail.com
File Name: tests/keras/layers/test_convolutional.py
Class Name:
Method Name: test_upsampling_3d


Project Name: keras-team/keras
Commit Name: efe5916109e220a429a2cff110edb952d747466f
Time: 2016-04-01
Author: francois.chollet@gmail.com
File Name: tests/keras/layers/test_convolutional.py
Class Name:
Method Name: test_upsampling_2d


Project Name: keras-team/keras
Commit Name: efe5916109e220a429a2cff110edb952d747466f
Time: 2016-04-01
Author: francois.chollet@gmail.com
File Name: tests/keras/layers/test_convolutional.py
Class Name:
Method Name: test_zero_padding_2d


Project Name: keras-team/keras
Commit Name: efe5916109e220a429a2cff110edb952d747466f
Time: 2016-04-01
Author: francois.chollet@gmail.com
File Name: tests/keras/layers/test_convolutional.py
Class Name:
Method Name: test_upsampling_3d


Project Name: keras-team/keras
Commit Name: efe5916109e220a429a2cff110edb952d747466f
Time: 2016-04-01
Author: francois.chollet@gmail.com
File Name: tests/keras/layers/test_convolutional.py
Class Name:
Method Name: test_zero_padding_3d