Gradient for gather_nd is not implemented #5342

Open
lan2720 opened this Issue Nov 2, 2016 · 4 comments

Projects

None yet

4 participants

@lan2720
lan2720 commented Nov 2, 2016 edited

Hi all,

when I use tf.gather_nd, It gives me the error "NotImplementedError: Gradient for gather_nd is not implemented".

I can temporarily solve this problem to flatten both of params and indices and then use tf.gather. But it isn't the best way to do so.

Is there any plan to support that? Thanks!

@ebrevdo ebrevdo was assigned by aselle Nov 2, 2016
@aselle
Member
aselle commented Nov 2, 2016

Yes, we are planning to support that. The patch will be imminently committed. @narphorium is implementing it.

@aselle aselle added the type:feature label Nov 2, 2016
@lan2720
lan2720 commented Nov 2, 2016

@aselle Oh great. Thanks for your quick reply. I'm looking forward to it.

@tfka
tfka commented Nov 2, 2016

@lan2720 。。how to flatten, I meet the same problem and I am a newer to tensorflow . Hope some advice for me . Thanks

@lan2720
lan2720 commented Nov 2, 2016

@tfka Yes, to use tf.gather you just need to reshape your params and indices.

For example

params = [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15]]
indices = [[2, 3, 1], [4, 0, 2], [3, 4, 0]]
# After some operation
new_params = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
new_indices = [2, 3, 1, 4+5, 0+5, 2+5, 3+10, 4+10, 0+10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment