tensorflow练习03-placeholder

import tensorflow as tf

input1 = tf.placeholder(tf.float32, [1, 2])  #第一参数:保存类型一般默认float32,
input2 = tf.placeholder(tf.float32, [2, 1])  #第二参数,保存矩阵结构

output1 = tf.matmul(input1, input2)


with tf.Session() as sess:
    print(sess.run(output1, feed_dict={input1: [[3.0,3.0]], input2:[[2.0],[2.0]]}))#字典格式给变量赋值

你可能感兴趣的:(tensorflow练习03-placeholder)