Skip to content

Commit

Permalink
add test for Python constant arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaehashi committed Apr 4, 2018
1 parent 54af21d commit 2b4b940
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cupy_tests/core_tests/test_fusion.py
Expand Up @@ -1378,3 +1378,18 @@ def f(x):

f(testing.shaped_arange((1,), numpy, 'f'))
f(testing.shaped_arange((1,), cupy, 'f'))


@testing.gpu
@testing.parameterize(*testing.product({
'dtype': [int, float, bool, complex],
}))
class TestFusionPythonConstant(unittest.TestCase):

@testing.numpy_cupy_array_equal()
def test_python_scalar(self, xp):
dtype = self.dtype
@cupy.fuse()
def f(x):
return x * dtype(1)
return f(testing.shaped_arange((1,), xp, dtype))

0 comments on commit 2b4b940

Please sign in to comment.