def METHOD_NAME():
    edge_index = torch.tensor([[0, 1, 0], [1, 0, 0]])
    edge_weight = torch.tensor([0.5, 0.5, 0.5])
    edge_attr = torch.eye(3)
    adj = to_torch_coo_tensor(edge_index, edge_weight)
    expected = [[0, 1, 0, 0, 1], [1, 0, 0, 0, 1]]
    assert add_self_loops(edge_index)[0].tolist() == expected
    out = add_self_loops(edge_index, edge_weight)
    assert out[0].tolist() == expected
    assert out[1].tolist() == [0.5, 0.5, 0.5, 1., 1.]
    out = add_self_loops(adj)[0]
    assert out._indices().tolist() == [[0, 0, 1, 1], [0, 1, 0, 1]]
    assert out._values().tolist() == [1.5, 0.5, 0.5, 1.0]
    out = add_self_loops(edge_index, edge_weight, fill_value=5)
    assert out[0].tolist() == expected
    assert out[1].tolist() == [0.5, 0.5, 0.5, 5.0, 5.0]
    out = add_self_loops(adj, fill_value=5)[0]
    assert out._indices().tolist() == [[0, 0, 1, 1], [0, 1, 0, 1]]
    assert out._values().tolist() == [5.5, 0.5, 0.5, 5.0]
    out = add_self_loops(edge_index, edge_weight, fill_value=torch.tensor(2.))
    assert out[0].tolist() == expected
    assert out[1].tolist() == [0.5, 0.5, 0.5, 2., 2.]
    out = add_self_loops(adj, fill_value=torch.tensor(2.))[0]
    assert out._indices().tolist() == [[0, 0, 1, 1], [0, 1, 0, 1]]
    assert out._values().tolist() == [2.5, 0.5, 0.5, 2.0]
    out = add_self_loops(edge_index, edge_weight, fill_value='add')
    assert out[0].tolist() == expected
    assert out[1].tolist() == [0.5, 0.5, 0.5, 1, 0.5]
    # Tests with `edge_attr`:
    out = add_self_loops(edge_index, edge_attr)
    assert out[0].tolist() == expected
    assert out[1].tolist() == [[1., 0., 0.], [0., 1., 0.], [0., 0., 1.],
                               [1., 1., 1.], [1., 1., 1.]]
    out = add_self_loops(edge_index, edge_attr,
                         fill_value=torch.tensor([0., 1., 0.]))
    assert out[0].tolist() == expected
    assert out[1].tolist() == [[1., 0., 0.], [0., 1., 0.], [0., 0., 1.],
                               [0., 1., 0.], [0., 1., 0.]]
    out = add_self_loops(edge_index, edge_attr, fill_value='add')
    assert out[0].tolist() == expected
    assert out[1].tolist() == [[1., 0., 0.], [0., 1., 0.], [0., 0., 1.],
                               [0., 1., 1.], [1., 0., 0.]]
    # Test empty `edge_index` and `edge_weight`:
    edge_index = torch.empty(2, 0, dtype=torch.long)
    edge_weight = torch.empty(0)
    out = add_self_loops(edge_index, edge_weight, num_nodes=1)
    assert out[0].tolist() == [[0], [0]]
    assert out[1].tolist() == [1.]