Rancho_Xia:

            scores.masked_fill_(attn_mask, -1e20)



Any methods/functions in PyTorch that end in an underscore represent an inplace version of such operation. For example, multiplication can be done via mul or its inplace equivalent  mul_