Let’s assume the following situation.
logits = model(inputs)
logits_x = logits[:batch_size]
logits_u_w, logits_u_s = logits[batch_size:].chunk(2)
del logits

e.g.1
pseudo_label = torch.softmax(logits_u_w, dim=-1).detach()
e.g.2
pseudo_label = torch.softmax(logits_u_w.detach(), dim=-1)

Q. I want the operation between “logits_u_w” and “softmax” not to be included in autograd. What is correct? What is the reason?