fixed segfault, see https://github.com/cupy/cupy/pull/2455#discussion_r325234488
fixed segfault, see https://github.com/cupy/cupy/pull/2455#discussion_r325234488

cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy