Skip to content

Commit a9bbc2c

Browse files
committed
change or in assert by and
1 parent 92dbe25 commit a9bbc2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ot/lp/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def emd(a, b, M, numItermax=100000, log=False):
109109
if len(b) == 0:
110110
b = np.ones((M.shape[1],), dtype=np.float64) / M.shape[1]
111111

112-
assert (a.shape[0] == M.shape[0] or b.shape[0] == M.shape[1]), \
112+
assert (a.shape[0] == M.shape[0] and b.shape[0] == M.shape[1]), \
113113
"Dimension mismatch, check dimensions of M with a and b"
114114

115115
G, cost, u, v, result_code = emd_c(a, b, M, numItermax)
@@ -215,7 +215,7 @@ def emd2(a, b, M, processes=multiprocessing.cpu_count(),
215215
if len(b) == 0:
216216
b = np.ones((M.shape[1],), dtype=np.float64) / M.shape[1]
217217

218-
assert (a.shape[0] == M.shape[0] or b.shape[0] == M.shape[1]), \
218+
assert (a.shape[0] == M.shape[0] and b.shape[0] == M.shape[1]), \
219219
"Dimension mismatch, check dimensions of M with a and b"
220220

221221
if log or return_matrix:

0 commit comments

Comments
 (0)