import tensorflow as tf
import numpy as np
with tf.Session() as sess:
x = tf.constant([[1, 2, 4], [8, 16, 32]]) # 2x2 matrix
# Tensor("Const:0", shape=(2, 3), dtype=int32)
print(x)
# 方法1
# [[ 1 2 4]
# [ 8 16 32]]
print(x.eval())
# 方法2
# [[ 1 2 4]
# [ 8 16 32]]
print(sess.run(x))