def has_nonzero(self):
        """Check if there is any nonzero value in this Index"""
        tensor = self.tousertensor()
        return F.sum(tensor, 0) > 0
Check if there is any nonzero value in this Index
python/dgl/utils/internal.py