02 2021 档案
摘要:torch.nn.Embedding(num_embeddings: int, embedding_dim: int)是用来embed词成为word embedding的 num_embeddings (int): size of the dictionary of embeddingsembedd
阅读全文
摘要:本文讨论了huggingface 🤗 Transformers的简单使用。原网址:https://huggingface.co/transformers/quicktour.html使用transformer库需要两个部件:Tokenizer和model。使用.from_pretrained(na
阅读全文
摘要:"我心想,你这样落魄的人也配考我" "记着吧,将来考举可能用得到。” 1.* 这种就是element-wise的 2.torch.mul 也是elemenet-wise的,同* 3.torch.mm 单纯的数学上的矩阵乘法,不支持广播。也不支持tensor相乘。 4.torch.bmm 专门用来算t
阅读全文
摘要:总结: torch.function(x, dim) 1.if 不传: 依照默认参数决定 2.if dim >=0 and dim <= x.dim()-1: 0是沿最粗数据粒度的方向进行操作,x.dim()-1是按最细粒度的方向。 3.if dim <0: dim的最小取值(此按照不同functi
阅读全文