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

Function test_ones_errors

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

Source from the content-addressed store, hash-verified

107
108
109def test_ones_errors():
110 ones((1,), device="cpu") # Doesn't error
111 assert_raises(ValueError, lambda: ones((1,), device="gpu"))
112 assert_raises(ValueError, lambda: ones((1,), dtype=int))
113 assert_raises(ValueError, lambda: ones((1,), dtype="i"))
114
115
116def test_ones_like_errors():

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
onesFunction · 0.50

Tested by

no test coverage detected