06 2021 档案

摘要:原贴地址:https://www.jianshu.com/p/e568213c8501 写模型的时候需要根据索引赋,直接写python效率很低,看到这个帖子原来pytorch内部已经实现了。 主要是 scatter index_fill index_put 阅读全文
posted @ 2021-06-17 13:14 Luke_Ye 阅读(672) 评论(0) 推荐(0)
摘要:tokenizer有个私有方法_convert_token_to_id,但这个方法是不会考虑added的词表的,如果用这个函数获取额外添加的词,会返回unk的id,正确的方法是采用_convert_token_to_id_with_added_voc这个函数。 阅读全文
posted @ 2021-06-15 20:44 Luke_Ye 阅读(184) 评论(0) 推荐(0)