src/transformers/models/fsmt/modeling_fsmt.py/fill_with_neg_inf
def fill_with_neg_inf(t):
    """FP16-compatible function that fills a input_ids with -inf."""
    return t.float().fill_(float("-inf")).type_as(t)