fix no_pos call

pull/930/head
Hui Zhang 3 years ago
parent 506f2bfd20
commit 0cd30e48a9

@ -45,8 +45,7 @@ class TransformerLM(nn.Layer, LMInterface, BatchScorerInterface):
if pos_enc == "sinusoidal": if pos_enc == "sinusoidal":
pos_enc_layer_type = "abs_pos" pos_enc_layer_type = "abs_pos"
elif pos_enc is None: elif pos_enc is None:
#TODO pos_enc_layer_type = "no_pos"
pos_enc_layer_type = "None"
else: else:
raise ValueError(f"unknown pos-enc option: {pos_enc}") raise ValueError(f"unknown pos-enc option: {pos_enc}")

@ -384,7 +384,7 @@ class TransformerEncoder(BaseEncoder):
Args: Args:
xs (paddle.Tensor): Input tensor. (B, T, D) xs (paddle.Tensor): Input tensor. (B, T, D)
masks (paddle.Tensor): Mask tensor. (B, 1, T) masks (paddle.Tensor): Mask tensor. (B, T, T)
cache (List[paddle.Tensor]): List of cache tensors. cache (List[paddle.Tensor]): List of cache tensors.
Returns: Returns:

Loading…
Cancel
Save