<
8000
div class="prc-PageLayout-Content--F7-I" data-width="full" style="--spacing:var(--spacing-none)">
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1127,7 +1127,7 @@ def cosine_distances(X, Y=None):
1127
1127
S = cosine_similarity (X , Y )
1128
1128
S *= - 1
1129
1129
S += 1
1130
- S = _clip (X , S , 0 , 2 , xp )
1130
+ S = _clip (S , 0 , 2 , xp )
1131
1131
if X is Y or Y is None :
1132
1132
# Ensure that distances between vectors and themselves are set to 0.0.
1133
1133
# This may not be the case due to floating point rounding errors.
Original file line number Diff line number Diff line change @@ -752,7 +752,7 @@ def _nanmax(X, axis=None, xp=None):
752
752
return X
753
753
754
754
755
- def _clip (X , S , min_val , max_val , xp ):
755
+ def _clip (S , min_val , max_val , xp ):
756
756
# TODO: remove this method and change all usage once we move to array api 2023.12
757
757
# https://data-apis.org/array-api/2023.12/API_specification/generated/array_api.clip.html#clip
758
758
if _is_numpy_namespace (xp ):
0 commit comments