def forward(self, degrees):
        """
        Parameters
        ----------
        degrees : Tensor
            If :attr:`direction` is ``both``, it should be stacked in degrees and out degrees
            of the batched graph with zero padding, a tensor of shape :math:`(2, B, N)`.
            Otherwise, it should be zero-padded in degrees or out degrees of the batched
            graph, a tensor of shape :math:`(B, N)`, where :math:`B` is the batch size
            of the batched graph, and :math:`N` is the maximum number of nodes.

        Returns
        -------
        Tensor
            Return degree embedding vectors of shape :math:`(B, N, d)`,
            where :math:`d` is :attr:`embedding_dim`.
        """
        degrees = th.clamp(degrees, min=0, max=self.max_degree)

        if self.direction == "in":
            assert len(degrees.shape) == 2
            degree_embedding = self.encoder(degrees)
        elif self.direction == "out":
            assert len(degrees.shape) == 2
            degree_embedding = self.encoder(degrees)
        elif self.direction == "both":
            assert len(degrees.shape) == 3 and degrees.shape[0] == 2
            degree_embedding = self.encoder1(degrees[0]) + self.encoder2(
                degrees[1]
            )
        else:
            raise ValueError(
                f'Supported direction options: "in", "out" and "both", '
                f"but got {self.direction}"
            )
        return degree_embedding

        Parameters
        ----------
        degrees : Tensor
            If :attr:`direction` is ``both``, it should be stacked in degrees and out degrees
            of the batched graph with zero padding, a tensor of shape :math:`(2, B, N)`.
            Otherwise, it should be zero-padded in degrees or out degrees of the batched
            graph, a tensor of shape :math:`(B, N)`, where :math:`B` is the batch size
            of the batched graph, and :math:`N` is the maximum number of nodes.

        Returns
        -------
        Tensor
            Return degree embedding vectors of shape :math:`(B, N, d)`,
            where :math:`d` is :attr:`embedding_dim`.
        
python/dgl/nn/pytorch/gt/degree_encoder.py