def METHOD_NAME(target_tokens):
    pad = self.tgt_dict.pad()
    bos = self.tgt_dict.bos()
    eos = self.tgt_dict.eos()
    unk = self.tgt_dict.unk()
    target_mask = (
        target_tokens.eq(bos) | target_tokens.eq(eos) | target_tokens.eq(pad)
    )
    return target_tokens.masked_fill(~target_mask, unk)