
pytorch
icoderzqliu
菜鸡一枚···
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python列表切片中的None
None起到增加维度的作用 def calc_mask_score(self, attention_mask): ''' input: [b,n] output: [b,h,n,n] ''' mask_score = torch.zeros(attention_mask.size(0),self.nums_heads,attention_mask.size(1),attention_mask.size(1)) # [b,h,n,原创 2021-12-07 15:41:01 · 1132 阅读 · 0 评论 -
PyTorch中向量表示
PyTorch中向量默认为行向量!(和习惯相反) 以nn.Linear()为例: Applies a linear transformation to the incoming data: y=xAT+by = xA^T + by=xAT+b原创 2021-12-06 22:00:14 · 467 阅读 · 0 评论