RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead
welcometomyblog问题描述我想将pytorch的计算结果赋值给numpyarray,S[i,v]=torch.div(row_res,row_sum),其中S是numpyarray,结果报错RuntimeError:Can’tcallnumpy()onVariablethatrequiresgrad.Usevar.detach().numpy()instead,意思是:需要求导的变量无