import torch


def delete_edge_mask(row, col, node1, node2):
    """return a boolean mask which can be used to construct a new adjacency matrix that deletes edges
    between node1 and node2."""
    mask1 = torch.logical_or(row != node1, col != node2)
    mask2 = torch.logical_or(row != node2, col != node1)

    mask = torch.logical_and(mask1, mask2)
    return mask