在程式運行時出現bug
File "C:/Users/zijian/PycharmProjects/project1/regression.py", line 77, in <module>
p = 10 * math.log10(max(labels[j]) ** 2 / loss)
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
代碼如下
if loss < 1.0e-10:
p = 100
else:
p = 10 * math.log10(max(labels[j]) ** 2 / loss)
這是什么原因呢?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/258855.html
