I now found the problem why my program was not converging i used argmag instead of sampling from the propabillety distribution from the network (in function  play_episode). This change should fix that problem:
def play_episode(net):
    states, actions, rewards = [], [], []
    obs = env.reset()
    done  = False
    while True:
        state = np.asarray(obs, dtype=np.float32)
        action = Categorical(F.softmax(net(torch.from_numpy(state).view(1,-1)), dim=1)).sample().item()
        obs, reward, done, _ = env.step(action)
        if done:
            return states, actions, rewards
        states.append(state)
        actions.append(action)
        rewards.append(reward)