MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_array_collapse

Function test_array_collapse

tests/test_numpy_vectorize.py:300–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298
299
300def test_array_collapse():
301 assert not isinstance(m.vectorized_func(1, 2, 3), np.ndarray)
302 assert not isinstance(m.vectorized_func(np.array(1), 2, 3), np.ndarray)
303 z = m.vectorized_func([1], 2, 3)
304 assert isinstance(z, np.ndarray)
305 assert z.shape == (1,)
306 z = m.vectorized_func(1, [[[2]]], 3)
307 assert isinstance(z, np.ndarray)
308 assert z.shape == (1, 1, 1)
309
310
311def test_vectorized_noreturn():

Callers

nothing calls this directly

Calls 2

isinstanceFunction · 0.85
arrayMethod · 0.80

Tested by

no test coverage detected