def check_backward(self, x_data, y_grad): slices = [] for i, s in enumerate(self.slices): if isinstance(s, numpy.ndarray): s = chainer.cuda.cupy.array(s) if isinstance(s, list): s = chainer.cuda.cupy.array(s, dtype=numpy.int32) slices.append(s) slices = tuple(slices) gradient_check.check_backward( functions.GetItem(slices), (x_data,), y_grad, dtype='d')
def check_backward(self, x_data, y_grad): gradient_check.check_backward(functions.GetItem(self.slices), (x_data, ), y_grad)