    def output_layer(self, features):
        """Project features to the vocabulary size.
        Return a dictionary of the form:
            {
                'input-channel': {
                    'predicted-channel': token prediction tensor of shape `(batch, tgt_len, vocab)`,
                }
            }

        if duration_prediction is enabled
            {
                'input-channel': {
                    'predicted-channel': {
                        'pred_token': token prediction tensor of shape `(batch, tgt_len, vocab)`,
                        'pred_duration': duration prediction tensor
                    }
                }
            }
        """
        # project back to size of vocabulary
        if self.output_duration_prediction is None:
            if self.is_cross_prediction:
                return {
                    channel: {
                        pred_channel: self.output_projection[j - i](features[channel])
                        for j, pred_channel in enumerate(self.channels)
                    }
                    for i, channel in enumerate(self.channels)
                }
            else:
                return {
                    channel: {channel: self.output_projection[0](features[channel])}
                    for i, channel in enumerate(self.channels)
                }
        else:
            if self.is_cross_prediction:
                return {
                    channel: {
                        pred_channel: {
                            "pred_token": self.output_projection[j - i](
                                features[channel]
                            ),
                            "pred_duration": self.output_duration_prediction[j - i](
                                features[channel]
                            ),
                        }
                        for j, pred_channel in enumerate(self.channels)
                    }
                    for i, channel in enumerate(self.channels)
                }
            else:
                return {
                    channel: {
                        channel: {
                            "pred_token": self.output_projection[0](features[channel]),
                            "pred_duration": self.output_duration_prediction[0](
                                features[channel]
                            ),
                        }
                    }
                    for i, channel in enumerate(self.channels)
                }
Project features to the vocabulary size.
Return a dictionary of the form:
{
'input-channel': {
'predicted-channel': token prediction tensor of shape `(batch, tgt_len, vocab)`,
}
}

if duration_prediction is enabled
{
'input-channel': {
'predicted-channel': {
'pred_token': token prediction tensor of shape `(batch, tgt_len, vocab)`,
'pred_duration': duration prediction tensor
}
}
}
fairseq/models/speech_dlm/modules/speech_dlm_decoder.py