def to_partid(self, id_tensor):
        """Mapping global ID to partition ID.

        Parameters
        ----------
        id_tensor : tensor
            Global ID tensor

        Return
        ------
        tensor
            partition ID
        """
        if self.is_node:
            return self._partition_book.nid2partid(id_tensor, self.type_name)
        else:
            return self._partition_book.eid2partid(id_tensor, self.type_name)
Mapping global ID to partition ID.

        Parameters
        ----------
        id_tensor : tensor
            Global ID tensor

        Return
        ------
        tensor
            partition ID
        
python/dgl/distributed/graph_partition_book.py