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

Method minimum

ot/backend.py:2059–2067  ·  view source on GitHub ↗
(self, a, b)

Source from the content-addressed store, hash-verified

2057 return torch.max(torch.stack(torch.broadcast_tensors(a, b)), axis=0)[0]
2058
2059 def minimum(self, a, b):
2060 if isinstance(a, int) or isinstance(a, float):
2061 a = torch.tensor([float(a)], dtype=b.dtype, device=b.device)
2062 if isinstance(b, int) or isinstance(b, float):
2063 b = torch.tensor([float(b)], dtype=a.dtype, device=a.device)
2064 if hasattr(torch, "minimum"):
2065 return torch.minimum(a, b)
2066 else:
2067 return torch.min(torch.stack(torch.broadcast_tensors(a, b)), axis=0)[0]
2068
2069 def sign(self, a):
2070 return torch.sign(a)

Callers

nothing calls this directly

Calls 3

minimumMethod · 0.45
minMethod · 0.45
stackMethod · 0.45

Tested by

no test coverage detected