def forward(self,
                student_logit,
                teacher_logit,
                label,
                semantic_weights=None):
        """
        Forward computation.

        Args:
            student_logit (Tensor): Logit tensor, the data type is float32, float64. Shape is
                (N, C), where C is number of classes, and if shape is more than 2D, this
                is (N, C, D1, D2,..., Dk), k >= 1.
            teacher_logit (Tensor): Logit tensor, the data type is float32, float64. The shape
                is the same as the student_logit.
            label (Tensor): Label tensor, the data type is int64. Shape is (N), where each
                value is 0 <= label[i] <= C-1, and if shape is more than 2D, this is
                (N, D1, D2,..., Dk), k >= 1.
            semantic_weights (Tensor, optional): Weights about loss for each pixels,
                shape is the same as label. Default: None.
        """

        if student_logit.shape != teacher_logit.shape:
            raise ValueError(
                'The shape of student_logit = {} must be the same as the shape of teacher_logit = {}.'
                .format(student_logit.shape, teacher_logit.shape))

        channel_axis = 1 if self.data_format == 'NCHW' else -1
        if self.weight is not None and student_logit.shape[channel_axis] != len(
                self.weight):
            raise ValueError(
                'The number of weights = {} must be the same as the number of classes = {}.'
                .format(len(self.weight), student_logit.shape[channel_axis]))

        if channel_axis == 1:
            student_logit = paddle.transpose(student_logit, [0, 2, 3, 1])
            teacher_logit = paddle.transpose(teacher_logit, [0, 2, 3, 1])

        teacher_logit = F.softmax(teacher_logit)

        loss = F.cross_entropy(student_logit,
                               teacher_logit,
                               weight=self.weight,
                               reduction='none',
                               soft_label=True)

        return self._post_process_loss(student_logit, label, semantic_weights,
                                       loss)

        Forward computation.

        Args:
            student_logit (Tensor): Logit tensor, the data type is float32, float64. Shape is
                (N, C), where C is number of classes, and if shape is more than 2D, this
                is (N, C, D1, D2,..., Dk), k >= 1.
            teacher_logit (Tensor): Logit tensor, the data type is float32, float64. The shape
                is the same as the student_logit.
            label (Tensor): Label tensor, the data type is int64. Shape is (N), where each
                value is 0 <= label[i] <= C-1, and if shape is more than 2D, this is
                (N, D1, D2,..., Dk), k >= 1.
            semantic_weights (Tensor, optional): Weights about loss for each pixels,
                shape is the same as label. Default: None.
        
paddleseg/models/losses/cross_entropy_loss.py