直接使用下面的语句会报错:‘Tensor’ object has no attribute ‘bool’

a = torch.ones(2,2)
a.bool()

应该改成:

a = torch.ones(2,2)
a.byte()
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐