We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
the comment is:[[3,1,2], [2,3,1]] -> [[[0, 3], [1, 1], [2, 2]], [[0, 2], [1, 3], [2, 1]]]
but when I test it, it output this:[[[0 3],[0 1],[0 2]],[[1 2],[1 3],[1 1]]]
this is test code:
with tf.Session(): ,,,,,,,print index_matrix_to_pairs(tf.constant([[3,1,2], [2,3,1]])).eval()
The text was updated successfully, but these errors were encountered:
I have the same question
Sorry, something went wrong.
should fix to follow? def index_matrix_to_pairs(index_matrix):
replicated_first_indices = tf.range(tf.shape(index_matrix)[-1]) #[0, 1, 2] rank = len(index_matrix.get_shape()) if rank == 2: replicated_first_indices = tf.tile( tf.expand_dims(replicated_first_indices, dim=0), #[[0, 1, 2]] [tf.shape(index_matrix)[0], 1]) return tf.stack([replicated_first_indices, index_matrix], axis=rank)
No branches or pull requests
the comment is:[[3,1,2], [2,3,1]] -> [[[0, 3], [1, 1], [2, 2]], [[0, 2], [1, 3], [2, 1]]]
but when I test it, it output this:[[[0 3],[0 1],[0 2]],[[1 2],[1 3],[1 1]]]
this is test code:
with tf.Session():
,,,,,,,print index_matrix_to_pairs(tf.constant([[3,1,2], [2,3,1]])).eval()
The text was updated successfully, but these errors were encountered: