![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Bug
门萨程序媛
这个作者很懒,什么都没留下…
展开
-
torch.einsum 简单介绍计算流程
torch.einsum>>> a = torch.arange(60.).reshape(5,3,4)>>> b = torch.arange(24.).reshape(3,4,2)>>> o = torch.einsum('fnd,ndh->fh', a, b)>>> otensor([[1012., 1078.], [2596., 2806.], [4180., 4534.],原创 2021-05-18 10:53:48 · 583 阅读 · 0 评论 -
pytorch bug: a leaf Variable that requires grad has been used in an in-place operation
pytorch写的好好的代码运行到某一块突然显示a leaf Variable that requires grad has been used in an in-place operation这个bug的意思是 需要梯度的叶子变量被用在了原位操作里指的是 如果是原位操作,就会覆盖原来的值。因为并不是计算过程,是赋值,梯度是多少这个没有一个定义(或许是一个跳变过程,梯度无穷大)。所以...原创 2019-08-27 21:45:35 · 2307 阅读 · 0 评论