fix bug for 'can't set attribute'

pull/3546/head
luayo-cv 2 years ago
parent 1dc67f96e0
commit 2b469841a8

@ -48,7 +48,6 @@ class PositionalEncoding(nn.Layer):
self.xscale = math.sqrt(self.d_model) self.xscale = math.sqrt(self.d_model)
self.dropout = nn.Dropout(p=dropout_rate) self.dropout = nn.Dropout(p=dropout_rate)
self.pe = None self.pe = None
self.dtype = dtype
self.extend_pe(paddle.expand(paddle.zeros([1]), (1, max_len))) self.extend_pe(paddle.expand(paddle.zeros([1]), (1, max_len)))
def extend_pe(self, x): def extend_pe(self, x):

Loading…
Cancel
Save