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

Method marginal_b

ot/utils.py:1242–1252  ·  view source on GitHub ↗

Second marginal of the transport plan, with the same shape as "b".

(self)

Source from the content-addressed store, hash-verified

1240
1241 @property
1242 def marginal_b(self):
1243 """Second marginal of the transport plan, with the same shape as "b"."""
1244 if self._plan is not None:
1245 return self._backend.sum(self._plan, 0)
1246 elif self._lazy_plan is not None:
1247 lp = self._lazy_plan
1248 bs = self._batch_size
1249 nx = self._backend
1250 return reduce_lazytensor(lp, nx.sum, axis=0, nx=nx, batch_size=bs)
1251 else:
1252 return None
1253
1254 @property
1255 def status(self):

Callers

nothing calls this directly

Calls 2

reduce_lazytensorFunction · 0.85
sumMethod · 0.45

Tested by

no test coverage detected