Dear Ramon,
I tested your code and realized that 1) your loss function and p.grad is nearly zero; 2) your model just outputs a fixed policy which has a categorical distribution of [0,1], thus results in a fixed action selection. I don’t know exactly why this is happening yet but you can possibly try to play around with your model initialization (make your model randomly initialized etc).
Good luck!