美文网首页
用Tensorflow打印"hello world"

用Tensorflow打印"hello world"

作者: secret_liang | 来源:发表于2017-11-27 18:27 被阅读0次

在计算机科学领域大家都达成了一个默契,通常都是使用"HelloWorld" 作为演示程序,这里也不例外。我们的第一个程序就是用Tensorflow打印"hello world":

import tensorflow as tf
```python

```python
# Simple hello world using TensorFlow

# Create a Constant op
# The op is added as a node to the default graph.
#
# The value returned by the constructor represents the output
# of the Constant op.

hello = tf.constant('Hello, TensorFlow!')
# Start tf session
sess = tf.Session()
# Run graph
print sess.run(hello)

相关文章

网友评论

      本文标题:用Tensorflow打印"hello world"

      本文链接:https://www.haomeiwen.com/subject/fcgdbxtx.html