105、TensorFlow的变量(一)

import tensorflow as tf

mammal = tf.Variable("Elephant", tf.string)
ignition = tf.Variable(451, tf.int16)
floating = tf.Variable(3.14159265359, tf.float64)
its_complicated = tf.Variable(12.3 - 4.85j, tf.complex64)
sess = tf.Session()
init = tf.global_variables_initializer()
sess.run(init)
print(sess.run(mammal))
print(sess.run(ignition))
print(sess.run(floating))
print(sess.run(its_complicated))

下面是输出的结果

2018-02-16 20:30:08.650791: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
b'Elephant'
451
3.14159
(12.3-4.85j)

 

posted @ 2018-02-16 20:32  香港胖仔  阅读(197)  评论(0编辑  收藏  举报