-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make L2 generic to work with all float numbers #1532
Conversation
y.chunks_exact(dimension) | ||
.map(move |v| l2_once::<f32x16, 16>(x, v)), | ||
), | ||
_ => Box::new(y.chunks_exact(dimension).map(|v| Self::l2(x, v))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this always resolve correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We let the caller to make sure y is a batch of centroids. Even the dimension is odd number, y.len() % dimension == 0
. We could prob add a debug_assert
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
A minor question about dimension matching in l2_batch
.
No description provided.