3898f705a06bca707a9c1f5c1c5f171b037a96a0,torch_geometric/transform/cartesian_test.py,CartesianTest,test_cartesian_adj,#CartesianTest#,9

Before Change



class CartesianTest(TestCase):
    def test_cartesian_adj(self):
        position = torch.LongTensor([[1, 0], [0, 0], [-2, 4]])
        index = torch.LongTensor([[0, 1, 1, 2], [1, 0, 2, 1]])
        weight = torch.FloatTensor([1, 1, 1, 1])
        adj = torch.sparse.FloatTensor(index, weight, torch.Size([3, 3]))

        transform = CartesianAdj()

        _, adj, position = transform((None, adj, position))
        adj = adj.to_dense()

        expected_position = [[1, 0], [0, 0], [-2, 4]]
        expected_adj_x = [
            [0., 0.375, 0],

After Change


        index = torch.LongTensor([[0, 1, 1, 2], [1, 0, 2, 1]])
        weight = torch.FloatTensor([1, 1, 1, 1])
        adj = torch.sparse.FloatTensor(index, weight, torch.Size([3, 3]))
        position = torch.FloatTensor([[1, 0], [0, 0], [-2, 4]])
        data = Data(None, adj, position, None)

        data = CartesianAdj()(data)
        adj, position = data.adj, data.position

        expected_adj = [
            [[0, 0], [0.375, 0.5], [0, 0]],
            [[0.625, 0.5], [0, 0], [0.25, 1]],
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: rusty1s/pytorch_geometric
Commit Name: 3898f705a06bca707a9c1f5c1c5f171b037a96a0
Time: 2017-11-18
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/cartesian_test.py
Class Name: CartesianTest
Method Name: test_cartesian_adj


Project Name: rusty1s/pytorch_geometric
Commit Name: 831e2ebde9122f2ffb2d128c4f8b8e85151efad0
Time: 2017-11-18
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/spherical_test.py
Class Name: SphericalTest
Method Name: test_spherical_adj


Project Name: rusty1s/pytorch_geometric
Commit Name: 831e2ebde9122f2ffb2d128c4f8b8e85151efad0
Time: 2017-11-18
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/polar_test.py
Class Name: PolarTest
Method Name: test_polar_adj