MixMatch-pytorch icon indicating copy to clipboard operation
MixMatch-pytorch copied to clipboard

why use .detach() here

Open hzhz2020 opened this issue 3 years ago • 0 comments

Hi

Thanks for the great repo. I'm wondering in the line below, why do we need .detach(), isn't that the targets_u is already in the scope of torch.no_grad()?

https://github.com/YU1ut/MixMatch-pytorch/blob/cc7ef42cffe61288d06eec1428268b384674009a/train.py#L235

hzhz2020 avatar Feb 25 '22 03:02 hzhz2020