I’m not familiar with REINFORCE, but from the code snippet it looks like you shouldn’t re-wrap your policy_loss into a new Variable, as this will detach your computation graph.
Could you just skip the Variable creation and just perform the mul and sum operation?
Not related to the problem, but in the current stable release, Variables and tensors were merged besides a lot of other bug fixes and new features. Have a look at the website 4 for the install instructions.