Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Sep 18, 2024
1 parent 1b826c9 commit ba9b4d1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests-cuda/test_3140_cuda_slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,20 +678,30 @@ def test_0127_tomask_operation():
[6.6, None, None, 9.9],
]


arrg_cpu = ak.Array([[1, 2, 3], [0], [4, 5]])
arrg_gpu = ak.Array([[1, 2, 3], [0], [4, 5]], backend="cuda")


def test_simple_slice_cpu():
print("slice on CPU")
out = arrg_cpu[:, 0]
expected = [1, 0, 4]
result = out.tolist()
cp.testing.assert_array_list_equal(result, expected, err_msg=f"Slice of [[1, 2, 3], [0], [4, 5]] should be {expected}, but got {result}")
cp.testing.assert_array_list_equal(
result,
expected,
err_msg=f"Slice of [[1, 2, 3], [0], [4, 5]] should be {expected}, but got {result}",
)


def test_simple_slice_gpu():
print("slice on GPU")
out = arrg_gpu[:, 0]
expected = [1, 0, 4]
result = out.tolist()
cp.testing.assert_array_list_equal(result, expected, err_msg=f"Slice of [[1, 2, 3], [0], [4, 5]] should be {expected}, but got {result}")
cp.testing.assert_array_list_equal(
result,
expected,
err_msg=f"Slice of [[1, 2, 3], [0], [4, 5]] should be {expected}, but got {result}",
)

0 comments on commit ba9b4d1

Please sign in to comment.