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

how to assign values in Tensor according to the indices? #2713

Closed
jiankang1991 opened this issue Jun 7, 2016 · 3 comments
Closed

how to assign values in Tensor according to the indices? #2713

jiankang1991 opened this issue Jun 7, 2016 · 3 comments

Comments

@jiankang1991
Copy link

jiankang1991 commented Jun 7, 2016

I want to assign values in a tensor according to the indices.

For example, According to the pooling values and the corresponding indices output of tf.nn.max_pool_with_argmax, I want to put these pooling values back into the original unpooling Tensor given the indices.

According to the trick in Adjust Single Value within Tensor — TensorFlow
I can recreate sparse tensor with the indices.
But here is the problem: tf.SparseTensor should input the unflattened indices i.e. the ndims coordinates list.
If I use this method, how to unravel the flattened indices obtained by tf.nn.max_pool_with_argmax to the normal indices?
If I do not use this method, is there any way in Tensorflow to achieve this work?
Thank you very much.

@jiankang1991
Copy link
Author

@vrv @mrry @girving
Thank you very much.

@jiankang1991
Copy link
Author

@girving
Copy link
Contributor

girving commented Jun 8, 2016

Thank you for posting the question on StackOverflow! See also #2075.

@girving girving closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants