用Tensorflow打印"hello world"

在计算机科学领域大家都达成了一个默契,通常都是使用"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)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容