def __call__(self, x):
"""Build the actual model here.
Args:
x: The encoded or embedded input sequence.
Returns:
The model output tensor.
"""
# Avoid mask propagation when dynamic mini-batches are not supported.
if not self.allows_dynamic_length():
x = ConsumeMask()(x)
x = self.build_model(x)
if self.dropout_rate > 0:
x = Dropout(self.dropout_rate)(x)
return x
评论列表
文章目录