This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from chainer import Function | |
| from chainer import cuda | |
| from chainer.utils import type_check, force_array | |
| def cupy_place(arr, mask, val): | |
| _place_kernel = cuda.cupy.ElementwiseKernel( | |
| 'T a, S mask, T val', | |
| 'T out', | |
| 'out = mask ? val : a', |