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

Method maximum

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

Source from the content-addressed store, hash-verified

2047 return torch.min(a, axis, keepdim=keepdims)[0]
2048
2049 def maximum(self, a, b):
2050 if isinstance(a, int) or isinstance(a, float):
2051 a = torch.tensor([float(a)], dtype=b.dtype, device=b.device)
2052 if isinstance(b, int) or isinstance(b, float):
2053 b = torch.tensor([float(b)], dtype=a.dtype, device=a.device)
2054 if hasattr(torch, "maximum"):
2055 return torch.maximum(a, b)
2056 else:
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):

Callers

nothing calls this directly

Calls 3

maximumMethod · 0.45
maxMethod · 0.45
stackMethod · 0.45

Tested by

no test coverage detected