Hi,
Not sure I can speak for which repos you are referring to, but if you look at the official DQN tutorial:
https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html 30
you can see that select action (what is used during the collection of experience tuples), is using with torch.no_grad()
def select_action(state):
    global steps_done
    sample = random.random()
    eps_threshold = EPS_END + (EPS_START - EPS_END) * \
        math.exp(-1. * steps_done / EPS_DECAY)
    steps_done += 1
    if sample > eps_threshold:
        with torch.no_grad():
            return policy_net(state).max(1)[1].view(1, 1)
    else:
        return torch.tensor([[random.randrange(2)]], device=device, dtype=torch.long)