MCPcopy Create free account
hub / github.com/numpy/numpy / test_ones_like_errors

Function test_ones_like_errors

numpy/array_api/tests/test_creation_functions.py:116–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115
116def test_ones_like_errors():
117 ones_like(asarray(1), device="cpu") # Doesn't error
118 assert_raises(ValueError, lambda: ones_like(asarray(1), device="gpu"))
119 assert_raises(ValueError, lambda: ones_like(asarray(1), dtype=int))
120 assert_raises(ValueError, lambda: ones_like(asarray(1), dtype="i"))
121
122
123def test_zeros_errors():

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
ones_likeFunction · 0.50
asarrayFunction · 0.50

Tested by

no test coverage detected