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

Function test_backend

test/batch/test_solve_batch.py:136–145  ·  view source on GitHub ↗

Check that all gradient methods run without error.

(nx)

Source from the content-addressed store, hash-verified

134
135
136def test_backend(nx):
137 """Check that all gradient methods run without error."""
138 batchsize = 2
139 n = 4
140 d = 2
141 X = np.random.randn(batchsize, n, d)
142 X = nx.from_numpy(X)
143 M = dist_batch(X, X)
144 solve_batch(M, reg=0.1, max_iter=10, tol=1e-5)
145 solve_sample_batch(X, X, reg=0.1, max_iter=10, tol=1e-5)

Callers

nothing calls this directly

Calls 5

dist_batchFunction · 0.90
solve_batchFunction · 0.90
solve_sample_batchFunction · 0.90
from_numpyMethod · 0.80
randnMethod · 0.45

Tested by

no test coverage detected