关于 pytorch中Tensor数据类型的使用问题

在使用github上关于LAPGAN的代码时发现程序报错

Original exception was:
Traceback (most recent call last):
  File "run_LAPGAN.py", line 201, in <module>
    G_featmap_dim=128, condi_G_featmap_dim=64, update_max=50)
  File "run_LAPGAN.py", line 194, in run_LAPGAN
    update_max=update_max)
  File "run_LAPGAN.py", line 116, in train_LAPGAN
    if condi_inputs:
RuntimeError: bool value of Tensor with more than one value is ambiguous

经过检查发现错误代码片为:

if condi_inputs:
    condi_inputs = torch.cat((condi_inputs, condi_inputs))

不知道有没有大神可以回答一下这里直接用IF判断一个Tensor变量的用意是啥?以及要怎样更改才能不报错?

github代码地址:https://github.com/AaronYALai/Generative_Adversarial_Networks_PyTorch/tree/master/LAPGAN

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^