(idtype)
| 766 | |
| 767 | @parametrize_idtype |
| 768 | def test_inc(idtype): |
| 769 | g = create_test_heterograph(idtype) |
| 770 | adj = F.sparse_to_numpy(g["follows"].inc("in")) |
| 771 | assert np.allclose(adj, np.array([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])) |
| 772 | adj = F.sparse_to_numpy(g["follows"].inc("out")) |
| 773 | assert np.allclose(adj, np.array([[1.0, 0.0], [0.0, 1.0], [0.0, 0.0]])) |
| 774 | adj = F.sparse_to_numpy(g["follows"].inc("both")) |
| 775 | assert np.allclose(adj, np.array([[-1.0, 0.0], [1.0, -1.0], [0.0, 1.0]])) |
| 776 | adj = F.sparse_to_numpy(g.inc("in", etype="plays")) |
| 777 | assert np.allclose( |
| 778 | adj, np.array([[1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]]) |
| 779 | ) |
| 780 | adj = F.sparse_to_numpy(g.inc("out", etype="plays")) |
| 781 | assert np.allclose( |
| 782 | adj, |
| 783 | np.array( |
| 784 | [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 0.0]] |
| 785 | ), |
| 786 | ) |
| 787 | adj = F.sparse_to_numpy(g.inc("both", etype="follows")) |
| 788 | assert np.allclose(adj, np.array([[-1.0, 0.0], [1.0, -1.0], [0.0, 1.0]])) |
| 789 | |
| 790 | |
| 791 | @parametrize_idtype |
nothing calls this directly
no test coverage detected