MCPcopy Create free account
hub / github.com/Kaggle/docker-python / TestCupy

Class TestCupy

tests/test_cupy.py:6–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6class TestCupy(unittest.TestCase):
7 @gpu_test
8 def test_kernel(self):
9 import cupy as cp
10 x = cp.arange(6, dtype='f').reshape(2, 3)
11 y = cp.arange(3, dtype='f')
12 kernel = cp.ElementwiseKernel(
13 'float32 x, float32 y', 'float32 z',
14 '''if (x - 2 > y) {
15 z = x * y;
16 } else {
17 z = x + y;
18 }''',
19 'my_kernel')
20 r = kernel(x, y)
21
22 self.assertEqual((2, 3), r.shape)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected