We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef8e772 commit bbe0131Copy full SHA for bbe0131
qdrant_client/local/distances.py
@@ -165,10 +165,9 @@ def calculate_distance_core(
165
166
167
def fast_sigmoid(x: np.float32) -> np.float32:
168
- if np.isnan(x):
169
- # To avoid divisions on NaNs, which gets: RuntimeWarning: invalid value encountered in scalar divide
170
- return x # NaN
171
-
+ if np.isnan(x) or np.isinf(x):
+ # To avoid divisions on NaNs or inf, which gets: RuntimeWarning: invalid value encountered in scalar divide
+ return x
172
return x / np.add(1.0, abs(x))
173
174
0 commit comments