美文网首页TensorFlow学习
TensorFlow 2.0第一个Demo:Hello Worl

TensorFlow 2.0第一个Demo:Hello Worl

作者: 数据大鱼 | 来源:发表于2020-03-21 10:04 被阅读0次

tensor安装成功

开始试用第一个测试例子:Hello World

import tensorflow as tf
tf.executing_eagerly()
A = tf.constant([[1, 2], [3, 4]])
B = tf.constant([[5, 6], [7, 8]])
C = tf.matmul(A, B)
print(C)
tf.print('This is my first tensorFlow example: Hello World! Congratulations!!!')

输出为:

tf.Tensor(
[[19 22]
 [43 50]], shape=(2, 2), dtype=int32)
This is my first tensorFlow example: Hello World! Congratulations!!!

成功!

相关文章

网友评论

    本文标题:TensorFlow 2.0第一个Demo:Hello Worl

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