albanD:

min=1e


I got same error
    o = o.clamp(min=1e-4)
    return o.log(),planlogits

Traceback (most recent call last):
  File "./train.py", line 351, in <module>
    main(args)
  File "./train.py", line 137, in main
    train_joint
  File "./train.py", line 221, in train
    gr_loss.backward()
  File "~/anaconda3/envs/torch-sci/lib/python3.6/site-packages/torch/tensor.py", line 198, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "~/anaconda3/envs/torch-sci/lib/python3.6/site-packages/torch/autograd/__init__.py", line 100, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: Function 'LogBackward' returned nan values in its 0th output.