def METHOD_NAME(self, model, net_output, sample):
    lprobs = model.get_normalized_probs(net_output, log_probs=True)
    target = model.get_targets(sample, net_output)
    if self.ignore_prefix_size > 0:
        # lprobs: B x T x C
        lprobs = lprobs[:, self.ignore_prefix_size :, :].contiguous()
        target = target[:, self.ignore_prefix_size :].contiguous()
    return lprobs.view(-1, lprobs.size(-1)), target.view(-1)