summaryrefslogtreecommitdiff
path: root/ot/utils.py
diff options
context:
space:
mode:
authorngayraud <nat.gayraud@gmail.com>2019-08-12 16:37:58 -0400
committerngayraud <nat.gayraud@gmail.com>2019-08-12 16:37:58 -0400
commit9d4b786a036ac95989825beec819521089fb4feb (patch)
tree3d9fcc4fd26e5d8dbe100d79eddf0776801df33a /ot/utils.py
parent092866815cf906012f9194b87af1e7ae0270f7e7 (diff)
fixes for travis, added test, minor nits
Diffstat (limited to 'ot/utils.py')
-rw-r--r--ot/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ot/utils.py b/ot/utils.py
index be839f8..a334fea 100644
--- a/ot/utils.py
+++ b/ot/utils.py
@@ -178,7 +178,9 @@ def cost_normalization(C, norm=None):
The input cost matrix normalized according to given norm.
"""
- if norm == "median":
+ if norm is None:
+ pass
+ elif norm == "median":
C /= float(np.median(C))
elif norm == "max":
C /= float(np.max(C))