import tensorflow as tf
import numpy as np
y,x = np.mgrid[0:38,0:38]
with tf.Session() as sess:
print(x)
print(y)
结果:
x
[[ 0 1 2 ... 35 36 37]
[ 0 1 2 ... 35 36 37]
[ 0 1 2 ... 35 36 37]
...
[ 0 1 2 ... 35 36 37]
[ 0 1 2 ... 35 36 37]
[ 0 1 2 ... 35 36 37]]
y
[[ 0 0 0 ... 0 0 0]
[ 1 1 1 ... 1 1 1]
[ 2 2 2 ... 2 2 2]
...
[35 35 35 ... 35 35 35]
[36 36 36 ... 36 36 36]
[37 37 37 ... 37 37 37]]