diff options
Diffstat (limited to 'ot')
-rw-r--r-- | ot/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ot/utils.py b/ot/utils.py index 57fb4a4..e3437da 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -234,7 +234,9 @@ def dist(x1, x2=None, metric='sqeuclidean', p=2, w=None): else: if isinstance(metric, str) and metric.endswith("minkowski"): return cdist(x1, x2, metric=metric, p=p, w=w) - return cdist(x1, x2, metric=metric, w=w) + if w is not None: + return cdist(x1, x2, metric=metric, w=w) + return cdist(x1, x2, metric=metric) def dist0(n, method='lin_square'): |