eef962609b8bfaef8454bada53fef75f26b702bd,test_layers.py,,test_transpose,#,14

Before Change



    for backend, TransposeLayer in backend_pairs:
        for pattern, axes_lengths, result_shape in patterns:
            x = numpy.arange(10 * 20 * 30 * 40, dtype="float32").reshape([10, 20, 30, 40])
            layer = TransposeLayer(pattern, **axes_lengths)
            assert layer(backend.from_numpy(x)).shape == result_shape
            for shape in [(), (10,), (10, 10, 10), (15, 20, 31, 40), (10, 1, 1, 1, 1)]:
                try:

After Change


                // hybridization doesn"t work
                // layer3 = layer2.hybridize()
                layer3 = deepcopy(layer2)
            result3 = backend.to_numpy(layer3(backend.from_numpy(x)))
            assert numpy.allclose(result1, result3)

            v = backend.from_numpy(x)
            if isinstance(v, torch.Tensor):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: arogozhnikov/einops
Commit Name: eef962609b8bfaef8454bada53fef75f26b702bd
Time: 2018-10-08
Author: iamfullofspam@gmail.com
File Name: test_layers.py
Class Name:
Method Name: test_transpose


Project Name: arogozhnikov/einops
Commit Name: 0e1f7fbd0c8080647bb48dd52c3b8c1109c28688
Time: 2018-10-06
Author: iamfullofspam@gmail.com
File Name: test_layers.py
Class Name:
Method Name: test_transpose


Project Name: bethgelab/foolbox
Commit Name: a04525112543a5dbf77401cde45442932aeec368
Time: 2020-01-26
Author: git@jonasrauber.de
File Name: foolbox/ext/native/models/tensorflow.py
Class Name: TensorFlowModel
Method Name: _init_preprocessing