torch.nn.attention.bias.causal_lower_right
- torch.nn.attention.bias.causal_lower_right(*size)
Creates a lower-right triangular causal bias.
This function generates a lower-right triangular matrix to represent causal attention bias with a diagonal offset set so that the inclusive values are aligned to the lower right corner of the matrix.
The equivalent pytorch code for constructing this bias is:
diagonal_offset = size