Created
February 21, 2019 08:39
-
-
Save hccho2/3430e79703129d9ee815c9c226c4cb22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import tensorflow as tf | |
import numpy as np | |
tf.reset_default_graph() | |
col_size=6 | |
n = 3 | |
a = np.arange(col_size*n*n).reshape(col_size*n,n) | |
x = tf.convert_to_tensor(a) | |
y = tf.reshape(x,[col_size*n*n]) | |
index = [n*j+n*i*col_size +i for i in range(n) for j in range(col_size)] | |
z = tf.gather(y,index) | |
sess= tf.Session() | |
sess.run(z) |
Author
hccho2
commented
Feb 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment