Skip to content

Commit 5ac5553

Browse files
committed
TF implementation of unique should inverse sort permutation for indicies
1 parent c249be0 commit 5ac5553

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ot/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,7 @@ def diag(self, a, k=0):
27932793
def unique(self, a, return_inverse=False):
27942794
y, idx = tf.unique(tf.reshape(a, [-1]))
27952795
sort_idx = tf.argsort(y)
2796-
return y[sort_idx] if not return_inverse else (y[sort_idx], idx[sort_idx])
2796+
return y[sort_idx] if not return_inverse else (y[sort_idx], sort_idx[idx])
27972797

27982798
def logsumexp(self, a, axis=None):
27992799
return tf.math.reduce_logsumexp(a, axis=axis)

0 commit comments

Comments
 (0)