prediction_layer.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:jack 作者: uclmr 项目源码 文件源码
def _mask(hypothesis, hypothesis_length, premise, premise_length):
    p_mask = tf.sequence_mask(premise_length, tf.shape(premise)[1], dtype=tf.float32)
    h_mask = tf.sequence_mask(hypothesis_length, tf.shape(hypothesis)[1], dtype=tf.float32)

    premise *= tf.expand_dims(p_mask, 2)
    hypothesis *= tf.expand_dims(h_mask, 2)
    return hypothesis, premise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号