Hello, thanks for reply.
I directly replace all a+=b by a=a+b, now there is no such operation in my code.
I read somewhere to use “with torch.no_grad():” function I tried it but I get an other error " element 0 of tensors  does not require grad and does not have a grad_fn"