pytorch index_put_给出运行时错误:'的导数;指数';没有实施
这是后续问题。我尝试使用中建议的pytorch index_put_给出运行时错误:'的导数;指数';没有实施,pytorch,autograd,Pytorch,Autograd,这是后续问题。我尝试使用中建议的index\u put\u,但是我得到了以下错误 RuntimeError: the derivative for 'indices' is not implemented 我想通过索引反向传播错误梯度,因此无法detach()it。有没有办法做到这一点 例如: import torch image = torch.tensor([[246, 50, 101], [116, 1, 113], [187, 110, 64]]) iy = torch.ten
index\u put\u
,但是我得到了以下错误
RuntimeError: the derivative for 'indices' is not implemented
我想通过索引反向传播错误梯度,因此无法detach()
it。有没有办法做到这一点
例如:
import torch
image = torch.tensor([[246, 50, 101], [116, 1, 113], [187, 110, 64]])
iy = torch.tensor([[1, 0, 2], [1, 0, 2], [2, 2, 2]])
ix = torch.tensor([[0, 2, 1], [1, 2, 0], [0, 1, 2]])
warped_image = torch.zeros(size=image.shape)
warped_image.index_put_((iy, ix), image, accumulate=True)