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

Method to_numpy

ot/backend.py:261–266  ·  view source on GitHub ↗

Returns the numpy version of tensors

(self, *arrays)

Source from the content-addressed store, hash-verified

259
260 # convert batch of tensors to numpy
261 def to_numpy(self, *arrays):
262 """Returns the numpy version of tensors"""
263 if len(arrays) == 1:
264 return self._to_numpy(arrays[0])
265 else:
266 return [self._to_numpy(array) for array in arrays]
267
268 # convert a tensor to numpy
269 def _to_numpy(self, a):

Callers 15

test_empty_backendFunction · 0.95
line_search_armijoFunction · 0.80
phiFunction · 0.80
distFunction · 0.80
fun_to_numpyFunction · 0.80
fun_numpyFunction · 0.80
to_numpyFunction · 0.80
coo_matrixMethod · 0.80
medianMethod · 0.80
medianMethod · 0.80
nan_to_numMethod · 0.80

Calls 1

_to_numpyMethod · 0.95

Tested by 15

test_empty_backendFunction · 0.76
assert_allclose_solFunction · 0.64
test_cootFunction · 0.64
test_entropic_cootFunction · 0.64
test_coot_warmstartFunction · 0.64
test_sanityFunction · 0.64