def backward_gpu(self, inputs, grad_outputs):
x, t = inputs
gloss = grad_outputs[0]
gx = cuda.cupy.zeros_like(x)
gx = cuda.elementwise(
'S t, T gloss',
'raw T gx',
'int ind[] = {i, t}; gx[ind] = gloss;',
'getitem_bwd'
)(t, gloss, gx)
return gx, None
评论列表
文章目录