Skip to content

Commit 3b0cdd8

Browse files
committed
Fix double data type issue in hamming_loss_fn.
1 parent e5dc65a commit 3b0cdd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TensorFlowNET.Keras/Metrics/metrics_utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static Tensor hamming_loss_fn(Tensor y_true, Tensor y_pred, Tensor thresh
3131
threshold = tf.reduce_max(y_pred, axis: -1, keepdims: true);
3232
// make sure [0, 0, 0] doesn't become [1, 1, 1]
3333
// Use abs(x) > eps, instead of x != 0 to check for zero
34-
y_pred = tf.logical_and(y_pred >= threshold, tf.abs(y_pred) > 1e-12);
34+
y_pred = tf.logical_and(y_pred >= threshold, tf.abs(y_pred) > 1e-12f);
3535
}
3636
else
3737
{

0 commit comments

Comments
 (0)