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

Function to_numpy

ot/backend.py:232–238  ·  view source on GitHub ↗

Returns numpy arrays from any compatible backend

(*args)

Source from the content-addressed store, hash-verified

230
231
232def to_numpy(*args):
233 """Returns numpy arrays from any compatible backend"""
234
235 if len(args) == 1:
236 return get_backend(args[0]).to_numpy(args[0])
237 else:
238 return [get_backend(a).to_numpy(a) for a in args]
239
240
241class Backend:

Calls 2

get_backendFunction · 0.85
to_numpyMethod · 0.80

Tested by 4

test_partial_wassersteinFunction · 0.72
test_to_numpyFunction · 0.72