Skip to content
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

projector: fix broken KNN #5063

Merged
merged 3 commits into from Jun 16, 2021
Merged

Conversation

stephanwlee
Copy link
Contributor

There were several issues with the code.

  1. Tensor.prototype.transpose symbol no longer exist. Replaced it with
    tf.transpose instead.
  2. KNN reuse was flawed as reused version would return a different
    number of outputs than what it would return normally.
  3. tf.split expects all returned members to have the equal size where
    it previously could not guarantee that. We now pad the matrix so the
    equal size can be formed even if we discard useless padded elements.

In the future, we may want to disable GPU based computation acceleration
as it is actually slower than just doing it on CPU.

There were several issues with the code.

1. `Tensor.prototype.transpose` symbol no longer exist. Replaced it with
  `tf.transpose` instead.
2. KNN reuse was flawed as reused version would return a different
  number of outputs than what it would return normally.
3. `tf.split` expects all returned members to have the equal size where
it previously could not guarantee that. We now pad the matrix so the
  equal size can be formed even if we discard useless padded elements.

In the future, we may want to disable GPU based computation acceleration
as it is actually slower than just doing it on CPU.
@stephanwlee stephanwlee requested a review from bmd3k June 15, 2021 18:32
@google-cla google-cla bot added the cla: yes label Jun 15, 2021
@stephanwlee stephanwlee merged commit 2b423dc into tensorflow:master Jun 16, 2021
@stephanwlee stephanwlee deleted the projector_fix branch June 16, 2021 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants