Hello World

使用TensorFlow v2张量的一个简单的“hello world”示例

  • 作者: Aymeric Damien
  • 原项目: https://github.com/aymericdamien/TensorFlow-Examples/
import tensorflow as tf
# 创建一个张量
hello = tf.constant("hello world")
print hello

Output:

tf.Tensor(hello world, shape=(), dtype=string)
 # 访问张量的值,调用numpy()
print hello.numpy()

output:

hello world

Copyright 2017-2019, All Rights Reserved.
粤ICP备18085907号 深圳市磐创网络科技有限公司

Documentation built with MkDocs.