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

Function test_unif_backend

test/test_utils.py:184–192  ·  view source on GitHub ↗
(nx)

Source from the content-addressed store, hash-verified

182
183
184def test_unif_backend(nx):
185 n = 100
186
187 for tp in nx.__type_list__:
188 print(nx.dtype_device(tp))
189
190 u = ot.unif(n, type_as=tp)
191
192 np.testing.assert_allclose(1, np.sum(nx.to_numpy(u)), atol=1e-6)
193
194
195def test_dist():

Callers

nothing calls this directly

Calls 3

to_numpyMethod · 0.80
dtype_deviceMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected