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

Method _to_numpy

ot/backend.py:1957–1960  ·  view source on GitHub ↗
(self, a)

Source from the content-addressed store, hash-verified

1955 self.ValFunction = ValFunction
1956
1957 def _to_numpy(self, a):
1958 if isinstance(a, float) or isinstance(a, int) or isinstance(a, np.ndarray):
1959 return np.array(a)
1960 return a.cpu().detach().numpy()
1961
1962 def _from_numpy(self, a, type_as=None):
1963 if (

Callers

nothing calls this directly

Calls 1

detachMethod · 0.80

Tested by

no test coverage detected