MCPcopy Create free account
hub / github.com/PythonOT/POT / test_to_numpy

Function test_to_numpy

test/test_backend.py:25–33  ·  view source on GitHub ↗
(nx)

Source from the content-addressed store, hash-verified

23
24
25def test_to_numpy(nx):
26 v = nx.zeros(10)
27 M = nx.ones((10, 10))
28
29 v2 = to_numpy(v)
30 assert isinstance(v2, np.ndarray)
31
32 v2, M2 = to_numpy(v, M)
33 assert isinstance(M2, np.ndarray)
34
35
36def test_get_backend_invalid():

Callers

nothing calls this directly

Calls 3

to_numpyFunction · 0.90
zerosMethod · 0.45
onesMethod · 0.45

Tested by

no test coverage detected