Beispiel #1
0
 def backward(self, indexes, grad_outputs):
     gy = grad_outputs[0]
     axis = self.axis
     if axis is not None:
         gx = flip.flip(cumprod(flip.flip(gy, axis), axis), axis)
     else:
         gx = flip.flip(cumprod(flip.flip(gy, 0), 0), 0)
         gx = gx.reshape(self._in_shape)
     return gx,
Beispiel #2
0
    def backward(self, indexes, grad_outputs):
        gy = grad_outputs[0]
        axis = self.axis

        if axis is not None:
            gx = flip.flip(cumsum(flip.flip(gy, axis), axis), axis)
        else:
            gx = flip.flip(cumsum(flip.flip(gy, 0), 0), 0)
            gx = gx.reshape(self._in_shape)

        return gx,
Beispiel #3
0
def _flipcumprodsum(xmul, xadd, axis):
    z, = Cumprodsum(axis).apply((flip.flip(xmul, axis), flip.flip(xadd, axis)))
    return flip.flip(z, axis)
Beispiel #4
0
def _flipcumprodsum(xmul, xadd, axis):
    z, = Cumprodsum(axis).apply((flip.flip(xmul, axis), flip.flip(xadd, axis)))
    return flip.flip(z, axis)