-
Notifications
You must be signed in to change notification settings - Fork 944
Gradient for tf.gather #981
Conversation
Really nice work! Left a few comments but nothing major. Will LGTM after your reply and merge. Thanks Josh! Reviewed 2 of 2 files at r1. src/ops/array_ops.ts, line 883 at r1 (raw file):
to avoid dealing with src/ops/array_ops.ts, line 886 at r1 (raw file):
since you already wrote this op and TF has it (tf.unsorted_segment_sum), can you expose it to the public API and add docs? src/ops/array_ops.ts, line 894 at r1 (raw file):
to save memory, and since the gradient for indices is meaningless, remove
src/ops/array_ops.ts, line 1295 at r1 (raw file):
same here: src/ops/array_ops.ts, line 1313 at r1 (raw file):
If I understand correctly the shape, you can take advantage of the Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. src/ops/array_ops.ts, line 883 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 886 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
I exposed src/ops/array_ops.ts, line 894 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 1295 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 1313 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done, thanks for noticing that, I completely missed it. src/ops/array_ops.ts, line 1293 at r2 (raw file):
Do I need to dispose of intermediate tensors like Comments from Reviewable |
Thanks, and sorry for the delay. Couple small things left (see comments). Really nice work man Reviewed 4 of 4 files at r2. src/ops/array_ops.ts, line 886 at r1 (raw file): Previously, jgartman (Josh Gartman) wrote…
Thanks! The subheading 'Reduction' src/ops/array_ops.ts, line 1249 at r2 (raw file):
this snippet might error unless you explicitly say indices is of type src/ops/array_ops.ts, line 1263 at r2 (raw file):
add src/ops/array_ops.ts, line 1293 at r2 (raw file): Previously, jgartman (Josh Gartman) wrote…
Great q. See my comment above. Add Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 4 unresolved discussions. src/ops/array_ops.ts, line 886 at r1 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 1249 at r2 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 1263 at r2 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/ops/array_ops.ts, line 1293 at r2 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. Comments from Reviewable |
Reviewed 3 of 6 files at r3, 3 of 3 files at r4. Comments from Reviewable |
This PR implements the gradient for
tf.gather
. tensorflow/tfjs#135This change is