Pytorch tensor的值 赋值给python变量
pytorch下只打印tensor的数值不打印出device等信息
print(conf)
str_1 = f'{conf:.5f}' conf_2 = float(str_1)
print(conf_2)
tensor(0.12781, device='cuda:0')
0.12781
#############
Pytorch tensor的值 赋值给python变量
print(conf)
str_1 = f'{conf:.5f}' conf_2 = float(str_1)
print(conf_2)
tensor(0.12781, device='cuda:0')
0.12781
#############