Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Add tf.topk #1172

Merged
merged 5 commits into from
Jul 18, 2018
Merged

Add tf.topk #1172

merged 5 commits into from
Jul 18, 2018

Conversation

dsmilkov
Copy link
Contributor

@dsmilkov dsmilkov commented Jul 17, 2018

Add tf.topk.

This is required in ssd_mobilenet_v2: tensorflow/tfjs#188. Uses a shared implementation across webgl and cpu where the values are downloaded and sorted on the cpu. There is already an issue that tracks topk on the gpu, which we can revisit later: tensorflow/tfjs#94

FEATURE


This change is Reviewable

@dsmilkov dsmilkov requested a review from nsthorat July 17, 2018 21:03
Copy link
Contributor

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 9 of 9 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @dsmilkov and @nsthorat)


src/ops/topk.ts, line 34 at r1 (raw file):

  if (k > lastDim) {
    throw new Error(
        `'k' passed to topk() must be <= the last dimension (${lastDim})`);

but got ${k}

@dsmilkov
Copy link
Contributor Author

cc @pyu10055 for adding support in the converter after this is in.

Copy link
Contributor Author

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained


src/ops/topk.ts, line 34 at r1 (raw file):

Previously, nsthorat (Nikhil Thorat) wrote…

but got ${k}

Done

@dsmilkov dsmilkov merged commit 8c3a1f3 into master Jul 18, 2018
@dsmilkov dsmilkov deleted the topk branch July 18, 2018 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants