-
Notifications
You must be signed in to change notification settings - Fork 943
Conversation
8b35560
to
4f6d40c
Compare
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.
Reviewed 2 of 8 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @syt123450)
src/backends/webgl/backend_webgl.ts, line 1323 at r1 (raw file):
inTopK<T extends Tensor, U extends Tensor>( predictions: T, targets: U, k: number): U { const predictionsVals = predictions.dataSync();
We made a mistake with topk, it actually should be async. Can you make these call .data() instead and return a Promise?
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.
Reviewed 1 of 8 files at r1.
Reviewable status: 0 of 1 approvals obtained (waiting on @syt123450)
src/backends/webgl/backend_webgl.ts, line 1323 at r1 (raw file):
Previously, nsthorat (Nikhil Thorat) wrote…
We made a mistake with topk, it actually should be async. Can you make these call .data() instead and return a Promise?
Oh hm... we can't make the kernel's asynchronous.. let me think about this.
Hi @nsthorat , it seems that in |
I'm going to merge this and send a follow up to remove this as a kernel, apologies. This will be fine for now. Thanks for the PR! |
FEATURE
This PR add inTopK op, which behaves the same way as tf.math.in_top_k in TensorFlow. This op help develop further metrics which depend on inTopK operation, such as, topKCategoricalAccuracy (feature requested in tensorflow/tfjs#27 ), sparseTopKCategoricalAccuracy (feature requested in tensorflow/tfjs#26). Relative PR tensorflow/tfjs-layers#537
This PR:
Reference:
This change is