def forward(self, x):
        xp = cuda.get_array_module(*x)
        if xp != numpy and cuda.cudnn_enabled and self.use_cudnn:
            dtype = x[0].dtype
            one = numpy.array(1, dtype=dtype).ctypes
            zero = numpy.array(0, dtype=dtype).ctypes
            handle = cudnn.get_handle()
            x_cube = x[0].reshape(x[0].shape[:2] + (-1, 1))
            desc = cudnn.create_tensor_descriptor(x_cube)
            self.y = xp.empty_like(x[0])
            libcudnn.softmaxForward(
                handle, _algorithm, _mode, one.data, desc.value,
                x_cube.data.ptr, zero.data, desc.value,
                self.y.data.ptr)
        else:
            self.y = x[0].max(axis=1, keepdims=True) - x[0]
            xp.exp(self.y, out=self.y)
            self.y /= self.y.sum(axis=1, keepdims=True)

        return self.y,
dataset/ETHPy150Open pfnet/chainer/chainer/functions/activation/softmax.py/Softmax.forward/swapped operands of `-`