Write hide_future(att): return a new tensor in which every score above the diagonal is -inf, for att of shape (T, T) or with any number of leading axes, like (B, H, T, T).
Instructions
1
Write hide_future(att) for a float tensor att of attention scores, shape (..., T, T), with any number of leading axes. Return a new tensor in which every score above the diagonal, a query looking at a later key, is -inf. Use torch.tril and masked_fill, and keep the diagonal: each position sees itself.