tensorflow笔记

保存数据的利器:placeholder

placeholder(type,strucuct…)它的第一个参数是你要保存的数据的数据类型,大多数是tensorflow中的float32数据类型,后面的参数就是要保存数据的结构,比如要保存一个1×2的矩阵,则struct=[1 2]。

input1 = tf.placeholder(tf.float32, [2, 2])
input2 = tf.placeholder(tf.float32, [2, 2])

#矩阵乘法
output1 = tf.matmul(input1, input2)
Author: Monkey
Link: https://monkeyip.github.io/2018/10/26/tensorflow笔记/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.