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

Method nan_to_num

ot/backend.py:3331–3334  ·  view source on GitHub ↗
(self, x, copy=True, nan=0.0, posinf=None, neginf=None)

Source from the content-addressed store, hash-verified

3329
3330 # todo(okachaiev): replace this with a more reasonable implementation
3331 def nan_to_num(self, x, copy=True, nan=0.0, posinf=None, neginf=None):
3332 x = self.to_numpy(x)
3333 x = np.nan_to_num(x, copy=copy, nan=nan, posinf=posinf, neginf=neginf)
3334 return self.from_numpy(x)
3335
3336 def det(self, x):
3337 return tf.linalg.det(x)

Callers

nothing calls this directly

Calls 3

to_numpyMethod · 0.80
from_numpyMethod · 0.80
nan_to_numMethod · 0.45

Tested by

no test coverage detected