摘要: RuntimeError:one of the variables needed for gradient computation has been modified by an inplace operation 原因:0.4.0把Varible和Tensor融合为一个Tensor,inplace 阅读全文
posted @ 2018-09-23 22:12 sbj123456789 阅读(4414) 评论(0) 推荐(0) 编辑
摘要: torch.distributions.Categorical() 功能:根据概率分布来产生sample,产生的sample是输入tensor的index 如: >>> m = Categorical(torch.tensor([ 0.25, 0.25, 0.25, 0.25 ])) >>> m.s 阅读全文
posted @ 2018-09-23 14:54 sbj123456789 阅读(6753) 评论(0) 推荐(1) 编辑