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

Method marginal_a

ot/utils.py:1229–1239  ·  view source on GitHub ↗

First marginal of the transport plan, with the same shape as "a".

(self)

Source from the content-addressed store, hash-verified

1227
1228 @property
1229 def marginal_a(self):
1230 """First marginal of the transport plan, with the same shape as "a"."""
1231 if self._plan is not None:
1232 return self._backend.sum(self._plan, 1)
1233 elif self._lazy_plan is not None:
1234 lp = self._lazy_plan
1235 bs = self._batch_size
1236 nx = self._backend
1237 return reduce_lazytensor(lp, nx.sum, axis=1, nx=nx, batch_size=bs)
1238 else:
1239 return None
1240
1241 @property
1242 def marginal_b(self):

Callers

nothing calls this directly

Calls 2

reduce_lazytensorFunction · 0.85
sumMethod · 0.45

Tested by

no test coverage detected