6a4fa82792bddc6126eaf944956f49f0a0cb7ca7,test/filters/test_blur.py,TestBoxBlur,test_kernel_5x5,#TestBoxBlur#,37

Before Change


        assert_allclose(actual[0, 0, 1, 1:4], torch.tensor(1.).to(device))

    def test_kernel_5x5(self, device):
        inp = torch.tensor([[[
            [1., 1., 1., 1., 1.],
            [1., 1., 1., 1., 1.],
            [1., 1., 1., 1., 1.],
            [2., 2., 2., 2., 2.],
            [2., 2., 2., 2., 2.]
        ]]]).to(device)

        kernel_size = (5, 5)
        expected = inp.sum((1, 2, 3)) / torch.mul(*kernel_size)

        actual = kornia.filters.box_blur(inp, kernel_size)
        assert_allclose(actual[:, 0, 2, 2], expected)

    def test_kernel_5x5_batch(self, device):

After Change


        assert_allclose(actual.sum(), torch.tensor(35.).to(actual), rtol=tol_val, atol=tol_val)

    def test_kernel_5x5(self, device, dtype):
        inp = torch.tensor([[[
            [1., 1., 1., 1., 1.],
            [1., 1., 1., 1., 1.],
            [1., 1., 1., 1., 1.],
            [2., 2., 2., 2., 2.],
            [2., 2., 2., 2., 2.]
        ]]], device=device, dtype=dtype)

        kernel_size = (5, 5)
        expected = inp.sum((1, 2, 3)) / torch.mul(*kernel_size)

        actual = kornia.filters.box_blur(inp, kernel_size)

        tol_val: float = utils._get_precision_by_name(device, "xla", 1e-1, 1e-4)
        assert_allclose(actual[:, 0, 2, 2], expected, rtol=tol_val, atol=tol_val)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 8

Non-data size: 3

Instances


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_blur.py
Class Name: TestBoxBlur
Method Name: test_kernel_5x5


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSpatialGradient
Method Name: test_edges_norm


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSpatialGradient
Method Name: test_edges_sep


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSobel
Method Name: test_magnitude


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_blur.py
Class Name: TestBoxBlur
Method Name: test_kernel_3x3


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSpatialGradient3d
Method Name: test_edges


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSpatialGradient
Method Name: test_edges_sep_norm


Project Name: arraiy/torchgeometry
Commit Name: 6a4fa82792bddc6126eaf944956f49f0a0cb7ca7
Time: 2020-12-22
Author: edgar.riba@gmail.com
File Name: test/filters/test_sobel.py
Class Name: TestSpatialGradient
Method Name: test_edges