src/transformers/generation/logits_process.py/NoBadWordsLogitsProcessor/_calc_static_bad_word_mask
class NoBadWordsLogitsProcessor:    def _calc_static_bad_word_mask(self, scores: torch.FloatTensor) -> torch.BoolTensor:
        static_bad_words_mask = torch.zeros(scores.shape[1])
        static_bad_words_mask[self.bad_words_id_length_1] = 1
        return static_bad_words_mask.unsqueeze(0).to(scores.device).bool()