首页 新闻 会员 周边

pytorch中torch.pow()

0
[待解决问题]

def distconvert(self, dist, s, m):
    a = torch.ones(dist.size())
    b = torch.ones(dist.size())
    c = a + b
    final_dist = torch.pow(Variable(c),dist)
return final_dist

执行到第5行时,报如下错误:

(float base)didn't match because some of the arguments have invalid types:(torch.cuda.FloatTensor)

 

type(dist)类型时,也是Variable类型的

张小仙儿的主页 张小仙儿 | 菜鸟二级 | 园豆:249
提问于:2018-08-04 16:55
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册