def forward(self, dist, path_data):
        """
        Parameters
        ----------
        dist : Tensor
            Shortest path distance matrix of the batched graph with zero padding,
            of shape :math:`(B, N, N)`, where :math:`B` is the batch size of
            the batched graph, and :math:`N` is the maximum number of nodes.
        path_data : Tensor
            Edge feature along the shortest path with zero padding, of shape
            :math:`(B, N, N, L, d)`, where :math:`L` is the maximum length of
            the shortest paths, and :math:`d` is :attr:`feat_dim`.

        Returns
        -------
        torch.Tensor
            Return attention bias as path encoding, of shape
            :math:`(B, N, N, H)`, where :math:`B` is the batch size of
            the input graph, :math:`N` is the maximum number of nodes, and
            :math:`H` is :attr:`num_heads`.
        """
        shortest_distance = th.clamp(dist, min=1, max=self.max_len)
        edge_embedding = self.embedding_table.weight.reshape(
            self.max_len, self.num_heads, -1
        )
        path_encoding = th.div(
            th.einsum("bxyld,lhd->bxyh", path_data, edge_embedding).permute(
                3, 0, 1, 2
            ),
            shortest_distance,
        ).permute(1, 2, 3, 0)
        return path_encoding

        Parameters
        ----------
        dist : Tensor
            Shortest path distance matrix of the batched graph with zero padding,
            of shape :math:`(B, N, N)`, where :math:`B` is the batch size of
            the batched graph, and :math:`N` is the maximum number of nodes.
        path_data : Tensor
            Edge feature along the shortest path with zero padding, of shape
            :math:`(B, N, N, L, d)`, where :math:`L` is the maximum length of
            the shortest paths, and :math:`d` is :attr:`feat_dim`.

        Returns
        -------
        torch.Tensor
            Return attention bias as path encoding, of shape
            :math:`(B, N, N, H)`, where :math:`B` is the batch size of
            the input graph, :math:`N` is the maximum number of nodes, and
            :math:`H` is :attr:`num_heads`.
        
python/dgl/nn/pytorch/gt/path_encoder.py