-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
The default setting is to use the bidirectional data, attn_type='bi', but bsz=1.
But in this function,
Line 371 in cb793a1
| def relative_positional_encoding(self, qlen, klen, d_model, clamp_len, attn_type, |
It shows the bidirectional data only works when bsz%2 ==0. However in default, bsz = 1.
I am confused, if bsz=1, the setting for the beg, and end in the following code, is it right?
Lines 380 to 387 in cb793a1
| if attn_type == 'bi': | |
| # beg, end = klen - 1, -qlen | |
| beg, end = klen, -qlen | |
| elif attn_type == 'uni': | |
| # beg, end = klen - 1, -1 | |
| beg, end = klen, -1 | |
| else: | |
| raise ValueError('Unknown `attn_type` {}.'.format(attn_type)) |
Could anyone help me with this confusion?
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested